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

How can I query an address' all token balances via RPC API? #1281

Open
heshuchao opened this issue Sep 23, 2020 · 1 comment
Open

How can I query an address' all token balances via RPC API? #1281

heshuchao opened this issue Sep 23, 2020 · 1 comment

Comments

@heshuchao
Copy link

the response of RPC-API-"getbalance" only contains the balance of ont and ong.

what if I need response like below

{"code":0,"msg":"SUCCESS","result":[{"balance":"580667.517022225","asset_name":"ong","asset_type":"native","contract_hash":"0200000000000000000000000000000000000000"},{"balance":"0","asset_name":"waitboundong","asset_type":"native","contract_hash":"0200000000000000000000000000000000000000"},{"balance":"0","asset_name":"unboundong","asset_type":"native","contract_hash":"0200000000000000000000000000000000000000"},{"balance":"77309","asset_name":"ont","asset_type":"native","contract_hash":"0100000000000000000000000000000000000000"},{"balance":"1608222085.94387794","asset_name":"MBL","asset_type":"oep4","contract_hash":"e5a49d7fd57e7178e189d3965d1ee64368a1036d"}]}

https://explorer.ont.io/v2/addresses/AaXXsKujBcwR9aB5NgNErgsB7eM9CTYByw/ALL/balances

DO I have to deploy ontology-explorer to get the response i want?

@laizy
Copy link
Contributor

laizy commented Oct 9, 2020

#1279 this pr has added a jsonrpc api to query oep4 token balance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants