1

Everybody on Solana network is generating tokens, making transactions. I don't want any of them, I just want to display tokens of a public key. So far, I managed to integrate Phantom wallet to my website. I can get Solana balance(lamports) of connected account.

var accountInfo = await connection.getAccountInfoAndContext(publicKey)

returns only SOL balance. There is also a data variable on the response but It is null. If it's not possible to get token data from web3.js, Is there a way to get it from Phantom wallet somehow? I mean If chrome is able to display this data on Phantom wallet, there should be a way to access it.

neiloth
  • 157
  • 1
  • 11

0 Answers0