Playground

Account Abstraction

Let users connect to their smart accounts with any wallet and unlock gas sponsorship, batched transactions, session keys and full wallet programmability.

Native Account Abstraction

On zkSync chains, you can take advantage of native account abstraction no code changes. The `sponsorGas` option also works out of the box.

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>
    </>
  );
}
Loading...