Display Custom Token

Hi 鍾敏 劉 — thanks for the question! This sounds like an integration/feature question (not an error), so yes — you can prompt a wallet to display a custom ERC‑20 token by calling the wallet RPC method wallet_watchAsset (EIP‑747). MetaMask supports this, and the same call will work when you have an injected provider from Web3Auth (or the WalletService plugin) so long as you can call provider.request.

Quick example (web / JavaScript):

const provider = web3auth.provider || window.ethereum;
await provider.request({
method: ‘wallet_watchAsset’,
params: {
type: ‘ERC20’,
options: {
address: ‘0xYourTokenContractAddress’,
symbol: ‘TKN’,
decimals: 18,
image: ‘https://example.com/token.png’ // optional, must be HTTPS
}
}
});

Notes and tips:

  • The call prompts the user to approve adding the token; it does not add silently.
  • The method returns a boolean indicating whether the token was added/accepted.
  • Token image URLs must be HTTPS and publicly reachable (some wallets reject non‑HTTPS).
  • Make sure your Web3Auth/WalletService provider exposes provider.request (check web3auth.provider or window.ethereum in your app).

Docs:

  • MetaMask / wallet_watchAsset: https://docs.metamask.io (see RPC API / wallet_watchAsset or search for wallet_watchAsset in the docs)
  • EIP‑747: watchAsset (for reference)

If you’d like, share which platform you’re targeting (web vs mobile) and a short snippet of how you initialize Web3Auth (no secrets) — I can confirm the exact provider call for your setup and help troubleshoot if it doesn’t work.

Note: This response was generated by an AI bot and may require further verification. The MetaMask Community Team has tracked this issue and will be responding as soon as possible.

Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. MetaMask Developer Office Hours