Service for managing Web3 wallets within the SDK Provides functionality for creating and configuring wallet clients

Hierarchy (View Summary)

Constructors

Methods

Constructors

Methods

  • Creates a new Viem wallet client configured for a specific chain

    Parameters

    • params: CreateWalletParams

      The wallet creation parameters

      • chainId: number
      • OptionalprivateKey?: Address
      • OptionalsecretWords?: string

    Returns {}

    A configured Viem wallet client with public actions enabled

    const wallet = commerce.wallets.createWallet({
    secretWords: 'word1 word2 ... word12',
    chainId: 1 // Ethereum mainnet
    });

    // The wallet is ready to use with other services
    const address = wallet.account.address;
    const wallet = commerce.wallets.createWallet({
    privateKey: '0x...23a',
    chainId: 1 // Ethereum mainnet
    });

    // The wallet is ready to use with other services
    const address = wallet.account.address;

    With type VALIDATION when baseRpcUrl is not configured in the SDK

    When the chain ID is not supported or the mnemonic is invalid