Skip to main content

Interact with the blockchain

One connected, embedded wallets can be used alongside the Contract SDK to interact with the blockchain.

Initialize the SDK With Your Wallet

The ThirdwebProvider handles maintaining the connection state, and allows using all the hooks in the SDK to interact with the blockchain as the connected user.

Here's an example using the Web3Button component to claim an NFT on a smart contract:

export default function App() {
return (
<ThirdwebProvider
activeChain="goerli"
clientId="YOUR_CLIENT_ID"
supportedWallets={[embeddedWallet()]}
>
<Web3Button
contractAddress="0x..."
action={(contract) => contract.erc721.claim(1)}
>
Claim NFT
</Web3Button>
</ThirdwebProvider>
);
}

Full Reference

View everything you can do in the Contract SDK once you have connected your wallet: