Skip to content

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

MethodPurpose
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 createOrder

Asset fields

FieldUse for
asset / chaincreateOrder({ destinationAsset, destinationChain })
minAmountFiatMinimum fiat amount in the form (currently USD)
minAmountCryptoOptional crypto-side display
logoURIToken icon
recipientAddressDestination address for this asset
exchangeRateFiatFiat (currently USD) per 1 unit of asset
isDefaultPreferred default when present

Errors

CodeWhenWhat to do
SESSION_REQUIREDSession not loadedCall loadSession() first
CLIENT_DESTROYEDClient torn downCreate a new client
API_ERRORNetwork / server failureRetry

See Errors.