How to automatically add a custom token to trustwalletwith ethers.js

205 Views Asked by At

I was playing around with creating BEP-20 tokens on cointool.app and noticed that whenever you generate a new token and pay the gas fee to mint it, the website automatically prompts you to add this custom token to your wallet. The dialogue window that pops up looks like this:

(https://i.stack.imgur.com/YmfBi.png)

I am wondering how I could implement the same functionality into my dapp that is build on ethers.js. Usually when a user trades a custom token for the first time they are being asked to manually copy and paste its address into the Trustwallet. But this is inconvenient and requires more effort than just pressing a Add Token button in a dialogue window. I can't find any documentation on this method, so if anyone knows how to do something similar with ethers.js or other library I'd be grateful to hear your suggestions. I already find it for metamask but I am looking for Trustwallet now...

answer of my question

0

There are 0 best solutions below