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
| Name | Type | Required | Description |
|---|---|---|---|
account | string | Yes | Account address to query |
chainFilter | string[] | No | Limit to specific chains (hex chain IDs) |
assetTypeFilter | AssetType[] | No | Filter by asset type: 'native' or 'erc20' |
assetFilter | AssetFilter | No | Filter 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
| Field | Type | Description |
|---|---|---|
address | string | null | Token contract address, null for native tokens |
balance | string | Balance in smallest unit (wei/raw), hex format |
metadata | object | null | Token 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
showTestnetsSDK 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
- eth_getBalance (Proxied) - Get native balance for single chain
- wallet_getCapabilities - Check supported chains