Read balances
Use the balance method that matches the scope you need:vThe Balance object
Use
rawAmount or decimalAmount for calculations. Use formatted with symbol for display.
Where balances come from
Balance retrieval varies by chain and method. •getBalance reads directly from the RPC endpoint configured for the chain, so results reflect the latest state returned by that node.
• On Ethereum, Base, and Polygon, including supported testnets, getTokenBalances uses Rain’s wallet infrastructure to discover the tokens held by the wallet.
• On other EVM chains, getTokenBalances checks tokens in Rain’s registry plus any tokens you registered with registerTokens. Tokens outside those lists will not appear until they are registered.
• On Solana, token accounts are discovered directly from the chain, so every token account held by the wallet can appear. Tokens the wallet has never received return a zero balance.
Unknown Solana mints may not include a symbol. Register them with registerTokens to provide consistent metadata.
If no RPC endpoint is configured for a chain, balance requests return RAIN_102.
Transaction history
UsegetTransactions to retrieve wallet transfers for a specific chain. Results are returned newest first by default and support offset pagination.
limit and offset, and stop when a page returns fewer results than requested.
Transaction history is scoped to a single chain. To build a cross chain activity feed, query each chain separately and merge the results by timestamp.
The RainTransaction object
To determine direction, compare the wallet address with
from and to.
What transaction history includes
Rain wallet history includes incoming and outgoing transfers on supported chains, including transactions that were initiated outside your application, on the chains listed under chain support. Solana history is available on mainnet and devnet. New transactions may take a short time to appear in history after broadcast. When your application initiates a send, use the returned transaction hash to show the transfer immediately, then reconcile it withgetTransactions.
Wallet balance vs card spending power
A wallet balance is not the same as the amount available to spend on a Rain card. For Rain managed programs, card spending power comes from the user or company’s collateral contract. Retrieve card funding and available spending information from the Rain API. A card funding experience will typically show both:- Wallet balance from the embedded wallet SDK
- Available card spending power from the Rain API
What’s next
Transaction webhooks and history
Server-side views of the same activity, and what’s coming at GA.
Receiving funds
Detecting deposits with these calls.