0

I cannot find any advice on how to manually add a contract address for tokens on the ETH network. All resources point to clicking "add wallet" within their own application.

Similar to adding a "Trustline" to a Stellar wallet, how can we manually (or programmatically) add contract addresses to our ETH wallets?

2
  • 1
    Not entirely sure what you mean. Do you mean adding token contract address to a wallet to show the wallet's token ballance?
    – Sloth Man
    Sep 2, 2021 at 17:46
  • Yes, many wallets will do this with a feature. Like "lookup this alt-coin and add it to your ETH wallet". But how can we do that without a 3rd party wallet? Like how are they adding a contract trustline to your wallet? Sep 2, 2021 at 20:55

1 Answer 1

1

The process for manually adding a contract address for ERC20 (ETH) tokens will depend on your particular wallet. If using Metamask, you can select "Assets" tab, scroll all the way to the bottom and click "Add Token". Select "Custom Token" and there you are able to input the token contract address and symbol. After clicking next, Metamask will begin tracking this token's balance for your account.

EDIT: If by "manually" you mean how to achieve this programatically without Metamask's UI, you can use their API through this code

window.ethereum.request({
        method: 'wallet_watchAsset',
        params: {
        type: 'ERC20',
        options: {
          address: tokenAddress, // The address that the token is at.
          symbol: TokenSymbol, // A ticker symbol or shorthand, up to 5 chars.
          decimals: 18, // The number of decimals in the token
          },
        }
      });
1
  • Yes of course, but how do we do this manually? Sep 2, 2021 at 20:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.