HTX API is going to add a new RESTful API endpoint – “GET /v2/account/ledger”
- API Announcements
Dear API user,
Since the effective day of this notification, HTX is going to add a new RESTful API endpoint – “GET /v2/account/ledger”.
GET /v2/account/ledger
API Key Permission: Read
Accessible for both parent user and sub user.
Phase 1 release only supports historical assets transfer querying (“transactType” = “transfer”).
The maximum query window size set by “startTime” & “endTime” is 10-day, which means, maximum 10-day records are queriable per request.
The query window can be sliding within the latest 180 days, which means, by adjusting “startTime” & “endTime” to slide the query window in multiple requests, the records in latest 180 days are queriable.
Effective Date: March 31, 2020 (GMT+8)
All the changes will be updated on https://huobiapi.github.io/docs/spot/v1/en/
HTX
March 31, 2020
The following are the changes in details:
Request Parameters
Field Name | Data Type | Mandatory | Description |
accountId | string | TRUE | Account ID |
currency | string | FALSE | Cryptocurrency (default value: all) |
transactType | string | FALSE | Transaction types (multiple inputs are allowed; default value: all; enumerated values: transfer) |
startTime | long | FALSE | Farthest time (please refer to note 1 for valid range and default value) |
endTime | long | FALSE | Nearest time (please refer to note 2 for valid range and default value) |
sort | string | FALSE | Sorting order (enumerated values: asc, desc) |
limit | int | FALSE | Maximum number of items in one page (valid range:[1,500]; default value:100) |
fromId | long | FALSE | First record ID in this query (only valid for next page querying; please refer to note 3) |
Note 1:
startTime valid range: [(endTime – 10days), endTime]
startTime default value: (endTime – 10days)
Note 2:
endTime valid range: [(current time – 180days), current time]
endTime default value: current time
Response
Field Name | Data Type | Mandatory | Description |
code | code | TRUE | Status code |
message | message | FALSE | Error message (if any) |
data | data | TRUE | Sorting as user defined (in request parameter “sort”) |
{accountId | {accountId | TRUE | Account ID |
currency | currency | TRUE | Cryptocurrency |
transactAmt | transactAmt | TRUE | Transaction amount (income positive, expenditure negative) |
transactType | transactType | TRUE | Transaction type |
transactId | transactId | TRUE | Transaction ID |
transactTime | transactTime | TRUE | Transaction time |
transferer | transferer | FALSE | Transferer’s account ID (only valid for transfer income) |
transferee} | transferee} | FALSE | Transferee’s account ID (only valid for transfer expenditure) |
nextId | nextId | FALSE | First record ID in next page (only valid if exceeded page size) |
Note 3:
Only when the number of items within the query window (between “startTime” and ”endTime”) exceeded the page limitation (defined by “limit”), HTX server returns “nextId”. Once received “nextId”, API user should –
1) Be aware of that, some items within the query window were not returned due to the page size limitation.
2) In order to get these items from HTX server, adopt the “nextId” as “fromId” and submit another request, with other request parameters no change.
3) “nextId” and “fromId” are for recurring query purpose and the ID itself does not have any business implication.
What are the Impacts on You, and What You Need to Do?
API users should evaluate the business impact caused by the new endpoint introduced, further to make relevant change in client’s application, if needed.
All the changes will be updated on HTX API Docs on the effective date.