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

get-balance-stx for ccd002-treasury only returns unlocked balance #11

Open
whoabuddy opened this issue May 31, 2023 · 0 comments
Open

Comments

@whoabuddy
Copy link
Contributor

The current endpoint for get-balance-stx returns the unlocked balance, e.g.

https://protocol.citycoins.co/api/ccd002-treasury/get-balance-stx?contractName=ccd002-treasury-mia-mining-v2

Returns:

155844000

Which matches the unlocked balance and doesn't indicate anything about the 10.2M STX locked.

image

This comes from stx-get-balance in the treasury contract, so we may need to switch to calling the Hiro API.

https://api.mainnet.hiro.so/extended/v1/address/SP8A9HZ3PKST0S42VM9523Z9NV42SZ026V4K39WH.ccd002-treasury-mia-mining-v2/stx

Returns:

{
  "balance": "10216532085394",
  "total_sent": "0",
  "total_received": "10216532085394",
  "total_fees_sent": "0",
  "total_miner_rewards_received": "0",
  "lock_tx_id": "0x117c1a1ccb8242cdaf52012623a52fadb0f0e78cb34e0ad4f7046717dc92f8be",
  "locked": "10216376241394",
  "lock_height": 107391,
  "burnchain_lock_height": 791949,
  "burnchain_unlock_height": 794150
}
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

1 participant