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:
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 Metamask or other web wallet to see its balance. 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.