Add custom token to user wallet

Hi
Currently, our most important task is to add the native ecosystem token to the Users wallet.

First, we tested the Sepolia ETH for users’ wallets, and it worked. Now, we want to integrate our own native token with the specified contract address and symbol, ensuring that it will be automatically displayed in the user’s wallet.

Please guide us on what steps to take

@pass Thanks for your recent post.

While connecting your preferred chain, you need to pass the chainConfig as a parameter. The Chain IDs for the supported chains can be found on ChainList. Please note that you need to pass over the hex value of the chain id in the provider config.

Providers are basically pre configured RPC clients for different blockchains. They are used to interact with the blockchain network. Once you have created your native token depending on which blockchain it is deployed , you can configure it using the chainConfig parameter :

@vjgee We have deployed our token on the Sepolia testnet, and wallet configuration is also set up on the Sepolia testnet. However, we are unable to find a way to add and display our token in users’ wallets. Please provide further guidance. Is it necessary to add it using Web3js?

Can you take a look at this thread Problems of "Sepolia" and "Sepolia Test Network"

@vjgee
I did not find any information in this document regarding how to add the address of the token contract and its symbol.

You need to add the token contract address manually in the wallet.

@vjgee So Is it not possible to establish a process to automatically display our native token with a specific contract address in their wallet? Must all users manually add the token contract address to their wallet?

Are you using the Torus EVM adapter for your application? If so, users need to manually add the token contract address for it to be displayed as the default token displayed will be for the native token for Sepolia testnet which is ETH.

@vjgee We are using the No Modal SDK for our web app.
and for mobile app we are using IOS and Android SDk.
we are showing all information inside the app.

Is there a way to automatically display the native token in the app after sending it to the user’s wallet? We need to enter the token contract address and its symbol so that it will be displayed to users by default.

@pass I will check with our Dev team if it is possible and get back with an update.

@pass By default you can’t display the custom token because RPC calls will give balance of networks of the native token. You will have to interact with contract for the custom token using the web3js for node, and respective SDKs for iOS and Android as well. You will need to install web3.js first.

You can use the contract address → and use balanceOf and decimals function. Use resultOfBalance / 10^decimals to get the user balance of their token.

const contractABI = <Token ABI>;
const contractAddress = "<Token contract address>";
const contract = new web3.eth.Contract(JSON.parse(JSON.stringify(contractABI)), contractAddress);

// Get balance from smart contract
const balanceInWei = await contract.methods.balanceOf(<user wallet address>).call();
const decimals = await tokenContract.methods.decimals().call();

const userTokenBalance = balanceInWei * 10 ** -decimals

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.