Skip to main content

Wallet Integration

The SDK supports three browser wallets (Keplr, Leap, XYZ Wallet) and a mnemonic-based connection for development. All return a standard WalletConnection interface. The easiest way to connect a wallet in a browser dApp. Shows a selection dialog with all available wallets:
The modal automatically detects which wallets are installed and only shows available options.

Individual Wallet Connections

Connect to a specific wallet directly:

Keplr

Leap

XYZ Wallet

Wallet Detection

Check which wallets are available before connecting:

Direct Connection (Development)

For Node.js scripts, tests, and development, connect with a mnemonic:
Never use connectDirect in production browser code. Mnemonics should only be used in server-side scripts and development environments.

WalletConnection Interface

All connection methods return the same interface:
Use wallet.signer with createContractClient() or other SDK transaction functions:

Chain Registration

When suggestChain: true is set, the SDK automatically registers XYZ Chain in the wallet if it hasn’t been added before. This uses the chain info from the SDK:

Disconnecting

Always clean up wallet connections when done:
In React applications, call disconnect() in cleanup effects or when the user logs out.

Next Steps

Transactions

Sign and broadcast transactions

Queries

Read chain data without a wallet