import {
useContract,
useTransferToken,
Web3Button,
} from "@thirdweb-dev/react";
const contractAddress = "{{contract_address}}";
const toAddress = "{{to_address}}";
const amount = "{{amount}}";
function App() {
const { contract } = useContract(contractAddress);
const {
mutate: transferTokens,
isLoading,
error,
} = useTransferToken(contract);
return (
<Web3Button
contractAddress={contractAddress}
action={() =>
transferTokens({
to: toAddress, // Address to transfer to
amount: amount, // Amount to transfer
})
}
>
Transfer
</Web3Button>
);
}