In order to get wallets, please ensure that you have registered and installed the Caishen SDK .
With the Caishen SDK, you can create wallets for:
🔍 Get Wallet Info
Fetch a wallet associated with a user or agent for a specific chain.
⚠️ Note: The privateKey will only be returned if the developer dashboard has explicitly allowed access. With it, you can construct your own signer. If not enabled, the SDK will only return the public data needed to interact via Caishen.
📥 Parameters
Name
Type
Required
Description
Blockchain type (ETHEREUM, SOLANA, etc.)
Optional chain ID (e.g., 1 for Ethereum)
Account index or identifier
📘 Example
Copy wallet = await sdk.crypto.get_wallet({
"chainType": "ETHEREUM",
"chainId": 1,
"account": 0
}) 📚 Type: IWalletAccount
⚠️ Private key is optional and only available if explicitly enabled in the dashboard.
Used for all cash and swap functions to avoid sending sensitive data.
🌐 Supported Chains
Returns the list of all chain types supported by the backend for wallet creation.
📦 Returns
📘 Example
🔗 Get EVM RPC URL
Returns the public RPC endpoint URL for a given EVM-compatible chain ID.
Name
Type
Required
Description
💸 Token Operations
Send a token or native coin (like ETH, MATIC, SOL) to another address.
📥 Parameters
Name
Type
Required
Description
Wallet object returned from getWallet()
{ token?: string; amount: string; toAddress: string; memo?: number }
🚫 Do not pass the full IWalletAccount into this function — only MinimalWalletInput is required and safer.
If payload.token is undefined , the function sends the native gas token (e.g. ETH, MATIC).
If payload.token is provided, it sends that ERC20 or token instead.
📦 Returns
📘 Example
Fetch the balance of a wallet for either the native coin or a specific token .
📥 Parameters
Name
Type
Required
Description
If token is provided, fetch its balance; otherwise fetch native balance
🚫 Do not pass the full IWalletAccount into this function — only MinimalWalletInput is required and safer.
📦 Returns
Native Balance
Token Balance
🔍 Get Swap Route
Fetch a possible token swap route across chains.
📥 Parameters
Pick<IWalletAccount, 'account'>
Swap details including amount, from/to tokens
🚫 Do not pass the full IWalletAccount into this function — only MinimalWalletInput is required and safer.
payload structure:
📦 Returns
📘 Example
Execute the swap route using a confirmation code.
📥 Parameters
Pick<IWalletAccount, 'account', 'chainType'>
Swap payload including confirmationCode
🚫 Do not pass the full IWalletAccount into this function — only MinimalWalletInput is required and safer.
payload structure:
📦 Returns
📘 Example
Last updated 9 months ago