Closed hetfly closed 2 years ago
@hetfly this endpoint should help you. @robcxyz can answer questions if it's not clear from the docs. You enter a timestamp and it returns a blockheight closest to the timestamp. From there, the UI can ping the node for balanceOf (blockHeight) for different tokens and different contracts. We should migrate all single-point-in-time API usage to this model. It's a new feature supported by ICON Nodes that allows you to query state at a given block height
This should also help when calling the icon node once you have the blockHeight
https://www.icondev.io/icon-stack/client-apis/json-rpc-api/v3.
So to summarize, this can be used for single-point-in-time queries. For example, let's compare today's DAO Fund bnUSD holdings to its bnUSD holdings on May 1st.
Calling backend API:
Calling ICON Node API:
Related to https://github.com/balancednetwork/balanced-network-info/issues/109
We will need to query stability fund balances based on timestamp, it would be ideal to have it similar to DAO fund endpoint, see https://balanced.sudoblock.io/api/v1/docs#/stats/get_daofund_balance_sheet_api_v1_stats_daofund_balance_sheet_get
example timestamp
1652252887000000