Playground

Sponsored transactions

Easily enable gas-free transactions for your users, Free on testnets, billed at the end of the month on mainnets.

Code
import { claimTo } from "thirdweb/extensions/erc1155";
import { TransactionButton } from "thirdweb/react";

function App() {
  return (
    <>
      <ConnectButton
        client={client}
        accountAbstraction={{
          chain,
          sponsorGas: true, // sponsor gas for all transactions
        }}
        connectButton={{
          label: "Login to mint this Kitten!",
        }}
      />
      {/* since sponsorGas is true, transactions will be sponsored */}
      <TransactionButton
        transaction={() =>
          claimTo({ contract, to: "0x123...", tokenId: 0n, quantity: 1n })
        }
      >
        Mint
      </TransactionButton>
    </>
  );
}
Preview