'How to make Fungible Token visible in Near Wallet?

I am currently working in a contract that has it's own fungible token. I am able to see my fungible token balance using the near-api-js, using the ft_balance_of function like this:

const res = await walletConnection
        ?.account()
        .viewFunction(contract?.contractId || '', 'ft_balance_of', {
          account_id: currentUser?.accountId,
        })

Unhappily when I open my Near Wallet I don't see the fungible tokens there. I click in send then select asset, but the only asset I see there is Near. There is also no way to search for the contract address, like we do with Metamask, for example. My token does have metadata. That's how it looks like currently:

{
    "spec": "ft-1.0.0",
    "name": "QuiD",
    "symbol": "QD",
    "icon": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 288 288'%3E%3Cg id='l' data-name='l'%3E%3Cpath d='M187.58,79.81l-30.1,44.69a3.2,3.2,0,0,0,4.75,4.2L191.86,103a1.2,1.2,0,0,1,2,.91v80.46a1.2,1.2,0,0,1-2.12.77L102.18,77.93A15.35,15.35,0,0,0,90.47,72.5H87.34A15.34,15.34,0,0,0,72,87.84V201.16A15.34,15.34,0,0,0,87.34,216.5h0a15.35,15.35,0,0,0,13.08-7.31l30.1-44.69a3.2,3.2,0,0,0-4.75-4.2L96.14,186a1.2,1.2,0,0,1-2-.91V104.61a1.2,1.2,0,0,1,2.12-.77l89.55,107.23a15.35,15.35,0,0,0,11.71,5.43h3.13A15.34,15.34,0,0,0,216,201.16V87.84A15.34,15.34,0,0,0,200.66,72.5h0A15.35,15.35,0,0,0,187.58,79.81Z'/%3E%3C/g%3E%3C/svg%3E",
    "reference": null,
    "reference_hash": null,
    "decimals": 18
}

I wonder what could be causing the Fungible Token not to show up automatically. Is there something wrong with my metadata? Or is it something else?



Solution 1:[1]

Have you followed the NEP-141 standard?

Maybe you need to implement ft_total_supply as wells as the ft_balance_of function? Have a look here for reference.

It looks like you are using metadata for the fungible token, so you also need to implement the ft_metadata function. It's important that the names are the same as defined in the standard. That way, wallets, and marketplaces can call those specific interfaces.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1