Skip to main content

Usage

Parameters

The mutation accepts an object with:
  • params (CreateWalletParams):
    • encryptKey (string): PIN or passkey-derived key used to encrypt the private key
    • externalUserId (string): Your application’s unique identifier for the user
    • chain (Chain): The blockchain network. Use Chain.STARKNET
    • walletType ("SHHH" | "CHIPI" | "READY", optional): defaults to "SHHH" (the pluggable-signer ShhhAccount — guardian recovery, multisig). "CHIPI" is the legacy account that supports session keys; "READY" is Argent X compatible. Whatever you create here, persist walletType (and signerKind) and pass them back on every transfer/approve/call.
    • usePasskey (boolean, optional): Set true when encryptKey was derived from a passkey (via @chipi-stack/chipi-passkey)
  • bearerToken (string): Bearer token for authentication

Return Value

Returns an object containing:
  • createWallet: Function to trigger wallet creation (fire-and-forget)
  • createWalletAsync: Promise-based function that resolves with the wallet data
  • data: The created wallet (CreateWalletResponse) — flat object with publicKey, encryptedPrivateKey, walletType, chain, etc.
  • isLoading: Boolean indicating if the operation is in progress
  • isError: Boolean indicating if an error occurred
  • error: Error instance when isError is true, otherwise null
  • isSuccess: Boolean indicating if wallet creation succeeded
  • reset: Function to reset the mutation state

Example Implementation

Security Considerations

  • PINs should always be collected client-side
  • Never log or store raw PIN values
  • Use secure encryption before any transmission
  • Store encrypted private key securely
  • Associate with user session (not persistent storage)

Error Handling

  • Catch and handle RPC connection errors
  • Monitor gasless API limits
  • Implement retry logic for failed deployments
Wallet creation is free! Gas fees are covered by our gasless integration.