Playground

Native Account Abstraction

On zkSync chains, you can take advantage of native account abstraction with no code changes.

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

function App() {
  return (
    <>
      <ConnectButton
        client={client}
        accountAbstraction={{
          chain: zkSyncSepolia, // zkSync chain with native AA
          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