From 5ba76128e7028d3abda38ee3147f363302adb420 Mon Sep 17 00:00:00 2001 From: Jerko J <83344666+JJ-Cro@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:04:41 +0200 Subject: [PATCH] chore(): small suggested changes --- package-lock.json | 71 ------------------------- package.json | 2 - src/rest-client-v5.ts | 18 ++++--- src/types/response/v5-preupgrade.ts | 80 ++++++++++++++--------------- 4 files changed, 52 insertions(+), 119 deletions(-) diff --git a/package-lock.json b/package-lock.json index 682f1bd..4915d29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,9 +10,7 @@ "license": "MIT", "dependencies": { "axios": "^1.6.6", - "fs": "^0.0.1-security", "isomorphic-ws": "^4.0.1", - "path": "^0.12.7", "ws": "^7.4.0" }, "devDependencies": { @@ -3450,11 +3448,6 @@ } } }, - "node_modules/fs": { - "version": "0.0.1-security", - "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", - "integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w==" - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -5641,15 +5634,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/path": { - "version": "0.12.7", - "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", - "integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==", - "dependencies": { - "process": "^0.11.1", - "util": "^0.10.3" - } - }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -5776,14 +5760,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "engines": { - "node": ">= 0.6.0" - } - }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -6604,25 +6580,12 @@ "punycode": "^2.1.0" } }, - "node_modules/util": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", - "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", - "dependencies": { - "inherits": "2.0.3" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "optional": true }, - "node_modules/util/node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==" - }, "node_modules/v8-compile-cache": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", @@ -9656,11 +9619,6 @@ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==" }, - "fs": { - "version": "0.0.1-security", - "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", - "integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w==" - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -11336,15 +11294,6 @@ "lines-and-columns": "^1.1.6" } }, - "path": { - "version": "0.12.7", - "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", - "integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==", - "requires": { - "process": "^0.11.1", - "util": "^0.10.3" - } - }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -11428,11 +11377,6 @@ } } }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==" - }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -11965,21 +11909,6 @@ "punycode": "^2.1.0" } }, - "util": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", - "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", - "requires": { - "inherits": "2.0.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==" - } - } - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/package.json b/package.json index a80857c..b713f3c 100644 --- a/package.json +++ b/package.json @@ -25,9 +25,7 @@ ], "dependencies": { "axios": "^1.6.6", - "fs": "^0.0.1-security", "isomorphic-ws": "^4.0.1", - "path": "^0.12.7", "ws": "^7.4.0" }, "devDependencies": { diff --git a/src/rest-client-v5.ts b/src/rest-client-v5.ts index c446ae4..89a500e 100644 --- a/src/rest-client-v5.ts +++ b/src/rest-client-v5.ts @@ -132,6 +132,9 @@ import { OrderbookResponseV5, PositionInfoParamsV5, PositionV5, + PreUpgradeOptionsDelivery, + PreUpgradeTransaction, + PreUpgradeUSDCSessionSettlement, PreupgradeOptionsDelivery, PreupgradeTransactionLog, PreupgradeUSDCSessionSettlement, @@ -852,11 +855,11 @@ export class RestClientV5 extends BaseRestClient { * INFO * USDC Perpeual & Option support the recent 6 months data. Please download older data via GUI */ - getPreUpgradeTransactionLog( + getPreUpgradeTransactions( params: GetPreUpgradeTransactionLogParamsV5, ): Promise< APIResponseV3WithTime<{ - list: PreupgradeTransactionLog[]; + list: PreUpgradeTransaction[]; nextPageCursor: string; }> > { @@ -872,7 +875,7 @@ export class RestClientV5 extends BaseRestClient { getPreUpgradeOptionDeliveryRecord( params: GetPreUpgradeOptionDeliveryRecordParamsV5, ): Promise< - APIResponseV3WithTime> + APIResponseV3WithTime> > { return this.getPrivate('/v5/pre-upgrade/asset/delivery-record', params); } @@ -883,11 +886,11 @@ export class RestClientV5 extends BaseRestClient { * INFO * USDC Perpetual support the recent 6 months data. Please download older data via GUI */ - getPreUpgradeUSDCSessionSettlement( + getPreUpgradeUSDCSessionSettlements( params: GetPreUpgradeUSDCSessionParamsV5, ): Promise< APIResponseV3WithTime< - CategoryCursorListV5 + CategoryCursorListV5 > > { return this.getPrivate('/v5/pre-upgrade/asset/settlement-record', params); @@ -1559,7 +1562,7 @@ export class RestClientV5 extends BaseRestClient { } /** - * This endpoint allows you to get a list of all sub UID of master account. + * This endpoint allows you to get a list of all sub UID of master account. At most 10k subaccounts. */ getSubUIDList(): Promise< APIResponseV3WithTime<{ subMembers: SubMemberV5[] }> @@ -1567,6 +1570,9 @@ export class RestClientV5 extends BaseRestClient { return this.getPrivate('/v5/user/query-sub-members'); } + /** + * This endpoint allows you to get a list of all sub UID of master account. No limit on the number of subaccounts. + */ getSubUIDListUnlimited(params?: { pageSize?: string; nextCursor?: string; diff --git a/src/types/response/v5-preupgrade.ts b/src/types/response/v5-preupgrade.ts index 19baf4d..759ad6e 100644 --- a/src/types/response/v5-preupgrade.ts +++ b/src/types/response/v5-preupgrade.ts @@ -1,42 +1,42 @@ -export interface PreupgradeTransactionLog { - symbol: string; - category: string; - side: 'Buy' | 'Sell' | 'None'; - transactionTime: string; - type: string; - qty: string; - size: string; - currency: 'USDC' | 'USDT' | 'BTC' | 'ETH'; - tradePrice: string; - funding: string; - fee: string; - cashFlow: string; - change: string; - cashBalance: string; - feeRate: string; - bonusChange: string; - tradeId: string; - orderId: string; - orderLinkId: string; - } +export interface PreUpgradeTransaction { + symbol: string; + category: string; + side: 'Buy' | 'Sell' | 'None'; + transactionTime: string; + type: string; + qty: string; + size: string; + currency: 'USDC' | 'USDT' | 'BTC' | 'ETH'; + tradePrice: string; + funding: string; + fee: string; + cashFlow: string; + change: string; + cashBalance: string; + feeRate: string; + bonusChange: string; + tradeId: string; + orderId: string; + orderLinkId: string; +} - export interface PreupgradeOptionsDelivery { - deliveryTime: number; - symbol: string; - side: 'Buy' | 'Sell'; - position: string; - deliveryPrice: string; - strike: string; - fee: string; - deliveryRpl: string; - } +export interface PreUpgradeOptionsDelivery { + deliveryTime: number; + symbol: string; + side: 'Buy' | 'Sell'; + position: string; + deliveryPrice: string; + strike: string; + fee: string; + deliveryRpl: string; +} - export interface PreupgradeUSDCSessionSettlement { - symbol: string; - side: 'Buy' | 'Sell'; - size: string; - sessionAvgPrice: string; - markPrice: string; - realisedPnl: string; - createdTime: string; - } \ No newline at end of file +export interface PreUpgradeUSDCSessionSettlement { + symbol: string; + side: 'Buy' | 'Sell'; + size: string; + sessionAvgPrice: string; + markPrice: string; + realisedPnl: string; + createdTime: string; +}