Open JB395 opened 6 years ago
Hey guys, any updates on possible fixes for these endpoints?
The commands are working correctly, and this issue can be closed. I will offer some separate README.md documentation updates.
In the API call, the tokenAddressBase must be the decoded hex address of the contract hash address. This can be obtained using the node fromhexaddress command.
For example, for the INK contract seen at https://qtum.info/contract/fe59cbc1704e89a698571413a81f0de9d8f00c69/
take address hash fe59cbc1704e89a698571413a81f0de9d8f00c69
and convert with the fromhexaddress command:
fromhexaddress fe59cbc1704e89a698571413a81f0de9d8f00c69
returns
QjnsK9sSa8QhJbvTRYEHXapT8M9JHhSLqY
Plugging that address into the API call gives
https://explorer.qtum.org/insight-api/tokens/QjnsK9sSa8QhJbvTRYEHXapT8M9JHhSLqY/total-supply
Which returns (in satoshis):
1000000000000000000
which is correct.
Developers reporting the following problems with API calls.
Using the format /insight-api/tokens/{:tokenAddressBase}/total-supply for the total supply of INK tokens:
https://explorer.qtum.org/insight-api/tokens/QiDqh87yneUH8q1pTyXVRryUcmRkoegBPy/total-supply
produces the response "Not Found"
Using the format /insight-api/tokens/{:tokenAddressBase}/addresses/{:addressBase}/balance for the BOT balance of a particular address
Bodhi token address base: QgRUhP8sLMCNKrzwtW4xU5DF8CCTeiA3sF
Bodhi address: QLuEbkvJLiZQqLfMUHGVM1Axqp5xZugqPV
https://explorer.qtum.org/insight-api/tokens/QgRUhP8sLMCNKrzwtW4xU5DF8CCTeiA3sF/addresses/QLuEbkvJLiZQqLfMUHGVM1Axqp5xZugqPV/balance
produces the response "Not Found".
How do these calls work?