Creating Wallets
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:
EVM
Bitcoin
Solana
SUI
XRP

š Get Wallet Info
ā ļø The
privateKey
is only returned ifallowPrivateKeyAccess
is enabled in your developer dashboard. You do not need to send the private key back to the server. All you need is{ account, chainType }
.
š„ Parameters
chainType
string
ā
Blockchain type (ETHEREUM
, SOLANA
, etc.)
chainId
number
ā
Optional chain ID (e.g., 1 for Ethereum)
account
number
ā
Account index or identifier
ā Supported chainTypes:
BITCOIN
,SOLANA
,ETHEREUM
,SUI
,APTOS
,TON
TRON
,NEAR
,XRP
,CARDANO
,COSMOS
š Example
const wallet = await sdk.crypto.getWallet({
chainType: 'ETHEREUM',
chainId: 1,
account: 0,
});
š Type: IWalletAccount
interface IWalletAccount {
address: string;
chainType: string;
account: number;
publicKey: string;
privateKey?: string; // Only returned if access is enabled in the dashboard
}

Minimal WalletInput
interface MinimalWalletInput {
account: number;
chainType: string;
address: string;
}
Used for all cash
and swap
functions to avoid sending sensitive data.
šø Token Operations
š« Use
MinimalWalletInput
when possible to reduce sensitive data exposure.
ā Send Token
const txHash = await sdk.crypto.send({
wallet,
payload: {
token: '0xTokenAddress...', // omit for native
amount: '0.5',
toAddress: '0xRecipient...',
},
});
š Get Balance
const native = await sdk.crypto.getBalance({ wallet, payload: {} });
const dai = await sdk.crypto.getBalance({
wallet,
payload: { token: '0x6B1754...' },
});
š Token Swap
š« Do not send the full wallet object. Use only
{ account, chainType }
.
š Get Swap Route
const route = await sdk.crypto.getSwapRoute({
wallet: { account: 0 },
payload: {
amount: '1000000000000000000',
from: { tokenAddress: '0x...', chainType: 'ETHEREUM' },
to: { tokenAddress: '0x...', chainType: 'ETHEREUM' },
},
});
š Execute Swap
const result = await sdk.crypto.swap({
wallet: { account: 0, chainType: 'ETHEREUM' },
payload: { confirmationCode: 'abc123' },
});
Last updated