[英]how can i get the symbol/name of a token in solana using solana web3 js?
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?在 solana web 3 中使用 getTokenSupply 我能够获得数量和小数,如何获得令牌的名称和其他元数据?
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输出
If you want the name of the token and other pieces of metadata, you likely want to query the Solana token-list
.如果您想要令牌的名称和其他元数据,您可能想要查询 Solana
token-list
。 Check out the repo at https://github.com/solana-labs/token-list在https://github.com/solana-labs/token-list查看 repo
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.