Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] How to get users all balance, TokenInfo etc #167

Open
jolestar opened this issue Aug 6, 2022 · 0 comments
Open

[question] How to get users all balance, TokenInfo etc #167

jolestar opened this issue Aug 6, 2022 · 0 comments
Labels
question Further information is requested

Comments

@jolestar
Copy link
Member

jolestar commented Aug 6, 2022

Question

Describe the Question

  • How to get users all balance

curl 'http://halley.seed.starcoin.org/' \
  -H 'content-type: application/json' \
  --data-raw '{"jsonrpc":"2.0","method":"state.list_resource","params":["0x0000000000000000000000000a550c18",{"decode":true,"resource_types":["0x00000000000000000000000000000001::Account::Balance"]}],"id":0}'

  • How to get TokenInfo
  • 请问有办法通过链上查RPC的方式, 获取这个token的详情信息吗? 类似于 eth_getCode 这样, 比如: 在仅知道token地址的情况下, 得到该代币的 name、symbol、decimals 等信息

curl 'http://halley.seed.starcoin.org/'
-H 'content-type: application/json'
--data-raw '{"jsonrpc":"2.0","method":"state.get_resource","params":["0x1","0x1::Token::TokenInfo<0x1::STC::STC>",{"decode":true}],"id":0}'

  • How to get Token icon

https://github.com/starcoinorg/starmask-contract-metadata

@jolestar jolestar added the question Further information is requested label Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant