Skip to main content
Once the user is approved, fund their card spending power by moving supported tokens (for example USDC or USDT) on-chain.
The embedded wallet can hold funds, but wallet balances do not fund card spend on their own. Card spend is backed by the user’s Rain collateral, not by whatever sits in the wallet. Fund spending power one of two ways, depending on your program’s collateral configuration:
  • The user deposits tokens into their Rain collateral contract.
  • If your program uses Real Time Funding, Rain pulls from the wallet at authorization instead.
See Managing Collateral and Supported Chains & Tokens.
This page covers Rain-managed embedded-wallet programs. Partner-managed programs fund a shared collateral account from the dashboard instead. See Partner-managed programs.

Read the user’s collateral details

Rain assigns a collateral contract when the user is approved. Read it to get the chain and, for programs that use one, the destination address for funding. From your backend, use the server-side SDK (API key):
Or fetch it directly in your app with the Client SDK’s built-in Rain API client, which mints and caches the required session token itself:
Each RainCollateralContract contains: Token name / symbol / decimals are enriched best-effort from the token registry or an on-chain read; a failed lookup leaves them empty rather than fabricating values. See Managing Collateral.

Move funds from the wallet

Move tokens out of the embedded wallet with the SDK’s send methods: an ordinary on-chain transfer to the collateral destination your program uses. Rain detects the transfer and updates the user’s spending power automatically. (Programs using Real Time Funding skip this deposit; the user keeps funds in the wallet and grants an allowance instead.)
In sandbox, mint rUSD test tokens to fund collateral. See Mint Test Tokens.

Verify spending power

Confirm the funds registered by reading the user’s Rain balances (in cents):
Callable from your backend, or your app with a CST. Once spendingPower is greater than zero, the user’s card can transact.

What’s next

Card Issuance

Issue a card the user can spend.

Balances & Transactions

Read wallet balances and send tokens.

Withdraw Collateral

Withdraw funds back out later.