Using Agent Cash
Caishen SDK provides the only wallets which support gasless stablecoin swaps, powered by Agent Cash.
๐ฆ Cash Accounts
Cash is a chain-abstracted, gasless stablecoin system designed to make stablecoin transfers seamless, fast, and free.
๐ What is Cash?
Cash is an internal ERC-20-compatible asset that abstracts away the complexity of stablecoins across chains. It enables instant, gasless transfers between wallets without needing users to worry about:
Native gas tokens (e.g., ETH, MATIC)
Stablecoin formats (e.g., USDC vs USDT)
Blockchain networks (e.g., Arbitrum, Base, Solana)
๐งช How It Works
Deposit: Users deposit supported stablecoins (e.g., USDC, USDT) from chains like Arbitrum, Base, or Solana.
Issue: The system issues equivalent Cash tokens 1:1, held in an abstracted balance.
Send: These Cash tokens can be sent to any wallet address instantly with zero gas cost.
Withdraw: When users withdraw, their Cash tokens are burned and they receive the original stablecoin on the selected chain.
โ ๏ธ Different combinations of
agentId
anduserId
result in separate Cash balances.
โ
Benefits
๐ธ Gasless transfers (no ETH/SOL required)
โก Cross-chain abstraction
๐ Simple send/receive interface
๐ Fully backed, 1:1 redeemable
๐ฑ Supported Stablecoins
Arbitrum
USDC
USDC
0xaf88...5831
Arbitrum
USDT
USDT
0xFd08...cbb9
Base
USDC
USDC
0x8335...2913
Solana
USDC
USDC
EPjFWd...TDt1v
See
CASH_SUPPORTED_TOKENS
for full details.
๐ฐ Get Account Balance
Get current balance of all tokens for a specific account.
Parameters
account
number
The account identifier
Returns
Promise<BalanceResponse>
๐ Example
const balance = await sdk.cash.getBalance({ account: 1 });
๐ต Deposit
Deposit a supported token into the account.
Parameters
params
DepositCashParams
Token and amount info
Returns
Promise<TransactionResponse>
๐ Example
await sdk.cash.deposit({
account: 1,
tokenAddress: '0x...',
amount: '1000000000000000000',
});
๐ธ Withdraw
Withdraw a supported token from the account.
Parameters
params
WithdrawCashParams
Token and amount info
Returns
Promise<TransactionResponse>
๐ Example
await sdk.cash.withdraw({
account: 1,
tokenAddress: '0x...',
amount: '1000000000000000000',
});
๐ Send
Send supported tokens between accounts.
Parameters
params
SendTransactionParams
Token, to/from, etc.
Returns
Promise<TransactionResponse>
๐ Example
await sdk.cash.send({
fromAccount: 1,
toAccount: 2,
tokenAddress: '0x...',
amount: '1000000000000000000',
});
๐ช Get Supported Tokens
const tokens = await sdk.cash.getSupportedTokens();
๐ Types
type TokenWithPrice = Token & {
priceUSD: string;
};
Last updated