Skip to main content

react package

Functions

FunctionDescription
getErc1155(contract)
getErc20(contract)
getErc721(contract)
getErcs(contract)
shouldNeverPersistQuery(key)
useActiveClaimCondition(contract, tokenId)(BETA) Use this to get the active claim conditon for ERC20, ERC721 or ERC1155 based contracts. They need to extend the claimCondition extension for this hook to work.
useActiveListings(contract, filter)(BETA) Use this to get a list active listings from your marketplace contract.
useAddress()

Hook for accessing the address of the connected wallet

import { useAddress } from "@thirdweb-dev/react";

| | useAirdropNFT(contract) | (BETA) Use this to transfer tokens on your | | useAllRoleMembers(contract) | (BETA) Use this to get the roles of a | | useAuctionWinner(contract, listingId) | (BETA) Use this to get the winner of an auction listing from your marketplace contract. | | useBalance(tokenAddress) | (BETA) A hook to get the native or (optional) ERC20 token balance of the connected wallet. | | useBatchesToReveal(contract) | | | useBidBuffer(contract) | (BETA) Use this to get the buffer in basis points between offers from your marketplace contract. | | useBurnNFT(contract) | (BETA) Use this to burn an NFT on your Erc721OrErc1155 | | useBurnToken(contract) | (BETA) Use this to burn tokens on your contract | | useBuyNow(contract) | (BETA) Use this to buy out an auction listing from your marketplace contract. | | useCancelListing(contract) | (BETA) Use this to cancel a listing on your marketplace contract. | | useChainId() |

Hook for accessing the chain ID of the network the current wallet is connected to

import { useChainId } from "@thirdweb-dev/react";

| | useClaimConditions(contract, tokenId) | (BETA) Use this to get all claim conditons for ERC20, ERC721 or ERC1155 based contracts. They need to extend the claimCondition extension for this hook to work. | | useClaimedNFTs(contract, queryParams) | (BETA) Use this to get a list of *claimed* (minted) NFT tokens of your ERC721 Drop contract. | | useClaimedNFTSupply(contract) | | | useClaimIneligibilityReasons(contract, params, tokenId) | (BETA) Use this to check for reasons that prevent claiming for either ERC20, ERC721 or ERC1155 based contracts. They need to extend the claimCondition extension for this hook to work. | | useClaimNFT(contract) | (BETA) Use this to claim a NFT on your DropContract | | useClaimToken(contract) | (BETA) Use this to claim tokens on your | | useCoinbaseWallet() |

Hook for connecting to a Coinbase wallet.

import { useCoinbaseWallet } from "@thirdweb-dev/react";

| | useCompilerMetadata(contractAddress) | | | useContract(contractAddress) | Use this resolve a contract address to a smart contract instance. | | useContract(contractAddress, _contractType) | Use this resolve a contract address to a smart contract instance. | | useContract(contractAddress, _abi) | Use this resolve a contract address to a smart contract instance. | | useContractEvents(contract, eventName, options) | (BETA) Use this to query (and subscribe) to events or a specific event on a contract. | | useContractMetadata(contract) | (BETA) Use this to get the contract metadata for a (built-in or custom) contract. | | useContractRead(contract, functionName, args) | (BETA) Use this to get data from a contract read-function call. | | useContractType(contractAddress) | | | useContractWrite(contract, functionName) | (BETA) Use this to get a function to make a write call to your contract | | useCreateAuctionListing(contract) | (BETA) Use this to create a new Auction Listing on your marketplace contract. | | useCreateDirectListing(contract) | (BETA) Use this to create a new Direct Listing on your marketplace contract. | | useDelayedRevealLazyMint(contract, onProgress) | (BETA) Use this to lazy mint a batch of delayed reveal NFTs on your DropContract | | useDisconnect(options) |

Hook for disconnecting the currently connected wallet

import { useDisconnect } from "@thirdweb-dev/react";

| | useEdition(contractAddress) | Hook for getting an instance of an Edition contract. This contract is used to interface with ERC1155 compliant NFTs. | | useEditionDrop(contractAddress) | Hook for getting an instance of an EditionDrop contract. This conract is used to interface with ERC1155 compliant NFTs that can be lazily minted. | | useGnosis() |

Hook for connecting to a Gnosis Safe. This enables multisig wallets to connect to your application and sing transactions.

import { useGnosis } from "@thirdweb-dev/react";

| | useGrantRole(contract) | (BETA) Use this to grant a WalletAddress a specific role on a | | useIsAddressRole(contract, role, walletAddress) | (BETA) Use this to check if a WalletAddress is a member of a role on a | | useLazyMint(contract, onProgress) | (BETA) Use this to lazy mint a batch of NFTs on your DropContract | | useListing(contract, listingId) | (BETA) Use this to get a specific listing from the marketplace. | | useListings(contract, filter) | (BETA) Use this to get a list all listings from your marketplace contract. | | useListingsCount(contract) | (BETA) Use this to get a count of all listings on your marketplace contract. | | useLogin(config) | (BETA) Hook to securely login to a backend with the connected wallet. The backend authentication URL must be configured on the ThirdwebProvider. | | useLogout() | (BETA) Hook to logout the connected wallet from the backend. The backend logout URL must be configured on the ThirdwebProvider. | | useMagic() |

Hook for connecting to an email wallet using magic link. This enables users without their own wallets to connect to your application and sign transactions securely using their email.

import { useMagic } from "@thirdweb-dev/react";

| | useMakeBid(contract) | (BETA) Use this to place a bid on an auction listing from your marketplace contract. | | useMarketplace(contractAddress) | Hook for getting an instance of a Marketplace contract. This contract is used to support marketplace for purchase and sale of on-chain assets. | | useMetadata(contract) | (BETA) Use this to get the metadata of your | | useMetamask() |

Hook for connecting to a Metamask wallet.

import { useMetamask } from "@thirdweb-dev/react";

| | useMintNFT(contract) | (BETA) Use this to mint a new NFT on your Erc721OrErc1155 | | useMintNFTSupply(contract) | (BETA) Use this to mint a new NFT on your | | useMintToken(contract) | (BETA) Use this to mint new tokens on your contract | | useMultiwrap(contractAddress) | Hook for getting an instance of an Multiwrap contract. This contract is an ERC721 in which you can wrap ERC721, ERC1155 and ERC20 tokens. | | useNetwork() | Hook for getting metadata about the network the current wallet is connected to and switching networks | | useNetworkMismatch() |

Hook for checking whether the connected wallet is on the correct network specified by the desiredChainId passed to the <ThirdwebProvider />.

import { useNetworkMistmatch } from "@thirdweb-dev/react";

| | useNFT(contract, tokenId) | (BETA) Use this to get an individual NFT token of your NFTContract. | | useNFTBalance(contract, ownerWalletAddress, tokenId) | (BETA) Use this to get a the total balance of a NFTContract and wallet address. | | useNFTCollection(contractAddress) | Hook for getting an instance of an NFTCollection contract. This contract is meant to interface with ERC721 compliant NFTs. | | useNFTDrop(contractAddress) | Hook for getting an instance of an NFTDrop contract. This contract is meant to interface with ERC721 compliant NFTs that can be lazily minted. | | useNFTs(contract, queryParams) | (BETA) Use this to get a list of NFT tokens of your NFTContract. | | useOwnedNFTs(contract, ownerWalletAddress) | (BETA) Use this to get a the owned NFTs for a specific Erc721OrErc1155 and wallet address. | | usePack(contractAddress) | Hook for getting an instance of a Pack contract. This contract supports the creation of on-chain luck-based lootboxes. | | usePlatformFees(contract) | (BETA) Use this to get the platform fees settings of your | | usePrimarySaleRecipient(contract) | (BETA) | | useResetClaimConditions(contract, tokenId) | (BETA) Use this to reset claim conditions on your DropContract | | useResolvedMediaType(uri) | | | useRevealLazyMint(contract) | (BETA) Use this to reveal a batch of delayed reveal NFTs on your RevealableContract | | useRevokeRole(contract) | (BETA) Use this to revoke a WalletAddress a specific role on a | | useRoleMembers(contract, role) | (BETA) Use this to get the members of a role on a | | useRoyaltySettings(contract) | (BETA) Use this to get the royalty settings of your | | useSDK() | | | useSetAllRoleMembers(contract) | (BETA) Use this to OVERWRITE the list of addresses that are members of specific roles | | useSetClaimConditions(contract, tokenId) | (BETA) Use this to set claim conditions on your DropContract | | useSignatureDrop(contractAddress) | Hook for getting an instance of an SignatureDrop contract. This contract is meant to interface with ERC721 compliant NFTs that can be lazily minted. | | useSplit(contractAddress) | Hook for getting an instance of a Split contract. This contract supports fund distribution to multiple parties. | | useToken(contractAddress) | Hook for getting an instance of a Token contract. This contract supports ERC20 compliant tokens. | | useTokenBalance(contract, walletAddress) | (BETA) Use this to get the balance of your contract for a given address. | | useTokenDecimals(contract) | (BETA) Use this to get the decimals of your contract for a given address. | | useTokenDrop(contractAddress) | Hook for getting an instance of a Token Drop contract. | | useTokenSupply(contract) | (BETA) Use this to get a the total supply of your contract. | | useTotalCirculatingSupply(contract, tokenId) | (BETA) Use this to get a the total (minted) supply of your NFTContract. | | useTotalCount(contract) | (BETA) Use this to get the total count of NFT tokens of your NFTContract. | | useTransferBatchToken(contract) | (BETA) Use this to transfer batch tokens on your contract | | useTransferNFT(contract) | (BETA) Use this to transfer tokens on your NFTContract | | useTransferToken(contract) | (BETA) Use this to transfer tokens on your contract | | useUnclaimedNFTs(contract, queryParams) | (BETA) Use this to get a list of *unclaimed* NFT tokens of your ERC721 Drop contract. | | useUnclaimedNFTSupply(contract) | | | useUpdateMetadata(contract) | (BETA) Use this to update the metadata of your | | useUpdatePlatformFees(contract) | (BETA) Use this to update the platform fees settings of your | | useUpdatePrimarySaleRecipient(contract) | (BETA) Use this to update the primary sales recipient of your | | useUpdateRoyaltySettings(contract) | (BETA) Use this to update the royalty settings of your | | useUser() | (BETA) Hook to get the currently logged in user. | | useVote(contractAddress) | Hook for getting an instance of an Vote contract. This contract enables fully featured voting-based decentralized governance systems. | | useWalletConnect() |

Hook for connecting to a mobile wallet with Wallet Connect

import { useWalletConnect } from "@thirdweb-dev/react";

| | useWinningBid(contract, listingId) | (BETA) Use this to get a the winning bid for an auction listing from your marketplace contract. |

Interfaces

InterfaceDescription
DAppMetaDatathe metadata to pass to wallet connection dialog (may show up during the wallet-connection process)
LoginConfig
MediaRendererPropsThe props for the MediaRenderer component.
MediaType
SharedMediaProps
ThirdwebAuthConfig(BETA) The configuration to use the react SDK with an [auth](https://portal.thirdweb.com/auth) server.
ThirdwebAuthUser
ThirdwebNftMediaPropsThe props for the ThirdwebNftMedia component.
ThirdwebProviderPropsThe possible props for the ThirdwebProvider.
ThirdwebSDKProviderProps

Variables

VariableDescription
compilerMetadata
ConnectWallet

(BETA) A component that allows the user to connect their wallet.

The button has to be wrapped in a ThirdwebProvider in order to function.

contractType
MediaRenderer

This component can be used to render any media type, including image, audio, video, and html files. Its convenient for rendering NFT media files, as these can be a variety of different types. The component falls back to a external link if the media type is not supported.

Props: MediaRendererProps

ThirdwebNftMedia(BETA)
ThirdwebProviderThe <ThirdwebProvider /> component lets you control what networks you want users to connect to, what types of wallets can connect to your app, and the settings for the [Typescript SDK](https://docs.thirdweb.com/typescript).
ThirdwebSDKProvider

A basic wrapper around the Thirdweb SDK.

You can use this in order to be able to pass a provider & signer directly to the SDK.

Web3Button

(BETA) A component that allows the user to call an on-chain function on a contract.

The button has to be wrapped in a ThirdwebProvider in order to function.

Type Aliases

Type AliasDescription
AirdropNFTParams(BETA) The params to pass to useTransferBatchNFT.
BurnNFTParams(BETA) The params for the useBurnNFT() hook mutation.
BuyNowParams
ClaimIneligibilityParams(BETA) The options to be passed as the second parameter to the useClaimIneligibilityReasons()` hook.
ClaimNFTParams(BETA) The params for the useClaimNFT() hook mutation.
ClaimNFTReturnType(BETA) The return type of the useClaimNFT() hook.
ClaimTokenParams
ContractAddress(BETA) A contract address.
DelayedRevealLazyMintInput(BETA) The params for the useDelayedRevealLazyMint() hook mutation.
DropContract(BETA) The possible DROP contract types.
Erc721OrErc1155(BETA) Possible NFT contract types.
MakeBidParams
MintNFTParams(BETA) The params for the useMintNFT() hook mutation.
MintNFTReturnType(BETA) The return type of the useMintNFT() hook.
MintNFTSupplyParams(BETA) The params to pass to useMintNFTSupply.
NFTContract(BETA) The possible NFT contract types.
RequiredParam(BETA) Makes a parameter required to be passed, but still allowes it to be null or undefined.
RevealableContract(BETA) The possible revealable contract types.
RevealLazyMintInput(BETA) The params for the useRevealLazyMint() hook mutation.
SetClaimConditionsParams(BETA) The params for the useSetClaimConditions() hook mutation.
TokenBurnParams(BETA) The parameters to pass to the burn function.
TokenContract(BETA) The possible Token contract types.
TokenParams(BETA) The parameters to pass to the mint and transfer functions.
TransferNFTParams(BETA) The params to pass to useTransferNFT.
UseContractResult
WalletAddress(BETA) A wallet address.