Skip to content

Commit 6c6d38e

Browse files
authored
Merge pull request #160 from tiagosiebler/historicbills
feat(v3.0.12): add endpoint for fetching bills older than 30 days
2 parents fdce0d0 + b1b6aa8 commit 6c6d38e

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "okx-api",
3-
"version": "3.0.11",
3+
"version": "3.0.12",
44
"description": "Complete Node.js SDK for OKX's REST APIs and WebSockets, with TypeScript & end-to-end tests",
55
"scripts": {
66
"test": "jest",

src/rest-client.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,6 +2395,9 @@ export class RestClient extends BaseRestClient {
23952395
return this.getPrivate('/api/v5/asset/transfer-state', params);
23962396
}
23972397

2398+
/**
2399+
* Query the billing record in the past month.
2400+
*/
23982401
getAssetBillsDetails(params?: {
23992402
ccy?: string;
24002403
type?: `${ASSET_BILL_TYPE}`;
@@ -2406,6 +2409,27 @@ export class RestClient extends BaseRestClient {
24062409
return this.getPrivate('/api/v5/asset/bills', params);
24072410
}
24082411

2412+
/**
2413+
* Query the billing records of all time since 1 February, 2021.
2414+
*
2415+
* ⚠️ IMPORTANT: Data updates occur every 30 seconds. Update frequency may vary based on data volume - please be aware of potential delays during high-traffic periods.
2416+
*
2417+
* Rate Limit: 1 Requests per second
2418+
* @param params
2419+
* @returns
2420+
*/
2421+
getAssetBillsHistoric(params?: {
2422+
ccy?: string;
2423+
type?: `${ASSET_BILL_TYPE}`;
2424+
clientId?: string;
2425+
after?: numberInString;
2426+
before?: numberInString;
2427+
limit?: numberInString;
2428+
pagingType?: '0' | '1';
2429+
}): Promise<AssetBillDetails[]> {
2430+
return this.getPrivate('/api/v5/asset/bills-history', params);
2431+
}
2432+
24092433
getLightningDeposits(params: {
24102434
ccy: string;
24112435
amt: numberInString;

src/types/rest/response/private-funding.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export interface AssetBillDetails {
8080
balChg: string;
8181
bal: string;
8282
type: `${ASSET_BILL_TYPE}`;
83+
notes: string;
8384
ts: string;
8485
}
8586

0 commit comments

Comments
 (0)