tronprotocol / java-tron

Java implementation of the Tron whitepaper
GNU Lesser General Public License v3.0
3.74k stars 1.41k forks source link

how to getBalance of TRC20 by curl #3105

Closed 1971192997 closed 4 years ago

1971192997 commented 4 years ago

how to getBalance of TRC20 by curl " is there any api?

1971192997 commented 4 years ago

and how to get the decimal of trc20 token by curl?

cathy-lishipu commented 4 years ago
  1. getBalance of TRC20 by curl: curl -X POST https://api.shasta.trongrid.io/wallet/triggersmartcontract -d '{ "contract_address":"419E62BE7F4F103C36507CB2A753418791B1CDC182", "function_selector":"balanceOf(address)", "parameter":"000000000000000000000041977C20977F412C2A1AA4EF3D49FEE5EC4C31CDFB", "owner_address":"41977C20977F412C2A1AA4EF3D49FEE5EC4C31CDFB" }'
  2. get the decimal of TRC20 token by curl: curl -X POST https://api.shasta.trongrid.io/wallet/triggersmartcontract -d '{ "contract_address":"419E62BE7F4F103C36507CB2A753418791B1CDC182", "function_selector":"decimals()", "owner_address":"41977C20977F412C2A1AA4EF3D49FEE5EC4C31CDFB" }'
1971192997 commented 4 years ago

is it possible to get balance of one token in an address directly?

i can get the list assets of an address but how to get one token?

1971192997 commented 4 years ago
  1. getBalance of TRC20 by curl: curl -X POST https://api.shasta.trongrid.io/wallet/triggersmartcontract -d '{ "contract_address":"419E62BE7F4F103C36507CB2A753418791B1CDC182", "function_selector":"balanceOf(address)", "parameter":"000000000000000000000041977C20977F412C2A1AA4EF3D49FEE5EC4C31CDFB", "owner_address":"41977C20977F412C2A1AA4EF3D49FEE5EC4C31CDFB" }'
  2. get the decimal of TRC20 token by curl: curl -X POST https://api.shasta.trongrid.io/wallet/triggersmartcontract -d '{ "contract_address":"419E62BE7F4F103C36507CB2A753418791B1CDC182", "function_selector":"decimals()", "owner_address":"41977C20977F412C2A1AA4EF3D49FEE5EC4C31CDFB" }'

thanks

andelf commented 4 years ago

is it possible to get balance of one token in an address directly?

i can get the list assets of an address but how to get one token?

Can you repeat your questions? since I haven't get your point. Sim Chinese is OK.

1971192997 commented 4 years ago

is it possible to get balance of one token in an address directly? i can get the list assets of an address but how to get one token?

Can you repeat your questions? since I haven't get your point. Sim Chinese is OK.

thank you i know how to do that.