0

using getTokenSupply in solana web 3 i was able to get amount and decimals, how can get the name of the token and other metadata?

let from_pairs = new anchor.web3.PublicKey("DUru78GcRB8Ucg24Gy6WNTyufuyBhqcL5wppZJkckQHz")
const NETWORK = anchor.web3.clusterApiUrl('devnet');
const Connection = new anchor.web3.Connection(NETWORK);
const data = await Connection.getTokenSupply(from_pairs)
console.log(data, data2)

output

enter image description here

mohan A
  • 65
  • 2
  • 10

1 Answers1

2

If you want the name of the token and other pieces of metadata, you likely want to query the Solana token-list. Check out the repo at https://github.com/solana-labs/token-list

Jon C
  • 7,019
  • 10
  • 17