ZoraOS ☼☽
  • Introduction
  • Developer Tools
    • Smart Contracts
      • Whitepaper
    • ZDK
      • React Connecting Wallet
      • Zora Protocol
      • Auction House
      • Minting Media
      • Addresses
      • Users
      • Metadata
      • Utility
    • Indexer
      • Getting Started
      • Entities
    • Subgraph
    • Media Rendering
      • NFT Hooks
        • useZNFT
        • useNFTMetadata
        • useNFTContent
  • Guides
    • Connect to a Wallet
    • Build a marketplace
  • Community
    • Join our Discord
    • Support
    • Platforms using Zora
      • Catalog
      • Mirror
Powered by GitBook
On this page

Was this helpful?

  1. Developer Tools
  2. ZDK

React Connecting Wallet

Guide to connecting the user's wallet in react.

PreviousZDKNextZora Protocol

Last updated 3 years ago

Was this helpful?

The Zora ZDK requires an ethers instance to interact with the blockchain.

If data is only being read from ZDK, an can be used to read from the blockchain. If you need to read or write to the blockchain, you should provide an ethers signer, a type of provider that also can sign transactions.

Typically, you will create an ethers signer through asking users to connect their wallet. The Zora team typically uses to connect the user's wallet or . Once you set up these libraries, you can then use that provider for the ZDK.

// Example for setting up the AuctionHouse from Web3React
function MyComponent() {
  const {library, chainId} = useWeb3React();
  // library is a ethers provider/signer instance
  // chainId is the networkId
  
  const auctionHouse = useMemo(() => {
    if (library && chainId) {
      return new AuctionHouse(library.getSigner(), chainId);
    }
  }, [library, chainId]);
  return (
    auctionHouse ? (
      <ManageAuction auctionHouse={auctionHouse} />
    ) : <div>Please connect wallet</div>
  );
}

If you want to allow easy bidding and listing of NFTs, Zora supports hosted urls where the user can interact with Zora interface to list their NFTs or bid on NFTs without needing to setup any wallet login and the user can trust the Zora.co site.

https://zora.co/auctions/{TOKEN_ADDRESS}/{TOKEN_ID}/list
// Lists the given token for an auction house auction

https://zora.co/auctions/{TOKEN_ADDRESS}/{TOKEN_ID}/bid
// Allows the user to bid on the active auction for the given token
ethers provider
web3-react
web3modal