Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

wallet_getAssets

Get token balances across multiple chains for an account. Implements EIP-7811.

Authentication Required: No (requires account parameter)

Request

await jaw.provider.request({
  method: 'wallet_getAssets',
  params: [{
    account: '0x1234...',
    assetFilter: {
      '0x1': [{ address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', type: 'erc20' }],
    },
  }],
});

Parameters

NameTypeRequiredDescription
accountstringYesAccount address to query
chainFilterstring[]NoLimit to specific chains (hex chain IDs)
assetTypeFilterAssetType[]NoFilter by asset type: 'native' or 'erc20'
assetFilterAssetFilterNoFilter by specific assets per chain

Types

type AssetType = 'native' | 'erc20';
 
type AssetFilter = Record<`0x${string}`, AssetFilterEntry[]>;
 
type AssetFilterEntry = {
  address: `0x${string}`;
  type: AssetType;
};

Example

[{
  "account": "0x1234567890123456789012345678901234567890",
  "chainFilter": ["0x1", "0x89"]
}]

With asset type filter (ERC-20 tokens only):

[{
  "account": "0x1234567890123456789012345678901234567890",
  "assetTypeFilter": ["erc20"]
}]

With specific asset filter:

[{
  "account": "0x1234567890123456789012345678901234567890",
  "assetFilter": {
    "0x1": [{ "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "type": "erc20" }],
    "0x2105": [{ "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "type": "erc20" }]
  }
}]

Response

Returns an object mapping chain IDs to asset arrays.

Type: WalletGetAssetsResponse

type WalletGetAssetsResponse = {
  [chainId: string]: Asset[];
};
 
type Asset = {
  /** Token contract address, null for native tokens */
  address: string | null;
  /** Balance in hex format */
  balance: string;
  /** Asset metadata */
  metadata: {
    decimals: number;
    name: string;
    symbol: string;
  } | null;
  /** Asset type */
  type: 'native' | 'erc20';
};

Example

{
  "0x1": [
    {
      "address": null,
      "balance": "0x1bc16d674ec80000",
      "metadata": {
        "decimals": 18,
        "name": "Ether",
        "symbol": "ETH"
      },
      "type": "native"
    },
    {
      "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "balance": "0x5f5e100",
      "metadata": {
        "decimals": 6,
        "name": "USD Coin",
        "symbol": "USDC"
      },
      "type": "erc20"
    }
  ],
  "0x89": [
    {
      "address": null,
      "balance": "0x2b5e3af16b1880000",
      "metadata": {
        "decimals": 18,
        "name": "POL",
        "symbol": "POL"
      },
      "type": "native"
    }
  ]
}

Asset Object Fields

FieldTypeDescription
addressstring | nullToken contract address, null for native tokens
balancestringBalance in smallest unit (wei/raw), hex format
metadataobject | nullToken metadata (decimals, name, symbol)
type'native' | 'erc20'Asset type

Behavior

  • Includes native tokens (ETH, MATIC, etc.)
  • Includes ERC-20 tokens with non-zero balances
  • Auto-filters by showTestnets SDK preference
  • Can be called without authentication
  • Returns only tokens with non-zero balances

Example

Get All Assets

const assets = await jaw.provider.request({
  method: 'wallet_getAssets',
  params: [{
    account: '0x1234...',
  }],
});

Filter by Asset Type

// Only get ERC-20 tokens
const tokens = await jaw.provider.request({
  method: 'wallet_getAssets',
  params: [{
    account: '0x1234...',
    assetTypeFilter: ['erc20'],
  }],
});

Filter by Specific Assets

// Get only USDC on mainnet and Base
const usdc = await jaw.provider.request({
  method: 'wallet_getAssets',
  params: [{
    account: '0x1234...',
    assetFilter: {
      '0x1': [{ address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', type: 'erc20' }],
      '0x2105': [{ address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', type: 'erc20' }],
    },
  }],
});

Related Methods