Skip to content

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

@whoabuddy

Description

@whoabuddy

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions