From 0d42d153b26d98f3d0ed074c42e72eecc57ddbe8 Mon Sep 17 00:00:00 2001 From: alplabin <122352306+alplabin@users.noreply.github.com> Date: Tue, 23 Jan 2024 18:30:37 +0900 Subject: [PATCH] Release v0.3.6 --- CHANGELOG.md | 38 +- ...epayRecord.ts => getBorrowRepayRecords.ts} | 11 +- examples/restful/margin/getCrossMarginPair.ts | 12 - .../getIsolatedMarginTransferHistory.ts | 25 - examples/restful/margin/getLeverageBracket.ts | 13 + examples/restful/margin/getMarginAsset.ts | 12 - ...mbol.ts => getMarginAvailableInventory.ts} | 4 +- .../margin/isolatedMarginAccountTransfer.ts | 18 - .../margin/marginAccountBorrowRepay.ts | 17 + ...nDustlog.ts => marginManualLiquidation.ts} | 4 +- examples/restful/market/tradingDayTicker.ts | 15 + .../getAllocations.ts} | 7 +- examples/restful/trade/getCommissionRates.ts | 13 + .../getPreventedMatches.ts} | 8 +- .../newOrderSOR.ts} | 8 +- examples/restful/trade/testNewOrder.ts | 2 +- .../testNewOrderSOR.ts} | 11 +- package-lock.json | 1006 ++++++++++++----- package.json | 2 +- src/index.ts | 12 +- src/modules/enum.ts | 38 +- src/modules/restful/margin/margin.ts | 485 +++----- src/modules/restful/margin/methods.ts | 62 +- src/modules/restful/margin/types.ts | 304 ++--- src/modules/restful/market/market.ts | 57 +- src/modules/restful/market/methods.ts | 19 +- src/modules/restful/market/types.ts | 27 + src/modules/restful/trade/methods.ts | 62 +- src/modules/restful/trade/trade.ts | 194 +++- src/modules/restful/trade/types.ts | 127 ++- src/modules/restful/wallet/types.ts | 9 +- src/modules/restful/wallet/wallet.ts | 3 + .../websocket/websocketAPI/trade/types.ts | 4 +- .../margin/crossMarginAccountTransfer.ts | 5 - .../restful/margin/getAllCrossMarginPairs.ts | 30 +- .../restful/margin/getAllMarginAssets.ts | 3 +- .../restful/margin/getBorrowRepayRecords.ts | 17 + .../margin/getCrossMarginAccountDetails.ts | 3 +- .../restful/margin/getCrossMarginPair.ts | 11 - .../margin/getCrossMarginTransferHistory.ts | 20 +- .../restful/margin/getIsolatedMarginSymbol.ts | 10 - .../getIsolatedMarginTransferHistory.ts | 14 - .../restful/margin/getLeverageBracket.ts | 30 + .../restful/margin/getLoanRecord.ts | 13 - .../restful/margin/getMarginAsset.ts | 10 - .../margin/getMarginAvailableInventory.ts | 11 + .../restful/margin/getRepayRecord.ts | 15 - .../margin/isolatedMarginAccountTransfer.ts | 5 - ...tBorrow.ts => marginAccountBorrowRepay.ts} | 6 +- .../restful/margin/marginAccountRepay.ts | 5 - .../restful/margin/marginDustlog.ts | 19 - .../restful/margin/marginManualLiquidation.ts | 11 + .../restful/market/currentAveragePrice.ts | 3 +- .../restful/market/tradingDayTicker.ts | 19 + .../trade/cancelAllOpenOrdersOnASymbol.ts | 1 + .../cancelAnExistingOrderAndSendANewOrder.ts | 1 + tests/mock_values/restful/trade/cancelOco.ts | 1 + .../mock_values/restful/trade/cancelOrder.ts | 1 + .../restful/trade/getAllocations.ts | 22 + .../restful/trade/getCommissionRates.ts | 23 + .../restful/trade/getPreventedMatches.ts | 16 + .../mock_values/restful/trade/newOrderSOR.ts | 30 + .../restful/trade/testNewOrderSOR.ts | 1 + .../mock_values/websocket/market/avgPrice.ts | 3 +- .../margin/crossMarginAccountTransfer.test.ts | 20 - .../margin/getAllCrossMarginPairs.test.ts | 2 +- .../margin/getAllIsolatedMarginSymbol.test.ts | 2 +- .../restful/margin/getAllMarginAssets.test.ts | 2 +- ....test.ts => getBorrowRepayRecords.test.ts} | 12 +- .../getCrossMarginAccountDetails.test.ts | 2 +- .../margin/getCrossMarginFeeData.test.ts | 2 +- .../getCrossMarginTransferHistory.test.ts | 2 +- .../getCurrentMarginOrderCountUsage.test.ts | 2 +- ...tEnabledIsolatedMarginAccountLimit.test.ts | 2 +- .../margin/getForceLiquidationRecord.test.ts | 2 +- .../restful/margin/getInterestHistory.test.ts | 2 +- .../getIsolatedMarginAccountInfo.test.ts | 2 +- .../margin/getIsolatedMarginFeeData.test.ts | 2 +- .../margin/getIsolatedMarginSymbol.test.ts | 20 - .../margin/getIsolatedMarginTierData.test.ts | 2 +- .../getIsolatedMarginTransferHistory.test.ts | 20 - ...air.test.ts => getLeverageBracket.test.ts} | 12 +- .../margin/getMarginAccountAllOco.test.ts | 2 +- .../margin/getMarginAccountAllOrders.test.ts | 2 +- .../margin/getMarginAccountOco.test.ts | 2 +- .../margin/getMarginAccountOpenOco.test.ts | 2 +- .../margin/getMarginAccountOpenOrders.test.ts | 2 +- .../margin/getMarginAccountOrder.test.ts | 2 +- .../margin/getMarginAccountTradeList.test.ts | 2 +- ...ts => getMarginAvailableInventory.test.ts} | 12 +- .../margin/getMarginPriceindex.test.ts | 2 +- tests/restful/margin/getMaxBorrow.test.ts | 2 +- .../margin/getMaxTransferoutAmount.test.ts | 2 +- .../margin/getSummaryOfMarginAccount.test.ts | 2 +- .../isolatedMarginAccountTransfer.test.ts | 20 - ...st.ts => marginAccountBorrowRepay.test.ts} | 12 +- .../margin/marginManualLiquidation.test.ts | 19 + tests/restful/market/tradingDayTicker.test.ts | 18 + .../getFlexiblePersonalLeftQuota.test.ts | 2 +- .../getFlexibleRedemptionRecord.test.ts | 2 +- ...tIpRestrictionForASubAccountApiKey.test.ts | 2 +- ...getManagedSubAccountDepositAddress.test.ts | 2 +- ...nagedSubAccountFuturesAssetDetails.test.ts | 2 +- .../getManagedSubAccountList.test.ts | 2 +- ...anagedSubAccountMarginAssetDetails.test.ts | 2 +- .../getManagedSubAccountTransferLog.test.ts | 2 +- ...ubAccountTransferLogForTradeParent.test.ts | 2 +- ...edSubAccountTransferLogForTradeSub.test.ts | 2 +- .../getManagedSubaccountAssetDetails.test.ts | 2 +- .../getManagedSubaccountSnapshot.test.ts | 2 +- ...etSubAccountAssetsForMasterAccount.test.ts | 2 +- ...nsactionStatisticsForMasterAccount.test.ts | 2 +- .../subAccount/getSubaccountAssets.test.ts | 2 +- ...accountFuturesAssetTransferHistory.test.ts | 2 +- .../subAccount/getSubaccountList.test.ts | 2 +- ...SubaccountSpotAssetTransferHistory.test.ts | 2 +- .../getSubaccountSpotAssetsSummary.test.ts | 2 +- .../getUniversalTransferHistory.test.ts | 2 +- tests/restful/trade/getAllOco.test.ts | 2 +- .../getAllocations.test.ts} | 12 +- .../getCommissionRates.test.ts} | 12 +- .../trade/getCurrentOrderCountUsage.test.ts | 2 +- tests/restful/trade/getOco.test.ts | 2 +- tests/restful/trade/getOpenOco.test.ts | 2 +- tests/restful/trade/getOrder.test.ts | 4 +- .../getPreventedMatches.test.ts} | 12 +- tests/restful/trade/newOco.test.ts | 2 +- tests/restful/trade/newOrder.test.ts | 2 +- tests/restful/trade/newOrderSOR.test.ts | 20 + tests/restful/trade/testNewOrder.test.ts | 4 +- tests/restful/trade/testNewOrderSOR.test.ts | 20 + .../wallet/getApiKeyPermission.test.ts | 2 +- ...getAssetsThatCanBeConvertedIntoBnb.test.ts | 2 +- .../getAutoconvertingStableCoins.test.ts | 2 +- ...CloudminingPaymentAndRefundHistory.test.ts | 2 +- .../restful/wallet/getConvertTransfer.test.ts | 2 +- .../getUserUniversalTransferHistory.test.ts | 2 +- 137 files changed, 1965 insertions(+), 1384 deletions(-) rename examples/restful/margin/{getRepayRecord.ts => getBorrowRepayRecords.ts} (50%) delete mode 100644 examples/restful/margin/getCrossMarginPair.ts delete mode 100644 examples/restful/margin/getIsolatedMarginTransferHistory.ts create mode 100644 examples/restful/margin/getLeverageBracket.ts delete mode 100644 examples/restful/margin/getMarginAsset.ts rename examples/restful/margin/{getIsolatedMarginSymbol.ts => getMarginAvailableInventory.ts} (68%) delete mode 100644 examples/restful/margin/isolatedMarginAccountTransfer.ts create mode 100644 examples/restful/margin/marginAccountBorrowRepay.ts rename examples/restful/margin/{marginDustlog.ts => marginManualLiquidation.ts} (69%) create mode 100644 examples/restful/market/tradingDayTicker.ts rename examples/restful/{margin/marginAccountRepay.ts => trade/getAllocations.ts} (58%) create mode 100644 examples/restful/trade/getCommissionRates.ts rename examples/restful/{margin/marginAccountBorrow.ts => trade/getPreventedMatches.ts} (58%) rename examples/restful/{margin/crossMarginAccountTransfer.ts => trade/newOrderSOR.ts} (53%) rename examples/restful/{margin/getLoanRecord.ts => trade/testNewOrderSOR.ts} (50%) delete mode 100644 tests/mock_values/restful/margin/crossMarginAccountTransfer.ts create mode 100644 tests/mock_values/restful/margin/getBorrowRepayRecords.ts delete mode 100644 tests/mock_values/restful/margin/getCrossMarginPair.ts delete mode 100644 tests/mock_values/restful/margin/getIsolatedMarginSymbol.ts delete mode 100644 tests/mock_values/restful/margin/getIsolatedMarginTransferHistory.ts create mode 100644 tests/mock_values/restful/margin/getLeverageBracket.ts delete mode 100644 tests/mock_values/restful/margin/getLoanRecord.ts delete mode 100644 tests/mock_values/restful/margin/getMarginAsset.ts create mode 100644 tests/mock_values/restful/margin/getMarginAvailableInventory.ts delete mode 100644 tests/mock_values/restful/margin/getRepayRecord.ts delete mode 100644 tests/mock_values/restful/margin/isolatedMarginAccountTransfer.ts rename tests/mock_values/restful/margin/{marginAccountBorrow.ts => marginAccountBorrowRepay.ts} (74%) delete mode 100644 tests/mock_values/restful/margin/marginAccountRepay.ts delete mode 100644 tests/mock_values/restful/margin/marginDustlog.ts create mode 100644 tests/mock_values/restful/margin/marginManualLiquidation.ts create mode 100644 tests/mock_values/restful/market/tradingDayTicker.ts create mode 100644 tests/mock_values/restful/trade/getAllocations.ts create mode 100644 tests/mock_values/restful/trade/getCommissionRates.ts create mode 100644 tests/mock_values/restful/trade/getPreventedMatches.ts create mode 100644 tests/mock_values/restful/trade/newOrderSOR.ts create mode 100644 tests/mock_values/restful/trade/testNewOrderSOR.ts delete mode 100644 tests/restful/margin/crossMarginAccountTransfer.test.ts rename tests/restful/margin/{getLoanRecord.test.ts => getBorrowRepayRecords.test.ts} (54%) delete mode 100644 tests/restful/margin/getIsolatedMarginSymbol.test.ts delete mode 100644 tests/restful/margin/getIsolatedMarginTransferHistory.test.ts rename tests/restful/margin/{getCrossMarginPair.test.ts => getLeverageBracket.test.ts} (66%) rename tests/restful/margin/{getMarginAsset.test.ts => getMarginAvailableInventory.test.ts} (57%) delete mode 100644 tests/restful/margin/isolatedMarginAccountTransfer.test.ts rename tests/restful/margin/{marginDustlog.test.ts => marginAccountBorrowRepay.test.ts} (51%) create mode 100644 tests/restful/margin/marginManualLiquidation.test.ts create mode 100644 tests/restful/market/tradingDayTicker.test.ts rename tests/restful/{margin/getRepayRecord.test.ts => trade/getAllocations.test.ts} (62%) rename tests/restful/{margin/marginAccountRepay.test.ts => trade/getCommissionRates.test.ts} (61%) rename tests/restful/{margin/marginAccountBorrow.test.ts => trade/getPreventedMatches.test.ts} (60%) create mode 100644 tests/restful/trade/newOrderSOR.test.ts create mode 100644 tests/restful/trade/testNewOrderSOR.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dae1b0..99054a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,40 @@ # Changelog -## 0.3.5 - 2024-01-10 +## 0.3.6 - 2024-01-24 + +### Added +- `POST /sapi/v1/margin/borrow-repay` +- `POST /sapi/v1/margin/manual-liquidation` +- `POST /api/v3/sor/order` +- `POST /api/v3/sor/order/test` +- `GET /sapi/v1/margin/available-inventory` +- `GET /sapi/v1/margin/borrow-repay` +- `GET /sapi/v1/margin/leverageBracket` +- `GET /api/v3/account/commission` +- `GET /api/v3/myPreventedMatches` +- `GET /api/v3/myAllocations` +- `GET /api/v3/ticker/tradingDay` + +### Changed +- `GET /api/v3/avgPrice`: response has a new field `closeTime`, indicating the last trade time. +- Upgrade dependencies + +### Removed +- `POST /sapi/v1/margin/dust` +- `POST /sapi/v1/margin/isolated/transfer` +- `POST /sapi/v1/margin/loan` +- `POST /sapi/v1/margin/repay` +- `POST /sapi/v1/margin/transfer` +- `GET /sapi/v1/margin/asset` +- `GET /sapi/v1/margin/dribblet` +- `GET /sapi/v1/margin/dust` +- `GET /sapi/v1/margin/isolated/pair` +- `GET /sapi/v1/margin/isolated/transfer` +- `GET /sapi/v1/margin/loan` +- `GET /sapi/v1/margin/pair` +- `GET /sapi/v1/margin/repay` + +## 0.3.5 - 2023-12-22 - Add new Enums - Update Websocket types @@ -17,7 +51,7 @@ Upgrade dependencies Fix issue from previous release -## 0.3.1 - 2023-10-09 +## 0.3.1 - 2023-10-06 Update configuration to resolve files exported issue diff --git a/examples/restful/margin/getRepayRecord.ts b/examples/restful/margin/getBorrowRepayRecords.ts similarity index 50% rename from examples/restful/margin/getRepayRecord.ts rename to examples/restful/margin/getBorrowRepayRecords.ts index 8b540af..4d69aa4 100644 --- a/examples/restful/margin/getRepayRecord.ts +++ b/examples/restful/margin/getBorrowRepayRecords.ts @@ -1,5 +1,5 @@ import dotenv from 'dotenv'; -import { RestMarginTypes, Spot } from '../../../src/index'; +import { MarginBorrowRepayType, RestMarginTypes, Spot } from '../../../src/index'; dotenv.config(); @@ -8,13 +8,10 @@ const apiSecret = process.env.BINANCE_API_SECRET || ''; const baseURL = process.env.BINANCE_BASE_URL || ''; const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); -const options: RestMarginTypes.getRepayRecordOptions = { - txId: 2970933056, - current: 1, - size: 100, +const options: RestMarginTypes.getBorrowRepayRecordsOptions = { recvWindow: 5000, }; -client.getRepayRecord('BTC', options).then((res: RestMarginTypes.getRepayRecordResponse) => { +client.getBorrowRepayRecords(MarginBorrowRepayType.BORROW, options).then((res: RestMarginTypes.getBorrowRepayRecordsResponse) => { console.log(res); -}).catch(err => { console.log(err); }); +}).catch(err => { console.log(err); }); \ No newline at end of file diff --git a/examples/restful/margin/getCrossMarginPair.ts b/examples/restful/margin/getCrossMarginPair.ts deleted file mode 100644 index 5b4bbee..0000000 --- a/examples/restful/margin/getCrossMarginPair.ts +++ /dev/null @@ -1,12 +0,0 @@ -import dotenv from 'dotenv'; -import { RestMarginTypes, Spot } from '../../../src/index'; - -dotenv.config(); - -const apiKey = process.env.BINANCE_API_KEY || ''; -const baseURL = process.env.BINANCE_BASE_URL || ''; -const client = new Spot(apiKey, '', { baseURL: baseURL }); - -client.getCrossMarginPair('BNBUSDT').then((res: RestMarginTypes.getCrossMarginPairResponse) => { - console.log(res); -}).catch(err => { console.log(err); }); diff --git a/examples/restful/margin/getIsolatedMarginTransferHistory.ts b/examples/restful/margin/getIsolatedMarginTransferHistory.ts deleted file mode 100644 index 8b741c7..0000000 --- a/examples/restful/margin/getIsolatedMarginTransferHistory.ts +++ /dev/null @@ -1,25 +0,0 @@ -import dotenv from 'dotenv'; -import { RestMarginTypes, Spot, TransFrom, TransTo } from '../../../src/index'; - -dotenv.config(); - -const apiKey = process.env.BINANCE_API_KEY || ''; -const apiSecret = process.env.BINANCE_API_SECRET || ''; -const baseURL = process.env.BINANCE_BASE_URL || ''; -const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - -const options: RestMarginTypes.getIsolatedMarginTransferHistoryOptions = { - asset: 'BNB', - transFrom: TransFrom.SPOT, - transTo: TransTo.ISOLATED_MARGIN, - current: 1, - size: 100, - recvWindow: 5000, -}; - -client.getIsolatedMarginTransferHistory( - 'BNBUSDT', - options -).then((res: RestMarginTypes.getIsolatedMarginTransferHistoryResponse) => { - console.log(res); -}).catch(err => { console.log(err); }); diff --git a/examples/restful/margin/getLeverageBracket.ts b/examples/restful/margin/getLeverageBracket.ts new file mode 100644 index 0000000..d8b0566 --- /dev/null +++ b/examples/restful/margin/getLeverageBracket.ts @@ -0,0 +1,13 @@ +import dotenv from 'dotenv'; +import { RestMarginTypes, Spot } from '../../../src/index'; + +dotenv.config(); + +const apiKey = process.env.BINANCE_API_KEY || ''; +const apiSecret = process.env.BINANCE_API_SECRET || ''; +const baseURL = process.env.BINANCE_BASE_URL || ''; +const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); + +client.getLeverageBracket().then((res: RestMarginTypes.getLeverageBracketResponse[]) => { + console.log(res); +}).catch(err => { console.log(err); }); \ No newline at end of file diff --git a/examples/restful/margin/getMarginAsset.ts b/examples/restful/margin/getMarginAsset.ts deleted file mode 100644 index 1328c17..0000000 --- a/examples/restful/margin/getMarginAsset.ts +++ /dev/null @@ -1,12 +0,0 @@ -import dotenv from 'dotenv'; -import { RestMarginTypes, Spot } from '../../../src/index'; - -dotenv.config(); - -const apiKey = process.env.BINANCE_API_KEY || ''; -const baseURL = process.env.BINANCE_BASE_URL || ''; -const client = new Spot(apiKey, '', { baseURL: baseURL }); - -client.getMarginAsset('BTC').then((res: RestMarginTypes.getMarginAssetResponse) => { - console.log(res); -}).catch(err => { console.log(err); }); diff --git a/examples/restful/margin/getIsolatedMarginSymbol.ts b/examples/restful/margin/getMarginAvailableInventory.ts similarity index 68% rename from examples/restful/margin/getIsolatedMarginSymbol.ts rename to examples/restful/margin/getMarginAvailableInventory.ts index 3a44676..0fe3984 100644 --- a/examples/restful/margin/getIsolatedMarginSymbol.ts +++ b/examples/restful/margin/getMarginAvailableInventory.ts @@ -8,10 +8,10 @@ const apiSecret = process.env.BINANCE_API_SECRET || ''; const baseURL = process.env.BINANCE_BASE_URL || ''; const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); -const options: RestMarginTypes.getIsolatedMarginSymbolOptions = { +const options: RestMarginTypes.getIsolatedMarginTierDataOptions = { recvWindow: 5000, }; -client.getIsolatedMarginSymbol('BNBUSDT', options).then((res: RestMarginTypes.getIsolatedMarginSymbolResponse) => { +client.getMarginAvailableInventory('MARGIN', options).then((res: RestMarginTypes.getMarginAvailableInventoryResponse) => { console.log(res); }).catch(err => { console.log(err); }); diff --git a/examples/restful/margin/isolatedMarginAccountTransfer.ts b/examples/restful/margin/isolatedMarginAccountTransfer.ts deleted file mode 100644 index f9fa698..0000000 --- a/examples/restful/margin/isolatedMarginAccountTransfer.ts +++ /dev/null @@ -1,18 +0,0 @@ -import dotenv from 'dotenv'; -import { RestMarginTypes, Spot, TransFrom, TransTo } from '../../../src/index'; - -dotenv.config(); - -const apiKey = process.env.BINANCE_API_KEY || ''; -const apiSecret = process.env.BINANCE_API_SECRET || ''; -const baseURL = process.env.BINANCE_BASE_URL || ''; -const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - -const options: RestMarginTypes.isolatedMarginAccountTransferOptions = { - recvWindow: 5000, -}; - -client.isolatedMarginAccountTransfer('BTC', 'BNBUSDT', TransFrom.SPOT, TransTo.ISOLATED_MARGIN, 1.01, options) - .then((res: RestMarginTypes.isolatedMarginAccountTransferResponse) => { - console.log(res); - }).catch(err => { console.log(err); }); diff --git a/examples/restful/margin/marginAccountBorrowRepay.ts b/examples/restful/margin/marginAccountBorrowRepay.ts new file mode 100644 index 0000000..997a883 --- /dev/null +++ b/examples/restful/margin/marginAccountBorrowRepay.ts @@ -0,0 +1,17 @@ +import dotenv from 'dotenv'; +import { MarginBorrowRepayType, RestMarginTypes, Spot } from '../../../src/index'; + +dotenv.config(); + +const apiKey = process.env.BINANCE_API_KEY || ''; +const apiSecret = process.env.BINANCE_API_SECRET || ''; +const baseURL = process.env.BINANCE_BASE_URL || ''; +const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); + +const options: RestMarginTypes.marginAccountBorrowRepayOptions = { + recvWindow: 5000, +}; + +client.marginAccountBorrowRepay('BNB', 'FALSE', 'BNBUSDT', '1.0', MarginBorrowRepayType.BORROW, options).then((res: RestMarginTypes.marginAccountBorrowRepayResponse) => { + console.log(res); +}).catch(err => { console.log(err); }); \ No newline at end of file diff --git a/examples/restful/margin/marginDustlog.ts b/examples/restful/margin/marginManualLiquidation.ts similarity index 69% rename from examples/restful/margin/marginDustlog.ts rename to examples/restful/margin/marginManualLiquidation.ts index e3ff4ab..b7edd82 100644 --- a/examples/restful/margin/marginDustlog.ts +++ b/examples/restful/margin/marginManualLiquidation.ts @@ -8,10 +8,10 @@ const apiSecret = process.env.BINANCE_API_SECRET || ''; const baseURL = process.env.BINANCE_BASE_URL || ''; const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); -const options: RestMarginTypes.marginDustlogOptions = { +const options: RestMarginTypes.getIsolatedMarginTierDataOptions = { recvWindow: 5000, }; -client.marginDustlog(options).then((res: RestMarginTypes.marginDustlogResponse) => { +client.marginManualLiquidation('MARGIN', options).then((res: RestMarginTypes.marginManualLiquidationResponse[]) => { console.log(res); }).catch(err => { console.log(err); }); diff --git a/examples/restful/market/tradingDayTicker.ts b/examples/restful/market/tradingDayTicker.ts new file mode 100644 index 0000000..c8874a6 --- /dev/null +++ b/examples/restful/market/tradingDayTicker.ts @@ -0,0 +1,15 @@ +import dotenv from 'dotenv'; +import { RestMarketTypes, Spot } from '../../../src/index'; + +dotenv.config(); + +const baseURL = process.env.BINANCE_BASE_URL || ''; +const client = new Spot('', '', { baseURL: baseURL }); + +const options: RestMarketTypes.tradingDayTickerOptions = { + type: 'MINI', +}; + +client.tradingDayTicker('BNBUSDT', options).then((res: RestMarketTypes.tradingDayTickerResponse | RestMarketTypes.tradingDayTickerResponse[]) => { + console.log(res); +}).catch(err => { console.log(err); }); diff --git a/examples/restful/margin/marginAccountRepay.ts b/examples/restful/trade/getAllocations.ts similarity index 58% rename from examples/restful/margin/marginAccountRepay.ts rename to examples/restful/trade/getAllocations.ts index 92aaba2..583ee5f 100644 --- a/examples/restful/margin/marginAccountRepay.ts +++ b/examples/restful/trade/getAllocations.ts @@ -1,5 +1,5 @@ import dotenv from 'dotenv'; -import { RestMarginTypes, Spot } from '../../../src/index'; +import { RestTradeTypes, Spot } from '../../../src/index'; dotenv.config(); @@ -8,11 +8,10 @@ const apiSecret = process.env.BINANCE_API_SECRET || ''; const baseURL = process.env.BINANCE_BASE_URL || ''; const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); -const options: RestMarginTypes.marginAccountRepayOptions = { - symbol: 'BNBUSDT', +const options: RestTradeTypes.getAllocationsOptions = { recvWindow: 5000, }; -client.marginAccountRepay('BTC', 1.01, options).then((res: RestMarginTypes.marginAccountRepayResponse) => { +client.getAllocations('BNBUSDT', options).then((res: RestTradeTypes.getAllocationsResponse[]) => { console.log(res); }).catch(err => { console.log(err); }); diff --git a/examples/restful/trade/getCommissionRates.ts b/examples/restful/trade/getCommissionRates.ts new file mode 100644 index 0000000..b7a747e --- /dev/null +++ b/examples/restful/trade/getCommissionRates.ts @@ -0,0 +1,13 @@ +import dotenv from 'dotenv'; +import { RestTradeTypes, Spot } from '../../../src/index'; + +dotenv.config(); + +const apiKey = process.env.BINANCE_API_KEY || ''; +const apiSecret = process.env.BINANCE_API_SECRET || ''; +const baseURL = process.env.BINANCE_BASE_URL || ''; +const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); + +client.getCommissionRates('BNBUSDT').then((res: RestTradeTypes.getCommissionRatesResponse) => { + console.log(res); +}).catch(err => { console.log(err); }); diff --git a/examples/restful/margin/marginAccountBorrow.ts b/examples/restful/trade/getPreventedMatches.ts similarity index 58% rename from examples/restful/margin/marginAccountBorrow.ts rename to examples/restful/trade/getPreventedMatches.ts index 459231b..a5d9216 100644 --- a/examples/restful/margin/marginAccountBorrow.ts +++ b/examples/restful/trade/getPreventedMatches.ts @@ -1,5 +1,5 @@ import dotenv from 'dotenv'; -import { RestMarginTypes, Spot } from '../../../src/index'; +import { RestTradeTypes, Spot } from '../../../src/index'; dotenv.config(); @@ -8,11 +8,11 @@ const apiSecret = process.env.BINANCE_API_SECRET || ''; const baseURL = process.env.BINANCE_BASE_URL || ''; const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); -const options: RestMarginTypes.marginAccountBorrowOptions = { - symbol: 'BNBUSDT', +const options: RestTradeTypes.getPreventedMatchesOptions = { + preventedMatchId: 1, recvWindow: 5000, }; -client.marginAccountBorrow('BTC', 1.01, options).then((res: RestMarginTypes.marginAccountBorrowResponse) => { +client.getPreventedMatches('BNBUSDT', options).then((res: RestTradeTypes.getPreventedMatchesResponse[]) => { console.log(res); }).catch(err => { console.log(err); }); diff --git a/examples/restful/margin/crossMarginAccountTransfer.ts b/examples/restful/trade/newOrderSOR.ts similarity index 53% rename from examples/restful/margin/crossMarginAccountTransfer.ts rename to examples/restful/trade/newOrderSOR.ts index dcd0124..01e595f 100644 --- a/examples/restful/margin/crossMarginAccountTransfer.ts +++ b/examples/restful/trade/newOrderSOR.ts @@ -1,5 +1,5 @@ import dotenv from 'dotenv'; -import { RestMarginTypes, Spot } from '../../../src/index'; +import { OrderType, RestTradeTypes, Side, Spot, TimeInForce } from '../../../src/index'; dotenv.config(); @@ -8,10 +8,12 @@ const apiSecret = process.env.BINANCE_API_SECRET || ''; const baseURL = process.env.BINANCE_BASE_URL || ''; const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); -const options: RestMarginTypes.crossMarginAccountTransferOptions = { +const options: RestTradeTypes.newOrderSOROptions = { + timeInForce: TimeInForce.GTC, + price: 219, recvWindow: 5000, }; -client.crossMarginAccountTransfer('BTC', 0.1, 1, options).then((res: RestMarginTypes.crossMarginAccountTransferResponse) => { +client.newOrderSOR('BNBUSDT', Side.SELL, OrderType.LIMIT, 1, options).then((res: RestTradeTypes.newOrderSORResponse) => { console.log(res); }).catch(err => { console.log(err); }); diff --git a/examples/restful/trade/testNewOrder.ts b/examples/restful/trade/testNewOrder.ts index d415ad3..c60723e 100644 --- a/examples/restful/trade/testNewOrder.ts +++ b/examples/restful/trade/testNewOrder.ts @@ -15,6 +15,6 @@ const options: RestTradeTypes.testNewOrderOptions = { recvWindow: 5000, }; -client.testNewOrder('BNBUSDT', Side.SELL, OrderType.LIMIT, options).then((res: Record) => { +client.testNewOrder('BNBUSDT', Side.SELL, OrderType.LIMIT, options).then((res: Record | RestTradeTypes.testNewOrderResponse) => { console.log(res); }).catch(err => { console.log(err); }); diff --git a/examples/restful/margin/getLoanRecord.ts b/examples/restful/trade/testNewOrderSOR.ts similarity index 50% rename from examples/restful/margin/getLoanRecord.ts rename to examples/restful/trade/testNewOrderSOR.ts index d6a41f2..e1bf35d 100644 --- a/examples/restful/margin/getLoanRecord.ts +++ b/examples/restful/trade/testNewOrderSOR.ts @@ -1,5 +1,5 @@ import dotenv from 'dotenv'; -import { RestMarginTypes, Spot } from '../../../src/index'; +import { OrderType, RestTradeTypes, Side, Spot, TimeInForce } from '../../../src/index'; dotenv.config(); @@ -8,13 +8,12 @@ const apiSecret = process.env.BINANCE_API_SECRET || ''; const baseURL = process.env.BINANCE_BASE_URL || ''; const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); -const options: RestMarginTypes.getLoanRecordOptions = { - txId: 123456789, - current: 1, - size: 100, +const options: RestTradeTypes.testNewOrderSOROptions = { + timeInForce: TimeInForce.GTC, + price: 219, recvWindow: 5000, }; -client.getLoanRecord('BTC', options).then((res: RestMarginTypes.getLoanRecordResponse) => { +client.testNewOrderSOR('BNBUSDT', Side.SELL, OrderType.LIMIT, 1, options).then((res: Record | RestTradeTypes.testNewOrderResponse) => { console.log(res); }).catch(err => { console.log(err); }); diff --git a/package-lock.json b/package-lock.json index 0c17b00..7d91153 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@binance/connector-typescript", - "version": "0.3.5", + "version": "0.3.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@binance/connector-typescript", - "version": "0.3.5", + "version": "0.3.6", "license": "MIT", "dependencies": { "axios": "^1.6.0", @@ -50,12 +50,12 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.13", + "@babel/highlight": "^7.23.4", "chalk": "^2.4.2" }, "engines": { @@ -134,30 +134,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.2.tgz", - "integrity": "sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", + "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.2.tgz", - "integrity": "sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ==", + "version": "7.23.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.7.tgz", + "integrity": "sha512-+UpDgowcmqe36d4NwqvKsyPMlOLNGMsfMmQ5WGCu+siCe3t3dfe9njrzGfdN4qq+bcNUt0+Vw6haRxBOycs4dw==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", - "@babel/helper-compilation-targets": "^7.22.15", - "@babel/helper-module-transforms": "^7.23.0", - "@babel/helpers": "^7.23.2", - "@babel/parser": "^7.23.0", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-compilation-targets": "^7.23.6", + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helpers": "^7.23.7", + "@babel/parser": "^7.23.6", "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.2", - "@babel/types": "^7.23.0", + "@babel/traverse": "^7.23.7", + "@babel/types": "^7.23.6", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -182,12 +182,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", - "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", + "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", "dev": true, "dependencies": { - "@babel/types": "^7.23.0", + "@babel/types": "^7.23.6", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -197,14 +197,14 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz", - "integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", + "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.22.9", - "@babel/helper-validator-option": "^7.22.15", - "browserslist": "^4.21.9", + "@babel/compat-data": "^7.23.5", + "@babel/helper-validator-option": "^7.23.5", + "browserslist": "^4.22.2", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, @@ -268,9 +268,9 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz", - "integrity": "sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", + "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", @@ -320,9 +320,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", "dev": true, "engines": { "node": ">=6.9.0" @@ -338,32 +338,32 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", - "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", + "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.2.tgz", - "integrity": "sha512-lzchcp8SjTSVe/fPmLwtWVBFC7+Tbn8LGHDVfDp9JGxpAY5opSaEFgt8UQvrnECWOTdji2mOWMz1rOhkHscmGQ==", + "version": "7.23.8", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.8.tgz", + "integrity": "sha512-KDqYz4PiOWvDFrdHLPhKtCThtIcKVy6avWD2oG4GEvyQ+XDZwHD4YQd+H2vNMnq2rkdxsDkU82T+Vk8U/WXHRQ==", "dev": true, "dependencies": { "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.2", - "@babel/types": "^7.23.0" + "@babel/traverse": "^7.23.7", + "@babel/types": "^7.23.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", @@ -446,9 +446,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", - "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", + "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -518,9 +518,9 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", - "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", + "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -620,9 +620,9 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", - "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz", + "integrity": "sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -649,20 +649,20 @@ } }, "node_modules/@babel/traverse": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", - "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "version": "7.23.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.7.tgz", + "integrity": "sha512-tY3mM8rH9jM0YHFGyfC0/xf+SB5eKUu7HPj7/k3fpi9dAlsMc5YbQvDi0Sh2QTPXqMhyaAtzAr807TIyfQrmyg==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.0", - "@babel/types": "^7.23.0", - "debug": "^4.1.0", + "@babel/parser": "^7.23.6", + "@babel/types": "^7.23.6", + "debug": "^4.3.1", "globals": "^11.1.0" }, "engines": { @@ -679,12 +679,12 @@ } }, "node_modules/@babel/types": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", - "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.6.tgz", + "integrity": "sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, @@ -1088,18 +1088,18 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.9.1.tgz", - "integrity": "sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA==", + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", - "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -1119,29 +1119,73 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@eslint/js": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.51.0.tgz", - "integrity": "sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", + "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.12", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.12.tgz", - "integrity": "sha512-NlGesA1usRNn6ctHCZ21M4/dKPgW9Nn1FypRdIKKgZOKzkVV4T1FlK5mBiLhHBCDmEbdQG0idrcXlbZfksJ+RA==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^2.0.0", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", "minimatch": "^3.0.5" }, "engines": { "node": ">=10.10.0" } }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -1156,11 +1200,107 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.0.tgz", - "integrity": "sha512-9S9QrXY2K0L4AGDcSgTi9vgiCcG8VcBv4Mp7/1hDPYoswIy6Z6KO5blYto82BT8M0MZNRWmCFLpCs3HlpYGGdw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", + "dev": true + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -1586,9 +1726,9 @@ "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.20", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", - "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", + "version": "0.3.22", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", + "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", @@ -1630,6 +1770,16 @@ "node": ">= 8" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -1637,9 +1787,9 @@ "dev": true }, "node_modules/@sinonjs/commons": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", - "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, "dependencies": { "type-detect": "4.0.8" @@ -1679,9 +1829,9 @@ "dev": true }, "node_modules/@types/babel__core": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.3.tgz", - "integrity": "sha512-54fjTSeSHwfan8AyHWrKbfBWiEUrNTZsUwPTDSNaaP1QDQIZbeNUg3a59E9D+375MzUw/x1vx2/0F5LBz+AeYA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "dependencies": { "@babel/parser": "^7.20.7", @@ -1692,18 +1842,18 @@ } }, "node_modules/@types/babel__generator": { - "version": "7.6.6", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.6.tgz", - "integrity": "sha512-66BXMKb/sUWbMdBNdMvajU7i/44RkrA3z/Yt1c7R5xejt8qh84iU54yUWCtm0QwGJlDcf/gg4zd/x4mpLAlb/w==", + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", "dev": true, "dependencies": { "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__template": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.3.tgz", - "integrity": "sha512-ciwyCLeuRfxboZ4isgdNZi/tkt06m8Tw6uGbBSBgWrnnZGNXiEyM27xc/PjXGQLqlZ6ylbgHMnm7ccF9tCkOeQ==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "dependencies": { "@babel/parser": "^7.1.0", @@ -1711,51 +1861,51 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.3.tgz", - "integrity": "sha512-Lsh766rGEFbaxMIDH7Qa+Yha8cMVI3qAK6CHt3OR0YfxOIn5Z54iHiyDRycHrBqeIiqGa20Kpsv1cavfBKkRSw==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.5.tgz", + "integrity": "sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==", "dev": true, "dependencies": { "@babel/types": "^7.20.7" } }, "node_modules/@types/graceful-fs": { - "version": "4.1.8", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.8.tgz", - "integrity": "sha512-NhRH7YzWq8WiNKVavKPBmtLYZHxNY19Hh+az28O/phfp68CF45pMFud+ZzJ8ewnxnC5smIdF3dqFeiSUQ5I+pw==", + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", - "integrity": "sha512-zONci81DZYCZjiLe0r6equvZut0b+dBRPBN5kBDjsONnutYNtJMoWQ9uR2RkL1gLG9NMTzvf+29e5RFfPbeKhQ==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", "dev": true }, "node_modules/@types/istanbul-lib-report": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.2.tgz", - "integrity": "sha512-8toY6FgdltSdONav1XtUHl4LN1yTmLza+EuDazb/fEmRNCwjyqNVIQWs2IfC74IqjHkREs/nQ2FWq5kZU9IC0w==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", "dev": true, "dependencies": { "@types/istanbul-lib-coverage": "*" } }, "node_modules/@types/istanbul-reports": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.3.tgz", - "integrity": "sha512-1nESsePMBlf0RPRffLZi5ujYh7IH1BWL4y9pr+Bn3cJBdxz+RTP8bUFljLz9HvzhhOSWKdyBZ4DIivdL6rvgZg==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", "dev": true, "dependencies": { "@types/istanbul-lib-report": "*" } }, "node_modules/@types/jest": { - "version": "29.5.6", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.6.tgz", - "integrity": "sha512-/t9NnzkOpXb4Nfvg17ieHE6EeSjDS2SGSpNYfoLbUAeL/EOueU/RSdOWFpfQTXBEM7BguYW1XQ0EbM+6RlIh6w==", + "version": "29.5.11", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.11.tgz", + "integrity": "sha512-S2mHmYIVe13vrm6q4kN6fLYYAka15ALQki/vgDC3mIukEOx8WJlv0kQPM+d4w8Gp6u0uSdKND04IlTXBv0rwnQ==", "dev": true, "dependencies": { "expect": "^29.0.0", @@ -1763,67 +1913,67 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.14", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.14.tgz", - "integrity": "sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "node_modules/@types/node": { - "version": "20.8.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.7.tgz", - "integrity": "sha512-21TKHHh3eUHIi2MloeptJWALuCu5H7HQTdTrWIFReA8ad+aggoX+lRes3ex7/FtpC+sVUpFMQ+QTfYr74mruiQ==", + "version": "20.11.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.5.tgz", + "integrity": "sha512-g557vgQjUUfN76MZAN/dt1z3dzcUsimuysco0KeluHgrPdJXkP/XdAURgyO2W9fZWHRtRBiVKzKn8vyOAwlG+w==", "dev": true, "dependencies": { - "undici-types": "~5.25.1" + "undici-types": "~5.26.4" } }, "node_modules/@types/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==", + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz", + "integrity": "sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==", "dev": true }, "node_modules/@types/stack-utils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.2.tgz", - "integrity": "sha512-g7CK9nHdwjK2n0ymT2CW698FuWJRIx+RP6embAzZ2Qi8/ilIrA1Imt2LVSeHUzKvpoi7BhmmQcXz95eS0f2JXw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true }, "node_modules/@types/ws": { - "version": "8.5.8", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.8.tgz", - "integrity": "sha512-flUksGIQCnJd6sZ1l5dqCEG/ksaoAg/eUwiLAGTJQcfgvZJKF++Ta4bJA6A5aPSJmsr+xlseHn4KLgVlNnvPTg==", + "version": "8.5.10", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", + "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/yargs": { - "version": "17.0.29", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.29.tgz", - "integrity": "sha512-nacjqA3ee9zRF/++a3FUY1suHTFKZeHba2n8WeDw9cCVdmzmHpIxyzOJBcpHvvEmS8E9KqWlSnWHUkOrkhWcvA==", + "version": "17.0.32", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", + "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==", "dev": true, "dependencies": { "@types/yargs-parser": "*" } }, "node_modules/@types/yargs-parser": { - "version": "21.0.2", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.2.tgz", - "integrity": "sha512-5qcvofLPbfjmBfKaLfj/+f+Sbd6pN4zl7w7VSVI5uz7m9QZTuB2aZAa2uo1wHFBNN2x6g/SoTkXmd8mQnQF2Cw==", + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.8.0.tgz", - "integrity": "sha512-GosF4238Tkes2SHPQ1i8f6rMtG6zlKwMEB0abqSJ3Npvos+doIlc/ATG+vX1G9coDF3Ex78zM3heXHLyWEwLUw==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.19.1.tgz", + "integrity": "sha512-roQScUGFruWod9CEyoV5KlCYrubC/fvG8/1zXuT0WTcxX87GnMMmnksMwSg99lo1xiKrBzw2icsJPMAw1OtKxg==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.8.0", - "@typescript-eslint/type-utils": "6.8.0", - "@typescript-eslint/utils": "6.8.0", - "@typescript-eslint/visitor-keys": "6.8.0", + "@typescript-eslint/scope-manager": "6.19.1", + "@typescript-eslint/type-utils": "6.19.1", + "@typescript-eslint/utils": "6.19.1", + "@typescript-eslint/visitor-keys": "6.19.1", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -1849,15 +1999,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.8.0.tgz", - "integrity": "sha512-5tNs6Bw0j6BdWuP8Fx+VH4G9fEPDxnVI7yH1IAPkQH5RUtvKwRoqdecAPdQXv4rSOADAaz1LFBZvZG7VbXivSg==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.19.1.tgz", + "integrity": "sha512-WEfX22ziAh6pRE9jnbkkLGp/4RhTpffr2ZK5bJ18M8mIfA8A+k97U9ZyaXCEJRlmMHh7R9MJZWXp/r73DzINVQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.8.0", - "@typescript-eslint/types": "6.8.0", - "@typescript-eslint/typescript-estree": "6.8.0", - "@typescript-eslint/visitor-keys": "6.8.0", + "@typescript-eslint/scope-manager": "6.19.1", + "@typescript-eslint/types": "6.19.1", + "@typescript-eslint/typescript-estree": "6.19.1", + "@typescript-eslint/visitor-keys": "6.19.1", "debug": "^4.3.4" }, "engines": { @@ -1877,13 +2027,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.8.0.tgz", - "integrity": "sha512-xe0HNBVwCph7rak+ZHcFD6A+q50SMsFwcmfdjs9Kz4qDh5hWhaPhFjRs/SODEhroBI5Ruyvyz9LfwUJ624O40g==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.19.1.tgz", + "integrity": "sha512-4CdXYjKf6/6aKNMSly/BP4iCSOpvMmqtDzRtqFyyAae3z5kkqEjKndR5vDHL8rSuMIIWP8u4Mw4VxLyxZW6D5w==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.8.0", - "@typescript-eslint/visitor-keys": "6.8.0" + "@typescript-eslint/types": "6.19.1", + "@typescript-eslint/visitor-keys": "6.19.1" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1894,13 +2044,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.8.0.tgz", - "integrity": "sha512-RYOJdlkTJIXW7GSldUIHqc/Hkto8E+fZN96dMIFhuTJcQwdRoGN2rEWA8U6oXbLo0qufH7NPElUb+MceHtz54g==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.19.1.tgz", + "integrity": "sha512-0vdyld3ecfxJuddDjACUvlAeYNrHP/pDeQk2pWBR2ESeEzQhg52DF53AbI9QCBkYE23lgkhLCZNkHn2hEXXYIg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.8.0", - "@typescript-eslint/utils": "6.8.0", + "@typescript-eslint/typescript-estree": "6.19.1", + "@typescript-eslint/utils": "6.19.1", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -1921,9 +2071,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.8.0.tgz", - "integrity": "sha512-p5qOxSum7W3k+llc7owEStXlGmSl8FcGvhYt8Vjy7FqEnmkCVlM3P57XQEGj58oqaBWDQXbJDZxwUWMS/EAPNQ==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.1.tgz", + "integrity": "sha512-6+bk6FEtBhvfYvpHsDgAL3uo4BfvnTnoge5LrrCj2eJN8g3IJdLTD4B/jK3Q6vo4Ql/Hoip9I8aB6fF+6RfDqg==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1934,16 +2084,17 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.8.0.tgz", - "integrity": "sha512-ISgV0lQ8XgW+mvv5My/+iTUdRmGspducmQcDw5JxznasXNnZn3SKNrTRuMsEXv+V/O+Lw9AGcQCfVaOPCAk/Zg==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.19.1.tgz", + "integrity": "sha512-aFdAxuhzBFRWhy+H20nYu19+Km+gFfwNO4TEqyszkMcgBDYQjmPJ61erHxuT2ESJXhlhrO7I5EFIlZ+qGR8oVA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.8.0", - "@typescript-eslint/visitor-keys": "6.8.0", + "@typescript-eslint/types": "6.19.1", + "@typescript-eslint/visitor-keys": "6.19.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", + "minimatch": "9.0.3", "semver": "^7.5.4", "ts-api-utils": "^1.0.1" }, @@ -1961,17 +2112,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.8.0.tgz", - "integrity": "sha512-dKs1itdE2qFG4jr0dlYLQVppqTE+Itt7GmIf/vX6CSvsW+3ov8PbWauVKyyfNngokhIO9sKZeRGCUo1+N7U98Q==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.19.1.tgz", + "integrity": "sha512-JvjfEZuP5WoMqwh9SPAPDSHSg9FBHHGhjPugSRxu5jMfjvBpq5/sGTD+9M9aQ5sh6iJ8AY/Kk/oUYVEMAPwi7w==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.8.0", - "@typescript-eslint/types": "6.8.0", - "@typescript-eslint/typescript-estree": "6.8.0", + "@typescript-eslint/scope-manager": "6.19.1", + "@typescript-eslint/types": "6.19.1", + "@typescript-eslint/typescript-estree": "6.19.1", "semver": "^7.5.4" }, "engines": { @@ -1986,12 +2137,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.8.0.tgz", - "integrity": "sha512-oqAnbA7c+pgOhW2OhGvxm0t1BULX5peQI/rLsNDpGM78EebV3C9IGbX5HNZabuZ6UQrYveCLjKo8Iy/lLlBkkg==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.1.tgz", + "integrity": "sha512-gkdtIO+xSO/SmI0W68DBg4u1KElmIUo3vXzgHyGPs6cxgB0sa3TlptRAAE0hUY1hM6FcDKEv7aIwiTGm76cXfQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.8.0", + "@typescript-eslint/types": "6.19.1", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -2002,10 +2153,16 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -2024,9 +2181,9 @@ } }, "node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", "dev": true, "engines": { "node": ">=0.4.0" @@ -2145,11 +2302,11 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", - "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.5.tgz", + "integrity": "sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==", "dependencies": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.4", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -2286,13 +2443,12 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/braces": { @@ -2308,9 +2464,9 @@ } }, "node_modules/browserslist": { - "version": "4.22.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", - "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", + "version": "4.22.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.2.tgz", + "integrity": "sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==", "dev": true, "funding": [ { @@ -2327,9 +2483,9 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001541", - "electron-to-chromium": "^1.4.535", - "node-releases": "^2.0.13", + "caniuse-lite": "^1.0.30001565", + "electron-to-chromium": "^1.4.601", + "node-releases": "^2.0.14", "update-browserslist-db": "^1.0.13" }, "bin": { @@ -2409,9 +2565,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001551", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001551.tgz", - "integrity": "sha512-vtBAez47BoGMMzlbYhfXrMV1kvRF2WP/lqiMuDu1Sb4EE4LKEgjopFDSRtZfdVnslNRpOqV/woE+Xgrwj6VQlg==", + "version": "1.0.30001579", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001579.tgz", + "integrity": "sha512-u5AUVkixruKHJjw/pj9wISlcMpgFWzSrczLZbrqBSxukQixmg0SJ5sZTpvaFvxU0HoQKd4yoyAogyrAz9pzJnA==", "dev": true, "funding": [ { @@ -2740,9 +2896,9 @@ } }, "node_modules/dotenv": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", - "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "version": "16.3.2", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.2.tgz", + "integrity": "sha512-HTlk5nmhkm8F6JcdXvHIzaorzCoziNQT9mGxLPVXW8wJF1TiGSL60ZGB4gHWabHOaMmWmhvk2/lPHfnBiT78AQ==", "dev": true, "engines": { "node": ">=12" @@ -2751,10 +2907,16 @@ "url": "https://github.com/motdotla/dotenv?sponsor=1" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, "node_modules/electron-to-chromium": { - "version": "1.4.561", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.561.tgz", - "integrity": "sha512-eS5t4ulWOBfVHdq9SW2dxEaFarj1lPjvJ8PaYMOjY0DecBaj/t4ARziL2IPpDr4atyWwjLFGQ2vo/VCgQFezVQ==", + "version": "1.4.642", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.642.tgz", + "integrity": "sha512-M4+u22ZJGpk4RY7tne6W+APkZhnnhmAH48FNl8iEFK2lEgob+U5rUQsIqQhvAwCXYpfd3H20pHK/ENsCvwTbsA==", "dev": true }, "node_modules/emittery": { @@ -2843,18 +3005,19 @@ } }, "node_modules/eslint": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.51.0.tgz", - "integrity": "sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", + "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.51.0", - "@humanwhocodes/config-array": "^0.11.11", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.56.0", + "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -2924,6 +3087,28 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", @@ -3051,9 +3236,9 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -3091,9 +3276,9 @@ "dev": true }, "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.16.0.tgz", + "integrity": "sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -3149,9 +3334,9 @@ } }, "node_modules/flat-cache": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", - "integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, "dependencies": { "flatted": "^3.2.9", @@ -3159,7 +3344,7 @@ "rimraf": "^3.0.2" }, "engines": { - "node": ">=12.0.0" + "node": "^10.12.0 || >=12.0.0" } }, "node_modules/flatted": { @@ -3169,9 +3354,9 @@ "dev": true }, "node_modules/follow-redirects": { - "version": "1.15.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", - "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", "funding": [ { "type": "individual", @@ -3187,6 +3372,34 @@ } } }, + "node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -3220,6 +3433,15 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -3291,10 +3513,32 @@ "node": ">=10.13.0" } }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/globals": { - "version": "13.23.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", - "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -3338,15 +3582,6 @@ "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, - "node_modules/has": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", - "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", - "dev": true, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -3356,6 +3591,18 @@ "node": ">=8" } }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -3372,9 +3619,9 @@ } }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", + "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", "dev": true, "engines": { "node": ">= 4" @@ -3459,12 +3706,12 @@ } }, "node_modules/is-core-module": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", - "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dev": true, "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3546,9 +3793,9 @@ "dev": true }, "node_modules/istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, "engines": { "node": ">=8" @@ -3611,6 +3858,24 @@ "node": ">=8" } }, + "node_modules/jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", @@ -4282,12 +4547,12 @@ } }, "node_modules/lilconfig": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", - "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", + "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", "dev": true, "engines": { - "node": ">=10" + "node": ">=14" } }, "node_modules/lines-and-columns": { @@ -4434,15 +4699,27 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" } }, "node_modules/ms": { @@ -4475,9 +4752,9 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", "dev": true }, "node_modules/normalize-path": { @@ -4653,6 +4930,31 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "node_modules/path-scurry": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", + "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "dev": true, + "dependencies": { + "lru-cache": "^9.1.1 || ^10.0.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.1.0.tgz", + "integrity": "sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -4754,21 +5056,27 @@ } }, "node_modules/postcss-load-config": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.1.tgz", - "integrity": "sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.2.tgz", + "integrity": "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==", "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "dependencies": { - "lilconfig": "^2.0.5", - "yaml": "^2.1.1" + "lilconfig": "^3.0.0", + "yaml": "^2.3.4" }, "engines": { "node": ">= 14" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, "peerDependencies": { "postcss": ">=8.0.9", "ts-node": ">=9.0.0" @@ -4836,9 +5144,9 @@ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, "engines": { "node": ">=6" @@ -5175,6 +5483,21 @@ "node": ">=8" } }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -5187,6 +5510,19 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -5218,14 +5554,14 @@ } }, "node_modules/sucrase": { - "version": "3.34.0", - "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.34.0.tgz", - "integrity": "sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==", + "version": "3.35.0", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz", + "integrity": "sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==", "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.2", "commander": "^4.0.0", - "glob": "7.1.6", + "glob": "^10.3.10", "lines-and-columns": "^1.1.6", "mz": "^2.7.0", "pirates": "^4.0.1", @@ -5236,24 +5572,26 @@ "sucrase-node": "bin/sucrase-node" }, "engines": { - "node": ">=8" + "node": ">=16 || 14 >=14.17" } }, "node_modules/sucrase/node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -5297,6 +5635,28 @@ "node": ">=8" } }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -5388,9 +5748,9 @@ "dev": true }, "node_modules/ts-jest": { - "version": "29.1.1", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz", - "integrity": "sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==", + "version": "29.1.2", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.2.tgz", + "integrity": "sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==", "dev": true, "dependencies": { "bs-logger": "0.x", @@ -5406,7 +5766,7 @@ "ts-jest": "cli.js" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^16.10.0 || ^18.0.0 || >=20.0.0" }, "peerDependencies": { "@babel/core": ">=7.0.0-beta.0 <8", @@ -5431,9 +5791,9 @@ } }, "node_modules/ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", @@ -5573,9 +5933,9 @@ } }, "node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -5586,9 +5946,9 @@ } }, "node_modules/undici-types": { - "version": "5.25.3", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", - "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==", + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "dev": true }, "node_modules/update-browserslist-db": { @@ -5637,9 +5997,9 @@ "dev": true }, "node_modules/v8-to-istanbul": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz", - "integrity": "sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", + "integrity": "sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", @@ -5708,6 +6068,24 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -5728,9 +6106,9 @@ } }, "node_modules/ws": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", - "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", "engines": { "node": ">=10.0.0" }, @@ -5763,9 +6141,9 @@ "dev": true }, "node_modules/yaml": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.3.tgz", - "integrity": "sha512-zw0VAJxgeZ6+++/su5AFoqBbZbrEakwu+X0M5HmcwUiBL7AzcuPKjj5we4xfQLp78LkEMpD0cOnUhmgOVy3KdQ==", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", "dev": true, "engines": { "node": ">= 14" diff --git a/package.json b/package.json index 0f7ffb3..e5695ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@binance/connector-typescript", - "version": "0.3.5", + "version": "0.3.6", "description": "This is a lightweight library that works as a connector to the Binance public API.", "main": "./dist/index.js", "module": "./dist/index.mjs", diff --git a/src/index.ts b/src/index.ts index 5c3d710..315daca 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,8 +23,11 @@ import { CancelResult, CancelRestrictions, CrossMarginAccountTransferType, + CrossMarginAccountType, + CrossMarginTrans, DepositHistory, Direction, + DustAccountType, Featured, FixedAndActivityProductType, FlexibleProductStatus, @@ -43,6 +46,7 @@ import { LendingType, LiquidityAddType, LiquidityRemoveType, + MarginBorrowRepayType, MargintransferType, MarginTransferType, MarginStatus, @@ -98,7 +102,8 @@ import { UnivTransferType, Urgency, ValidTime, - WithdrawHistory + WithdrawHistory, + WorkingFloor } from './modules/enum'; export { AccountSnapshotType, @@ -109,8 +114,11 @@ export { AccountSnapshotType, CancelResult, CancelRestrictions, CrossMarginAccountTransferType, + CrossMarginAccountType, + CrossMarginTrans, DepositHistory, Direction, + DustAccountType, Featured, FixedAndActivityProductType, FlexibleProductStatus, @@ -130,6 +138,7 @@ export { AccountSnapshotType, LiquidityAddType, LiquidityRemoveType, listenkeyResponse, + MarginBorrowRepayType, MargintransferType, MarginTransferType, MarginStatus, @@ -189,6 +198,7 @@ export { AccountSnapshotType, WebsocketAPI, WebsocketStream, WithdrawHistory, + WorkingFloor, RestMarginTypes, RestMarketTypes, RestSimpleEarnTypes, diff --git a/src/modules/enum.ts b/src/modules/enum.ts index 87d59e1..a2a1fbb 100644 --- a/src/modules/enum.ts +++ b/src/modules/enum.ts @@ -40,6 +40,26 @@ export enum CrossMarginAccountTransferType { TransferFromMarginAccountToMainAccount = 2, } +export enum CrossMarginAccountType { + Margin_1 = 'Margin_1', + Margin_2 = 'Margin_2', +} + +export enum CrossMarginTrans { + SPOT = 'SPOT', + FUTURES = 'FUTURES', + FIAT = 'FIAT', + DELIVERY = 'DELIVERY', + MINING = 'MINING', + ISOLATED_MARGIN = 'ISOLATED_MARGIN', + FUNDING = 'FUNDING', + MOTHER_SPOT = 'MOTHER_SPOT', + OPTION = 'OPTION', + SUB_SPOT = 'SUB_SPOT', + SUB_MARGIN = 'SUB_MARGIN', + CROSS_MARGIN = 'CROSS_MARGIN', +} + export enum DepositHistory { Pending = 0, CreditedButCannotWithdraw = 6, @@ -92,6 +112,11 @@ export enum FuturesTransferType { TransferFromSubaccountCOIN = 4, } +export enum DustAccountType { + SPOT = 'SPOT', + MARGIN = 'MARGIN', +} + export enum GetCrossMargingTransferHistoryType { ROLL_IN = 'ROLL_IN', ROLL_OUT = 'ROLL_OUT', @@ -173,6 +198,11 @@ export enum LiquidityRemoveType { COMBINATION = 'COMBINATION', } +export enum MarginBorrowRepayType { + BORROW = 'BORROW', + REPAY = 'REPAY', +} + export enum MargintransferType { TransferFromMainAccountToMarginAccount = 1, TransferFromMarginAccountToMainAccount = 2, @@ -369,6 +399,7 @@ export enum SideEffectType { NO_SIDE_EFFECT = 'NO_SIDE_EFFECT', MARGIN_BUY = 'MARGIN_BUY', AUTO_REPAY = 'AUTO_REPAY', + AUTO_BORROW_REPAY = 'AUTO_BORROW_REPAY', } export enum SimpleEarnDestAccount { @@ -517,7 +548,7 @@ export enum UnivTransferType { MAIN_ISOLATED_MARGIN = 'MAIN_ISOLATED_MARGIN', ISOLATED_MARGIN_MAIN = 'ISOLATED_MARGIN_MAIN', MAIN_FUNDING = 'MAIN_FUNDING', - FUNDING_MAIN = 'FUNDING_MAIN', + FUNDING_MAIN = 'FUNDING_MAIN' } export enum Urgency { @@ -542,3 +573,8 @@ export enum WithdrawHistory { Failure = 5, Completed = 6, } + +export enum WorkingFloor { + EXCHANGE = 'EXCHANGE', + SOR = 'SOR', +} diff --git a/src/modules/restful/margin/margin.ts b/src/modules/restful/margin/margin.ts index 67f9795..211b8bb 100644 --- a/src/modules/restful/margin/margin.ts +++ b/src/modules/restful/margin/margin.ts @@ -1,42 +1,32 @@ import { Constructor } from '../../../setters/types'; import { validateRequiredParameters } from '../../../helpers/utils'; import { - crossMarginAccountTransferOptions, - crossMarginAccountTransferResponse, + adjustCrossMarginMaxLeverageResponse, + getAllCrossMarginPairsOptions, + getAllCrossMarginPairsResponse, + getAllMarginAssetsOptions, + getAllMarginAssetsResponse, + getCrossMarginAccountDetailsOptions, + getCrossMarginAccountDetailsResponse, getCrossMarginTransferHistoryOptions, getCrossMarginTransferHistoryResponse, - marginAccountBorrowOptions, - marginAccountBorrowResponse, - getLoanRecordOptions, - getLoanRecordResponse, - marginAccountRepayOptions, - marginAccountRepayResponse, - getRepayRecordOptions, - getRepayRecordResponse, - getMarginAssetResponse, - getCrossMarginPairResponse, - getAllMarginAssetsResponse, - getAllCrossMarginPairsResponse, - getMarginPriceIndexResponse, - adjustCrossMarginMaxLeverageResponse, - getMarginAccountOrderOptions, - getMarginAccountOrderResponse, - marginAccountNewOrderOptions, - marginAccountNewOrderResponse, - marginAccountCancelOrderOptions, - marginAccountCancelOrderResponse, - getInterestHistoryOptions, - getInterestHistoryResponse, getForceLiquidationRecordOptions, getForceLiquidationRecordResponse, - getCrossMarginAccountDetailsOptions, - getCrossMarginAccountDetailsResponse, + getInterestHistoryOptions, + getInterestHistoryResponse, + getMarginPriceIndexResponse, + getMarginAccountAllOrdersOptions, + getMarginAccountAllOrdersResponse, getMarginAccountOpenOrdersOptions, getMarginAccountOpenOrdersResponse, + getMarginAccountOrderOptions, + getMarginAccountOrderResponse, marginAccountCancelAllOpenOrdersOnASymbolOptions, marginAccountCancelAllOpenOrdersOnASymbolResponse, - getMarginAccountAllOrdersOptions, - getMarginAccountAllOrdersResponse, + marginAccountCancelOrderOptions, + marginAccountCancelOrderResponse, + marginAccountNewOrderOptions, + marginAccountNewOrderResponse, marginAccountNewOcoOptions, marginAccountNewOcoResponse, getMarginAccountOcoOptions, @@ -55,10 +45,6 @@ import { getMaxTransferoutAmountResponse, getSummaryOfMarginAccountOptions, getSummaryOfMarginAccountResponse, - getIsolatedMarginTransferHistoryOptions, - getIsolatedMarginTransferHistoryResponse, - isolatedMarginAccountTransferOptions, - isolatedMarginAccountTransferResponse, getIsolatedMarginAccountInfoOptions, getIsolatedMarginAccountInfoResponse, disableIsolatedMarginAccountOptions, @@ -67,8 +53,6 @@ import { enableIsolatedMarginAccountResponse, getEnabledIsolatedMarginAccountLimitOptions, getEnabledIsolatedMarginAccountLimitResponse, - getIsolatedMarginSymbolOptions, - getIsolatedMarginSymbolResponse, getAllIsolatedMarginSymbolOptions, getAllIsolatedMarginSymbolResponse, toggleBnbBurnOnSpotTradeAndMarginInterestOptions, @@ -85,12 +69,6 @@ import { getIsolatedMarginTierDataResponse, getCurrentMarginOrderCountUsageOptions, getCurrentMarginOrderCountUsageResponse, - marginDustlogOptions, - marginDustlogResponse, - getAssetsThatCanBeConvertedIntoBNBOptions, - getAssetsThatCanBeConvertedIntoBNBResponse, - dustTransferOptions, - dustTransferResponse, crossMarginCollateralRatioResponse, getSmallLiabilityExchangeCoinListOptions, getSmallLiabilityExchangeCoinListResponse, @@ -100,134 +78,50 @@ import { getSmallLiabilityExchangeHistoryResponse, getFutureHoulyInterestRateResponse, getTokensOrSymbolsDelistScheduleForCrossMarginAndIsolatedMarginOptions, - getTokensOrSymbolsDelistScheduleForCrossMarginAndIsolatedMarginResponse + getTokensOrSymbolsDelistScheduleForCrossMarginAndIsolatedMarginResponse, + getMarginAvailableInventoryOptions, + getMarginAvailableInventoryResponse, + marginManualLiquidationOptions, + marginManualLiquidationResponse, + getLeverageBracketResponse, + marginAccountBorrowRepayOptions, + marginAccountBorrowRepayResponse, + getBorrowRepayRecordsOptions, + getBorrowRepayRecordsResponse } from './types'; import { MarginMethods } from './methods'; -import { Side, OrderType, TransFrom, TransTo, IsIsolatedMargin } from '../../enum'; +import { Side, OrderType, IsIsolatedMargin, MarginBorrowRepayType } from '../../enum'; export function mixinMargin(base: T): Constructor & T { return class extends base { /** - * Cross Margin Account Transfer (MARGIN) {@link https://binance-docs.github.io/apidocs/spot/en/#cross-margin-account-transfer-margin} - * - * @param {string} asset - * @param {number} amount - * @param {number} type - * `1` - transfer from main account to margin account, * `2` - transfer from margin account to main account - * @param {object} [options] - * @param {number} [options.recvWindow] - The value cannot be greater than 60000 - */ - async crossMarginAccountTransfer(asset: string, amount: number, type: number, options?: crossMarginAccountTransferOptions): Promise { - validateRequiredParameters({ asset, amount, type }); - const url = this.prepareSignedPath('/sapi/v1/margin/transfer', - Object.assign( - options ? options : {}, - { - asset: asset.toUpperCase(), - amount: amount, - type: type - } - ) - ); - return await this.makeRequest('POST', url); - } - - - /** - * Margin Account Borrow (MARGIN) {@link https://binance-docs.github.io/apidocs/spot/en/#margin-account-borrow-margin} - * - * @param {string} asset - * @param {number} amount + * Get All Margin Assets (MARKET_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#get-all-margin-assets-market_data} + * * @param {object} [options] - * @param {IsIsolatedMargin} [options.isIsolated] - * `TRUE` - For isolated margin, * `FALSE` - Default, not for isolated margin - * @param {string} [options.symbol] - Trading symbol, e.g. BNBUSDT - * @param {number} [options.recvWindow] - The value cannot be greater than 60000 + * @param {string} [options.asset] */ - async marginAccountBorrow(asset: string, amount: number, options?: marginAccountBorrowOptions): Promise { - validateRequiredParameters({ asset, amount }); - const url = this.prepareSignedPath('/sapi/v1/margin/loan', - Object.assign( - options ? options : {}, - { - asset: asset.toUpperCase(), - amount: amount - } - ) + async getAllMarginAssets(options?: getAllMarginAssetsOptions): Promise { + const url = this.prepareSignedPath('/sapi/v1/margin/allAssets', + options ? options : {} ); - return await this.makeRequest('POST', url); + return await this.makeRequest('GET', url); } /** - * Margin Account Repay (MARGIN) {@link https://binance-docs.github.io/apidocs/spot/en/#margin-account-repay-margin} - * - * @param {string} asset - * @param {number} amount + * Get All Cross Margin Pairs (MARKET_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#get-all-cross-margin-pairs-market_data} + * * @param {object} [options] - * @param {IsIsolatedMargin} [options.isIsolated] - * `TRUE` - For isolated margin, * `FALSE` - Default, not for isolated margin - * @param {string} [options.symbol] - Trading symbol, e.g. BNBUSDT - * @param {number} [options.recvWindow] - The value cannot be greater than 60000 + * @param {string} [options.symbol] */ - async marginAccountRepay(asset: string, amount: number, options?: marginAccountRepayOptions): Promise { - validateRequiredParameters({ asset, amount }); - const url = this.prepareSignedPath('/sapi/v1/margin/repay', - Object.assign( - options ? options : {}, - { - asset: asset.toUpperCase(), - amount: amount - } - ) + async getAllCrossMarginPairs(options?: getAllCrossMarginPairsOptions): Promise { + const url = this.prepareSignedPath('/sapi/v1/margin/allPairs', + options ? options : {} ); - return await this.makeRequest('POST', url); - } - - - /** - * Query Margin Asset (MARKET_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#query-margin-asset-market_data} - * - * @param {string} asset - */ - async getMarginAsset(asset: string): Promise { - validateRequiredParameters({ asset }); - const url = this.preparePath('/sapi/v1/margin/asset', - { - asset: asset.toUpperCase() - }); - return await this.makeRequest('GET', url); - } - - - /** - * Query Cross Margin Pair (MARKET_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#query-cross-margin-pair-market_data} - * - * @param {string} symbol - Trading symbol, e.g. BNBUSDT - */ - async getCrossMarginPair(symbol: string): Promise { - validateRequiredParameters({ symbol }); - const url = this.preparePath('/sapi/v1/margin/pair', - { - symbol: symbol.toUpperCase() - }); return await this.makeRequest('GET', url); } - /** - * Get All Margin Assets (MARKET_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#get-all-margin-assets-market_data} - */ - async getAllMarginAssets(): Promise { - return await this.makeRequest('GET', '/sapi/v1/margin/allAssets'); - } - - - /** - * Get All Cross Margin Pairs (MARKET_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#get-all-cross-margin-pairs-market_data} - */ - async getAllCrossMarginPairs(): Promise { - return await this.makeRequest('GET', '/sapi/v1/margin/allPairs'); - } - - /** * Query Margin PriceIndex (MARKET_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#query-margin-priceindex-market_data} * @@ -330,7 +224,7 @@ export function mixinMargin(base: T): Constructor { validateRequiredParameters({ maxLeverage }); @@ -353,6 +247,7 @@ export function mixinMargin(base: T): Constructor(base: T): Constructor { - validateRequiredParameters({ asset }); - const url = this.prepareSignedPath('/sapi/v1/margin/loan', - Object.assign( - options ? options : {}, - { - asset: asset.toUpperCase() - } - ) - ); - return await this.makeRequest('GET', url); - } - - - /** - * Query Repay Record (USER_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#query-repay-record-user_data} - * - * @param {string} asset - * @param {object} [options] - * @param {string} [options.isolatedSymbol] - Isolated symbol - * @param {number} [options.txId] - the tranId in `POST /sapi/v1/margin/repay` - * @param {number} [options.startTime] - UTC timestamp in ms - * @param {number} [options.endTime] - UTC timestamp in ms - * @param {number} [options.current] - Current querying page. Start from 1. Default:1 - * @param {number} [options.size] - Default:10 Max:100 - * @param {string} [options.archived] - Default: false. Set to true for archived data from 6 months ago - * @param {number} [options.recvWindow] - The value cannot be greater than 60000 - */ - async getRepayRecord(asset: string, options?: getRepayRecordOptions): Promise { - validateRequiredParameters({ asset }); - const url = this.prepareSignedPath('/sapi/v1/margin/repay', - Object.assign( - options ? options : {}, - { - asset: asset.toUpperCase() - } - ) - ); - return await this.makeRequest('GET', url); - } - /** * Get Interest History (USER_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#get-interest-history-user_data} @@ -746,64 +586,6 @@ export function mixinMargin(base: T): Constructor { - validateRequiredParameters({ asset, symbol, transFrom, transTo, amount }); - const url = this.prepareSignedPath('/sapi/v1/margin/isolated/transfer', - Object.assign( - options ? options : {}, - { - asset: asset.toUpperCase(), - symbol: symbol.toUpperCase(), - transFrom: transFrom, - transTo: transTo, - amount: amount - } - ) - ); - return await this.makeRequest('POST', url); - } - - - /** - * Get Isolated Margin Transfer History (USER_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#get-isolated-margin-transfer-history-user_data} - * - * @param {string} symbol - Trading symbol, e.g. BNBUSDT - * @param {object} [options] - * @param {string} [options.asset] - * @param {TransFrom} [options.transFrom] - * @param {TransTo} [options.transTo] - * @param {number} [options.startTime] - UTC timestamp in ms - * @param {number} [options.endTime] - UTC timestamp in ms - * @param {number} [options.current] - Current querying page. Start from 1. Default:1 - * @param {number} [options.size] - Default:10 Max:100 - * @param {string} [options.archived] - Default: false. Set to true for archived data from 6 months ago - * @param {number} [options.recvWindow] - The value cannot be greater than 60000 - */ - async getIsolatedMarginTransferHistory(symbol: string, options?: getIsolatedMarginTransferHistoryOptions): Promise { - validateRequiredParameters({ symbol }); - const url = this.prepareSignedPath('/sapi/v1/margin/isolated/transfer', - Object.assign( - options ? options : {}, - { - symbol: symbol.toUpperCase() - } - ) - ); - return await this.makeRequest('GET', url); - } - - /** * Query Isolated Margin Account Info (USER_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#query-isolated-margin-account-info-user_data} * @@ -875,31 +657,11 @@ export function mixinMargin(base: T): Constructor { - validateRequiredParameters({ symbol }); - const url = this.prepareSignedPath('/sapi/v1/margin/isolated/pair', - Object.assign( - options ? options : {}, - { - symbol: symbol.toUpperCase() - } - ) - ); - return await this.makeRequest('GET', url); - } - - /** * Get All Isolated Margin Symbol (USER_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#get-all-isolated-margin-symbol-user_data} * * @param {object} [options] + * @param {string} [options.symbol] * @param {number} [options.recvWindow] - The value cannot be greater than 60000 */ async getAllIsolatedMarginSymbol(options?: getAllIsolatedMarginSymbolOptions): Promise { @@ -1035,58 +797,6 @@ export function mixinMargin(base: T): Constructor { - - const url = this.prepareSignedPath('/sapi/v1/margin/dribblet', - options ? options : {} - ); - return await this.makeRequest('GET', url); - } - - - /** - * Get Assets That Can Be Converted Into BNB (USER_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#get-assets-that-can-be-converted-into-bnb-user_data-2} - * - * @param {object} [options] - * @param {number} [options.recvWindow] - The value cannot be greater than 60000 - */ - async getAssetsThatCanBeConvertedIntoBNB(options?: getAssetsThatCanBeConvertedIntoBNBOptions): Promise { - const url = this.prepareSignedPath('/sapi/v1/margin/dust', - options ? options : {} - ); - return await this.makeRequest('GET', url); - } - - - /** - * Dust Transfer (TRADE) {@link https://binance-docs.github.io/apidocs/spot/en/#dust-transfer-trade} - * - * @param {string[]} asset - The asset being converted. For example: asset=BTC,USDT - * @param {object} [options] - * @param {number} [options.recvWindow] - The value cannot be greater than 60000 - */ - async dustTransfer(asset: string[], options?: dustTransferOptions): Promise { - validateRequiredParameters({ asset }); - const url = this.prepareSignedPath('/sapi/v1/margin/dust ', - Object.assign( - options ? options : {}, - { - asset: asset, - } - ) - ); - return await this.makeRequest('POST', url); - } - - /** * Cross margin collateral ratio (MARKET_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#cross-margin-collateral-ratio-market_data} * @@ -1185,5 +895,110 @@ export function mixinMargin(base: T): Constructor { + validateRequiredParameters({ type }); + const url = this.prepareSignedPath('/sapi/v1/margin/available-inventory', + Object.assign( + options ? options : {}, + { + type: type + } + ) + ); + return await this.makeRequest('GET', url); + } + + + /** + * Margin manual liquidation (MARGIN) {@link https://binance-docs.github.io/apidocs/spot/en/#margin-manual-liquidation-margin} + * + * @param {string} type - MARGIN, ISOLATED + * @param {object} [options] + * @param {string} [options.symbol] - When type selects ISOLATED, symbol must be filled in + * @param {number} [options.recvWindow] - The value cannot be greater than 60000 + */ + async marginManualLiquidation(type: string, options?: marginManualLiquidationOptions): Promise { + validateRequiredParameters({ type }); + const url = this.prepareSignedPath('/sapi/v1/margin/manual-liquidation', + Object.assign( + options ? options : {}, + { + type: type + } + ) + ); + return await this.makeRequest('POST', url); + } + + /** + * Get the liability assets leverage bracket in Cross Margin Pro Mode (MARKET_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#query-liability-coin-leverage-bracket-in-cross-margin-pro-mode-market_data} + */ + async getLeverageBracket(): Promise { + const url = this.prepareSignedPath('/sapi/v1/margin/leverageBracket'); + return await this.makeRequest('GET', url); + } + + /** + * Margin account borrow/repay(MARGIN) {@link https://binance-docs.github.io/apidocs/spot/en/#margin-account-borrow-repay-margin} + * + * @param {string} asset + * @param {string} isIsolated - TRUE for Isolated Margin, FALSE for Cross Margin, Default FALSE + * @param {string} symbol - Only for Isolated margin + * @param {string} amount + * @param {MarginBorrowRepayType} type - BORROW or REPAY + * @param {object} [options] + * @param {number} [options.recvWindow] - The value cannot be greater than 60000 + */ + async marginAccountBorrowRepay(asset: string, isIsolated: string, symbol: string, amount: string, type: MarginBorrowRepayType, options?: marginAccountBorrowRepayOptions): Promise { + validateRequiredParameters({ asset, isIsolated, symbol, amount, type }); + const url = this.prepareSignedPath('/sapi/v1/margin/borrow-repay', + Object.assign( + options ? options : {}, + { + asset: asset, + isIsolated: isIsolated, + symbol: symbol, + amount: amount, + type: type + } + ) + ); + return await this.makeRequest('POST', url); + } + + /** + * Query borrow/repay records in Margin account(USER_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#query-borrow-repay-records-in-margin-account-user_data} + * + * @param {MarginBorrowRepayType} type - BORROW or REPAY + * @param {object} [options] + * @param {string} [options.asset] + * @param {string} [options.isolatedSymbol] - Symbol in Isolated Margin + * @param {number} [options.txId] + * @param {number} [options.startTime] + * @param {number} [options.endTime] + * @param {number} [options.current] - Current querying page. Start from 1. Default:1 + * @param {number} [options.size] - Default:10 Max:100 + * @param {number} [options.recvWindow] - The value cannot be greater than 60000 + */ + async getBorrowRepayRecords(type: MarginBorrowRepayType, options?: getBorrowRepayRecordsOptions): Promise { + validateRequiredParameters({ type }); + const url = this.prepareSignedPath('/sapi/v1/margin/borrow-repay', + Object.assign( + options ? options : {}, + { + type: type + } + ) + ); + return await this.makeRequest('GET', url); + } }; } diff --git a/src/modules/restful/margin/methods.ts b/src/modules/restful/margin/methods.ts index caa064b..56c3010 100644 --- a/src/modules/restful/margin/methods.ts +++ b/src/modules/restful/margin/methods.ts @@ -1,27 +1,16 @@ import { OrderType, IsIsolatedMargin, + MarginBorrowRepayType, Side, - TransFrom, - TransTo } from '../../enum'; import { - crossMarginAccountTransferOptions, - crossMarginAccountTransferResponse, getCrossMarginTransferHistoryOptions, getCrossMarginTransferHistoryResponse, - marginAccountBorrowOptions, - marginAccountBorrowResponse, - getLoanRecordOptions, - getLoanRecordResponse, - marginAccountRepayOptions, - marginAccountRepayResponse, - getRepayRecordOptions, - getRepayRecordResponse, - getMarginAssetResponse, - getCrossMarginPairResponse, + getAllMarginAssetsOptions, getAllMarginAssetsResponse, + getAllCrossMarginPairsOptions, getAllCrossMarginPairsResponse, getMarginPriceIndexResponse, adjustCrossMarginMaxLeverageResponse, @@ -61,10 +50,6 @@ import { getMaxTransferoutAmountResponse, getSummaryOfMarginAccountOptions, getSummaryOfMarginAccountResponse, - getIsolatedMarginTransferHistoryOptions, - getIsolatedMarginTransferHistoryResponse, - isolatedMarginAccountTransferOptions, - isolatedMarginAccountTransferResponse, getIsolatedMarginAccountInfoOptions, getIsolatedMarginAccountInfoResponse, disableIsolatedMarginAccountOptions, @@ -73,8 +58,6 @@ import { enableIsolatedMarginAccountResponse, getEnabledIsolatedMarginAccountLimitOptions, getEnabledIsolatedMarginAccountLimitResponse, - getIsolatedMarginSymbolOptions, - getIsolatedMarginSymbolResponse, getAllIsolatedMarginSymbolOptions, getAllIsolatedMarginSymbolResponse, toggleBnbBurnOnSpotTradeAndMarginInterestOptions, @@ -91,12 +74,6 @@ import { getIsolatedMarginTierDataResponse, getCurrentMarginOrderCountUsageOptions, getCurrentMarginOrderCountUsageResponse, - marginDustlogOptions, - marginDustlogResponse, - getAssetsThatCanBeConvertedIntoBNBOptions, - getAssetsThatCanBeConvertedIntoBNBResponse, - dustTransferOptions, - dustTransferResponse, crossMarginCollateralRatioResponse, getSmallLiabilityExchangeCoinListOptions, getSmallLiabilityExchangeCoinListResponse, @@ -106,25 +83,27 @@ import { getSmallLiabilityExchangeHistoryResponse, getFutureHoulyInterestRateResponse, getTokensOrSymbolsDelistScheduleForCrossMarginAndIsolatedMarginOptions, - getTokensOrSymbolsDelistScheduleForCrossMarginAndIsolatedMarginResponse + getTokensOrSymbolsDelistScheduleForCrossMarginAndIsolatedMarginResponse, + getMarginAvailableInventoryOptions, + getMarginAvailableInventoryResponse, + marginManualLiquidationOptions, + marginManualLiquidationResponse, + getLeverageBracketResponse, + marginAccountBorrowRepayOptions, + marginAccountBorrowRepayResponse, + getBorrowRepayRecordsOptions, + getBorrowRepayRecordsResponse } from './types'; export interface MarginMethods { - crossMarginAccountTransfer(asset: string, amount: number, type: number, options?: crossMarginAccountTransferOptions): Promise; - marginAccountBorrow(asset: string, amount: number, options?: marginAccountBorrowOptions): Promise; - marginAccountRepay(asset: string, amount: number, options?: marginAccountRepayOptions): Promise; - getMarginAsset(asset: string): Promise; - getCrossMarginPair(symbol: string): Promise; - getAllMarginAssets(): Promise; - getAllCrossMarginPairs(): Promise; + getAllMarginAssets(options?: getAllMarginAssetsOptions): Promise + getAllCrossMarginPairs(options?: getAllCrossMarginPairsOptions): Promise; getMarginPriceIndex(symbol: string): Promise; marginAccountNewOrder(symbol: string, side: Side, type: OrderType, options?: marginAccountNewOrderOptions): Promise; marginAccountCancelOrder(symbol: string, options?: marginAccountCancelOrderOptions): Promise; marginAccountCancelAllOpenOrdersOnASymbol(symbol: string, options?: marginAccountCancelAllOpenOrdersOnASymbolOptions): Promise; adjustCrossMarginMaxLeverage(maxLeverage: number): Promise; getCrossMarginTransferHistory(options?: getCrossMarginTransferHistoryOptions): Promise; - getLoanRecord(asset: string, options?: getLoanRecordOptions): Promise; - getRepayRecord(asset: string, options?: getRepayRecordOptions): Promise; getInterestHistory(options?: getInterestHistoryOptions): Promise; getForceLiquidationRecord(options?: getForceLiquidationRecordOptions): Promise; getCrossMarginAccountDetails(options?: getCrossMarginAccountDetailsOptions): Promise; @@ -140,13 +119,10 @@ export interface MarginMethods { getMaxBorrow(asset: string, options?: getMaxBorrowOptions): Promise; getMaxTransferoutAmount(asset: string, options?: getMaxTransferoutAmountOptions): Promise; getSummaryOfMarginAccount(options?: getSummaryOfMarginAccountOptions): Promise; - isolatedMarginAccountTransfer(asset: string, symbol: string, transFrom: TransFrom, transTo: TransTo, amount: number, options?: isolatedMarginAccountTransferOptions): Promise; - getIsolatedMarginTransferHistory(symbol: string, options?: getIsolatedMarginTransferHistoryOptions): Promise; getIsolatedMarginAccountInfo(options?: getIsolatedMarginAccountInfoOptions): Promise; disableIsolatedMarginAccount(symbol: string, options?: disableIsolatedMarginAccountOptions): Promise; enableIsolatedMarginAccount(symbol: string, options?: enableIsolatedMarginAccountOptions): Promise; getEnabledIsolatedMarginAccountLimit(options?: getEnabledIsolatedMarginAccountLimitOptions): Promise; - getIsolatedMarginSymbol(symbol: string, options?: getIsolatedMarginSymbolOptions): Promise; getAllIsolatedMarginSymbol(options?: getAllIsolatedMarginSymbolOptions): Promise; toggleBnbBurnOnSpotTradeAndMarginInterest(options?: toggleBnbBurnOnSpotTradeAndMarginInterestOptions): Promise; getBnbBurnStatus(options?: getBnbBurnStatusOptions): Promise; @@ -155,13 +131,15 @@ export interface MarginMethods { getIsolatedMarginFeeData(options?: getIsolatedMarginFeeDataOptions): Promise; getIsolatedMarginTierData(symbol: string, options?: getIsolatedMarginTierDataOptions): Promise; getCurrentMarginOrderCountUsage(options?: getCurrentMarginOrderCountUsageOptions): Promise; - marginDustlog(options?: marginDustlogOptions): Promise; - getAssetsThatCanBeConvertedIntoBNB(options?: getAssetsThatCanBeConvertedIntoBNBOptions): Promise; - dustTransfer(asset: string[], options?: dustTransferOptions): Promise; crossMarginCollateralRatio(): Promise; getSmallLiabilityExchangeCoinList(options?: getSmallLiabilityExchangeCoinListOptions): Promise; smallLiabilityExchange(assetNames: string[], options?: smallLiabilityExchangeOptions): Promise; getSmallLiabilityExchangeHistory(current: number, size: number, options?: getSmallLiabilityExchangeHistoryOptions): Promise; getFutureHoulyInterestRate(assets: string, isIsolated: IsIsolatedMargin): Promise; getTokensOrSymbolsDelistScheduleForCrossMarginAndIsolatedMargin(options?: getTokensOrSymbolsDelistScheduleForCrossMarginAndIsolatedMarginOptions): Promise; + getMarginAvailableInventory(type: string, options?: getMarginAvailableInventoryOptions): Promise; + marginManualLiquidation(type: string, options?: marginManualLiquidationOptions): Promise; + getLeverageBracket(): Promise; + marginAccountBorrowRepay(asset: string, isIsolated: string, symbol: string, amount: string, type: MarginBorrowRepayType, options?: marginAccountBorrowRepayOptions): Promise; + getBorrowRepayRecords(type: MarginBorrowRepayType, options?: getBorrowRepayRecordsOptions): Promise; } \ No newline at end of file diff --git a/src/modules/restful/margin/types.ts b/src/modules/restful/margin/types.ts index dc1a095..84634dc 100644 --- a/src/modules/restful/margin/types.ts +++ b/src/modules/restful/margin/types.ts @@ -10,81 +10,44 @@ import { SideEffectType, TimeInForce, StopLimitTimeInForce, - TransFrom, - TransTo, SpotBNBBurn, InterestBNBBurn, GetCrossMargingTransferHistoryType, SelfTradePreventionMode, MarginStatus, MarginInterestHistory, - MarginLevelStatus + MarginLevelStatus, + CrossMarginAccountType, + CrossMarginTrans } from '../../enum'; -export interface crossMarginAccountTransferOptions { - recvWindow?: number; -} - -export interface crossMarginAccountTransferResponse { - tranId: number; -} - -export interface marginAccountBorrowOptions { - isIsolated?: IsIsolatedMargin; - symbol?: string; - recvWindow?: number; -} - -export interface marginAccountBorrowResponse { - tranId: number; -} - -export interface marginAccountRepayOptions { - isIsolated?: IsIsolatedMargin; - symbol?: string; - recvWindow?: number; -} - -export interface marginAccountRepayResponse { - tranId: number; +export interface getAllMarginAssetsOptions { + asset?: string; } -export interface getMarginAssetResponse { +export interface getAllMarginAssetsResponse { assetFullName: string; assetName: string; isBorrowable: boolean; isMortgageable: boolean; userMinBorrow: string; userMinRepay: string; + delistTime: number; } -export interface getCrossMarginPairResponse { - id: number; - symbol: string; - base: string; - quote: string; - isMarginTrade: boolean; - isBuyAllowed: boolean; - isSellAllowed: boolean; -} - -export interface getAllMarginAssetsResponse { - assetFullName: string; - assetName: string; - isBorrowable: boolean; - isMortgageable: boolean; - userMinBorrow: string; - userMinRepay: string; +export interface getAllCrossMarginPairsOptions { + symbol?: string; } export interface getAllCrossMarginPairsResponse { base: string; - id: number; + id: bigint; isBuyAllowed: boolean; isMarginTrade: boolean; isSellAllowed: boolean; quote: string; symbol: string; + delistTime?: number; } export interface getMarginPriceIndexResponse { @@ -192,6 +155,7 @@ export interface getCrossMarginTransferHistoryOptions { endTime?: number; current?: number; size?: number; + isolatedSymbol?: string; archived?: MarginArchive; recvWindow?: number; } @@ -208,59 +172,12 @@ interface getCrossMarginTransferHistoryRows { timestamp: number; txId: number; type: GetCrossMargingTransferHistoryType; + transFrom?: CrossMarginTrans; + transTo?: CrossMarginTrans; + fromSymbol?: string; + toSymbol?: string; } -export interface getLoanRecordOptions { - isolatedSymbol?: string; - txId?: number; - startTime?: number; - endTime?: number; - current?: number; - size?: number; - archived?: MarginArchive; - recvWindow?: number; -} - -export interface getLoanRecordResponse { - rows: getLoanRecordRows[]; - total: number; -} - -interface getLoanRecordRows { - isolatedSymbol: string; - txId: number; - asset: string; - principal: string; - timestamp: number; - status: MarginStatus; -} - -export interface getRepayRecordOptions { - isolatedSymbol?: string; - txId?: number; - startTime?: number; - endTime?: number; - current?: number; - size?: number; - archived?: MarginArchive; - recvWindow?: number; -} - -export interface getRepayRecordResponse { - rows: getRepayRecordRows[]; - total: number; -} - -interface getRepayRecordRows { - isolatedSymbol: string; - amount: string; - asset: string; - interest: string; - principal: string; - status: MarginStatus; - timestamp: number; - txId: number; -} export interface getInterestHistoryOptions { asset?: string; @@ -329,6 +246,7 @@ export interface getCrossMarginAccountDetailsResponse { totalNetAssetOfBtc: string; tradeEnabled: boolean; transferEnabled: boolean; + accountType: CrossMarginAccountType; userAssets: getCrossMarginAccountDetailsUserassets[]; } @@ -659,41 +577,6 @@ export interface getSummaryOfMarginAccountResponse { forceLiquidationBar: string; } -export interface isolatedMarginAccountTransferOptions { - recvWindow?: number; -} - -export interface isolatedMarginAccountTransferResponse { - tranId: number; -} - -export interface getIsolatedMarginTransferHistoryOptions { - asset?: string; - transFrom?: TransFrom; - transTo?: TransTo; - startTime?: number; - endTime?: number; - current?: number; - size?: number; - archived?: MarginArchive; - recvWindow?: number; -} - -export interface getIsolatedMarginTransferHistoryResponse { - rows: getIsolatedMarginTransferHistoryRows[]; - total: number; -} - -interface getIsolatedMarginTransferHistoryRows { - amount: string; - asset: string; - status: MarginStatus; - timestamp: number; - txId: number; - transFrom: TransFrom; - transTo: TransTo; -} - export interface getIsolatedMarginAccountInfoOptions { symbols?: string; recvWindow?: number; @@ -774,20 +657,8 @@ export interface getEnabledIsolatedMarginAccountLimitResponse { maxAccount: number; } -export interface getIsolatedMarginSymbolOptions { - recvWindow?: number; -} - -export interface getIsolatedMarginSymbolResponse { - symbol: string; - base: string; - quote: string; - isMarginTrade: boolean; - isBuyAllowed: boolean; - isSellAllowed: boolean; -} - export interface getAllIsolatedMarginSymbolOptions { + symbol?: string; recvWindow?: number; } @@ -899,74 +770,6 @@ export interface getCurrentMarginOrderCountUsageResponse { count: number; } -export interface marginDustlogOptions { - startTime?: number; - endTime?: number; - recvWindow?: number; -} - -export interface marginDustlogResponse { - total: number; - userAssetDribblets: marginDustlogUserassetdribblets[]; -} - -interface marginDustlogUserassetdribblets { - operateTime: number; - totalTransferedAmount: string; - totalServiceChargeAmount: string; - transId: number; - userAssetDribbletDetails: marginDustlogUserassetdribbletdetails[]; -} - -interface marginDustlogUserassetdribbletdetails { - transId: number; - serviceChargeAmount: string; - amount: string; - operateTime: number; - transferedAmount: string; - fromAsset: string; -} - -export interface getAssetsThatCanBeConvertedIntoBNBOptions { - recvWindow?: number; -} - -export interface getAssetsThatCanBeConvertedIntoBNBResponse { - details: getAssetsThatCanBeConvertedIntoBNBDetails[]; - totalTransferBtc: string; - totalTransferBNB: string; - dribbletPercentage: string; -} - -interface getAssetsThatCanBeConvertedIntoBNBDetails { - asset: string; - assetFullName: string; - amountFree: string; - toBTC: string; - toBNB: string; - toBNBOffExchange: string; - exchange: string; -} - -export interface dustTransferOptions { - recvWindow?: number; -} - -export interface dustTransferResponse { - totalServiceCharge: string; - totalTransfered: string; - transferResult: dustTransferResult[]; -} - -interface dustTransferResult { - amount: string; - fromAsset: string; - operateTime: number; - serviceChargeAmount: string; - tranId: number; - transferedAmount: string; -} - export interface crossMarginCollateralRatioResponse { collaterals: crossMarginCollateralRatioCollaterals[]; assetNames: string[]; @@ -1036,4 +839,75 @@ export interface getTokensOrSymbolsDelistScheduleForCrossMarginAndIsolatedMargin delistTime: number; crossMarginAssets: string[]; isolatedMarginSymbols: string[]; +} + +export interface getMarginAvailableInventoryOptions { + recvWindow?: number; +} + +export interface getMarginAvailableInventoryResponse { + assets: { [key: string]: string }; + updateTime: number; +} + +export interface marginManualLiquidationOptions { + symbol?: string; + recvWindow?: number; +} + +export interface marginManualLiquidationResponse { + asset: string; + interest: string; + principal: string; + liabilityAsset: string; + liabilityQty: number; +} + +export interface getLeverageBracketResponse { + assetNames: string[]; + rank: number; + brackets: leverageBracket[]; +} + +export interface leverageBracket { + leverage: number; + maxDebt: number; + maintenanceMarginRate: number; + initialMarginRate: number; + fastNum: number; +} + +export interface marginAccountBorrowRepayOptions { + recvWindow?: number; +} + +export interface marginAccountBorrowRepayResponse { + tranId: number; +} + +export interface getBorrowRepayRecordsOptions { + asset?: string; + isolatedSymbol?: string; + txId?: number; + startTime?: number; + endTime?: number; + current?: number; + size?: number; + recvWindow?: number; +} + +export interface getBorrowRepayRecordsResponse { + rows: BorrowRepayRecordsRow[]; + total: number; +} + +export interface BorrowRepayRecordsRow { + isolatedSymbol: string; + amount: string; + asset: string; + interest: string; + principal: string; + status: MarginStatus; + timestamp: number; + txId: number; } \ No newline at end of file diff --git a/src/modules/restful/market/market.ts b/src/modules/restful/market/market.ts index d1f702b..681d7cb 100644 --- a/src/modules/restful/market/market.ts +++ b/src/modules/restful/market/market.ts @@ -2,29 +2,31 @@ import { Constructor } from '../../../setters/types'; import { validateRequiredParameters } from '../../../helpers/utils'; import { checkServerTimeResponse, + compressedAggregateTradesListOptions, + compressedAggregateTradesListResponse, + currentAveragePriceResponse, exchangeInformationOptions, exchangeInformationResponse, + klineCandlestickDataOptions, + klineCandlestickDataResponse, + oldTradeLookupOptions, + oldTradeLookupResponse, orderBookOptions, orderBookResponse, recentTradesListOptions, recentTradesListResponse, - oldTradeLookupOptions, - oldTradeLookupResponse, - compressedAggregateTradesListOptions, - compressedAggregateTradesListResponse, - klineCandlestickDataOptions, - klineCandlestickDataResponse, - uiklinesOptions, - uiklinesResponse, - currentAveragePriceResponse, - ticker24hrOptions, - ticker24hrResponse, - symbolPriceTickerOptions, - symbolPriceTickerResponse, + rollingWindowPriceChangeStatisticsOptions, + rollingWindowPriceChangeStatisticsResponse, symbolOrderBookTickerOptions, symbolOrderBookTickerResponse, - rollingWindowPriceChangeStatisticsOptions, - rollingWindowPriceChangeStatisticsResponse + symbolPriceTickerOptions, + symbolPriceTickerResponse, + ticker24hrOptions, + ticker24hrResponse, + tradingDayTickerOptions, + tradingDayTickerResponse, + uiklinesOptions, + uiklinesResponse } from './types'; import { MarketMethods } from './methods'; import { Interval } from '../../enum'; @@ -159,6 +161,7 @@ export function mixinMarket(base: T): Constructor { @@ -184,6 +187,7 @@ export function mixinMarket(base: T): Constructor { @@ -277,5 +281,28 @@ export function mixinMarket(base: T): Constructor { + validateRequiredParameters({ symbol }); + const url = this.preparePath('/api/v3/ticker/tradingDay', + Object.assign( + options ? options : {}, + { + symbol: symbol.toUpperCase() + } + ) + ); + return await this.makeRequest('GET', url); + } }; } diff --git a/src/modules/restful/market/methods.ts b/src/modules/restful/market/methods.ts index e7a3907..705562e 100644 --- a/src/modules/restful/market/methods.ts +++ b/src/modules/restful/market/methods.ts @@ -14,16 +14,18 @@ import { orderBookResponse, recentTradesListOptions, recentTradesListResponse, - uiklinesOptions, - uiklinesResponse, - ticker24hrOptions, - ticker24hrResponse, - symbolPriceTickerOptions, - symbolPriceTickerResponse, + rollingWindowPriceChangeStatisticsOptions, + rollingWindowPriceChangeStatisticsResponse, symbolOrderBookTickerOptions, symbolOrderBookTickerResponse, - rollingWindowPriceChangeStatisticsOptions, - rollingWindowPriceChangeStatisticsResponse + symbolPriceTickerOptions, + symbolPriceTickerResponse, + ticker24hrOptions, + ticker24hrResponse, + tradingDayTickerOptions, + tradingDayTickerResponse, + uiklinesOptions, + uiklinesResponse } from './types'; export interface MarketMethods { @@ -41,4 +43,5 @@ export interface MarketMethods { symbolPriceTicker(options?: symbolPriceTickerOptions): Promise; symbolOrderBookTicker(options?: symbolOrderBookTickerOptions): Promise; rollingWindowPriceChangeStatistics(options?: rollingWindowPriceChangeStatisticsOptions): Promise; + tradingDayTicker(symbol: string, options?: tradingDayTickerOptions): Promise; } \ No newline at end of file diff --git a/src/modules/restful/market/types.ts b/src/modules/restful/market/types.ts index ad93c22..2397c67 100644 --- a/src/modules/restful/market/types.ts +++ b/src/modules/restful/market/types.ts @@ -110,6 +110,7 @@ export interface compressedAggregateTradesListResponse { export interface klineCandlestickDataOptions { startTime?: number; endTime?: number; + timeZone?: string; limit?: number; } @@ -118,6 +119,7 @@ export type klineCandlestickDataResponse = (string | number)[] export interface uiklinesOptions { startTime?: number; endTime?: number; + timeZone?: string; limit?: number; } @@ -126,6 +128,7 @@ export type uiklinesResponse = (number | string)[] export interface currentAveragePriceResponse { mins: number; price: string; + closeTime: number; } export interface ticker24hrOptions { @@ -306,3 +309,27 @@ interface trailingDelta { minTrailingBelowDelta: number; maxTrailingBelowDelta: number; } + +export interface tradingDayTickerOptions { + symbols?: string; + timeZone?: string; + type?: 'FULL' | 'MINI'; +} + +export interface tradingDayTickerResponse { + symbol: string; + priceChange: string; + priceChangePercent: string; + weightedAvgPrice: string; + openPrice: string; + highPrice: string; + lowPrice: string; + lastPrice: string; + volume: string; + quoteVolume: string; + openTime: number; + closeTime: number; + firstId: number; + lastId: number; + count: number; +} \ No newline at end of file diff --git a/src/modules/restful/trade/methods.ts b/src/modules/restful/trade/methods.ts index 942cf62..737f55d 100644 --- a/src/modules/restful/trade/methods.ts +++ b/src/modules/restful/trade/methods.ts @@ -1,41 +1,50 @@ import { Side, OrderType, CancelReplaceMode } from '../../enum'; import { - testNewOrderOptions, - getOrderOptions, - getOrderResponse, - newOrderOptions, - newOrderResponse, - cancelOrderOptions, - cancelOrderResponse, - cancelAnExistingOrderAndSendANewOrderOptions, - cancelAnExistingOrderAndSendANewOrderResponse, - currentOpenOrdersOptions, - currentOpenOrdersResponse, - cancelAllOpenOrdersOnASymbolOptions, - cancelAllOpenOrdersOnASymbolResponse, + accountInformationOptions, + accountInformationResponse, + accountTradeListOptions, + accountTradeListResponse, allOrdersOptions, allOrdersResponse, - newOcoOptions, - newOcoResponse, - getOcoOptions, - getOcoResponse, + cancelAllOpenOrdersOnASymbolOptions, + cancelAllOpenOrdersOnASymbolResponse, + cancelAnExistingOrderAndSendANewOrderOptions, + cancelAnExistingOrderAndSendANewOrderResponse, cancelOcoOptions, cancelOcoResponse, + cancelOrderOptions, + cancelOrderResponse, + currentOpenOrdersOptions, + currentOpenOrdersResponse, + getAllocationsOptions, + getAllocationsResponse, getAllOcoOptions, getAllOcoResponse, - getOpenOcoOptions, - getOpenOcoResponse, - accountInformationOptions, - accountInformationResponse, - accountTradeListOptions, - accountTradeListResponse, + getCommissionRatesResponse, getCurrentOrderCountUsageOptions, getCurrentOrderCountUsageResponse, + getOcoOptions, + getOcoResponse, + getOpenOcoOptions, + getOpenOcoResponse, + getOrderOptions, + getOrderResponse, + getPreventedMatchesOptions, + getPreventedMatchesResponse, + newOcoOptions, + newOcoResponse, + newOrderOptions, + newOrderResponse, + newOrderSOROptions, + newOrderSORResponse, + testNewOrderOptions, + testNewOrderResponse, + testNewOrderSOROptions } from './types'; export interface TradeMethods { - testNewOrder(symbol: string, side: Side, type: OrderType, options?: testNewOrderOptions): Promise>; + testNewOrder(symbol: string, side: Side, type: OrderType, options?: testNewOrderOptions): Promise | testNewOrderResponse>; getOrder(symbol: string, options?: getOrderOptions): Promise; newOrder(symbol: string, side: Side, type: OrderType, options?: newOrderOptions): Promise; cancelOrder(symbol: string, options?: cancelOrderOptions): Promise; @@ -51,4 +60,9 @@ export interface TradeMethods { accountInformation(options?: accountInformationOptions): Promise; accountTradeList(symbol: string, options?: accountTradeListOptions): Promise; getCurrentOrderCountUsage(options?: getCurrentOrderCountUsageOptions): Promise; + testNewOrderSOR(symbol: string, side: Side, type: OrderType, quantity: number, options?: testNewOrderSOROptions): Promise | testNewOrderResponse>; + newOrderSOR(symbol: string, side: Side, type: OrderType, quantity: number, options?: newOrderSOROptions): Promise; + getPreventedMatches(symbol: string, options?: getPreventedMatchesOptions): Promise; + getAllocations(symbol: string, options?: getAllocationsOptions): Promise; + getCommissionRates(symbol: string): Promise; } \ No newline at end of file diff --git a/src/modules/restful/trade/trade.ts b/src/modules/restful/trade/trade.ts index 72df69b..0633b89 100644 --- a/src/modules/restful/trade/trade.ts +++ b/src/modules/restful/trade/trade.ts @@ -1,37 +1,46 @@ import { Constructor } from '../../../setters/types'; import { validateRequiredParameters } from '../../../helpers/utils'; import { - testNewOrderOptions, - getOrderOptions, - getOrderResponse, - newOrderOptions, - newOrderResponse, - cancelOrderOptions, - cancelOrderResponse, - cancelAnExistingOrderAndSendANewOrderOptions, - cancelAnExistingOrderAndSendANewOrderResponse, - currentOpenOrdersOptions, - currentOpenOrdersResponse, - cancelAllOpenOrdersOnASymbolOptions, - cancelAllOpenOrdersOnASymbolResponse, + accountInformationOptions, + accountInformationResponse, + accountTradeListOptions, + accountTradeListResponse, allOrdersOptions, allOrdersResponse, - newOcoOptions, - newOcoResponse, - getOcoOptions, - getOcoResponse, + cancelAllOpenOrdersOnASymbolOptions, + cancelAllOpenOrdersOnASymbolResponse, + cancelAnExistingOrderAndSendANewOrderOptions, + cancelAnExistingOrderAndSendANewOrderResponse, cancelOcoOptions, cancelOcoResponse, + cancelOrderOptions, + cancelOrderResponse, + currentOpenOrdersOptions, + currentOpenOrdersResponse, + getAllocationsOptions, + getAllocationsResponse, getAllOcoOptions, getAllOcoResponse, + getCommissionRatesResponse, + getCurrentOrderCountUsageOptions, + getCurrentOrderCountUsageResponse, + getOcoOptions, + getOcoResponse, getOpenOcoOptions, getOpenOcoResponse, - accountInformationOptions, - accountInformationResponse, - accountTradeListOptions, - accountTradeListResponse, - getCurrentOrderCountUsageOptions, - getCurrentOrderCountUsageResponse + getOrderOptions, + getOrderResponse, + getPreventedMatchesOptions, + getPreventedMatchesResponse, + newOcoOptions, + newOcoResponse, + newOrderOptions, + newOrderResponse, + newOrderSOROptions, + newOrderSORResponse, + testNewOrderOptions, + testNewOrderResponse, + testNewOrderSOROptions } from './types'; import { TradeMethods } from './methods'; import { Side, OrderType, CancelReplaceMode } from '../../enum'; @@ -56,9 +65,11 @@ export function mixinTrade(base: T): Constructor> { + async testNewOrder(symbol: string, side: Side, type: OrderType, options?: testNewOrderOptions): Promise | testNewOrderResponse> { validateRequiredParameters({ symbol, side, type }); const url = this.prepareSignedPath('/api/v3/order/test', Object.assign( @@ -115,6 +126,7 @@ export function mixinTrade(base: T): Constructor { @@ -429,5 +441,139 @@ export function mixinTrade(base: T): Constructor | testNewOrderResponse> { + validateRequiredParameters({ symbol, side, type, quantity }); + const url = this.prepareSignedPath('/api/v3/sor/order/test', + Object.assign( + options ? options : {}, + { + symbol: symbol.toUpperCase(), + side: side, + type: type, + quantity: quantity + } + ) + ); + return await this.makeRequest('POST', url); + } + + + /** + * New Order Using SOR (TRADE) {@link https://binance-docs.github.io/apidocs/spot/en/#new-order-using-sor-trade} + * + * @param {string} symbol - Trading symbol, e.g. BNBUSDT + * @param {Side} side + * @param {OrderType} type - Order type + * @param {number} [quantity] - Order quantity + * @param {object} [options] + * @param {TimeInForce} [options.timeInForce] - Order time in force + * @param {number} [options.price] - Order price + * @param {string} [options.newClientOrderId] - Used to uniquely identify this cancel. Automatically generated by default + * @param {number} [options.strategyId] + * @param {number} [options.strategyType] - The value cannot be less than 1000000. + * @param {number} [options.icebergQty] - Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order. + * @param {NewOrderRespType} [options.newOrderRespType] - Set the response JSON. MARKET and LIMIT order types default to FULL, all other orders default to ACK. + * @param {SelfTradePreventionMode} [options.selfTradePreventionMode] - The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE. + * @param {number} [options.recvWindow] - The value cannot be greater than 60000 + */ + async newOrderSOR(symbol: string, side: Side, type: OrderType, quantity: number, options?: newOrderSOROptions): Promise { + validateRequiredParameters({ symbol, side, type, quantity }); + const url = this.prepareSignedPath('/api/v3/sor/order', + Object.assign( + options ? options : {}, + { + symbol: symbol.toUpperCase(), + side: side, + type: type, + quantity: quantity + } + ) + ); + return await this.makeRequest('POST', url); + } + + /** + * Query Prevented Matches (USER_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#query-prevented-matches-user_data} + * + * @param {string} symbol - Trading symbol, e.g. BNBUSDT + * @param {object} [options] + * @param {number} [options.preventedMatchId] + * @param {number} [options.orderId] + * @param {number} [options.fromPreventedMatchId] + * @param {number} [options.limit] - Default: 500; Max: 1000 + * @param {number} [options.recvWindow] - The value cannot be greater than 60000 + */ + async getPreventedMatches(symbol: string, options?: getPreventedMatchesOptions): Promise { + validateRequiredParameters({ symbol }); + const url = this.prepareSignedPath('/api/v3/myPreventedMatches', + Object.assign( + options ? options : {}, + { + symbol: symbol.toUpperCase() + } + ) + ); + return await this.makeRequest('GET', url); + } + + /** + * Query Allocations (USER_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#query-allocations-user_data} + * + * @param {string} symbol - Trading symbol, e.g. BNBUSDT + * @param {object} [options] + * @param {number} [options.startTime] + * @param {number} [options.endTime] + * @param {number} [options.fromAllocationId] + * @param {number} [options.limit] - Default: 500; Max: 1000 + * @param {number} [options.orderId] + * @param {number} [options.recvWindow] - The value cannot be greater than 60000 + */ + async getAllocations(symbol: string, options?: getAllocationsOptions): Promise { + validateRequiredParameters({ symbol }); + const url = this.prepareSignedPath('/api/v3/myAllocations', + Object.assign( + options ? options : {}, + { + symbol: symbol.toUpperCase() + } + ) + ); + return await this.makeRequest('GET', url); + } + + /** + * Query Commission Rates (USER_DATA) {@link https://binance-docs.github.io/apidocs/spot/en/#query-commission-rates-user_data} + * + * @param {string} symbol - Trading symbol, e.g. BNBUSDT + */ + async getCommissionRates(symbol: string): Promise { + validateRequiredParameters({ symbol }); + const url = this.prepareSignedPath('/api/v3/account/commission', + { + symbol: symbol.toUpperCase() + } + ); + return await this.makeRequest('GET', url); + } }; } diff --git a/src/modules/restful/trade/types.ts b/src/modules/restful/trade/types.ts index 9db8bb6..26a4816 100644 --- a/src/modules/restful/trade/types.ts +++ b/src/modules/restful/trade/types.ts @@ -11,7 +11,8 @@ import { SelfTradePreventionMode, Side, StopLimitTimeInForce, - TimeInForce + TimeInForce, + WorkingFloor } from '../../enum'; export interface testNewOrderOptions { @@ -26,7 +27,27 @@ export interface testNewOrderOptions { trailingDelta?: number; icebergQty?: number; newOrderRespType?: NewOrderRespType; + selfTradePreventionMode?: SelfTradePreventionMode; recvWindow?: number; + computeCommissionRates?: boolean; +} + +export interface testNewOrderResponse { + standardCommissionForOrder: commissionParams; + taxCommissionForOrder: commissionParams; + discount: discount; +} + +export interface commissionParams { + maker: string; + taker: string; +} + +export interface discount { + enabledForAccount: boolean; + enabledForSymbol: boolean; + discountAsset: string; + discount: string; } export interface getOrderOptions { @@ -70,6 +91,7 @@ export interface newOrderOptions { trailingDelta?: number; icebergQty?: number; newOrderRespType?: NewOrderRespType; + selfTradePreventionMode?: SelfTradePreventionMode; recvWindow?: number; } @@ -114,6 +136,7 @@ export interface cancelOrderResponse { orderId: number; orderListId: number; clientOrderId: string; + transactTime: number; price: string; origQty: string; executedQty: string; @@ -156,6 +179,7 @@ export interface cancelAnExistingOrderAndSendANewOrderCancelresponse { orderId: number; orderListId: number; clientOrderId: string; + transactTime: number; price: string; origQty: string; executedQty: string; @@ -205,6 +229,7 @@ export interface cancelAllOpenOrdersOnASymbolResponse { orderId: number; orderListId: number; clientOrderId: string; + transactTime: number; price: string; origQty: string; executedQty: string; @@ -356,6 +381,7 @@ export interface cancelOcoOrderReports { orderId: number; orderListId: number; clientOrderId: string; + transactTime: number; price: string; origQty: string; executedQty: string; @@ -484,3 +510,102 @@ export interface getCurrentOrderCountUsageResponse { limit: number; count: number; } + +export interface testNewOrderSOROptions { + timeInForce?: TimeInForce; + price?: number; + newClientOrderId?: string; + strategyId?: number; + strategyType?: number; + icebergQty?: number; + newOrderRespType?: NewOrderRespType; + selfTradePreventionMode?: SelfTradePreventionMode; + recvWindow?: number; + computeCommissionRates?: boolean; +} + +export interface newOrderSOROptions { + timeInForce?: TimeInForce; + price?: number; + newClientOrderId?: string; + strategyId?: number; + strategyType?: number; + icebergQty?: number; + newOrderRespType?: NewOrderRespType; + selfTradePreventionMode?: SelfTradePreventionMode; + recvWindow?: number; +} + +export interface newOrderSORResponse { + symbol: string; + orderId: number; + orderListId: number; + clientOrderId: string; + transactTime: number; + price: string; + origQty: string; + executedQty: string; + cummulativeQuoteQty: string; + status: OrderStatus; + timeInForce: TimeInForce; + type: OrderType; + side: Side; + workingTime: number; + fills: fill[] | []; + workingFloor: WorkingFloor; + selfTradePreventionMode: SelfTradePreventionMode; + usedSor: boolean; +} + +export interface getPreventedMatchesOptions { + preventedMatchId?: number; + orderId?: number; + fromPreventedMatchId?: number; + limit?: number; + recvWindow?: number; +} + +export interface getPreventedMatchesResponse { + symbol: string; + preventedMatchId: number; + takerOrderId: number; + makerOrderId: number; + tradeGroupId: number; + selfTradePreventionMode: SelfTradePreventionMode; + price: string; + makerPreventedQuantity: string; + transactTime: number; +} + +export interface getAllocationsOptions { + startTime?: number; + endTime?: number; + fromAllocationId?: number; + limit?: number; + orderId?: number; + recvWindow?: number; +} + +export interface getAllocationsResponse { + symbol: string; + allocationId: number; + allocationType: string; + orderId: number; + orderListId: number; + price: string; + qty: string; + quoteQty: string; + commission: string; + commissionAsset: string; + time: number; + isBuyer: boolean; + isMaker: boolean; + isAllocator: boolean; +} + +export interface getCommissionRatesResponse { + symbol: string; + standardCommission: accountInformationCommissionrates; + taxCommission: accountInformationCommissionrates; + discount: discount; +} \ No newline at end of file diff --git a/src/modules/restful/wallet/types.ts b/src/modules/restful/wallet/types.ts index dd4db85..ab11c4e 100644 --- a/src/modules/restful/wallet/types.ts +++ b/src/modules/restful/wallet/types.ts @@ -1,4 +1,4 @@ -import { AccountType, UnivTransferType, NeedBtcValuation, QueryConvertTransfer, UnivStatus } from '../../enum'; +import { AccountType, DustAccountType, UnivTransferType, NeedBtcValuation, QueryConvertTransfer, UnivStatus } from '../../enum'; export interface systemStatusResponse { status: number; @@ -207,6 +207,7 @@ interface accountApiTradingStatusTriggercondition { } export interface dustlogOptions { + accountType?: DustAccountType; startTime?: number; endTime?: number; recvWindow?: number; @@ -235,6 +236,7 @@ interface dustlogUserassetdribbletdetails { } export interface getAssetsThatCanBeConvertedIntoBnbOptions { + accountType?: DustAccountType; recvWindow?: number; } @@ -257,16 +259,17 @@ interface getAssetsThatCanBeConvertedIntoBnbDetails { export interface dustTransferOptions { + accountType?: DustAccountType; recvWindow?: number; } export interface dustTransferResponse { totalServiceCharge: string; totalTransfered: string; - transferResult: dustTransferTransferresult[]; + transferResult: dustTransferTransferResult[]; } -interface dustTransferTransferresult { +interface dustTransferTransferResult { amount: string; fromAsset: string; operateTime: number; diff --git a/src/modules/restful/wallet/wallet.ts b/src/modules/restful/wallet/wallet.ts index 7e763e6..6a86777 100644 --- a/src/modules/restful/wallet/wallet.ts +++ b/src/modules/restful/wallet/wallet.ts @@ -242,6 +242,7 @@ export function mixinWallet(base: T): Constructor(base: T): Constructor { @@ -273,6 +275,7 @@ export function mixinWallet(base: T): Constructor { diff --git a/src/modules/websocket/websocketAPI/trade/types.ts b/src/modules/websocket/websocketAPI/trade/types.ts index 1d0f1e2..aa00dec 100644 --- a/src/modules/websocket/websocketAPI/trade/types.ts +++ b/src/modules/websocket/websocketAPI/trade/types.ts @@ -132,7 +132,7 @@ export interface cancelOCOOrder extends Omit, orderReports: cancelOcoOrder[]; } -interface cancelOcoOrder extends Omit, sendMessageOptions { +interface cancelOcoOrder extends Omit, sendMessageOptions { transactTime?: number; stopPrice?: string; } @@ -149,7 +149,7 @@ export interface cancelOpenOCOOrder extends Omit, sendMessageOptions { +interface orderReport extends Omit, sendMessageOptions { transactTime?: number; stopPrice?: string; } diff --git a/tests/mock_values/restful/margin/crossMarginAccountTransfer.ts b/tests/mock_values/restful/margin/crossMarginAccountTransfer.ts deleted file mode 100644 index 44ed5b7..0000000 --- a/tests/mock_values/restful/margin/crossMarginAccountTransfer.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { RestMarginTypes } from '../../../../src/index'; - -export const mockResponse: RestMarginTypes.crossMarginAccountTransferResponse = { - 'tranId': 345196462 -}; diff --git a/tests/mock_values/restful/margin/getAllCrossMarginPairs.ts b/tests/mock_values/restful/margin/getAllCrossMarginPairs.ts index a6450ee..fe6b35b 100644 --- a/tests/mock_values/restful/margin/getAllCrossMarginPairs.ts +++ b/tests/mock_values/restful/margin/getAllCrossMarginPairs.ts @@ -3,11 +3,39 @@ import { RestMarginTypes } from '../../../../src/index'; export const mockResponse: RestMarginTypes.getAllCrossMarginPairsResponse[] = [ { 'base': 'BNB', - 'id': 351637150141315840, + 'id': 351637150141315861n, 'isBuyAllowed': true, 'isMarginTrade': true, 'isSellAllowed': true, 'quote': 'BTC', 'symbol': 'BNBBTC' + }, + { + 'base': 'TRX', + 'id': 351637923235429141n, + 'isBuyAllowed': true, + 'isMarginTrade': true, + 'isSellAllowed': true, + 'quote': 'BTC', + 'symbol': 'TRXBTC', + 'delistTime': 1704973040 + }, + { + 'base': 'XRP', + 'id': 351638112213990165n, + 'isBuyAllowed': true, + 'isMarginTrade': true, + 'isSellAllowed': true, + 'quote': 'BTC', + 'symbol': 'XRPBTC' + }, + { + 'base': 'ETH', + 'id': 351638524530850581n, + 'isBuyAllowed': true, + 'isMarginTrade': true, + 'isSellAllowed': true, + 'quote': 'BTC', + 'symbol': 'ETHBTC' } ]; diff --git a/tests/mock_values/restful/margin/getAllMarginAssets.ts b/tests/mock_values/restful/margin/getAllMarginAssets.ts index 4283e35..9e44570 100644 --- a/tests/mock_values/restful/margin/getAllMarginAssets.ts +++ b/tests/mock_values/restful/margin/getAllMarginAssets.ts @@ -7,6 +7,7 @@ export const mockResponse: RestMarginTypes.getAllMarginAssetsResponse[] = [ 'isBorrowable': true, 'isMortgageable': true, 'userMinBorrow': '0.00000000', - 'userMinRepay': '0.00000000' + 'userMinRepay': '0.00000000', + 'delistTime': 1704973040 } ]; diff --git a/tests/mock_values/restful/margin/getBorrowRepayRecords.ts b/tests/mock_values/restful/margin/getBorrowRepayRecords.ts new file mode 100644 index 0000000..88877ba --- /dev/null +++ b/tests/mock_values/restful/margin/getBorrowRepayRecords.ts @@ -0,0 +1,17 @@ +import { MarginStatus, RestMarginTypes } from '../../../../src/index'; + +export const mockResponse: RestMarginTypes.getBorrowRepayRecordsResponse = { + 'rows': [ + { + 'isolatedSymbol': 'BNBUSDT', + 'amount': '14.00000000', + 'asset': 'BNB', + 'interest': '0.01866667', + 'principal': '13.98133333', + 'status': MarginStatus.CONFIRMED, + 'timestamp': 1563438204000, + 'txId': 2970933056 + } + ], + 'total': 1 +}; diff --git a/tests/mock_values/restful/margin/getCrossMarginAccountDetails.ts b/tests/mock_values/restful/margin/getCrossMarginAccountDetails.ts index 318a4f2..acb8ed4 100644 --- a/tests/mock_values/restful/margin/getCrossMarginAccountDetails.ts +++ b/tests/mock_values/restful/margin/getCrossMarginAccountDetails.ts @@ -1,4 +1,4 @@ -import { RestMarginTypes } from '../../../../src/index'; +import { CrossMarginAccountType, RestMarginTypes } from '../../../../src/index'; export const mockResponse: RestMarginTypes.getCrossMarginAccountDetailsResponse = { 'borrowEnabled': true, @@ -8,6 +8,7 @@ export const mockResponse: RestMarginTypes.getCrossMarginAccountDetailsResponse 'totalNetAssetOfBtc': '6.24095242', 'tradeEnabled': true, 'transferEnabled': true, + 'accountType': CrossMarginAccountType.Margin_1, 'userAssets': [{ 'asset': 'BTC', 'borrowed': '0.00000000', diff --git a/tests/mock_values/restful/margin/getCrossMarginPair.ts b/tests/mock_values/restful/margin/getCrossMarginPair.ts deleted file mode 100644 index 2d62c26..0000000 --- a/tests/mock_values/restful/margin/getCrossMarginPair.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { RestMarginTypes } from '../../../../src/index'; - -export const mockResponse: RestMarginTypes.getCrossMarginPairResponse = { - 'id': 323355778339572400, - 'symbol': 'BNBUSDT', - 'base': 'BTC', - 'quote': 'USDT', - 'isMarginTrade': true, - 'isBuyAllowed': true, - 'isSellAllowed': true -}; diff --git a/tests/mock_values/restful/margin/getCrossMarginTransferHistory.ts b/tests/mock_values/restful/margin/getCrossMarginTransferHistory.ts index 258b3a6..28f9634 100644 --- a/tests/mock_values/restful/margin/getCrossMarginTransferHistory.ts +++ b/tests/mock_values/restful/margin/getCrossMarginTransferHistory.ts @@ -1,4 +1,4 @@ -import { GetCrossMargingTransferHistoryType, MarginStatus, RestMarginTypes } from '../../../../src/index'; +import { CrossMarginTrans, GetCrossMargingTransferHistoryType, MarginStatus, RestMarginTypes } from '../../../../src/index'; export const mockResponse: RestMarginTypes.getCrossMarginTransferHistoryResponse = { 'rows': [ @@ -8,7 +8,9 @@ export const mockResponse: RestMarginTypes.getCrossMarginTransferHistoryResponse 'status': MarginStatus.CONFIRMED, 'timestamp': 1566898617, 'txId': 5240372201, - 'type': GetCrossMargingTransferHistoryType.ROLL_IN + 'type': GetCrossMargingTransferHistoryType.ROLL_IN, + 'transFrom': CrossMarginTrans.SPOT, + 'transTo': CrossMarginTrans.ISOLATED_MARGIN, }, { 'amount': '5.00000000', @@ -16,7 +18,19 @@ export const mockResponse: RestMarginTypes.getCrossMarginTransferHistoryResponse 'status': MarginStatus.CONFIRMED, 'timestamp': 1566888436, 'txId': 5239810406, - 'type': GetCrossMargingTransferHistoryType.ROLL_OUT + 'type': GetCrossMargingTransferHistoryType.ROLL_OUT, + 'transFrom': CrossMarginTrans.ISOLATED_MARGIN, + 'transTo': CrossMarginTrans.ISOLATED_MARGIN, + 'fromSymbol': 'BNBUSDT', + 'toSymbol': 'BTCUSDT' + }, + { + 'amount': '1.00000000', + 'asset': 'EOS', + 'status': MarginStatus.CONFIRMED, + 'timestamp': 1566888403, + 'txId': 5239808703, + 'type': GetCrossMargingTransferHistoryType.ROLL_IN } ], 'total': 3 diff --git a/tests/mock_values/restful/margin/getIsolatedMarginSymbol.ts b/tests/mock_values/restful/margin/getIsolatedMarginSymbol.ts deleted file mode 100644 index eab3f35..0000000 --- a/tests/mock_values/restful/margin/getIsolatedMarginSymbol.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { RestMarginTypes } from '../../../../src/index'; - -export const mockResponse: RestMarginTypes.getIsolatedMarginSymbolResponse = { - 'symbol': 'BTCUSDT', - 'base': 'BTC', - 'quote': 'USDT', - 'isMarginTrade': true, - 'isBuyAllowed': true, - 'isSellAllowed': true -}; diff --git a/tests/mock_values/restful/margin/getIsolatedMarginTransferHistory.ts b/tests/mock_values/restful/margin/getIsolatedMarginTransferHistory.ts deleted file mode 100644 index 9969c26..0000000 --- a/tests/mock_values/restful/margin/getIsolatedMarginTransferHistory.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { MarginStatus, RestMarginTypes, TransFrom, TransTo } from '../../../../src/index'; - -export const mockResponse: RestMarginTypes.getIsolatedMarginTransferHistoryResponse = { - 'rows': [{ - 'amount': '0.10000000', - 'asset': 'BNB', - 'status': MarginStatus.CONFIRMED, - 'timestamp': 1566898617000, - 'txId': 5240372201, - 'transFrom': TransFrom.SPOT, - 'transTo': TransTo.ISOLATED_MARGIN - }], - 'total': 1 -}; diff --git a/tests/mock_values/restful/margin/getLeverageBracket.ts b/tests/mock_values/restful/margin/getLeverageBracket.ts new file mode 100644 index 0000000..6ce8658 --- /dev/null +++ b/tests/mock_values/restful/margin/getLeverageBracket.ts @@ -0,0 +1,30 @@ +import { RestMarginTypes } from '../../../../src/index'; + +export const mockResponse: RestMarginTypes.getLeverageBracketResponse[] = [ + { + 'assetNames': [ + 'SHIB', + 'FDUSD', + 'BTC', + 'ETH', + 'USDC' + ], + 'rank': 1, + 'brackets': [ + { + 'leverage': 10, + 'maxDebt': 1000000.00000000, + 'maintenanceMarginRate': 0.02000000, + 'initialMarginRate': 0.1112, + 'fastNum': 0 + }, + { + 'leverage': 3, + 'maxDebt': 4000000.00000000, + 'maintenanceMarginRate': 0.07000000, + 'initialMarginRate': 0.5000, + 'fastNum': 60000.0000000000000000 + } + ] + } +]; diff --git a/tests/mock_values/restful/margin/getLoanRecord.ts b/tests/mock_values/restful/margin/getLoanRecord.ts deleted file mode 100644 index 9c5241b..0000000 --- a/tests/mock_values/restful/margin/getLoanRecord.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { MarginStatus, RestMarginTypes } from '../../../../src/index'; - -export const mockResponse: RestMarginTypes.getLoanRecordResponse = { - 'rows': [{ - 'isolatedSymbol': 'BNBUSDT', - 'txId': 12807067523, - 'asset': 'BNB', - 'principal': '0.84624403', - 'timestamp': 1555056425000, - 'status': MarginStatus.CONFIRMED - }], - 'total': 0 -}; diff --git a/tests/mock_values/restful/margin/getMarginAsset.ts b/tests/mock_values/restful/margin/getMarginAsset.ts deleted file mode 100644 index abd2b43..0000000 --- a/tests/mock_values/restful/margin/getMarginAsset.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { RestMarginTypes } from '../../../../src/index'; - -export const mockResponse: RestMarginTypes.getMarginAssetResponse = { - 'assetFullName': 'Binance Coin', - 'assetName': 'BNB', - 'isBorrowable': false, - 'isMortgageable': true, - 'userMinBorrow': '0.00000000', - 'userMinRepay': '0.00000000' -}; diff --git a/tests/mock_values/restful/margin/getMarginAvailableInventory.ts b/tests/mock_values/restful/margin/getMarginAvailableInventory.ts new file mode 100644 index 0000000..d2dcfd3 --- /dev/null +++ b/tests/mock_values/restful/margin/getMarginAvailableInventory.ts @@ -0,0 +1,11 @@ +import { RestMarginTypes } from '../../../../src/index'; + +export const mockResponse: RestMarginTypes.getMarginAvailableInventoryResponse = { + 'assets': { + 'MATIC': '100000000', + 'STPT': '100000000', + 'TVK': '100000000', + 'SHIB': '97409653' + }, + 'updateTime': 1699272487 +}; \ No newline at end of file diff --git a/tests/mock_values/restful/margin/getRepayRecord.ts b/tests/mock_values/restful/margin/getRepayRecord.ts deleted file mode 100644 index 8606c97..0000000 --- a/tests/mock_values/restful/margin/getRepayRecord.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { MarginStatus, RestMarginTypes } from '../../../../src/index'; - -export const mockResponse: RestMarginTypes.getRepayRecordResponse = { - 'rows': [{ - 'isolatedSymbol': 'BNBUSDT', - 'amount': '14.00000000', - 'asset': 'BNB', - 'interest': '0.01866667', - 'principal': '13.98133333', - 'status': MarginStatus.CONFIRMED, - 'timestamp': 1563438204000, - 'txId': 2970933056 - }], - 'total': 1 -}; diff --git a/tests/mock_values/restful/margin/isolatedMarginAccountTransfer.ts b/tests/mock_values/restful/margin/isolatedMarginAccountTransfer.ts deleted file mode 100644 index dd1933f..0000000 --- a/tests/mock_values/restful/margin/isolatedMarginAccountTransfer.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { RestMarginTypes } from '../../../../src/index'; - -export const mockResponse: RestMarginTypes.isolatedMarginAccountTransferResponse = { - 'tranId': 100000001 -}; diff --git a/tests/mock_values/restful/margin/marginAccountBorrow.ts b/tests/mock_values/restful/margin/marginAccountBorrowRepay.ts similarity index 74% rename from tests/mock_values/restful/margin/marginAccountBorrow.ts rename to tests/mock_values/restful/margin/marginAccountBorrowRepay.ts index a03c10d..576a86c 100644 --- a/tests/mock_values/restful/margin/marginAccountBorrow.ts +++ b/tests/mock_values/restful/margin/marginAccountBorrowRepay.ts @@ -1,5 +1,5 @@ import { RestMarginTypes } from '../../../../src/index'; -export const mockResponse: RestMarginTypes.marginAccountBorrowResponse = { - 'tranId': 345196462 -}; +export const mockResponse: RestMarginTypes.marginAccountBorrowRepayResponse = { + 'tranId': 100000001 +}; \ No newline at end of file diff --git a/tests/mock_values/restful/margin/marginAccountRepay.ts b/tests/mock_values/restful/margin/marginAccountRepay.ts deleted file mode 100644 index b922cf5..0000000 --- a/tests/mock_values/restful/margin/marginAccountRepay.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { RestMarginTypes } from '../../../../src/index'; - -export const mockResponse: RestMarginTypes.marginAccountRepayResponse = { - 'tranId': 345196462 -}; diff --git a/tests/mock_values/restful/margin/marginDustlog.ts b/tests/mock_values/restful/margin/marginDustlog.ts deleted file mode 100644 index f9df24d..0000000 --- a/tests/mock_values/restful/margin/marginDustlog.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { RestMarginTypes } from '../../../../src/index'; - -export const mockResponse: RestMarginTypes.marginDustlogResponse = { - 'total': 8, - 'userAssetDribblets': [{ - 'operateTime': 1615985535000, - 'totalTransferedAmount': '0.00132256', - 'totalServiceChargeAmount': '0.00002699', - 'transId': 45178372831, - 'userAssetDribbletDetails': [{ - 'transId': 4359321, - 'serviceChargeAmount': '0.000009', - 'amount': '0.0009', - 'operateTime': 1615985535000, - 'transferedAmount': '0.000441', - 'fromAsset': 'USDT' - }] - }] -}; diff --git a/tests/mock_values/restful/margin/marginManualLiquidation.ts b/tests/mock_values/restful/margin/marginManualLiquidation.ts new file mode 100644 index 0000000..3e725fe --- /dev/null +++ b/tests/mock_values/restful/margin/marginManualLiquidation.ts @@ -0,0 +1,11 @@ +import { RestMarginTypes } from '../../../../src/index'; + +export const mockResponse: RestMarginTypes.marginManualLiquidationResponse[] = [ + { + 'asset': 'ETH', + 'interest': '0.00083334', + 'principal': '0.001', + 'liabilityAsset': 'USDT', + 'liabilityQty': 0.3552 + } +]; \ No newline at end of file diff --git a/tests/mock_values/restful/market/currentAveragePrice.ts b/tests/mock_values/restful/market/currentAveragePrice.ts index 6c899f0..e5a4abc 100644 --- a/tests/mock_values/restful/market/currentAveragePrice.ts +++ b/tests/mock_values/restful/market/currentAveragePrice.ts @@ -2,5 +2,6 @@ import { RestMarketTypes } from '../../../../src/index'; export const mockResponse: RestMarketTypes.currentAveragePriceResponse = { 'mins': 5, - 'price': '9.35751834' + 'price': '9.35751834', + 'closeTime': 1694061154503 }; diff --git a/tests/mock_values/restful/market/tradingDayTicker.ts b/tests/mock_values/restful/market/tradingDayTicker.ts new file mode 100644 index 0000000..396cf6d --- /dev/null +++ b/tests/mock_values/restful/market/tradingDayTicker.ts @@ -0,0 +1,19 @@ +import { RestMarketTypes } from '../../../../src/index'; + +export const mockResponse: RestMarketTypes.tradingDayTickerResponse = { + 'symbol': 'BTCUSDT', + 'priceChange': '-83.13000000', + 'priceChangePercent': '-0.317', + 'weightedAvgPrice': '26234.58803036', + 'openPrice': '26304.80000000', + 'highPrice': '26397.46000000', + 'lowPrice': '26088.34000000', + 'lastPrice': '26221.67000000', + 'volume': '18495.35066000', + 'quoteVolume': '485217905.04210480', + 'openTime': 1695686400000, + 'closeTime': 1695772799999, + 'firstId': 3220151555, + 'lastId': 3220849281, + 'count': 697727 +}; \ No newline at end of file diff --git a/tests/mock_values/restful/trade/cancelAllOpenOrdersOnASymbol.ts b/tests/mock_values/restful/trade/cancelAllOpenOrdersOnASymbol.ts index e07ff1d..d84f1de 100644 --- a/tests/mock_values/restful/trade/cancelAllOpenOrdersOnASymbol.ts +++ b/tests/mock_values/restful/trade/cancelAllOpenOrdersOnASymbol.ts @@ -7,6 +7,7 @@ export const mockResponse: RestTradeTypes.cancelAllOpenOrdersOnASymbolResponse[] 'orderId': 28, 'orderListId': -1, 'clientOrderId': '6gCrw2kRUAF9CvJDGP16IP', + 'transactTime': 1684804350068, 'price': '1.00000000', 'origQty': '10.00000000', 'executedQty': '10.00000000', diff --git a/tests/mock_values/restful/trade/cancelAnExistingOrderAndSendANewOrder.ts b/tests/mock_values/restful/trade/cancelAnExistingOrderAndSendANewOrder.ts index 786c478..e226c9b 100644 --- a/tests/mock_values/restful/trade/cancelAnExistingOrderAndSendANewOrder.ts +++ b/tests/mock_values/restful/trade/cancelAnExistingOrderAndSendANewOrder.ts @@ -18,6 +18,7 @@ export const mockResponse: RestTradeTypes.cancelAnExistingOrderAndSendANewOrderR 'orderId': 9, 'orderListId': -1, 'clientOrderId': 'osxN3JXAtJvKvCqGeMWMVR', + 'transactTime': 1684804350068, 'price': '0.01000000', 'origQty': '0.000100', 'executedQty': '0.00000000', diff --git a/tests/mock_values/restful/trade/cancelOco.ts b/tests/mock_values/restful/trade/cancelOco.ts index 351b516..43b6eba 100644 --- a/tests/mock_values/restful/trade/cancelOco.ts +++ b/tests/mock_values/restful/trade/cancelOco.ts @@ -19,6 +19,7 @@ export const mockResponse: RestTradeTypes.cancelOcoResponse = { 'orderId': 0, 'orderListId': 0, 'clientOrderId': '', + 'transactTime': 0, 'price': '', 'origQty': '', 'executedQty': '', diff --git a/tests/mock_values/restful/trade/cancelOrder.ts b/tests/mock_values/restful/trade/cancelOrder.ts index f9ed32b..6633ca5 100644 --- a/tests/mock_values/restful/trade/cancelOrder.ts +++ b/tests/mock_values/restful/trade/cancelOrder.ts @@ -6,6 +6,7 @@ export const mockResponse: RestTradeTypes.cancelOrderResponse = { 'orderId': 28, 'orderListId': -1, 'clientOrderId': '6gCrw2kRUAF9CvJDGP16IP', + 'transactTime': 1684804350068, 'price': '1.00000000', 'origQty': '10.00000000', 'executedQty': '10.00000000', diff --git a/tests/mock_values/restful/trade/getAllocations.ts b/tests/mock_values/restful/trade/getAllocations.ts new file mode 100644 index 0000000..4393076 --- /dev/null +++ b/tests/mock_values/restful/trade/getAllocations.ts @@ -0,0 +1,22 @@ +import { RestTradeTypes } from '../../../../src/index'; + + +export const mockResponse: RestTradeTypes.getAllocationsResponse[] = [ + { + 'symbol': 'BTCUSDT', + 'allocationId': 0, + 'allocationType': 'SOR', + 'orderId': 1, + 'orderListId': -1, + 'price': '1.00000000', + 'qty': '5.00000000', + 'quoteQty': '5.00000000', + 'commission': '0.00000000', + 'commissionAsset': 'BTC', + 'time': 1687506878118, + 'isBuyer': true, + 'isMaker': false, + 'isAllocator': false + } +]; + \ No newline at end of file diff --git a/tests/mock_values/restful/trade/getCommissionRates.ts b/tests/mock_values/restful/trade/getCommissionRates.ts new file mode 100644 index 0000000..cd84181 --- /dev/null +++ b/tests/mock_values/restful/trade/getCommissionRates.ts @@ -0,0 +1,23 @@ +import { RestTradeTypes } from '../../../../src/index'; + +export const mockResponse: RestTradeTypes.getCommissionRatesResponse = { + 'symbol': 'BTCUSDT', + 'standardCommission': { //Standard commission rates on trades from the order. + 'maker': '0.00000010', + 'taker': '0.00000020', + 'buyer': '0.00000030', + 'seller': '0.00000040' + }, + 'taxCommission': { //Tax commission rates for trades from the order. + 'maker': '0.00000112', + 'taker': '0.00000114', + 'buyer': '0.00000118', + 'seller': '0.00000116' + }, + 'discount': { //Discount commission when paying in BNB + 'enabledForAccount': true, + 'enabledForSymbol': true, + 'discountAsset': 'BNB', + 'discount': '0.25000000' //Standard commission is reduced by this rate when paying commission in BNB. + } +}; \ No newline at end of file diff --git a/tests/mock_values/restful/trade/getPreventedMatches.ts b/tests/mock_values/restful/trade/getPreventedMatches.ts new file mode 100644 index 0000000..24e6442 --- /dev/null +++ b/tests/mock_values/restful/trade/getPreventedMatches.ts @@ -0,0 +1,16 @@ +import { RestTradeTypes, SelfTradePreventionMode } from '../../../../src/index'; + + +export const mockResponse: RestTradeTypes.getPreventedMatchesResponse[] = [ + { + 'symbol': 'BTCUSDT', + 'preventedMatchId': 1, + 'takerOrderId': 5, + 'makerOrderId': 3, + 'tradeGroupId': 1, + 'selfTradePreventionMode': SelfTradePreventionMode.EXPIRE_MAKER, + 'price': '1.100000', + 'makerPreventedQuantity': '1.300000', + 'transactTime': 1669101687094 + } +]; \ No newline at end of file diff --git a/tests/mock_values/restful/trade/newOrderSOR.ts b/tests/mock_values/restful/trade/newOrderSOR.ts new file mode 100644 index 0000000..c59cbf2 --- /dev/null +++ b/tests/mock_values/restful/trade/newOrderSOR.ts @@ -0,0 +1,30 @@ +import { OrderStatus, OrderType, RestTradeTypes, SelfTradePreventionMode, Side, TimeInForce, WorkingFloor } from '../../../../src/index'; + +export const mockResponse: RestTradeTypes.newOrderSORResponse = { + 'symbol': 'BTCUSDT', + 'orderId': 2, + 'orderListId': -1, + 'clientOrderId': 'sBI1KM6nNtOfj5tccZSKly', + 'transactTime': 1689149087774, + 'price': '31000.00000000', + 'origQty': '0.50000000', + 'executedQty': '0.50000000', + 'cummulativeQuoteQty': '14000.00000000', + 'status': OrderStatus.FILLED, + 'timeInForce': TimeInForce.GTC, + 'type': OrderType.LIMIT, + 'side': Side.BUY, + 'workingTime': 1689149087774, + 'fills': [ + { + 'price': '28000.00000000', + 'qty': '0.50000000', + 'commission': '0.00000000', + 'commissionAsset': 'BTC', + 'tradeId': -1 + } + ], + 'workingFloor': WorkingFloor.SOR, + 'selfTradePreventionMode': SelfTradePreventionMode.NONE, + 'usedSor': true +}; \ No newline at end of file diff --git a/tests/mock_values/restful/trade/testNewOrderSOR.ts b/tests/mock_values/restful/trade/testNewOrderSOR.ts new file mode 100644 index 0000000..3858378 --- /dev/null +++ b/tests/mock_values/restful/trade/testNewOrderSOR.ts @@ -0,0 +1 @@ +export const mockResponse: Record = {}; \ No newline at end of file diff --git a/tests/mock_values/websocket/market/avgPrice.ts b/tests/mock_values/websocket/market/avgPrice.ts index a5f3bfe..eeac22c 100644 --- a/tests/mock_values/websocket/market/avgPrice.ts +++ b/tests/mock_values/websocket/market/avgPrice.ts @@ -2,5 +2,6 @@ import { RestMarketTypes } from '../../../../src/index'; export const mockAvgPrice: RestMarketTypes.currentAveragePriceResponse = { 'mins': 5, - 'price': '0.01378135' + 'price': '0.01378135', + 'closeTime': 1694061154503 }; \ No newline at end of file diff --git a/tests/restful/margin/crossMarginAccountTransfer.test.ts b/tests/restful/margin/crossMarginAccountTransfer.test.ts deleted file mode 100644 index 95eefd9..0000000 --- a/tests/restful/margin/crossMarginAccountTransfer.test.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { expect } from '@jest/globals'; -import { Spot } from '../../../src/index'; -import { mockResponse } from '../../mock_values/restful/margin/crossMarginAccountTransfer'; - -jest.mock('../../../src/index'); - -const apiKey = process.env.BINANCE_API_KEY || ''; -const apiSecret = process.env.BINANCE_API_SECRET || ''; -const baseURL = process.env.BINANCE_BASE_URL || ''; - -describe('Cross Margin Account Transfer', () => { - const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Cross Margin Account Transfer', async () => { - const spy = jest.spyOn(client, 'crossMarginAccountTransfer').mockReturnValue(Promise.resolve(mockResponse)); - const res = await client.crossMarginAccountTransfer('BTC', 1.01, 1); - expect(res).toBeDefined(); - expect(res).toBe(mockResponse); - spy.mockRestore(); - }); -}); diff --git a/tests/restful/margin/getAllCrossMarginPairs.test.ts b/tests/restful/margin/getAllCrossMarginPairs.test.ts index a73800d..0b7d13d 100644 --- a/tests/restful/margin/getAllCrossMarginPairs.test.ts +++ b/tests/restful/margin/getAllCrossMarginPairs.test.ts @@ -9,7 +9,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Get All Cross Margin Pairs', () => { const client = new Spot(apiKey, '', { baseURL: baseURL }); - it('should return Get All Cross Margin Pairs', async () => { + it('should return all Cross Margin Pairs', async () => { const spy = jest.spyOn(client, 'getAllCrossMarginPairs').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getAllCrossMarginPairs(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getAllIsolatedMarginSymbol.test.ts b/tests/restful/margin/getAllIsolatedMarginSymbol.test.ts index 7854cb2..7542293 100644 --- a/tests/restful/margin/getAllIsolatedMarginSymbol.test.ts +++ b/tests/restful/margin/getAllIsolatedMarginSymbol.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Get All Isolated Margin Symbol', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Get All Isolated Margin Symbol', async () => { + it('should return All Isolated Margin Symbol', async () => { const spy = jest.spyOn(client, 'getAllIsolatedMarginSymbol').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getAllIsolatedMarginSymbol(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getAllMarginAssets.test.ts b/tests/restful/margin/getAllMarginAssets.test.ts index 450f210..d4b3129 100644 --- a/tests/restful/margin/getAllMarginAssets.test.ts +++ b/tests/restful/margin/getAllMarginAssets.test.ts @@ -9,7 +9,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Get All Margin Assets', () => { const client = new Spot(apiKey, '', { baseURL: baseURL }); - it('should return Get All Margin Assets', async () => { + it('should return All Margin Assets', async () => { const spy = jest.spyOn(client, 'getAllMarginAssets').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getAllMarginAssets(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getLoanRecord.test.ts b/tests/restful/margin/getBorrowRepayRecords.test.ts similarity index 54% rename from tests/restful/margin/getLoanRecord.test.ts rename to tests/restful/margin/getBorrowRepayRecords.test.ts index 7fbc0ec..489ddc8 100644 --- a/tests/restful/margin/getLoanRecord.test.ts +++ b/tests/restful/margin/getBorrowRepayRecords.test.ts @@ -1,6 +1,6 @@ import { expect } from '@jest/globals'; -import { Spot } from '../../../src/index'; -import { mockResponse } from '../../mock_values/restful/margin/getLoanRecord'; +import { MarginBorrowRepayType, Spot } from '../../../src/index'; +import { mockResponse } from '../../mock_values/restful/margin/getBorrowRepayRecords'; jest.mock('../../../src/index'); @@ -8,11 +8,11 @@ const apiKey = process.env.BINANCE_API_KEY || ''; const apiSecret = process.env.BINANCE_API_SECRET || ''; const baseURL = process.env.BINANCE_BASE_URL || ''; -describe('Query Loan Record', () => { +describe('Get Margin Borrow Repay Records', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Loan Record', async () => { - const spy = jest.spyOn(client, 'getLoanRecord').mockReturnValue(Promise.resolve(mockResponse)); - const res = await client.getLoanRecord('BTC'); + it('should return Margin Borrow Repay Records', async () => { + const spy = jest.spyOn(client, 'getBorrowRepayRecords').mockReturnValue(Promise.resolve(mockResponse)); + const res = await client.getBorrowRepayRecords(MarginBorrowRepayType.BORROW); expect(res).toBeDefined(); expect(res).toBe(mockResponse); spy.mockRestore(); diff --git a/tests/restful/margin/getCrossMarginAccountDetails.test.ts b/tests/restful/margin/getCrossMarginAccountDetails.test.ts index b066c2d..f87fed4 100644 --- a/tests/restful/margin/getCrossMarginAccountDetails.test.ts +++ b/tests/restful/margin/getCrossMarginAccountDetails.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Cross Margin Account Details', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Cross Margin Account Details', async () => { + it('should return Cross Margin Account Details', async () => { const spy = jest.spyOn(client, 'getCrossMarginAccountDetails').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getCrossMarginAccountDetails(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getCrossMarginFeeData.test.ts b/tests/restful/margin/getCrossMarginFeeData.test.ts index f18cd41..2485e15 100644 --- a/tests/restful/margin/getCrossMarginFeeData.test.ts +++ b/tests/restful/margin/getCrossMarginFeeData.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Cross Margin Fee Data', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Cross Margin Fee Data', async () => { + it('should return Cross Margin Fee Data', async () => { const spy = jest.spyOn(client, 'getCrossMarginFeeData').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getCrossMarginFeeData(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getCrossMarginTransferHistory.test.ts b/tests/restful/margin/getCrossMarginTransferHistory.test.ts index 622ea7d..fc38966 100644 --- a/tests/restful/margin/getCrossMarginTransferHistory.test.ts +++ b/tests/restful/margin/getCrossMarginTransferHistory.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Get Cross Margin Transfer History', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Get Cross Margin Transfer History', async () => { + it('should return Cross Margin Transfer History', async () => { const spy = jest.spyOn(client, 'getCrossMarginTransferHistory').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getCrossMarginTransferHistory(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getCurrentMarginOrderCountUsage.test.ts b/tests/restful/margin/getCurrentMarginOrderCountUsage.test.ts index 15c0a3a..c4501c6 100644 --- a/tests/restful/margin/getCurrentMarginOrderCountUsage.test.ts +++ b/tests/restful/margin/getCurrentMarginOrderCountUsage.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Current Margin Order Count Usage', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Current Margin Order Count Usage', async () => { + it('should return Current Margin Order Count Usage', async () => { const spy = jest.spyOn(client, 'getCurrentMarginOrderCountUsage').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getCurrentMarginOrderCountUsage(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getEnabledIsolatedMarginAccountLimit.test.ts b/tests/restful/margin/getEnabledIsolatedMarginAccountLimit.test.ts index 7828f2c..ca03557 100644 --- a/tests/restful/margin/getEnabledIsolatedMarginAccountLimit.test.ts +++ b/tests/restful/margin/getEnabledIsolatedMarginAccountLimit.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Enabled Isolated Margin Account Limit', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Enabled Isolated Margin Account Limit', async () => { + it('should return Enabled Isolated Margin Account Limit', async () => { const spy = jest.spyOn(client, 'getEnabledIsolatedMarginAccountLimit').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getEnabledIsolatedMarginAccountLimit(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getForceLiquidationRecord.test.ts b/tests/restful/margin/getForceLiquidationRecord.test.ts index a15ecb2..673c530 100644 --- a/tests/restful/margin/getForceLiquidationRecord.test.ts +++ b/tests/restful/margin/getForceLiquidationRecord.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Get Force Liquidation Record', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Get Force Liquidation Record', async () => { + it('should return Force Liquidation Record', async () => { const spy = jest.spyOn(client, 'getForceLiquidationRecord').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getForceLiquidationRecord(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getInterestHistory.test.ts b/tests/restful/margin/getInterestHistory.test.ts index d43e7f2..d123df9 100644 --- a/tests/restful/margin/getInterestHistory.test.ts +++ b/tests/restful/margin/getInterestHistory.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Get Interest History', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Get Interest History', async () => { + it('should return Interest History', async () => { const spy = jest.spyOn(client, 'getInterestHistory').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getInterestHistory(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getIsolatedMarginAccountInfo.test.ts b/tests/restful/margin/getIsolatedMarginAccountInfo.test.ts index c143931..1b4b70b 100644 --- a/tests/restful/margin/getIsolatedMarginAccountInfo.test.ts +++ b/tests/restful/margin/getIsolatedMarginAccountInfo.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Isolated Margin Account Info', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Isolated Margin Account Info', async () => { + it('should return Isolated Margin Account Info', async () => { const spy = jest.spyOn(client, 'getIsolatedMarginAccountInfo').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getIsolatedMarginAccountInfo(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getIsolatedMarginFeeData.test.ts b/tests/restful/margin/getIsolatedMarginFeeData.test.ts index da3402d..bd7ceb0 100644 --- a/tests/restful/margin/getIsolatedMarginFeeData.test.ts +++ b/tests/restful/margin/getIsolatedMarginFeeData.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Isolated Margin Fee Data', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Isolated Margin Fee Data', async () => { + it('should return Isolated Margin Fee Data', async () => { const spy = jest.spyOn(client, 'getIsolatedMarginFeeData').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getIsolatedMarginFeeData(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getIsolatedMarginSymbol.test.ts b/tests/restful/margin/getIsolatedMarginSymbol.test.ts deleted file mode 100644 index e73f632..0000000 --- a/tests/restful/margin/getIsolatedMarginSymbol.test.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { expect } from '@jest/globals'; -import { Spot } from '../../../src/index'; -import { mockResponse } from '../../mock_values/restful/margin/getIsolatedMarginSymbol'; - -jest.mock('../../../src/index'); - -const apiKey = process.env.BINANCE_API_KEY || ''; -const apiSecret = process.env.BINANCE_API_SECRET || ''; -const baseURL = process.env.BINANCE_BASE_URL || ''; - -describe('Query Isolated Margin Symbol', () => { - const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Isolated Margin Symbol', async () => { - const spy = jest.spyOn(client, 'getIsolatedMarginSymbol').mockReturnValue(Promise.resolve(mockResponse)); - const res = await client.getIsolatedMarginSymbol('BNBUSDT'); - expect(res).toBeDefined(); - expect(res).toBe(mockResponse); - spy.mockRestore(); - }); -}); diff --git a/tests/restful/margin/getIsolatedMarginTierData.test.ts b/tests/restful/margin/getIsolatedMarginTierData.test.ts index dc5a6f1..e5aeff3 100644 --- a/tests/restful/margin/getIsolatedMarginTierData.test.ts +++ b/tests/restful/margin/getIsolatedMarginTierData.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Isolated Margin Tier Data', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Isolated Margin Tier Data', async () => { + it('should return Isolated Margin Tier Data', async () => { const spy = jest.spyOn(client, 'getIsolatedMarginTierData').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getIsolatedMarginTierData('BNBUSDT'); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getIsolatedMarginTransferHistory.test.ts b/tests/restful/margin/getIsolatedMarginTransferHistory.test.ts deleted file mode 100644 index b0618cb..0000000 --- a/tests/restful/margin/getIsolatedMarginTransferHistory.test.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { expect } from '@jest/globals'; -import { Spot } from '../../../src/index'; -import { mockResponse } from '../../mock_values/restful/margin/getIsolatedMarginTransferHistory'; - -jest.mock('../../../src/index'); - -const apiKey = process.env.BINANCE_API_KEY || ''; -const apiSecret = process.env.BINANCE_API_SECRET || ''; -const baseURL = process.env.BINANCE_BASE_URL || ''; - -describe('Get Isolated Margin Transfer History', () => { - const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Get Isolated Margin Transfer History', async () => { - const spy = jest.spyOn(client, 'getIsolatedMarginTransferHistory').mockReturnValue(Promise.resolve(mockResponse)); - const res = await client.getIsolatedMarginTransferHistory('BNBUSDT'); - expect(res).toBeDefined(); - expect(res).toBe(mockResponse); - spy.mockRestore(); - }); -}); diff --git a/tests/restful/margin/getCrossMarginPair.test.ts b/tests/restful/margin/getLeverageBracket.test.ts similarity index 66% rename from tests/restful/margin/getCrossMarginPair.test.ts rename to tests/restful/margin/getLeverageBracket.test.ts index 0cc0cc1..d32d86d 100644 --- a/tests/restful/margin/getCrossMarginPair.test.ts +++ b/tests/restful/margin/getLeverageBracket.test.ts @@ -1,19 +1,19 @@ import { expect } from '@jest/globals'; import { Spot } from '../../../src/index'; -import { mockResponse } from '../../mock_values/restful/margin/getCrossMarginPair'; +import { mockResponse } from '../../mock_values/restful/margin/getLeverageBracket'; jest.mock('../../../src/index'); const apiKey = process.env.BINANCE_API_KEY || ''; const baseURL = process.env.BINANCE_BASE_URL || ''; -describe('Query Cross Margin Pair', () => { +describe('Get Leverage Bracket', () => { const client = new Spot(apiKey, '', { baseURL: baseURL }); - it('should return Query Cross Margin Pair', async () => { - const spy = jest.spyOn(client, 'getCrossMarginPair').mockReturnValue(Promise.resolve(mockResponse)); - const res = await client.getCrossMarginPair('BNBUSDT'); + it('should return Leverage Bracket', async () => { + const spy = jest.spyOn(client, 'getLeverageBracket').mockReturnValue(Promise.resolve(mockResponse)); + const res = await client.getLeverageBracket(); expect(res).toBeDefined(); expect(res).toBe(mockResponse); spy.mockRestore(); }); -}); +}); \ No newline at end of file diff --git a/tests/restful/margin/getMarginAccountAllOco.test.ts b/tests/restful/margin/getMarginAccountAllOco.test.ts index 43325ad..0081513 100644 --- a/tests/restful/margin/getMarginAccountAllOco.test.ts +++ b/tests/restful/margin/getMarginAccountAllOco.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Margin Account all OCO', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Margin Account all OCO', async () => { + it('should return Margin Account all OCO', async () => { const spy = jest.spyOn(client, 'getMarginAccountAllOco').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getMarginAccountAllOco(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getMarginAccountAllOrders.test.ts b/tests/restful/margin/getMarginAccountAllOrders.test.ts index e936624..750a825 100644 --- a/tests/restful/margin/getMarginAccountAllOrders.test.ts +++ b/tests/restful/margin/getMarginAccountAllOrders.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Margin Account All Orders', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Margin Account All Orders', async () => { + it('should return Margin Account All Orders', async () => { const spy = jest.spyOn(client, 'getMarginAccountAllOrders').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getMarginAccountAllOrders('BNBUSDT'); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getMarginAccountOco.test.ts b/tests/restful/margin/getMarginAccountOco.test.ts index 6df630f..1a33283 100644 --- a/tests/restful/margin/getMarginAccountOco.test.ts +++ b/tests/restful/margin/getMarginAccountOco.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Margin Account OCO', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Margin Account OCO', async () => { + it('should return Margin Account OCO', async () => { const spy = jest.spyOn(client, 'getMarginAccountOco').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getMarginAccountOco(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getMarginAccountOpenOco.test.ts b/tests/restful/margin/getMarginAccountOpenOco.test.ts index acdbe91..3b8fe26 100644 --- a/tests/restful/margin/getMarginAccountOpenOco.test.ts +++ b/tests/restful/margin/getMarginAccountOpenOco.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Margin Account Open OCO', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Margin Account Open OCO', async () => { + it('should return Margin Account Open OCO', async () => { const spy = jest.spyOn(client, 'getMarginAccountOpenOco').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getMarginAccountOpenOco(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getMarginAccountOpenOrders.test.ts b/tests/restful/margin/getMarginAccountOpenOrders.test.ts index 87d40d4..dcf5f31 100644 --- a/tests/restful/margin/getMarginAccountOpenOrders.test.ts +++ b/tests/restful/margin/getMarginAccountOpenOrders.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Margin Account Open Orders', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Margin Account Open Orders', async () => { + it('should return Margin Account Open Orders', async () => { const spy = jest.spyOn(client, 'getMarginAccountOpenOrders').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getMarginAccountOpenOrders(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getMarginAccountOrder.test.ts b/tests/restful/margin/getMarginAccountOrder.test.ts index 15a811a..43dc60e 100644 --- a/tests/restful/margin/getMarginAccountOrder.test.ts +++ b/tests/restful/margin/getMarginAccountOrder.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Margin Account Order', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Margin Account Order', async () => { + it('should return Margin Account Order', async () => { const spy = jest.spyOn(client, 'getMarginAccountOrder').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getMarginAccountOrder('BNBUSDT'); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getMarginAccountTradeList.test.ts b/tests/restful/margin/getMarginAccountTradeList.test.ts index 62fdadf..cee58ae 100644 --- a/tests/restful/margin/getMarginAccountTradeList.test.ts +++ b/tests/restful/margin/getMarginAccountTradeList.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Margin Account Trade List', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Margin Account Trade List', async () => { + it('should return Margin Account Trade List', async () => { const spy = jest.spyOn(client, 'getMarginAccountTradeList').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getMarginAccountTradeList('BNBUSDT'); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getMarginAsset.test.ts b/tests/restful/margin/getMarginAvailableInventory.test.ts similarity index 57% rename from tests/restful/margin/getMarginAsset.test.ts rename to tests/restful/margin/getMarginAvailableInventory.test.ts index cd589d3..f74359c 100644 --- a/tests/restful/margin/getMarginAsset.test.ts +++ b/tests/restful/margin/getMarginAvailableInventory.test.ts @@ -1,19 +1,19 @@ import { expect } from '@jest/globals'; import { Spot } from '../../../src/index'; -import { mockResponse } from '../../mock_values/restful/margin/getMarginAsset'; +import { mockResponse } from '../../mock_values/restful/margin/getMarginAvailableInventory'; jest.mock('../../../src/index'); const apiKey = process.env.BINANCE_API_KEY || ''; const baseURL = process.env.BINANCE_BASE_URL || ''; -describe('Query Margin Asset', () => { +describe('Get Margin Available Inventory', () => { const client = new Spot(apiKey, '', { baseURL: baseURL }); - it('should return Query Margin Asset', async () => { - const spy = jest.spyOn(client, 'getMarginAsset').mockReturnValue(Promise.resolve(mockResponse)); - const res = await client.getMarginAsset('BTC'); + it('should return Margin Available Inventory', async () => { + const spy = jest.spyOn(client, 'getMarginAvailableInventory').mockReturnValue(Promise.resolve(mockResponse)); + const res = await client.getMarginAvailableInventory('MARGIN'); expect(res).toBeDefined(); expect(res).toBe(mockResponse); spy.mockRestore(); }); -}); +}); \ No newline at end of file diff --git a/tests/restful/margin/getMarginPriceindex.test.ts b/tests/restful/margin/getMarginPriceindex.test.ts index 5664667..781bc88 100644 --- a/tests/restful/margin/getMarginPriceindex.test.ts +++ b/tests/restful/margin/getMarginPriceindex.test.ts @@ -9,7 +9,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Margin PriceIndex', () => { const client = new Spot(apiKey, '', { baseURL: baseURL }); - it('should return Query Margin PriceIndex', async () => { + it('should return Margin PriceIndex', async () => { const spy = jest.spyOn(client, 'getMarginPriceIndex').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getMarginPriceIndex('BNBUSDT'); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getMaxBorrow.test.ts b/tests/restful/margin/getMaxBorrow.test.ts index a96ce8d..8649254 100644 --- a/tests/restful/margin/getMaxBorrow.test.ts +++ b/tests/restful/margin/getMaxBorrow.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Max Borrow', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Max Borrow', async () => { + it('should return Max Borrow', async () => { const spy = jest.spyOn(client, 'getMaxBorrow').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getMaxBorrow('BTC'); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getMaxTransferoutAmount.test.ts b/tests/restful/margin/getMaxTransferoutAmount.test.ts index 4276bc5..1d7394e 100644 --- a/tests/restful/margin/getMaxTransferoutAmount.test.ts +++ b/tests/restful/margin/getMaxTransferoutAmount.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Max Transfer-Out Amount', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Max Transfer-Out Amount', async () => { + it('should return Max Transfer-Out Amount', async () => { const spy = jest.spyOn(client, 'getMaxTransferoutAmount').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getMaxTransferoutAmount('BTC'); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getSummaryOfMarginAccount.test.ts b/tests/restful/margin/getSummaryOfMarginAccount.test.ts index d2a4c66..3e09ddb 100644 --- a/tests/restful/margin/getSummaryOfMarginAccount.test.ts +++ b/tests/restful/margin/getSummaryOfMarginAccount.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Get Summary of Margin account', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Get Summary of Margin account', async () => { + it('should return Summary of Margin account', async () => { const spy = jest.spyOn(client, 'getSummaryOfMarginAccount').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getSummaryOfMarginAccount(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/isolatedMarginAccountTransfer.test.ts b/tests/restful/margin/isolatedMarginAccountTransfer.test.ts deleted file mode 100644 index 50c7ce2..0000000 --- a/tests/restful/margin/isolatedMarginAccountTransfer.test.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { expect } from '@jest/globals'; -import { Spot, TransFrom, TransTo } from '../../../src/index'; -import { mockResponse } from '../../mock_values/restful/margin/isolatedMarginAccountTransfer'; - -jest.mock('../../../src/index'); - -const apiKey = process.env.BINANCE_API_KEY || ''; -const apiSecret = process.env.BINANCE_API_SECRET || ''; -const baseURL = process.env.BINANCE_BASE_URL || ''; - -describe('Isolated Margin Account Transfer', () => { - const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Isolated Margin Account Transfer', async () => { - const spy = jest.spyOn(client, 'isolatedMarginAccountTransfer').mockReturnValue(Promise.resolve(mockResponse)); - const res = await client.isolatedMarginAccountTransfer('BTC', 'BNBUSDT', TransFrom.SPOT, TransTo.ISOLATED_MARGIN, 1.01); - expect(res).toBeDefined(); - expect(res).toBe(mockResponse); - spy.mockRestore(); - }); -}); diff --git a/tests/restful/margin/marginDustlog.test.ts b/tests/restful/margin/marginAccountBorrowRepay.test.ts similarity index 51% rename from tests/restful/margin/marginDustlog.test.ts rename to tests/restful/margin/marginAccountBorrowRepay.test.ts index 879ba26..eb14c51 100644 --- a/tests/restful/margin/marginDustlog.test.ts +++ b/tests/restful/margin/marginAccountBorrowRepay.test.ts @@ -1,6 +1,6 @@ import { expect } from '@jest/globals'; -import { Spot } from '../../../src/index'; -import { mockResponse } from '../../mock_values/restful/margin/marginDustlog'; +import { MarginBorrowRepayType, Spot } from '../../../src/index'; +import { mockResponse } from '../../mock_values/restful/margin/marginAccountBorrowRepay'; jest.mock('../../../src/index'); @@ -8,11 +8,11 @@ const apiKey = process.env.BINANCE_API_KEY || ''; const apiSecret = process.env.BINANCE_API_SECRET || ''; const baseURL = process.env.BINANCE_BASE_URL || ''; -describe('Margin Dustlog', () => { +describe('Margin Account Borrow Repay', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Margin Dustlog', async () => { - const spy = jest.spyOn(client, 'marginDustlog').mockReturnValue(Promise.resolve(mockResponse)); - const res = await client.marginDustlog(); + it('should return Margin Account Borrow Repay result', async () => { + const spy = jest.spyOn(client, 'marginAccountBorrowRepay').mockReturnValue(Promise.resolve(mockResponse)); + const res = await client.marginAccountBorrowRepay('BNB', 'FALSE', 'BNBUSDT', '1.0', MarginBorrowRepayType.BORROW); expect(res).toBeDefined(); expect(res).toBe(mockResponse); spy.mockRestore(); diff --git a/tests/restful/margin/marginManualLiquidation.test.ts b/tests/restful/margin/marginManualLiquidation.test.ts new file mode 100644 index 0000000..0985b87 --- /dev/null +++ b/tests/restful/margin/marginManualLiquidation.test.ts @@ -0,0 +1,19 @@ +import { expect } from '@jest/globals'; +import { Spot } from '../../../src/index'; +import { mockResponse } from '../../mock_values/restful/margin/marginManualLiquidation'; + +jest.mock('../../../src/index'); + +const apiKey = process.env.BINANCE_API_KEY || ''; +const baseURL = process.env.BINANCE_BASE_URL || ''; + +describe('Margin Manual Liquidation', () => { + const client = new Spot(apiKey, '', { baseURL: baseURL }); + it('should return Margin Manual Liquidation result', async () => { + const spy = jest.spyOn(client, 'marginManualLiquidation').mockReturnValue(Promise.resolve(mockResponse)); + const res = await client.marginManualLiquidation('MARGIN'); + expect(res).toBeDefined(); + expect(res).toBe(mockResponse); + spy.mockRestore(); + }); +}); \ No newline at end of file diff --git a/tests/restful/market/tradingDayTicker.test.ts b/tests/restful/market/tradingDayTicker.test.ts new file mode 100644 index 0000000..242effd --- /dev/null +++ b/tests/restful/market/tradingDayTicker.test.ts @@ -0,0 +1,18 @@ +import { expect } from '@jest/globals'; +import { Spot } from '../../../src/index'; +import { mockResponse } from '../../mock_values/restful/market/tradingDayTicker'; + +jest.mock('../../../src/index'); + +const baseURL = process.env.BINANCE_BASE_URL || ''; + +describe('Get Trading Day Ticker', () => { + const client = new Spot('', '', { baseURL: baseURL }); + it('should return Trading Day Ticker', async () => { + const spy = jest.spyOn(client, 'tradingDayTicker').mockReturnValue(Promise.resolve(mockResponse)); + const res = await client.tradingDayTicker('BNBUSDT'); + expect(res).toBeDefined(); + expect(res).toBe(mockResponse); + spy.mockRestore(); + }); +}); diff --git a/tests/restful/simpleEarn/getFlexiblePersonalLeftQuota.test.ts b/tests/restful/simpleEarn/getFlexiblePersonalLeftQuota.test.ts index a3b758e..c3dbaa6 100644 --- a/tests/restful/simpleEarn/getFlexiblePersonalLeftQuota.test.ts +++ b/tests/restful/simpleEarn/getFlexiblePersonalLeftQuota.test.ts @@ -13,7 +13,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Get Flexible Personal Left Quota', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return get flexible personal left quota', async () => { + it('should return flexible personal left quota', async () => { const spy = jest.spyOn(client, 'getFlexiblePersonalLeftQuota').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getFlexiblePersonalLeftQuota('1'); expect(res).toBeDefined(); diff --git a/tests/restful/simpleEarn/getFlexibleRedemptionRecord.test.ts b/tests/restful/simpleEarn/getFlexibleRedemptionRecord.test.ts index c7afd96..c38cd2e 100644 --- a/tests/restful/simpleEarn/getFlexibleRedemptionRecord.test.ts +++ b/tests/restful/simpleEarn/getFlexibleRedemptionRecord.test.ts @@ -13,7 +13,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Get Flexible Redemption Record', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return get flexible redemption record', async () => { + it('should return flexible redemption record', async () => { const spy = jest.spyOn(client, 'getFlexibleRedemptionRecord').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getFlexibleRedemptionRecord(); expect(res).toBeDefined(); diff --git a/tests/restful/subAccount/getIpRestrictionForASubAccountApiKey.test.ts b/tests/restful/subAccount/getIpRestrictionForASubAccountApiKey.test.ts index 232ff02..4f6f225 100644 --- a/tests/restful/subAccount/getIpRestrictionForASubAccountApiKey.test.ts +++ b/tests/restful/subAccount/getIpRestrictionForASubAccountApiKey.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Get IP Restriction for a Sub-account API Key', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Get IP Restriction for a Sub-account API Key', async () => { + it('should return IP Restriction for a Sub-account API Key', async () => { const spy = jest.spyOn(client, 'getIpRestrictionForASubAccountApiKey').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getIpRestrictionForASubAccountApiKey('alice@test.com', 'subAccountApiKey'); expect(res).toBeDefined(); diff --git a/tests/restful/subAccount/getManagedSubAccountDepositAddress.test.ts b/tests/restful/subAccount/getManagedSubAccountDepositAddress.test.ts index d1bd879..974853a 100644 --- a/tests/restful/subAccount/getManagedSubAccountDepositAddress.test.ts +++ b/tests/restful/subAccount/getManagedSubAccountDepositAddress.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Managed Sub-account Deposit Address', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Managed Sub-account Deposit Address', async () => { + it('should return Managed Sub-account Deposit Address', async () => { const spy = jest.spyOn(client, 'getManagedSubAccountDepositAddress').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getManagedSubAccountDepositAddress('alice@test.com', 'BTC'); expect(res).toBeDefined(); diff --git a/tests/restful/subAccount/getManagedSubAccountFuturesAssetDetails.test.ts b/tests/restful/subAccount/getManagedSubAccountFuturesAssetDetails.test.ts index de709de..3650275 100644 --- a/tests/restful/subAccount/getManagedSubAccountFuturesAssetDetails.test.ts +++ b/tests/restful/subAccount/getManagedSubAccountFuturesAssetDetails.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Managed Sub-account Futures Asset Details', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Managed Sub-account Futures Asset Details', async () => { + it('should return Managed Sub-account Futures Asset Details', async () => { const spy = jest.spyOn(client, 'getManagedSubAccountFuturesAssetDetails').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getManagedSubAccountFuturesAssetDetails('alice@test.com'); expect(res).toBeDefined(); diff --git a/tests/restful/subAccount/getManagedSubAccountList.test.ts b/tests/restful/subAccount/getManagedSubAccountList.test.ts index 6106f50..3582f91 100644 --- a/tests/restful/subAccount/getManagedSubAccountList.test.ts +++ b/tests/restful/subAccount/getManagedSubAccountList.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Managed Sub-account List', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Managed Sub-account List', async () => { + it('should return Managed Sub-account List', async () => { const spy = jest.spyOn(client, 'getManagedSubAccountList').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getManagedSubAccountList('alice@test.com'); expect(res).toBeDefined(); diff --git a/tests/restful/subAccount/getManagedSubAccountMarginAssetDetails.test.ts b/tests/restful/subAccount/getManagedSubAccountMarginAssetDetails.test.ts index 1c6fc45..900717d 100644 --- a/tests/restful/subAccount/getManagedSubAccountMarginAssetDetails.test.ts +++ b/tests/restful/subAccount/getManagedSubAccountMarginAssetDetails.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Managed Sub-account Margin Asset Details', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Managed Sub-account Margin Asset Details', async () => { + it('should return Managed Sub-account Margin Asset Details', async () => { const spy = jest.spyOn(client, 'getManagedSubAccountMarginAssetDetails').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getManagedSubAccountMarginAssetDetails('alice@test.com'); expect(res).toBeDefined(); diff --git a/tests/restful/subAccount/getManagedSubAccountTransferLog.test.ts b/tests/restful/subAccount/getManagedSubAccountTransferLog.test.ts index 4a96c87..2b99c03 100644 --- a/tests/restful/subAccount/getManagedSubAccountTransferLog.test.ts +++ b/tests/restful/subAccount/getManagedSubAccountTransferLog.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Managed Sub-account Transfer log test', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Managed Sub-account Transfer log test', async () => { + it('should return Managed Sub-account Transfer log test', async () => { const currentTime = Date.now(); const spy = jest.spyOn(client, 'getManagedSubAccountTransferLog').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getManagedSubAccountTransferLog('alice@test.com', (currentTime - 1000000), currentTime, 1, 10); diff --git a/tests/restful/subAccount/getManagedSubAccountTransferLogForTradeParent.test.ts b/tests/restful/subAccount/getManagedSubAccountTransferLogForTradeParent.test.ts index c154597..d14870f 100644 --- a/tests/restful/subAccount/getManagedSubAccountTransferLogForTradeParent.test.ts +++ b/tests/restful/subAccount/getManagedSubAccountTransferLogForTradeParent.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Managed Sub-account Transfer log trade Parent', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Managed Sub-account Transfer log trade Parent', async () => { + it('should return Managed Sub-account Transfer log trade Parent', async () => { const currentTime = Date.now(); const spy = jest.spyOn(client, 'getManagedSubAccountTransferLogForTradeParent').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getManagedSubAccountTransferLogForTradeParent('alice@test.com', (currentTime - 1000000), currentTime, 1, 10); diff --git a/tests/restful/subAccount/getManagedSubAccountTransferLogForTradeSub.test.ts b/tests/restful/subAccount/getManagedSubAccountTransferLogForTradeSub.test.ts index 6d52c9e..583d7cf 100644 --- a/tests/restful/subAccount/getManagedSubAccountTransferLogForTradeSub.test.ts +++ b/tests/restful/subAccount/getManagedSubAccountTransferLogForTradeSub.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Managed Sub-account Transfer log for TradeSub', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Managed Sub-account Transfer log for TradeSub', async () => { + it('should return Managed Sub-account Transfer log for TradeSub', async () => { const currentTime = Date.now(); const spy = jest.spyOn(client, 'getManagedSubAccountTransferLogForTradeSub').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getManagedSubAccountTransferLogForTradeSub((currentTime - 1000000), currentTime, 1, 10); diff --git a/tests/restful/subAccount/getManagedSubaccountAssetDetails.test.ts b/tests/restful/subAccount/getManagedSubaccountAssetDetails.test.ts index a036325..abb822b 100644 --- a/tests/restful/subAccount/getManagedSubaccountAssetDetails.test.ts +++ b/tests/restful/subAccount/getManagedSubaccountAssetDetails.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Managed Sub-account Asset Details', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Managed Sub-account Asset Details', async () => { + it('should return Managed Sub-account Asset Details', async () => { const spy = jest.spyOn(client, 'getManagedSubAccountAssetDetails').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getManagedSubAccountAssetDetails('alice@test.com'); expect(res).toBeDefined(); diff --git a/tests/restful/subAccount/getManagedSubaccountSnapshot.test.ts b/tests/restful/subAccount/getManagedSubaccountSnapshot.test.ts index 3bf864b..dbd4bda 100644 --- a/tests/restful/subAccount/getManagedSubaccountSnapshot.test.ts +++ b/tests/restful/subAccount/getManagedSubaccountSnapshot.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Managed Sub-account Snapshot', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Managed Sub-account Snapshot', async () => { + it('should return Managed Sub-account Snapshot', async () => { const spy = jest.spyOn(client, 'getManagedSubAccountSnapshot').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getManagedSubAccountSnapshot('alice@test.com', AccountSnapshotType.SPOT); expect(res).toBeDefined(); diff --git a/tests/restful/subAccount/getSubAccountAssetsForMasterAccount.test.ts b/tests/restful/subAccount/getSubAccountAssetsForMasterAccount.test.ts index 8133adb..0b1a760 100644 --- a/tests/restful/subAccount/getSubAccountAssetsForMasterAccount.test.ts +++ b/tests/restful/subAccount/getSubAccountAssetsForMasterAccount.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Sub-account Assets for Master Account', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Sub-account Assets for Master Account', async () => { + it('should return Sub-account Assets for Master Account', async () => { const spy = jest.spyOn(client, 'getSubAccountAssetsForMasterAccount').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getSubAccountAssetsForMasterAccount('alice@test.com'); expect(res).toBeDefined(); diff --git a/tests/restful/subAccount/getSubAccountTransactionStatisticsForMasterAccount.test.ts b/tests/restful/subAccount/getSubAccountTransactionStatisticsForMasterAccount.test.ts index 7f112b7..d78ac85 100644 --- a/tests/restful/subAccount/getSubAccountTransactionStatisticsForMasterAccount.test.ts +++ b/tests/restful/subAccount/getSubAccountTransactionStatisticsForMasterAccount.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Sub-account Transaction Statistics for Master Account', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Sub-account Transaction Statistics for Master Account', async () => { + it('should return Sub-account Transaction Statistics for Master Account', async () => { const spy = jest.spyOn(client, 'getSubAccountTransactionStatisticsForMasterAccount').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getSubAccountTransactionStatisticsForMasterAccount('alice@test.com'); expect(res).toBeDefined(); diff --git a/tests/restful/subAccount/getSubaccountAssets.test.ts b/tests/restful/subAccount/getSubaccountAssets.test.ts index 8f855f5..e83ae59 100644 --- a/tests/restful/subAccount/getSubaccountAssets.test.ts +++ b/tests/restful/subAccount/getSubaccountAssets.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Sub-account Assets', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Sub-account Assets', async () => { + it('should return Sub-account Assets', async () => { const spy = jest.spyOn(client, 'getSubAccountAssets').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getSubAccountAssets('alice@test.com'); expect(res).toBeDefined(); diff --git a/tests/restful/subAccount/getSubaccountFuturesAssetTransferHistory.test.ts b/tests/restful/subAccount/getSubaccountFuturesAssetTransferHistory.test.ts index af3b039..1332528 100644 --- a/tests/restful/subAccount/getSubaccountFuturesAssetTransferHistory.test.ts +++ b/tests/restful/subAccount/getSubaccountFuturesAssetTransferHistory.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Sub-account Futures Asset Transfer History', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Sub-account Futures Asset Transfer History', async () => { + it('should return Sub-account Futures Asset Transfer History', async () => { const spy = jest.spyOn(client, 'getSubAccountFuturesAssetTransferHistory').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getSubAccountFuturesAssetTransferHistory('alice@test.com', 1); expect(res).toBeDefined(); diff --git a/tests/restful/subAccount/getSubaccountList.test.ts b/tests/restful/subAccount/getSubaccountList.test.ts index 7969a36..e5faa6f 100644 --- a/tests/restful/subAccount/getSubaccountList.test.ts +++ b/tests/restful/subAccount/getSubaccountList.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Sub-account List', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Sub-account List', async () => { + it('should return Sub-account List', async () => { const spy = jest.spyOn(client, 'getSubAccountList').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getSubAccountList(); expect(res).toBeDefined(); diff --git a/tests/restful/subAccount/getSubaccountSpotAssetTransferHistory.test.ts b/tests/restful/subAccount/getSubaccountSpotAssetTransferHistory.test.ts index eccc1e5..2038e52 100644 --- a/tests/restful/subAccount/getSubaccountSpotAssetTransferHistory.test.ts +++ b/tests/restful/subAccount/getSubaccountSpotAssetTransferHistory.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Sub-account Spot Asset Transfer History', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Sub-account Spot Asset Transfer History', async () => { + it('should return Sub-account Spot Asset Transfer History', async () => { const spy = jest.spyOn(client, 'getSubAccountSpotAssetTransferHistory').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getSubAccountSpotAssetTransferHistory(); expect(res).toBeDefined(); diff --git a/tests/restful/subAccount/getSubaccountSpotAssetsSummary.test.ts b/tests/restful/subAccount/getSubaccountSpotAssetsSummary.test.ts index 0ad3d81..3924b9d 100644 --- a/tests/restful/subAccount/getSubaccountSpotAssetsSummary.test.ts +++ b/tests/restful/subAccount/getSubaccountSpotAssetsSummary.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Sub-account Spot Assets Summary', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Sub-account Spot Assets Summary', async () => { + it('should return Sub-account Spot Assets Summary', async () => { const spy = jest.spyOn(client, 'getSubAccountSpotAssetsSummary').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getSubAccountSpotAssetsSummary(); expect(res).toBeDefined(); diff --git a/tests/restful/subAccount/getUniversalTransferHistory.test.ts b/tests/restful/subAccount/getUniversalTransferHistory.test.ts index 9735765..2fbf669 100644 --- a/tests/restful/subAccount/getUniversalTransferHistory.test.ts +++ b/tests/restful/subAccount/getUniversalTransferHistory.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Universal Transfer History', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Universal Transfer History', async () => { + it('should return Universal Transfer History', async () => { const spy = jest.spyOn(client, 'getUniversalTransferHistory').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getUniversalTransferHistory(); expect(res).toBeDefined(); diff --git a/tests/restful/trade/getAllOco.test.ts b/tests/restful/trade/getAllOco.test.ts index 5fd5533..698fb10 100644 --- a/tests/restful/trade/getAllOco.test.ts +++ b/tests/restful/trade/getAllOco.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query all OCO', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query all OCO', async () => { + it('should return all OCO', async () => { const spy = jest.spyOn(client, 'getAllOco').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getAllOco(); expect(res).toBeDefined(); diff --git a/tests/restful/margin/getRepayRecord.test.ts b/tests/restful/trade/getAllocations.test.ts similarity index 62% rename from tests/restful/margin/getRepayRecord.test.ts rename to tests/restful/trade/getAllocations.test.ts index 0ac24b7..724ceed 100644 --- a/tests/restful/margin/getRepayRecord.test.ts +++ b/tests/restful/trade/getAllocations.test.ts @@ -1,6 +1,6 @@ import { expect } from '@jest/globals'; import { Spot } from '../../../src/index'; -import { mockResponse } from '../../mock_values/restful/margin/getRepayRecord'; +import { mockResponse } from '../../mock_values/restful/trade/getAllocations'; jest.mock('../../../src/index'); @@ -8,13 +8,13 @@ const apiKey = process.env.BINANCE_API_KEY || ''; const apiSecret = process.env.BINANCE_API_SECRET || ''; const baseURL = process.env.BINANCE_BASE_URL || ''; -describe('Query Repay Record', () => { +describe('Get Allocations', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Repay Record', async () => { - const spy = jest.spyOn(client, 'getRepayRecord').mockReturnValue(Promise.resolve(mockResponse)); - const res = await client.getRepayRecord('BTC'); + it('should return Allocations', async () => { + const spy = jest.spyOn(client, 'getAllocations').mockReturnValue(Promise.resolve(mockResponse)); + const res = await client.getAllocations('BNBUSDT'); expect(res).toBeDefined(); expect(res).toBe(mockResponse); spy.mockRestore(); }); -}); +}); \ No newline at end of file diff --git a/tests/restful/margin/marginAccountRepay.test.ts b/tests/restful/trade/getCommissionRates.test.ts similarity index 61% rename from tests/restful/margin/marginAccountRepay.test.ts rename to tests/restful/trade/getCommissionRates.test.ts index 35ae83f..ed850bd 100644 --- a/tests/restful/margin/marginAccountRepay.test.ts +++ b/tests/restful/trade/getCommissionRates.test.ts @@ -1,6 +1,6 @@ import { expect } from '@jest/globals'; import { Spot } from '../../../src/index'; -import { mockResponse } from '../../mock_values/restful/margin/marginAccountRepay'; +import { mockResponse } from '../../mock_values/restful/trade/getCommissionRates'; jest.mock('../../../src/index'); @@ -8,13 +8,13 @@ const apiKey = process.env.BINANCE_API_KEY || ''; const apiSecret = process.env.BINANCE_API_SECRET || ''; const baseURL = process.env.BINANCE_BASE_URL || ''; -describe('Margin Account Repay', () => { +describe('Get Comissions Rates', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Margin Account Repay', async () => { - const spy = jest.spyOn(client, 'marginAccountRepay').mockReturnValue(Promise.resolve(mockResponse)); - const res = await client.marginAccountRepay('BTC', 1.01); + it('should return Comissions Rates', async () => { + const spy = jest.spyOn(client, 'getCommissionRates').mockReturnValue(Promise.resolve(mockResponse)); + const res = await client.getCommissionRates('BNBUSDT'); expect(res).toBeDefined(); expect(res).toBe(mockResponse); spy.mockRestore(); }); -}); +}); \ No newline at end of file diff --git a/tests/restful/trade/getCurrentOrderCountUsage.test.ts b/tests/restful/trade/getCurrentOrderCountUsage.test.ts index c4f014e..cf6493c 100644 --- a/tests/restful/trade/getCurrentOrderCountUsage.test.ts +++ b/tests/restful/trade/getCurrentOrderCountUsage.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Current Order Count Usage', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Current Order Count Usage', async () => { + it('should return Current Order Count Usage', async () => { const spy = jest.spyOn(client, 'getCurrentOrderCountUsage').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getCurrentOrderCountUsage(); expect(res).toBeDefined(); diff --git a/tests/restful/trade/getOco.test.ts b/tests/restful/trade/getOco.test.ts index fe0181e..fe8c4e2 100644 --- a/tests/restful/trade/getOco.test.ts +++ b/tests/restful/trade/getOco.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query OCO', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query OCO', async () => { + it('should return OCO', async () => { const spy = jest.spyOn(client, 'getOco').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getOco(); expect(res).toBeDefined(); diff --git a/tests/restful/trade/getOpenOco.test.ts b/tests/restful/trade/getOpenOco.test.ts index b0dae8b..539af54 100644 --- a/tests/restful/trade/getOpenOco.test.ts +++ b/tests/restful/trade/getOpenOco.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Open OCO', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Open OCO', async () => { + it('should return Open OCO', async () => { const spy = jest.spyOn(client, 'getOpenOco').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getOpenOco(); expect(res).toBeDefined(); diff --git a/tests/restful/trade/getOrder.test.ts b/tests/restful/trade/getOrder.test.ts index 12bb04a..f369fa4 100644 --- a/tests/restful/trade/getOrder.test.ts +++ b/tests/restful/trade/getOrder.test.ts @@ -10,9 +10,9 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Order', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Order', async () => { + it('should return Order', async () => { const spy = jest.spyOn(client, 'getOrder').mockReturnValue(Promise.resolve(mockResponse)); - const res = await client.getOrder('BNBUSDT',); + const res = await client.getOrder('BNBUSDT'); expect(res).toBeDefined(); expect(res).toBe(mockResponse); spy.mockRestore(); diff --git a/tests/restful/margin/marginAccountBorrow.test.ts b/tests/restful/trade/getPreventedMatches.test.ts similarity index 60% rename from tests/restful/margin/marginAccountBorrow.test.ts rename to tests/restful/trade/getPreventedMatches.test.ts index 252e2e6..87f8927 100644 --- a/tests/restful/margin/marginAccountBorrow.test.ts +++ b/tests/restful/trade/getPreventedMatches.test.ts @@ -1,6 +1,6 @@ import { expect } from '@jest/globals'; import { Spot } from '../../../src/index'; -import { mockResponse } from '../../mock_values/restful/margin/marginAccountBorrow'; +import { mockResponse } from '../../mock_values/restful/trade/getPreventedMatches'; jest.mock('../../../src/index'); @@ -8,13 +8,13 @@ const apiKey = process.env.BINANCE_API_KEY || ''; const apiSecret = process.env.BINANCE_API_SECRET || ''; const baseURL = process.env.BINANCE_BASE_URL || ''; -describe('Margin Account Borrow', () => { +describe('Get Prevented Matches', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Margin Account Borrow', async () => { - const spy = jest.spyOn(client, 'marginAccountBorrow').mockReturnValue(Promise.resolve(mockResponse)); - const res = await client.marginAccountBorrow('BTC', 1.01); + it('should return Prevented Matches', async () => { + const spy = jest.spyOn(client, 'getPreventedMatches').mockReturnValue(Promise.resolve(mockResponse)); + const res = await client.getPreventedMatches('BNBUSDT'); expect(res).toBeDefined(); expect(res).toBe(mockResponse); spy.mockRestore(); }); -}); +}); \ No newline at end of file diff --git a/tests/restful/trade/newOco.test.ts b/tests/restful/trade/newOco.test.ts index cc21cf1..05bcf46 100644 --- a/tests/restful/trade/newOco.test.ts +++ b/tests/restful/trade/newOco.test.ts @@ -12,7 +12,7 @@ describe('New OCO', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); it('should return New OCO', async () => { const spy = jest.spyOn(client, 'newOco').mockReturnValue(Promise.resolve(mockResponse)); - const res = await client.newOco('BNBUSDT', Side.SELL, 1, 218, 220,); + const res = await client.newOco('BNBUSDT', Side.SELL, 1, 218, 220); expect(res).toBeDefined(); expect(res).toBe(mockResponse); spy.mockRestore(); diff --git a/tests/restful/trade/newOrder.test.ts b/tests/restful/trade/newOrder.test.ts index 979424c..7a28193 100644 --- a/tests/restful/trade/newOrder.test.ts +++ b/tests/restful/trade/newOrder.test.ts @@ -12,7 +12,7 @@ describe('New Order', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); it('should return New Order', async () => { const spy = jest.spyOn(client, 'newOrder').mockReturnValue(Promise.resolve(mockResponse)); - const res = await client.newOrder('BNBUSDT', Side.SELL, OrderType.LIMIT,); + const res = await client.newOrder('BNBUSDT', Side.SELL, OrderType.LIMIT); expect(res).toBeDefined(); expect(res).toBe(mockResponse); spy.mockRestore(); diff --git a/tests/restful/trade/newOrderSOR.test.ts b/tests/restful/trade/newOrderSOR.test.ts new file mode 100644 index 0000000..ce0a0b1 --- /dev/null +++ b/tests/restful/trade/newOrderSOR.test.ts @@ -0,0 +1,20 @@ +import { expect } from '@jest/globals'; +import { OrderType, Side, Spot } from '../../../src/index'; +import { mockResponse } from '../../mock_values/restful/trade/newOrderSOR'; + +jest.mock('../../../src/index'); + +const apiKey = process.env.BINANCE_API_KEY || ''; +const apiSecret = process.env.BINANCE_API_SECRET || ''; +const baseURL = process.env.BINANCE_BASE_URL || ''; + +describe('New Order SOR', () => { + const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); + it('should return New Order SOR result', async () => { + const spy = jest.spyOn(client, 'newOrderSOR').mockReturnValue(Promise.resolve(mockResponse)); + const res = await client.newOrderSOR('BNBUSDT', Side.SELL, OrderType.LIMIT, 1); + expect(res).toBeDefined(); + expect(res).toBe(mockResponse); + spy.mockRestore(); + }); +}); diff --git a/tests/restful/trade/testNewOrder.test.ts b/tests/restful/trade/testNewOrder.test.ts index af2028d..adccb14 100644 --- a/tests/restful/trade/testNewOrder.test.ts +++ b/tests/restful/trade/testNewOrder.test.ts @@ -10,9 +10,9 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Test New Order', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Test New Order', async () => { + it('should return Test New Order result', async () => { const spy = jest.spyOn(client, 'testNewOrder').mockReturnValue(Promise.resolve(mockResponse)); - const res = await client.testNewOrder('BNBUSDT', Side.SELL, OrderType.LIMIT,); + const res = await client.testNewOrder('BNBUSDT', Side.SELL, OrderType.LIMIT); expect(res).toBeDefined(); expect(res).toBe(mockResponse); spy.mockRestore(); diff --git a/tests/restful/trade/testNewOrderSOR.test.ts b/tests/restful/trade/testNewOrderSOR.test.ts new file mode 100644 index 0000000..8a6c47c --- /dev/null +++ b/tests/restful/trade/testNewOrderSOR.test.ts @@ -0,0 +1,20 @@ +import { expect } from '@jest/globals'; +import { OrderType, Side, Spot } from '../../../src/index'; +import { mockResponse } from '../../mock_values/restful/trade/testNewOrderSOR'; + +jest.mock('../../../src/index'); + +const apiKey = process.env.BINANCE_API_KEY || ''; +const apiSecret = process.env.BINANCE_API_SECRET || ''; +const baseURL = process.env.BINANCE_BASE_URL || ''; + +describe('Test New Order SOR', () => { + const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); + it('should return Test New Order SOR result', async () => { + const spy = jest.spyOn(client, 'testNewOrderSOR').mockReturnValue(Promise.resolve(mockResponse)); + const res = await client.testNewOrderSOR('BNBUSDT', Side.SELL, OrderType.LIMIT, 1); + expect(res).toBeDefined(); + expect(res).toBe(mockResponse); + spy.mockRestore(); + }); +}); \ No newline at end of file diff --git a/tests/restful/wallet/getApiKeyPermission.test.ts b/tests/restful/wallet/getApiKeyPermission.test.ts index e70d3db..d0f4bca 100644 --- a/tests/restful/wallet/getApiKeyPermission.test.ts +++ b/tests/restful/wallet/getApiKeyPermission.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Get API Key Permission', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Get API Key Permission', async () => { + it('should return API Key Permission', async () => { const spy = jest.spyOn(client, 'getApiKeyPermission').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getApiKeyPermission(); expect(res).toBeDefined(); diff --git a/tests/restful/wallet/getAssetsThatCanBeConvertedIntoBnb.test.ts b/tests/restful/wallet/getAssetsThatCanBeConvertedIntoBnb.test.ts index 5d4debc..51e54a6 100644 --- a/tests/restful/wallet/getAssetsThatCanBeConvertedIntoBnb.test.ts +++ b/tests/restful/wallet/getAssetsThatCanBeConvertedIntoBnb.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Get Assets That Can Be Converted Into BNB', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Get Assets That Can Be Converted Into BNB', async () => { + it('should return Assets That Can Be Converted Into BNB', async () => { const spy = jest.spyOn(client, 'getAssetsThatCanBeConvertedIntoBnb').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getAssetsThatCanBeConvertedIntoBnb(); expect(res).toBeDefined(); diff --git a/tests/restful/wallet/getAutoconvertingStableCoins.test.ts b/tests/restful/wallet/getAutoconvertingStableCoins.test.ts index aab367a..e0611f4 100644 --- a/tests/restful/wallet/getAutoconvertingStableCoins.test.ts +++ b/tests/restful/wallet/getAutoconvertingStableCoins.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query auto-converting stable coins', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query auto-converting stable coins', async () => { + it('should return auto-converting stable coins', async () => { const spy = jest.spyOn(client, 'getAutoconvertingStableCoins').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getAutoconvertingStableCoins(); expect(res).toBeDefined(); diff --git a/tests/restful/wallet/getCloudminingPaymentAndRefundHistory.test.ts b/tests/restful/wallet/getCloudminingPaymentAndRefundHistory.test.ts index 65ac6b1..7356ee1 100644 --- a/tests/restful/wallet/getCloudminingPaymentAndRefundHistory.test.ts +++ b/tests/restful/wallet/getCloudminingPaymentAndRefundHistory.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Get Cloud-Mining payment and refund history', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Get Cloud-Mining payment and refund history', async () => { + it('should return Cloud-Mining payment and refund history', async () => { const currentTimestamp = Date.now(); const spy = jest.spyOn(client, 'getCloudminingPaymentAndRefundHistory').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getCloudminingPaymentAndRefundHistory(currentTimestamp - 100000, currentTimestamp); diff --git a/tests/restful/wallet/getConvertTransfer.test.ts b/tests/restful/wallet/getConvertTransfer.test.ts index 44aa5c7..745600c 100644 --- a/tests/restful/wallet/getConvertTransfer.test.ts +++ b/tests/restful/wallet/getConvertTransfer.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query Convert Transfer', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query Convert Transfer', async () => { + it('should return Convert Transfer', async () => { const currentTimestamp = Date.now(); const spy = jest.spyOn(client, 'getConvertTransfer').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getConvertTransfer(currentTimestamp - 100000, currentTimestamp); diff --git a/tests/restful/wallet/getUserUniversalTransferHistory.test.ts b/tests/restful/wallet/getUserUniversalTransferHistory.test.ts index 29fc6a0..475ff20 100644 --- a/tests/restful/wallet/getUserUniversalTransferHistory.test.ts +++ b/tests/restful/wallet/getUserUniversalTransferHistory.test.ts @@ -10,7 +10,7 @@ const baseURL = process.env.BINANCE_BASE_URL || ''; describe('Query User Universal Transfer History', () => { const client = new Spot(apiKey, apiSecret, { baseURL: baseURL }); - it('should return Query User Universal Transfer History', async () => { + it('should return User Universal Transfer History', async () => { const spy = jest.spyOn(client, 'getUserUniversalTransferHistory').mockReturnValue(Promise.resolve(mockResponse)); const res = await client.getUserUniversalTransferHistory(UnivTransferType.MAIN_MARGIN); expect(res).toBeDefined();