Defined in EIP-747
Requests that the wallet tracks the given token in the user’s wallet. Once a token is added, it will be shown in the wallet’s token list.
Parameters
The asset type. Currently only “ERC20” is supported.
Token options object.
The address of the token contract (42-character hexadecimal address).
A ticker symbol or shorthand, up to 11 characters.
The number of token decimals.
A string URL of a token logo image (optional).
Returns
Returns true if the token was successfully added to the watch list.
{
"id": 1,
"jsonrpc": "2.0",
"method": "wallet_watchAsset",
"params": {
"type": "ERC20",
"options": {
"address": "0xA0b86a33E6776e1e627E5C82dF4C0cf77B8bb0c9",
"symbol": "USDC",
"decimals": 6,
"image": "https://cryptologos.cc/logos/usd-coin-usdc-logo.png"
}
}
}
{
"id": 1,
"jsonrpc": "2.0",
"result": true
}
Error Handling
| Code | Message | Description |
|---|
| 4001 | User rejected the request | User denied adding the token |
| 4100 | Requested method not supported | The method is not supported by the wallet |
| -32602 | Invalid params | Invalid token parameters |
Always verify the token contract address and ensure it’s a legitimate token to prevent users from adding malicious tokens.
The token will appear in the user’s wallet token list if successfully added.