Skip to content

Commit

Permalink
HIP-980: Enhance description to include additional response field (#1004
Browse files Browse the repository at this point in the history
)

Signed-off-by: IvanKavaldzhiev <ivankavaldzhiev@gmail.com>
  • Loading branch information
IvanKavaldzhiev authored Jul 15, 2024
1 parent 574ee2c commit 8986159
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion HIP/hip-980.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ For example, if we have an `asc` ordering of the results, then `?timestamp=X`, `

The `timestamp` query parameter will support having a range of timestamps. For example, `timestamp=gt:X&timestamp=lt:Y` will return a single result with the entity or entity related info in the most recent state within the range that is greater than `X` and less than `Y`, where `X` and `Y` are different timestamps.

Here are the affected APIs with the query parameter added:

```
/api/v1/accounts/{idOrAliasOrEvmAddress}/tokens?timestamp={value}
/api/v1/accounts/{idOrAliasOrEvmAddress}/nfts?timestamp={value}
Expand All @@ -70,6 +72,9 @@ The `timestamp` query parameter will support having a range of timestamps. For e
/api/v1/tokens/{tokenId}/nfts/{serialNumber}?timestamp={value}
```

Note: There is an existing API with a `timestamp` query parameter, which is `/api/v1/accounts/{idOrAliasOrEvmAddress}?timestamp={value}`. While parameter changes won't be applied for it, it's
behaviour will reflect to actually return modification changes of all account fields. Currently, the timestamp filter is applied only to the transaction list. The balance info section will continue to have granularity of 15 minutes.

**Request**
```
/api/v1/accounts/{idOrAliasOrEvmAddress}/tokens?timestamp={value}
Expand All @@ -87,6 +92,8 @@ GET api/v1/accounts/4408244/tokens?order=asc&timestamp=eq:1705334449.803393003

**Response**

The response format of all the mentioned APIs will be enhanced with additional timestamp range with `from` and `to` fields, reflecting the period in which the returned data state was valid. The `to` field will be null if the result represent the latest updated state.

```json
{
"tokens": [
Expand All @@ -97,7 +104,11 @@ GET api/v1/accounts/4408244/tokens?order=asc&timestamp=eq:1705334449.803393003
"decimals": 0,
"token_id": "0.0.4328145",
"freeze_status": "NOT_APPLICABLE",
"kyc_status": "NOT_APPLICABLE"
"kyc_status": "NOT_APPLICABLE",
"timestamp": {
"from": "1705334449.803393003",
"to": null
}
}
],
"links": {
Expand Down

0 comments on commit 8986159

Please sign in to comment.