Interact with the blockchain

One connected, in-app 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 TransactionButton component to claim an NFT on a smart contract:

export default function App() {
const account = useActiveAccount();
return (
<div>
<TransactionButton
transaction={() => {
if (!account) {
return alert("Please connect your wallet");
}
return claimTo({
contract,
to: account.address,
quantity: 1,
});
}}
>
Claim NFT
</TransactionButton>
</div>
);
}

Full Reference

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