Skip to main content

Recommended: JavaScript SDK with React Hooks

For new React apps, we recommend the JavaScript SDK with React Hooks (@dynamic-labs-sdk/react-hooks) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the React quickstart (JavaScript SDK) to get started.
This guide is currently React only.

Overview

If you have account abstraction enabled on your global wallet, users will get a smart wallet created for them on login.

Custom Paymaster

If you need to use your own paymaster for a global wallet (smart wallet), you can do so by creating your own kernel client and interacting with it. If you are using the zerodev methods, make sure you have the @zerodev/sdk and @dynamic-labs/ethereum-aa packages as dependencies in your Global Wallets package (see the dynamic-global-wallet repository for reference).

Example

import YourGlobalWallet from 'your-gw-wallet-package';
import { createKernelClient } from 'your-gw-wallet-package/zerodev';

// The wallet must be imported from your global wallet package
const smartWallet = YourGlobalWallet.wallets[0];

const kernelClient = createKernelClient({
  wallet: smartWallet,
  paymaster: 'SPONSOR',
  paymasterRpc: 'https://some-paymaster-rpc.com',
});

const { account } = kernelClient;

  const hash = await kernelClient.sendUserOperation({
    account,
    callData: await account.encodeCalls([
      {
        data: encodeFunctionData({
          abi: contractABI,
          args: [primaryWallet.address],
          functionName: 'mint',
        }),
        to: contractAddress,
        value: BigInt(0),
      },
      {
        data: encodeFunctionData({
          abi: contractABI,
          args: [primaryWallet.address],
          functionName: 'mint',
        }),
        to: contractAddress,
        value: BigInt(0),
      },
    ]),
  })

  return hash
Last modified on June 25, 2026