Usage
Parameters
The mutation accepts an object with:params(CreateWalletParams):encryptKey(string): PIN or passkey-derived key used to encrypt the private keyexternalUserId(string): Your application’s unique identifier for the userchain(Chain): The blockchain network. UseChain.STARKNETwalletType("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, persistwalletType(andsignerKind) and pass them back on every transfer/approve/call.usePasskey(boolean, optional): SettruewhenencryptKeywas 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 datadata: The created wallet (CreateWalletResponse) — flat object withpublicKey,encryptedPrivateKey,walletType,chain, etc.isLoading: Boolean indicating if the operation is in progressisError: Boolean indicating if an error occurrederror: Error instance whenisErroris true, otherwisenullisSuccess: Boolean indicating if wallet creation succeededreset: 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.
