Metamask login then display users XToken balance

I’m creating a website for our project, it’s going to be a physical crypto exchange based in Taipei, Taiwan. It will be a shop where people can buy and sell crypto as well as crypto kit such as hardware wallets, miners, coffee shop, as well as a social hub for people in the crypto community here in Taiwan.

We will have our own token too, either on Ethereum or Binance smart chain we haven’t decided yet. This token will act as a membership with levels. Gold (10,000 tokens), Silver(5000 tokens) and Bronze (1000 tokens), for instance gold membership will let you trade with no commission fees as well as get a free coffee/ soft drink, silver 50% reduction in trading fees, bronze, 25% off trading fees.

Right now I want to build a website for the project, I need a metamask login, and for the site to display the balance of tokens in the users wallet, and the corresponding membership level badge next to the balance.

Ive just installed the ethereum boilerplate code, but I have a feeling it’s way too heavy for what i need to do, is there a way with simple javascript that I can make my website have these features?

Is there a tutorial on moralis that is very close to what I need can you help me to find it?

I guess I just need to change this nativeBalance part to show instead, the balance in the users wallet of “A particular token” Can anyone point me to some help with this?

You know how when you login to Uniswap, it displays your UNI balance (it used to) . thats what i’m looking for basically.

Like that but instead of Eth balance it displays the balance of our custom token

i hope someone can help me, im super frustrated

you can find here the documentation for react:

it is not complicated what you want to do, you can do it in vanilla js too, you only have to call few web3api functions

do you know where i can find an example of such vanilla javascript that i can look at?

you can find some demo app here:

1 Like