Appearance
Assets
Load destination assets a Cash App onramp can pay out to.
When to use
After the user picks Cash App. Use the list to build token + network + amount UI. Each row’s minAmountFiat is the minimum for the amount field.
Methods
| Method | Purpose |
|---|---|
getSupportedAssets() | Promise<CashAppSupportedAsset[]> for the current session |
getCashAppAssetKey(asset) | Stable asset:chain key for list keys / selection |
Mins are floored at the client default of $1.
Example
ts
import {
getCashAppAssetKey,
Network,
TokenSymbol,
} from '@swapped/connect-sdk';
const assets = await client.cashApp.getSupportedAssets();
const usdt = assets.find(
asset =>
asset.asset === TokenSymbol.USDT && asset.chain === Network.Ethereum,
);
if (!usdt) {
throw new Error('USDT on Ethereum is not available for this session');
}
console.log(getCashAppAssetKey(usdt));
// 'USDT:ethereum'
console.log(usdt.minAmountFiat, usdt.minAmountCrypto, usdt.logoURI);
// Use usdt.asset + usdt.chain when calling createOrderAsset fields
| Field | Use for |
|---|---|
asset / chain | createOrder({ destinationAsset, destinationChain }) |
minAmountFiat | Minimum fiat amount in the form (currently USD) |
minAmountCrypto | Optional crypto-side display |
logoURI | Token icon |
recipientAddress | Destination address for this asset |
exchangeRateFiat | Fiat (currently USD) per 1 unit of asset |
isDefault | Preferred default when present |
Errors
| Code | When | What to do |
|---|---|---|
SESSION_REQUIRED | Session not loaded | Call loadSession() first |
CLIENT_DESTROYED | Client torn down | Create a new client |
API_ERROR | Network / server failure | Retry |
See Errors.