Comparing version 2.12.3 to 2.13.0
@@ -34,6 +34,6 @@ import { AxiosRequestConfig } from 'axios'; | ||
getKlines(params: KlinesParams): Promise<Kline[]>; | ||
getPremiumIndexKlines(params: KlinesParams): Promise<Kline[]>; | ||
getContinuousContractKlines(params: ContinuousContractKlinesParams): Promise<Kline[]>; | ||
getIndexPriceKlines(params: IndexPriceKlinesParams): Promise<Kline[]>; | ||
getMarkPriceKlines(params: SymbolKlinePaginatedParams): Promise<Kline[]>; | ||
getPremiumIndexKlines(params: KlinesParams): Promise<Kline[]>; | ||
/** | ||
@@ -46,5 +46,2 @@ * @deprecated use get24hrChangeStatistics() instead (method without the typo) | ||
getSymbolOrderBookTicker(params?: SymbolOrPair): Promise<CoinMSymbolOrderBookTicker[]>; | ||
getIndexPriceConstituents(params: { | ||
symbol: string; | ||
}): Promise<IndexPriceConstituents>; | ||
getOpenInterest(params: { | ||
@@ -59,2 +56,13 @@ symbol: string; | ||
getCompositeSymbolIndex(params: FuturesCoinMBasisParams): Promise<any>; | ||
/** | ||
* possibly @deprecated | ||
* Only in old documentation, not in new one | ||
**/ | ||
getIndexPriceConstituents(params: { | ||
symbol: string; | ||
}): Promise<IndexPriceConstituents>; | ||
/** | ||
* possibly @deprecated | ||
* Only in old documentation, not in new one | ||
**/ | ||
getQuarterlyContractSettlementPrices(params: { | ||
@@ -65,13 +73,7 @@ pair: string; | ||
* | ||
* USD-Futures Account/Trade Endpoints | ||
* Trade Endpoints | ||
* | ||
**/ | ||
setPositionMode(params: PositionModeParams): Promise<ModeChangeResult>; | ||
getCurrentPositionMode(): Promise<PositionModeResponse>; | ||
submitNewOrder(params: NewFuturesOrderParams): Promise<NewOrderResult>; | ||
/** | ||
* Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue | ||
*/ | ||
modifyOrder(params: ModifyFuturesOrderParams): Promise<ModifyFuturesOrderResult>; | ||
/** | ||
* Warning: max 5 orders at a time! This method does not throw, instead it returns individual errors in the response array if any orders were rejected. | ||
@@ -83,2 +85,6 @@ * | ||
/** | ||
* Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue | ||
*/ | ||
modifyOrder(params: ModifyFuturesOrderParams): Promise<ModifyFuturesOrderResult>; | ||
/** | ||
* Warning: max 5 orders at a time! This method does not throw, instead it returns individual errors in the response array if any orders were rejected. | ||
@@ -88,33 +94,60 @@ */ | ||
getOrderModifyHistory(params: GetOrderModifyHistoryParams): Promise<OrderAmendment[]>; | ||
getOrder(params: GetOrderParams): Promise<OrderResult>; | ||
cancelOrder(params: CancelOrderParams): Promise<CancelFuturesOrderResult>; | ||
cancelMultipleOrders(params: CancelMultipleOrdersParams): Promise<(CancelFuturesOrderResult | GenericCodeMsgError)[]>; | ||
cancelAllOpenOrders(params: BasicSymbolParam): Promise<CancelAllOpenOrdersResult>; | ||
cancelMultipleOrders(params: CancelMultipleOrdersParams): Promise<(CancelFuturesOrderResult | GenericCodeMsgError)[]>; | ||
setCancelOrdersOnTimeout(params: CancelOrdersTimeoutParams): Promise<SetCancelTimeoutResult>; | ||
getOrder(params: GetOrderParams): Promise<OrderResult>; | ||
getAllOrders(params: GetAllOrdersParams): Promise<OrderResult[]>; | ||
getAllOpenOrders(params?: Partial<BasicSymbolParam>): Promise<OrderResult[]>; | ||
getCurrentOpenOrder(params: GetOrderParams): Promise<OrderResult>; | ||
getAllOpenOrders(params?: Partial<BasicSymbolParam>): Promise<OrderResult[]>; | ||
getAllOrders(params: GetAllOrdersParams): Promise<OrderResult[]>; | ||
getBalance(): Promise<FuturesCoinMAccountBalance[]>; | ||
getAccountInformation(): Promise<FuturesCoinMAccountInformation>; | ||
getForceOrders(params?: GetForceOrdersParams): Promise<ForceOrderResult[]>; | ||
getAccountTrades(params: CoinMAccountTradeParams & { | ||
orderId?: number; | ||
}): Promise<CoinMPositionTrade[]>; | ||
getPositions(): Promise<PositionRisk[]>; | ||
setPositionMode(params: PositionModeParams): Promise<ModeChangeResult>; | ||
setMarginType(params: SetMarginTypeParams): Promise<ModeChangeResult>; | ||
setLeverage(params: SetLeverageParams): Promise<SetLeverageResult>; | ||
setMarginType(params: SetMarginTypeParams): Promise<ModeChangeResult>; | ||
getADLQuantileEstimation(params?: Partial<BasicSymbolParam>): Promise<any>; | ||
setIsolatedPositionMargin(params: SetIsolatedMarginParams): Promise<SetIsolatedMarginResult>; | ||
getPositionMarginChangeHistory(params: GetPositionMarginChangeHistoryParams): Promise<any>; | ||
getPositions(): Promise<PositionRisk[]>; | ||
getAccountTrades(params: CoinMAccountTradeParams & { | ||
orderId?: number; | ||
}): Promise<CoinMPositionTrade[]>; | ||
getIncomeHistory(params?: GetIncomeHistoryParams): Promise<IncomeHistory[]>; | ||
/** | ||
* | ||
* Account Endpoints | ||
* | ||
**/ | ||
getBalance(): Promise<FuturesCoinMAccountBalance[]>; | ||
getAccountComissionRate(params: BasicSymbolParam): Promise<UserCommissionRate>; | ||
getAccountInformation(): Promise<FuturesCoinMAccountInformation>; | ||
/** | ||
* Notional Bracket for Symbol (NOT "pair") | ||
*/ | ||
getNotionalAndLeverageBrackets(params?: Partial<BasicSymbolParam>): Promise<SymbolLeverageBracketsResult[] | SymbolLeverageBracketsResult>; | ||
getForceOrders(params?: GetForceOrdersParams): Promise<ForceOrderResult[]>; | ||
getADLQuantileEstimation(params?: Partial<BasicSymbolParam>): Promise<any>; | ||
getAccountComissionRate(params: BasicSymbolParam): Promise<UserCommissionRate>; | ||
getCurrentPositionMode(): Promise<PositionModeResponse>; | ||
getIncomeHistory(params?: GetIncomeHistoryParams): Promise<IncomeHistory[]>; | ||
/** | ||
* | ||
* Portfolio Margin Endpoints | ||
* | ||
**/ | ||
getClassicPortfolioMarginAccount(params: { | ||
asset: string; | ||
}): Promise<ClassicPortfolioMarginAccount>; | ||
/** | ||
* possibly @deprecated | ||
* Only in old documentation, not in new one | ||
**/ | ||
getClassicPortfolioMarginNotionalLimits(params?: GetClassicPortfolioMarginNotionalLimitParams): Promise<{ | ||
notionalLimits: ClassicPortfolioMarginNotionalLimit[]; | ||
}>; | ||
/** | ||
* | ||
* Broker Futures Endpoints | ||
* Possibly @deprecated, found only in old docs | ||
* All broker endpoints start with /sapi/v1/broker or sapi/v2/broker or sapi/v3/broker | ||
* | ||
**/ | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerIfNewFuturesUser(brokerId: string, type?: 1 | 2): Promise<{ | ||
@@ -125,2 +158,5 @@ brokerId: string; | ||
}>; | ||
/** | ||
* @deprecated | ||
**/ | ||
setBrokerCustomIdForClient(customerId: string, email: string): Promise<{ | ||
@@ -130,7 +166,25 @@ customerId: string; | ||
}>; | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerClientCustomIds(customerId: string, email: string, page?: number, limit?: number): Promise<any>; | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerUserCustomId(brokerId: string): Promise<any>; | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerRebateDataOverview(type?: 1 | 2): Promise<RebateDataOverview>; | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerUserTradeVolume(type?: 1 | 2, startTime?: number, endTime?: number, limit?: number): Promise<any>; | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerRebateVolume(type?: 1 | 2, startTime?: number, endTime?: number, limit?: number): Promise<any>; | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerTradeDetail(type?: 1 | 2, startTime?: number, endTime?: number, limit?: number): Promise<any>; | ||
@@ -148,13 +202,2 @@ /** | ||
/** | ||
* | ||
* Classic Portfolio Margin Endpoints | ||
* | ||
**/ | ||
getClassicPortfolioMarginNotionalLimits(params?: GetClassicPortfolioMarginNotionalLimitParams): Promise<{ | ||
notionalLimits: ClassicPortfolioMarginNotionalLimit[]; | ||
}>; | ||
getClassicPortfolioMarginAccount(params: { | ||
asset: string; | ||
}): Promise<ClassicPortfolioMarginAccount>; | ||
/** | ||
* Validate syntax meets requirements set by binance. Log warning if not. | ||
@@ -161,0 +204,0 @@ */ |
@@ -71,5 +71,2 @@ "use strict"; | ||
} | ||
getPremiumIndexKlines(params) { | ||
return this.get('dapi/v1/premiumIndexKlines', params); | ||
} | ||
getContinuousContractKlines(params) { | ||
@@ -84,2 +81,5 @@ return this.get('dapi/v1/continuousKlines', params); | ||
} | ||
getPremiumIndexKlines(params) { | ||
return this.get('dapi/v1/premiumIndexKlines', params); | ||
} | ||
/** | ||
@@ -100,5 +100,2 @@ * @deprecated use get24hrChangeStatistics() instead (method without the typo) | ||
} | ||
getIndexPriceConstituents(params) { | ||
return this.get('dapi/v1/constituents', params); | ||
} | ||
getOpenInterest(params) { | ||
@@ -125,2 +122,13 @@ return this.get('dapi/v1/openInterest', params); | ||
} | ||
/** | ||
* possibly @deprecated | ||
* Only in old documentation, not in new one | ||
**/ | ||
getIndexPriceConstituents(params) { | ||
return this.get('dapi/v1/constituents', params); | ||
} | ||
/** | ||
* possibly @deprecated | ||
* Only in old documentation, not in new one | ||
**/ | ||
getQuarterlyContractSettlementPrices(params) { | ||
@@ -131,11 +139,5 @@ return this.get('futures/data/delivery-price', params); | ||
* | ||
* USD-Futures Account/Trade Endpoints | ||
* Trade Endpoints | ||
* | ||
**/ | ||
setPositionMode(params) { | ||
return this.postPrivate('dapi/v1/positionSide/dual', params); | ||
} | ||
getCurrentPositionMode() { | ||
return this.getPrivate('dapi/v1/positionSide/dual'); | ||
} | ||
submitNewOrder(params) { | ||
@@ -146,8 +148,2 @@ this.validateOrderId(params, 'newClientOrderId'); | ||
/** | ||
* Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue | ||
*/ | ||
modifyOrder(params) { | ||
return this.putPrivate('dapi/v1/order', params); | ||
} | ||
/** | ||
* Warning: max 5 orders at a time! This method does not throw, instead it returns individual errors in the response array if any orders were rejected. | ||
@@ -169,2 +165,8 @@ * | ||
/** | ||
* Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue | ||
*/ | ||
modifyOrder(params) { | ||
return this.putPrivate('dapi/v1/order', params); | ||
} | ||
/** | ||
* Warning: max 5 orders at a time! This method does not throw, instead it returns individual errors in the response array if any orders were rejected. | ||
@@ -185,11 +187,5 @@ */ | ||
} | ||
getOrder(params) { | ||
return this.getPrivate('dapi/v1/order', params); | ||
} | ||
cancelOrder(params) { | ||
return this.deletePrivate('dapi/v1/order', params); | ||
} | ||
cancelAllOpenOrders(params) { | ||
return this.deletePrivate('dapi/v1/allOpenOrders', params); | ||
} | ||
cancelMultipleOrders(params) { | ||
@@ -205,2 +201,5 @@ const requestParams = Object.assign({}, params); | ||
} | ||
cancelAllOpenOrders(params) { | ||
return this.deletePrivate('dapi/v1/allOpenOrders', params); | ||
} | ||
// Auto-cancel all open orders | ||
@@ -210,23 +209,35 @@ setCancelOrdersOnTimeout(params) { | ||
} | ||
getCurrentOpenOrder(params) { | ||
return this.getPrivate('dapi/v1/openOrder', params); | ||
getOrder(params) { | ||
return this.getPrivate('dapi/v1/order', params); | ||
} | ||
getAllOrders(params) { | ||
return this.getPrivate('dapi/v1/allOrders', params); | ||
} | ||
getAllOpenOrders(params) { | ||
return this.getPrivate('dapi/v1/openOrders', params); | ||
} | ||
getAllOrders(params) { | ||
return this.getPrivate('dapi/v1/allOrders', params); | ||
getCurrentOpenOrder(params) { | ||
return this.getPrivate('dapi/v1/openOrder', params); | ||
} | ||
getBalance() { | ||
return this.getPrivate('dapi/v1/balance'); | ||
getForceOrders(params) { | ||
return this.getPrivate('dapi/v1/forceOrders', params); | ||
} | ||
getAccountInformation() { | ||
return this.getPrivate('dapi/v1/account'); | ||
getAccountTrades(params) { | ||
return this.getPrivate('dapi/v1/userTrades', params); | ||
} | ||
setLeverage(params) { | ||
return this.postPrivate('dapi/v1/leverage', params); | ||
getPositions() { | ||
return this.getPrivate('dapi/v1/positionRisk'); | ||
} | ||
setPositionMode(params) { | ||
return this.postPrivate('dapi/v1/positionSide/dual', params); | ||
} | ||
setMarginType(params) { | ||
return this.postPrivate('dapi/v1/marginType', params); | ||
} | ||
setLeverage(params) { | ||
return this.postPrivate('dapi/v1/leverage', params); | ||
} | ||
getADLQuantileEstimation(params) { | ||
return this.getPrivate('dapi/v1/adlQuantile', params); | ||
} | ||
setIsolatedPositionMargin(params) { | ||
@@ -238,10 +249,15 @@ return this.postPrivate('dapi/v1/positionMargin', params); | ||
} | ||
getPositions() { | ||
return this.getPrivate('dapi/v1/positionRisk'); | ||
/** | ||
* | ||
* Account Endpoints | ||
* | ||
**/ | ||
getBalance() { | ||
return this.getPrivate('dapi/v1/balance'); | ||
} | ||
getAccountTrades(params) { | ||
return this.getPrivate('dapi/v1/userTrades', params); | ||
getAccountComissionRate(params) { | ||
return this.getPrivate('dapi/v1/commissionRate', params); | ||
} | ||
getIncomeHistory(params) { | ||
return this.getPrivate('dapi/v1/income', params); | ||
getAccountInformation() { | ||
return this.getPrivate('dapi/v1/account'); | ||
} | ||
@@ -254,17 +270,35 @@ /** | ||
} | ||
getForceOrders(params) { | ||
return this.getPrivate('dapi/v1/forceOrders', params); | ||
// TO ADD: dapi/v1/leverageBracket | ||
// can use dapi/v2/leverageBracket | ||
getCurrentPositionMode() { | ||
return this.getPrivate('dapi/v1/positionSide/dual'); | ||
} | ||
getADLQuantileEstimation(params) { | ||
return this.getPrivate('dapi/v1/adlQuantile', params); | ||
getIncomeHistory(params) { | ||
return this.getPrivate('dapi/v1/income', params); | ||
} | ||
getAccountComissionRate(params) { | ||
return this.getPrivate('dapi/v1/commissionRate', params); | ||
/** | ||
* | ||
* Portfolio Margin Endpoints | ||
* | ||
**/ | ||
getClassicPortfolioMarginAccount(params) { | ||
return this.getPrivate('dapi/v1/pmAccountInfo', params); | ||
} | ||
/** | ||
* possibly @deprecated | ||
* Only in old documentation, not in new one | ||
**/ | ||
getClassicPortfolioMarginNotionalLimits(params) { | ||
return this.getPrivate('dapi/v1/pmExchangeInfo', params); | ||
} | ||
/** | ||
* | ||
* Broker Futures Endpoints | ||
* Possibly @deprecated, found only in old docs | ||
* All broker endpoints start with /sapi/v1/broker or sapi/v2/broker or sapi/v3/broker | ||
* | ||
**/ | ||
// 1 == USDT-Margined, 2 == Coin-margined | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerIfNewFuturesUser(brokerId, type = 1) { | ||
@@ -276,2 +310,5 @@ return this.getPrivate('dapi/v1/apiReferral/ifNewUser', { | ||
} | ||
/** | ||
* @deprecated | ||
**/ | ||
setBrokerCustomIdForClient(customerId, email) { | ||
@@ -283,2 +320,5 @@ return this.postPrivate('dapi/v1/apiReferral/customization', { | ||
} | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerClientCustomIds(customerId, email, page, limit) { | ||
@@ -292,2 +332,5 @@ return this.getPrivate('dapi/v1/apiReferral/customization', { | ||
} | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerUserCustomId(brokerId) { | ||
@@ -298,2 +341,5 @@ return this.getPrivate('dapi/v1/apiReferral/userCustomization', { | ||
} | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerRebateDataOverview(type = 1) { | ||
@@ -304,2 +350,5 @@ return this.getPrivate('dapi/v1/apiReferral/overview', { | ||
} | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerUserTradeVolume(type = 1, startTime, endTime, limit) { | ||
@@ -313,2 +362,5 @@ return this.getPrivate('dapi/v1/apiReferral/tradeVol', { | ||
} | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerRebateVolume(type = 1, startTime, endTime, limit) { | ||
@@ -322,2 +374,5 @@ return this.getPrivate('dapi/v1/apiReferral/rebateVol', { | ||
} | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerTradeDetail(type = 1, startTime, endTime, limit) { | ||
@@ -346,13 +401,2 @@ return this.getPrivate('dapi/v1/apiReferral/traderSummary', { | ||
/** | ||
* | ||
* Classic Portfolio Margin Endpoints | ||
* | ||
**/ | ||
getClassicPortfolioMarginNotionalLimits(params) { | ||
return this.getPrivate('dapi/v1/pmExchangeInfo', params); | ||
} | ||
getClassicPortfolioMarginAccount(params) { | ||
return this.getPrivate('dapi/v1/pmAccountInfo', params); | ||
} | ||
/** | ||
* Validate syntax meets requirements set by binance. Log warning if not. | ||
@@ -359,0 +403,0 @@ */ |
@@ -47,338 +47,5 @@ "use strict"; | ||
* | ||
* Wallet Endpoints | ||
* SPOT TRADING Endpoints - General endpoints | ||
* | ||
**/ | ||
getSystemStatus() { | ||
return this.get('sapi/v1/system/status'); | ||
} | ||
getBalances() { | ||
return this.getPrivate('sapi/v1/capital/config/getall'); | ||
} | ||
getDailyAccountSnapshot(params) { | ||
return this.getPrivate('sapi/v1/accountSnapshot', params); | ||
} | ||
disableFastWithdrawSwitch() { | ||
return this.postPrivate('sapi/v1/account/disableFastWithdrawSwitch'); | ||
} | ||
enableFastWithdrawSwitch() { | ||
return this.postPrivate('sapi/v1/account/enableFastWithdrawSwitch'); | ||
} | ||
withdraw(params) { | ||
return this.postPrivate('sapi/v1/capital/withdraw/apply', params); | ||
} | ||
getDepositHistory(params) { | ||
return this.getPrivate('sapi/v1/capital/deposit/hisrec', params); | ||
} | ||
getWithdrawHistory(params) { | ||
return this.getPrivate('sapi/v1/capital/withdraw/history', params); | ||
} | ||
getDepositAddress(params) { | ||
return this.getPrivate('sapi/v1/capital/deposit/address', params); | ||
} | ||
getAccountStatus() { | ||
return this.getPrivate('sapi/v1/account/status'); | ||
} | ||
getDustLog(params) { | ||
return this.getPrivate('sapi/v1/asset/dribblet', params); | ||
} | ||
convertDustToBnb(params) { | ||
return this.postPrivate('sapi/v1/asset/dust', params); | ||
} | ||
getDust() { | ||
return this.postPrivate('sapi/v1/asset/dust-btc'); | ||
} | ||
getAssetDividendRecord(params) { | ||
return this.getPrivate('sapi/v1/asset/assetDividend', params); | ||
} | ||
getAssetDetail(params) { | ||
return this.getPrivate('sapi/v1/asset/assetDetail', params); | ||
} | ||
getTradeFee(params) { | ||
return this.getPrivate('sapi/v1/asset/tradeFee', params); | ||
} | ||
submitUniversalTransfer(params) { | ||
return this.postPrivate('sapi/v1/asset/transfer', params); | ||
} | ||
getUniversalTransferHistory(params) { | ||
return this.getPrivate('sapi/v1/asset/transfer', params); | ||
} | ||
getApiTradingStatus() { | ||
return this.getPrivate('sapi/v1/account/apiTradingStatus'); | ||
} | ||
getApiKeyPermissions() { | ||
return this.getPrivate('sapi/v1/account/apiRestrictions'); | ||
} | ||
enableConvertSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccount/convert', params); | ||
} | ||
getFundingAsset(params) { | ||
return this.postPrivate('sapi/v1/asset/get-funding-asset', params); | ||
} | ||
getUserAsset(params) { | ||
return this.postPrivate('sapi/v3/asset/getUserAsset', params); | ||
} | ||
convertBUSD(params) { | ||
return this.postPrivate('sapi/v1/asset/convert-transfer', params); | ||
} | ||
getConvertBUSDHistory(params) { | ||
return this.getPrivate('sapi/v1/asset/convert-transfer/queryByPage', params); | ||
} | ||
getCloudMiningHistory(params) { | ||
return this.getPrivate('sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage', params); | ||
} | ||
getAutoConvertStablecoins() { | ||
return this.getPrivate('sapi/v1/capital/contract/convertible-coins'); | ||
} | ||
setConvertibleCoins(params) { | ||
return this.postPrivate('sapi/v1/capital/contract/convertible-coins', params); | ||
} | ||
submitDepositCredit(params) { | ||
return this.postPrivate('sapi/v1/capital/deposit/credit-apply', params); | ||
} | ||
getDepositAddresses(params) { | ||
return this.getPrivate('sapi/v1/capital/deposit/address/list', params); | ||
} | ||
getWalletBalances() { | ||
return this.getPrivate('sapi/v1/asset/wallet/balance'); | ||
} | ||
getDelegationHistory(params) { | ||
return this.getPrivate('sapi/v1/asset/custody/transfer-history', params); | ||
} | ||
getDelistSchedule() { | ||
return this.getPrivate('sapi/v1/spot/delist-schedule'); | ||
} | ||
getWithdrawAddresses() { | ||
return this.getPrivate('sapi/v1/capital/withdraw/address/list'); | ||
} | ||
getAccountInfo() { | ||
return this.getPrivate('sapi/v1/account/info'); | ||
} | ||
/** | ||
* | ||
* | ||
* Sub-Account Endpoints | ||
* | ||
**/ | ||
createVirtualSubAccount(params) { | ||
return this.postPrivate('sapi/v1/sub-account/virtualSubAccount', params); | ||
} | ||
getSubAccountList(params) { | ||
return this.getPrivate('sapi/v1/sub-account/list', params); | ||
} | ||
getSubAccountSpotAssetTransferHistory(params) { | ||
return this.getPrivate('sapi/v1/sub-account/sub/transfer/history', params); | ||
} | ||
getSubAccountFuturesAssetTransferHistory(params) { | ||
return this.getPrivate('sapi/v1/sub-account/futures/internalTransfer', params); | ||
} | ||
subAccountFuturesAssetTransfer(params) { | ||
return this.postPrivate('sapi/v1/sub-account/futures/internalTransfer', params); | ||
} | ||
getSubAccountAssets(params) { | ||
return this.getPrivate('sapi/v3/sub-account/assets', params); | ||
} | ||
getSubAccountSpotAssetsSummary(params) { | ||
return this.getPrivate('sapi/v1/sub-account/spotSummary', params); | ||
} | ||
getSubAccountDepositAddress(params) { | ||
return this.getPrivate('sapi/v1/capital/deposit/subAddress', params); | ||
} | ||
getSubAccountDepositHistory(params) { | ||
return this.getPrivate('sapi/v1/capital/deposit/subHisrec', params); | ||
} | ||
getSubAccountStatusOnMarginOrFutures(params) { | ||
return this.getPrivate('sapi/v1/sub-account/status', params); | ||
} | ||
subAccountEnableMargin(email) { | ||
return this.postPrivate('sapi/v1/sub-account/margin/enable', { email }); | ||
} | ||
getSubAccountDetailOnMarginAccount(email) { | ||
return this.getPrivate('sapi/v1/sub-account/margin/account', { email }); | ||
} | ||
getSubAccountsSummaryOfMarginAccount() { | ||
return this.getPrivate('sapi/v1/sub-account/margin/accountSummary'); | ||
} | ||
subAccountEnableFutures(email) { | ||
return this.postPrivate('sapi/v1/sub-account/futures/enable', { email }); | ||
} | ||
getSubAccountFuturesAccountDetail(email) { | ||
return this.getPrivate('sapi/v1/sub-account/futures/account', { email }); | ||
} | ||
getSubAccountFuturesAccountSummary() { | ||
return this.getPrivate('sapi/v1/sub-account/futures/accountSummary'); | ||
} | ||
getSubAccountFuturesPositionRisk(email) { | ||
return this.getPrivate('sapi/v1/sub-account/futures/positionRisk', { | ||
email, | ||
}); | ||
} | ||
subAccountFuturesTransfer(params) { | ||
return this.postPrivate('sapi/v1/sub-account/futures/transfer', params); | ||
} | ||
subAccountMarginTransfer(params) { | ||
return this.postPrivate('sapi/v1/sub-account/margin/transfer', params); | ||
} | ||
subAccountTransferToSameMaster(params) { | ||
return this.postPrivate('sapi/v1/sub-account/transfer/subToSub', params); | ||
} | ||
subAccountTransferToMaster(params) { | ||
return this.postPrivate('sapi/v1/sub-account/transfer/subToMaster', params); | ||
} | ||
subAccountTransferHistory(params) { | ||
return this.getPrivate('sapi/v1/sub-account/transfer/subUserHistory', params); | ||
} | ||
subAccountUniversalTransfer(params) { | ||
return this.postPrivate('sapi/v1/sub-account/universalTransfer', params); | ||
} | ||
getSubAccountUniversalTransferHistory(params) { | ||
return this.getPrivate('sapi/v1/sub-account/universalTransfer', params); | ||
} | ||
getSubAccountDetailOnFuturesAccountV2(params) { | ||
return this.getPrivate('sapi/v2/sub-account/futures/account', params); | ||
} | ||
getSubAccountSummaryOnFuturesAccountV2(params) { | ||
return this.getPrivate('sapi/v2/sub-account/futures/accountSummary', params); | ||
} | ||
getSubAccountFuturesPositionRiskV2(params) { | ||
return this.getPrivate('sapi/v2/sub-account/futures/positionRisk', params); | ||
} | ||
subAccountEnableLeverageToken(params) { | ||
return this.postPrivate('sapi/v1/sub-account/blvt/enable', params); | ||
} | ||
subAccountEnableOrDisableIPRestriction(params) { | ||
return this.postPrivate('sapi/v1/sub-account/subAccountApi/ipRestriction', params); | ||
} | ||
subAccountAddIPList(params) { | ||
return this.postPrivate('sapi/v1/sub-account/subAccountApi/ipRestriction/ipList', params); | ||
} | ||
subAccountAddIPRestriction(params) { | ||
return this.postPrivate('sapi/v2/sub-account/subAccountApi/ipRestriction', params); | ||
} | ||
getSubAccountIPRestriction(params) { | ||
return this.getPrivate('sapi/v1/sub-account/subAccountApi/ipRestriction', params); | ||
} | ||
subAccountDeleteIPList(params) { | ||
return this.deletePrivate('sapi/v1/sub-account/subAccountApi/ipRestriction/ipList', params); | ||
} | ||
depositAssetsIntoManagedSubAccount(params) { | ||
return this.postPrivate('sapi/v1/managed-subaccount/deposit', params); | ||
} | ||
getManagedSubAccountAssetDetails(email) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/asset', { email }); | ||
} | ||
withdrawAssetsFromManagedSubAccount(params) { | ||
return this.postPrivate('sapi/v1/managed-subaccount/withdraw', params); | ||
} | ||
getManagedSubAccountSnapshot(params) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/accountSnapshot', params); | ||
} | ||
getManagedSubAccountTransfersInvestor(params) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/queryTransLogForInvestor', params); | ||
} | ||
getManagedSubAccountTransfersParent(params) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/queryTransLogForTradeParent', params); | ||
} | ||
getManagedSubAccountFuturesAssets(params) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/fetch-future-asset', params); | ||
} | ||
getManagedSubAccountMarginAssets(params) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/marginAsset', params); | ||
} | ||
getSubAccountAssetsMaster(params) { | ||
return this.getPrivate('sapi/v4/sub-account/assets', params); | ||
} | ||
getManagedSubAccounts(params) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/info', params); | ||
} | ||
getSubAccountTransactionStatistics(params) { | ||
return this.getPrivate('sapi/v1/sub-account/transaction-statistics', params); | ||
} | ||
getManagedSubAccountDepositAddress(params) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/deposit/address', params); | ||
} | ||
enableOptionsForSubAccount(params) { | ||
return this.postPrivate('sapi/v1/sub-account/eoptions/enable', params); | ||
} | ||
getManagedSubAccountTransferLog(params) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/query-trans-log', params); | ||
} | ||
/** | ||
* Broker Endpoints | ||
*/ | ||
getBrokerIfNewSpotUser() { | ||
return this.getPrivate('sapi/v1/apiReferral/ifNewUser'); | ||
} | ||
getBrokerSubAccountDepositHistory(params) { | ||
return this.getPrivate('sapi/v1/broker/subAccount/depositHist', params); | ||
} | ||
getBrokerUserCustomisedId(market) { | ||
const prefix = market === 'spot' ? 'sapi' : 'fapi'; | ||
return this.getPrivate(prefix + '/v1/apiReferral/userCustomization'); | ||
} | ||
createBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccount', params); | ||
} | ||
getBrokerSubAccountHistory(params) { | ||
return this.getPrivate('sapi/v1/broker/transfer', params); | ||
} | ||
getBrokerSubAccount(params) { | ||
return this.getPrivate('sapi/v1/broker/subAccount', params); | ||
} | ||
getApiKeyBrokerSubAccount(params) { | ||
return this.getPrivate('sapi/v1/broker/subAccountApi', params); | ||
} | ||
createApiKeyBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccountApi', params); | ||
} | ||
deleteApiKeyBrokerSubAccount(params) { | ||
return this.deletePrivate('sapi/v1/broker/subAccountApi', params); | ||
} | ||
changePermissionApiKeyBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccountApi/permission', params); | ||
} | ||
changeComissionBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccountApi/permission', params); | ||
} | ||
enableUniversalTransferApiKeyBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccountApi/permission/universalTransfer', params); | ||
} | ||
enableMarginBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccount/futures', params); | ||
} | ||
enableFuturesBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccount', params); | ||
} | ||
enableMarginApiKeyBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccount/margin', params); | ||
} | ||
transferBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/transfer', params); | ||
} | ||
universalTransferBroker(params) { | ||
return this.postPrivate('sapi/v1/broker/universalTransfer', params); | ||
} | ||
getUniversalTransferBroker(params) { | ||
return this.getPrivate('sapi/v1/broker/universalTransfer', params); | ||
} | ||
getBrokerInfo() { | ||
return this.getPrivate('sapi/v1/broker/info'); | ||
} | ||
// USD & Coin-M can be found under API getIncome() (find "API rebate" in results) | ||
getBrokerSpotRebateHistory(days, customerId) { | ||
if (days === 7) { | ||
return this.getPrivate('sapi/v1/apiReferral/rebate/recentRecord', { | ||
customerId, | ||
}); | ||
} | ||
if (days === 30) { | ||
return this.getPrivate('sapi/v1/apiReferral/rebate/historicalRecord', { | ||
customerId, | ||
}); | ||
} | ||
} | ||
/** | ||
* | ||
* Market Data Endpoints | ||
* | ||
**/ | ||
testConnectivity() { | ||
@@ -399,2 +66,7 @@ return this.get('api/v3/ping'); | ||
} | ||
/** | ||
* | ||
* SPOT TRADING Endpoints - Market endpoints | ||
* | ||
**/ | ||
getOrderBook(params) { | ||
@@ -446,5 +118,9 @@ return this.get('api/v3/depth', params); | ||
* | ||
* Spot Account/Trade Endpoints | ||
* SPOT TRADING Endpoints - Trading endpoints | ||
* | ||
**/ | ||
submitNewOrder(params) { | ||
this.validateOrderId(params, 'newClientOrderId'); | ||
return this.postPrivate('api/v3/order', params); | ||
} | ||
testNewOrder(params) { | ||
@@ -454,9 +130,5 @@ this.validateOrderId(params, 'newClientOrderId'); | ||
} | ||
replaceOrder(params) { | ||
return this.postPrivate('api/v3/order/cancelReplace', params); | ||
getOrder(params) { | ||
return this.getPrivate('api/v3/order', params); | ||
} | ||
submitNewOrder(params) { | ||
this.validateOrderId(params, 'newClientOrderId'); | ||
return this.postPrivate('api/v3/order', params); | ||
} | ||
cancelOrder(params) { | ||
@@ -468,4 +140,4 @@ return this.deletePrivate('api/v3/order', params); | ||
} | ||
getOrder(params) { | ||
return this.getPrivate('api/v3/order', params); | ||
replaceOrder(params) { | ||
return this.postPrivate('api/v3/order/cancelReplace', params); | ||
} | ||
@@ -541,7 +213,5 @@ getOpenOrders(params) { | ||
* | ||
* SPOT TRADING Endpoints - Account endpoints | ||
* | ||
* Spot Account Endpoints | ||
* | ||
* | ||
*/ | ||
**/ | ||
/** | ||
@@ -570,66 +240,79 @@ * Get current account information | ||
* | ||
* Margin Account/Trade Endpoints | ||
* MARGIN TRADING Endpoints - Market Data endpoints | ||
* | ||
**/ | ||
submitMarginAccountBorrowRepay(params) { | ||
return this.postPrivate('sapi/v1/margin/borrow-repay', params); | ||
getCrossMarginCollateralRatio() { | ||
return this.getPrivate('sapi/v1/margin/crossMarginCollateralRatio'); | ||
} | ||
getMarginAccountBorrowRepayRecords(params) { | ||
return this.getPrivate('sapi/v1/margin/borrow-repay', params); | ||
getAllCrossMarginPairs() { | ||
return this.get('sapi/v1/margin/allPairs'); | ||
} | ||
getIsolatedMarginAllSymbols(params) { | ||
return this.getPrivate('sapi/v1/margin/isolated/allPairs', params); | ||
} | ||
getAllMarginAssets() { | ||
return this.get('sapi/v1/margin/allAssets'); | ||
} | ||
getAllCrossMarginPairs() { | ||
return this.get('sapi/v1/margin/allPairs'); | ||
getMarginDelistSchedule() { | ||
return this.getPrivate('sapi/v1/margin/delist-schedule'); | ||
} | ||
getIsolatedMarginTierData(params) { | ||
return this.getPrivate('sapi/v1/margin/isolatedMarginTier', params); | ||
} | ||
queryMarginPriceIndex(params) { | ||
return this.get('sapi/v1/margin/priceIndex', params); | ||
} | ||
marginAccountNewOrder(params) { | ||
this.validateOrderId(params, 'newClientOrderId'); | ||
return this.postPrivate('sapi/v1/margin/order', params); | ||
getMarginAvailableInventory(params) { | ||
return this.getPrivate('sapi/v1/margin/available-inventory', params); | ||
} | ||
marginAccountCancelOrder(params) { | ||
return this.deletePrivate('sapi/v1/margin/order', params); | ||
getLeverageBracket() { | ||
return this.getPrivate('sapi/v1/margin/leverageBracket'); | ||
} | ||
marginAccountCancelOpenOrders(params) { | ||
return this.deletePrivate('sapi/v1/margin/openOrders', params); | ||
/** | ||
* | ||
* MARGIN TRADING Endpoints - Borrow and Repay endpoints | ||
* | ||
**/ | ||
getNextHourlyInterestRate(params) { | ||
return this.getPrivate('sapi/v1/margin/next-hourly-interest-rate', params); | ||
} | ||
updateCrossMarginMaxLeverage(params) { | ||
return this.postPrivate('sapi/v1/margin/max-leverage', params); | ||
} | ||
getCrossMarginTransferHistory(params) { | ||
return this.getPrivate('sapi/v1/margin/transfer', params); | ||
} | ||
getMarginInterestHistory(params) { | ||
return this.getPrivate('sapi/v1/margin/interestHistory', params); | ||
} | ||
submitMarginAccountBorrowRepay(params) { | ||
return this.postPrivate('sapi/v1/margin/borrow-repay', params); | ||
} | ||
getMarginAccountBorrowRepayRecords(params) { | ||
return this.getPrivate('sapi/v1/margin/borrow-repay', params); | ||
} | ||
getMarginInterestRateHistory(params) { | ||
return this.getPrivate('sapi/v1/margin/interestRateHistory', params); | ||
} | ||
queryMaxBorrow(params) { | ||
return this.getPrivate('sapi/v1/margin/maxBorrowable', params); | ||
} | ||
/** | ||
* | ||
* MARGIN TRADING Endpoints - Trade endpoints | ||
* | ||
**/ | ||
getMarginForceLiquidationRecord(params) { | ||
return this.getPrivate('sapi/v1/margin/forceLiquidationRec', params); | ||
} | ||
/** | ||
* @deprecated on 2024-01-09, use getMarginAccountBorrowRepayRecords() instead | ||
*/ | ||
queryLoanRecord(params) { | ||
return this.getPrivate('sapi/v1/margin/loan', params); | ||
getSmallLiabilityExchangeCoins() { | ||
return this.getPrivate('sapi/v1/margin/exchange-small-liability'); | ||
} | ||
/** | ||
* @deprecated on 2024-01-09, use getMarginAccountBorrowRepayRecords() instead | ||
*/ | ||
queryRepayRecord(params) { | ||
return this.getPrivate('sapi/v1/margin/repay', params); | ||
getSmallLiabilityExchangeHistory(params) { | ||
return this.getPrivate('sapi/v1/margin/exchange-small-liability-history', params); | ||
} | ||
queryCrossMarginAccountDetails() { | ||
return this.getPrivate('sapi/v1/margin/account'); | ||
marginAccountCancelOpenOrders(params) { | ||
return this.deletePrivate('sapi/v1/margin/openOrders', params); | ||
} | ||
queryMarginAccountOrder(params) { | ||
return this.getPrivate('sapi/v1/margin/order', params); | ||
marginAccountCancelOCO(params) { | ||
this.validateOrderId(params, 'newClientOrderId'); | ||
return this.deletePrivate('sapi/v1/margin/orderList', params); | ||
} | ||
queryMarginAccountOpenOrders(params) { | ||
return this.getPrivate('sapi/v1/margin/openOrders', params); | ||
marginAccountCancelOrder(params) { | ||
return this.deletePrivate('sapi/v1/margin/order', params); | ||
} | ||
queryMarginAccountAllOrders(params) { | ||
return this.getPrivate('sapi/v1/margin/allOrders', params); | ||
} | ||
marginAccountNewOCO(params) { | ||
@@ -641,8 +324,8 @@ this.validateOrderId(params, 'listClientOrderId'); | ||
} | ||
marginAccountCancelOCO(params) { | ||
marginAccountNewOrder(params) { | ||
this.validateOrderId(params, 'newClientOrderId'); | ||
return this.deletePrivate('sapi/v1/margin/orderList', params); | ||
return this.postPrivate('sapi/v1/margin/order', params); | ||
} | ||
queryMarginAccountOCO(params) { | ||
return this.getPrivate('sapi/v1/margin/orderList', params); | ||
getMarginOrderCountUsage(params) { | ||
return this.getPrivate('sapi/v1/margin/rateLimit/order', params); | ||
} | ||
@@ -652,17 +335,34 @@ queryMarginAccountAllOCO(params) { | ||
} | ||
/** | ||
* Query margin account's open OCO | ||
*/ | ||
queryMarginAccountAllOrders(params) { | ||
return this.getPrivate('sapi/v1/margin/allOrders', params); | ||
} | ||
queryMarginAccountOCO(params) { | ||
return this.getPrivate('sapi/v1/margin/orderList', params); | ||
} | ||
queryMarginAccountOpenOCO(params) { | ||
return this.getPrivate('sapi/v1/margin/openOrderList', params); | ||
} | ||
/** | ||
* Query margin account's trade list | ||
*/ | ||
queryMarginAccountOpenOrders(params) { | ||
return this.getPrivate('sapi/v1/margin/openOrders', params); | ||
} | ||
queryMarginAccountOrder(params) { | ||
return this.getPrivate('sapi/v1/margin/order', params); | ||
} | ||
queryMarginAccountTradeList(params) { | ||
return this.getPrivate('sapi/v1/margin/myTrades', params); | ||
} | ||
queryMaxBorrow(params) { | ||
return this.getPrivate('sapi/v1/margin/maxBorrowable', params); | ||
submitSmallLiabilityExchange(params) { | ||
return this.postPrivate('sapi/v1/margin/exchange-small-liability', params); | ||
} | ||
submitManualLiquidation(params) { | ||
return this.postPrivate('sapi/v1/margin/manual-liquidation', params); | ||
} | ||
/** | ||
* | ||
* MARGIN TRADING Endpoints - Transfer endpoints | ||
* | ||
**/ | ||
getCrossMarginTransferHistory(params) { | ||
return this.getPrivate('sapi/v1/margin/transfer', params); | ||
} | ||
queryMaxTransferOutAmount(params) { | ||
@@ -672,237 +372,436 @@ return this.getPrivate('sapi/v1/margin/maxTransferable', params); | ||
/** | ||
* @deprecated on 2024-01-09, use submitUniversalTransfer() instead | ||
*/ | ||
isolatedMarginAccountTransfer(params) { | ||
return this.postPrivate('sapi/v1/margin/isolated/transfer', params); | ||
* | ||
* MARGIN TRADING Endpoints - Account endpoints | ||
* | ||
**/ | ||
updateCrossMarginMaxLeverage(params) { | ||
return this.postPrivate('sapi/v1/margin/max-leverage', params); | ||
} | ||
disableIsolatedMarginAccount(params) { | ||
return this.deletePrivate('sapi/v1/margin/isolated/account', params); | ||
} | ||
enableIsolatedMarginAccount(params) { | ||
return this.postPrivate('sapi/v1/margin/isolated/account', params); | ||
} | ||
getBNBBurn() { | ||
return this.getPrivate('sapi/v1/bnbBurn'); | ||
} | ||
getMarginSummary() { | ||
return this.getPrivate('sapi/v1/margin/tradeCoeff'); | ||
} | ||
queryCrossMarginAccountDetails() { | ||
return this.getPrivate('sapi/v1/margin/account'); | ||
} | ||
getCrossMarginFeeData(params) { | ||
return this.getPrivate('sapi/v1/margin/crossMarginData', params); | ||
} | ||
getIsolatedMarginAccountLimit() { | ||
return this.getPrivate('sapi/v1/margin/isolated/accountLimit'); | ||
} | ||
getIsolatedMarginAccountInfo(params) { | ||
return this.getPrivate('sapi/v1/margin/isolated/account', { params }); | ||
} | ||
getIsolatedMarginFeeData(params) { | ||
return this.getPrivate('sapi/v1/margin/isolatedMarginData', params); | ||
} | ||
toggleBNBBurn(params) { | ||
return this.postPrivate('sapi/v1/bnbBurn', params); | ||
} | ||
/** | ||
* Disable isolated margin account | ||
* Possibly @deprecated | ||
* Only existing in old documentation, not in new documentation | ||
*/ | ||
disableIsolatedMarginAccount(params) { | ||
return this.deletePrivate('sapi/v1/margin/isolated/account', params); | ||
getMarginCapitalFlow(params) { | ||
return this.getPrivate('sapi/v1/margin/capital-flow', params); | ||
} | ||
/** | ||
* Enable isolated margin account | ||
* @deprecated on 2024-01-09, use getMarginAccountBorrowRepayRecords() instead | ||
*/ | ||
enableIsolatedMarginAccount(params) { | ||
return this.postPrivate('sapi/v1/margin/isolated/account', params); | ||
queryLoanRecord(params) { | ||
return this.getPrivate('sapi/v1/margin/loan', params); | ||
} | ||
/** | ||
* Query enabled isolated margin account limit | ||
* @deprecated on 2024-01-09, use getMarginAccountBorrowRepayRecords() instead | ||
*/ | ||
getIsolatedMarginAccountLimit() { | ||
return this.getPrivate('sapi/v1/margin/isolated/accountLimit'); | ||
queryRepayRecord(params) { | ||
return this.getPrivate('sapi/v1/margin/repay', params); | ||
} | ||
/** | ||
* Get all isolated margin symbols | ||
* @deprecated on 2024-01-09, use submitUniversalTransfer() instead | ||
*/ | ||
getIsolatedMarginAllSymbols(params) { | ||
return this.getPrivate('sapi/v1/margin/isolated/allPairs', params); | ||
isolatedMarginAccountTransfer(params) { | ||
return this.postPrivate('sapi/v1/margin/isolated/transfer', params); | ||
} | ||
/** | ||
* Toggle BNB burn on spot trade and margin interest | ||
* | ||
* WALLET Endpoints - Capital endpoints | ||
* | ||
**/ | ||
getBalances() { | ||
return this.getPrivate('sapi/v1/capital/config/getall'); | ||
} | ||
withdraw(params) { | ||
return this.postPrivate('sapi/v1/capital/withdraw/apply', params); | ||
} | ||
getWithdrawHistory(params) { | ||
return this.getPrivate('sapi/v1/capital/withdraw/history', params); | ||
} | ||
getWithdrawAddresses() { | ||
return this.getPrivate('sapi/v1/capital/withdraw/address/list'); | ||
} | ||
getDepositHistory(params) { | ||
return this.getPrivate('sapi/v1/capital/deposit/hisrec', params); | ||
} | ||
getDepositAddress(params) { | ||
return this.getPrivate('sapi/v1/capital/deposit/address', params); | ||
} | ||
getDepositAddresses(params) { | ||
return this.getPrivate('sapi/v1/capital/deposit/address/list', params); | ||
} | ||
submitDepositCredit(params) { | ||
return this.postPrivate('sapi/v1/capital/deposit/credit-apply', params); | ||
} | ||
getAutoConvertStablecoins() { | ||
return this.getPrivate('sapi/v1/capital/contract/convertible-coins'); | ||
} | ||
setConvertibleCoins(params) { | ||
return this.postPrivate('sapi/v1/capital/contract/convertible-coins', params); | ||
} | ||
/** | ||
* | ||
* WALLET Endpoints - Asset endpoints | ||
* | ||
**/ | ||
getAssetDetail(params) { | ||
return this.getPrivate('sapi/v1/asset/assetDetail', params); | ||
} | ||
getWalletBalances() { | ||
return this.getPrivate('sapi/v1/asset/wallet/balance'); | ||
} | ||
getUserAsset(params) { | ||
return this.postPrivate('sapi/v3/asset/getUserAsset', params); | ||
} | ||
submitUniversalTransfer(params) { | ||
return this.postPrivate('sapi/v1/asset/transfer', params); | ||
} | ||
getUniversalTransferHistory(params) { | ||
return this.getPrivate('sapi/v1/asset/transfer', params); | ||
} | ||
getDust() { | ||
return this.postPrivate('sapi/v1/asset/dust-btc'); | ||
} | ||
convertDustToBnb(params) { | ||
return this.postPrivate('sapi/v1/asset/dust', params); | ||
} | ||
getDustLog(params) { | ||
return this.getPrivate('sapi/v1/asset/dribblet', params); | ||
} | ||
getAssetDividendRecord(params) { | ||
return this.getPrivate('sapi/v1/asset/assetDividend', params); | ||
} | ||
getTradeFee(params) { | ||
return this.getPrivate('sapi/v1/asset/tradeFee', params); | ||
} | ||
getFundingAsset(params) { | ||
return this.postPrivate('sapi/v1/asset/get-funding-asset', params); | ||
} | ||
getCloudMiningHistory(params) { | ||
return this.getPrivate('sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage', params); | ||
} | ||
getDelegationHistory(params) { | ||
return this.getPrivate('sapi/v1/asset/custody/transfer-history', params); | ||
} | ||
/** | ||
* | ||
* Futures Management Endpoints: | ||
* https://binance-docs.github.io/apidocs/spot/en/#futures | ||
* | ||
* Note: to trade futures use the usdm-client or coinm-client. | ||
* MainClient only has the futures endpoints listed in the "spot" docs category, primarily used for transfers. | ||
* | ||
**/ | ||
/** | ||
* Execute transfer between spot account and futures account. | ||
* | ||
* Type: | ||
* - 1: transfer from spot account to USDT-Ⓜ futures account. | ||
* - 2: transfer from USDT-Ⓜ futures account to spot account. | ||
* - 3: transfer from spot account to COIN-Ⓜ futures account. | ||
* - 4: transfer from COIN-Ⓜ futures account to spot account. | ||
*/ | ||
toggleBNBBurn(params) { | ||
return this.postPrivate('sapi/v1/bnbBurn', params); | ||
/** | ||
* Possibly @deprecated, found only in old docs only | ||
* Use sapi/v1/asset/transfer instead | ||
*/ | ||
submitNewFutureAccountTransfer(params) { | ||
return this.postPrivate(`sapi/v1/futures/transfer`, params); | ||
} | ||
/** | ||
* Get BNB burn status | ||
* Possibly @deprecated, found only in old docs only | ||
* Use sapi/v1/asset/transfer instead | ||
*/ | ||
getBNBBurn() { | ||
return this.getPrivate('sapi/v1/bnbBurn'); | ||
getFutureAccountTransferHistory(params) { | ||
return this.getPrivate(`sapi/v1/futures/transfer`, params); | ||
} | ||
/** | ||
* Query margin interest rate history | ||
* @deprecated as of 2023-09-25 | ||
*/ | ||
getMarginInterestRateHistory(params) { | ||
return this.getPrivate('sapi/v1/margin/interestRateHistory', params); | ||
getCrossCollateralBorrowHistory(params) { | ||
return this.getPrivate(`sapi/v1/futures/loan/borrow/history`, params); | ||
} | ||
/** | ||
* Query cross margin fee data | ||
* @deprecated as of 2023-09-25 | ||
*/ | ||
getCrossMarginFeeData(params) { | ||
return this.getPrivate('sapi/v1/margin/crossMarginData', params); | ||
getCrossCollateralRepaymentHistory(params) { | ||
return this.getPrivate(`sapi/v1/futures/loan/repay/history`, params); | ||
} | ||
/** | ||
* Query isolated margin fee data | ||
* @deprecated as of 2023-09-25 | ||
*/ | ||
getIsolatedMarginFeeData(params) { | ||
return this.getPrivate('sapi/v1/margin/isolatedMarginData', params); | ||
getCrossCollateralWalletV2() { | ||
return this.getPrivate(`sapi/v2/futures/loan/wallet`); | ||
} | ||
/** | ||
* Query isolated margin tier data | ||
* @deprecated as of 2023-09-25 | ||
*/ | ||
getIsolatedMarginTierData(params) { | ||
return this.getPrivate('sapi/v1/margin/isolatedMarginTier', params); | ||
getAdjustCrossCollateralLTVHistory(params) { | ||
return this.getPrivate(`sapi/v1/futures/loan/adjustCollateral/history`, params); | ||
} | ||
getMarginOrderCountUsage(params) { | ||
return this.getPrivate('sapi/v1/margin/rateLimit/order', params); | ||
/** | ||
* @deprecated as of 2023-09-25 | ||
*/ | ||
getCrossCollateralLiquidationHistory(params) { | ||
return this.getPrivate(`sapi/v1/futures/loan/liquidationHistory`, params); | ||
} | ||
getCrossMarginCollateralRatio() { | ||
return this.getPrivate('sapi/v1/margin/crossMarginCollateralRatio'); | ||
/** | ||
* @deprecated as of 2023-09-25 | ||
*/ | ||
getCrossCollateralInterestHistory(params) { | ||
return this.getPrivate(`sapi/v1/futures/loan/interestHistory`, params); | ||
} | ||
getSmallLiabilityExchangeCoins() { | ||
return this.getPrivate('sapi/v1/margin/exchange-small-liability'); | ||
/** | ||
* | ||
* WALLET Endpoints - Account endpoints | ||
* | ||
**/ | ||
getAccountInfo() { | ||
return this.getPrivate('sapi/v1/account/info'); | ||
} | ||
submitSmallLiabilityExchange(params) { | ||
return this.postPrivate('sapi/v1/margin/exchange-small-liability', params); | ||
getDailyAccountSnapshot(params) { | ||
return this.getPrivate('sapi/v1/accountSnapshot', params); | ||
} | ||
getSmallLiabilityExchangeHistory(params) { | ||
return this.getPrivate('sapi/v1/margin/exchange-small-liability-history', params); | ||
disableFastWithdrawSwitch() { | ||
return this.postPrivate('sapi/v1/account/disableFastWithdrawSwitch'); | ||
} | ||
getNextHourlyInterestRate(params) { | ||
return this.getPrivate('sapi/v1/margin/next-hourly-interest-rate', params); | ||
enableFastWithdrawSwitch() { | ||
return this.postPrivate('sapi/v1/account/enableFastWithdrawSwitch'); | ||
} | ||
getMarginCapitalFlow(params) { | ||
return this.getPrivate('sapi/v1/margin/capital-flow', params); | ||
getAccountStatus() { | ||
return this.getPrivate('sapi/v1/account/status'); | ||
} | ||
getMarginDelistSchedule() { | ||
return this.getPrivate('sapi/v1/margin/delist-schedule'); | ||
getApiTradingStatus() { | ||
return this.getPrivate('sapi/v1/account/apiTradingStatus'); | ||
} | ||
getMarginAvailableInventory(params) { | ||
return this.getPrivate('sapi/v1/margin/available-inventory', params); | ||
getApiKeyPermissions() { | ||
return this.getPrivate('sapi/v1/account/apiRestrictions'); | ||
} | ||
submitManualLiquidation(params) { | ||
return this.postPrivate('sapi/v1/margin/manual-liquidation', params); | ||
/** | ||
* | ||
* WALLET Endpoints - Travel Rule endpoints | ||
* | ||
**/ | ||
// to be added | ||
/** | ||
* | ||
* WALLET Endpoints - Other endpoints | ||
* | ||
**/ | ||
getSystemStatus() { | ||
return this.get('sapi/v1/system/status'); | ||
} | ||
getLeverageBracket() { | ||
return this.getPrivate('sapi/v1/margin/leverageBracket'); | ||
getDelistSchedule() { | ||
return this.getPrivate('sapi/v1/spot/delist-schedule'); | ||
} | ||
/** | ||
* | ||
* User Data Stream Endpoints | ||
* SUB ACCOUNT Endpoints - Account management | ||
* | ||
**/ | ||
// spot | ||
getSpotUserDataListenKey() { | ||
return this.post('api/v3/userDataStream'); | ||
createVirtualSubAccount(params) { | ||
return this.postPrivate('sapi/v1/sub-account/virtualSubAccount', params); | ||
} | ||
keepAliveSpotUserDataListenKey(listenKey) { | ||
return this.put(`api/v3/userDataStream?listenKey=${listenKey}`); | ||
getSubAccountList(params) { | ||
return this.getPrivate('sapi/v1/sub-account/list', params); | ||
} | ||
closeSpotUserDataListenKey(listenKey) { | ||
return this.delete(`api/v3/userDataStream?listenKey=${listenKey}`); | ||
subAccountEnableFutures(email) { | ||
return this.postPrivate('sapi/v1/sub-account/futures/enable', { email }); | ||
} | ||
// margin | ||
getMarginUserDataListenKey() { | ||
return this.post('sapi/v1/userDataStream'); | ||
subAccountEnableMargin(email) { | ||
return this.postPrivate('sapi/v1/sub-account/margin/enable', { email }); | ||
} | ||
keepAliveMarginUserDataListenKey(listenKey) { | ||
return this.put(`sapi/v1/userDataStream?listenKey=${listenKey}`); | ||
enableOptionsForSubAccount(params) { | ||
return this.postPrivate('sapi/v1/sub-account/eoptions/enable', params); | ||
} | ||
closeMarginUserDataListenKey(listenKey) { | ||
return this.delete(`sapi/v1/userDataStream?listenKey=${listenKey}`); | ||
subAccountEnableLeverageToken(params) { | ||
return this.postPrivate('sapi/v1/sub-account/blvt/enable', params); | ||
} | ||
// isolated margin | ||
getIsolatedMarginUserDataListenKey(params) { | ||
return this.post(`sapi/v1/userDataStream/isolated?${(0, requestUtils_1.serialiseParams)(params)}`); | ||
getSubAccountStatusOnMarginOrFutures(params) { | ||
return this.getPrivate('sapi/v1/sub-account/status', params); | ||
} | ||
keepAliveIsolatedMarginUserDataListenKey(params) { | ||
return this.put(`sapi/v1/userDataStream/isolated?${(0, requestUtils_1.serialiseParams)(params)}`); | ||
getSubAccountFuturesPositionRisk(email) { | ||
return this.getPrivate('sapi/v1/sub-account/futures/positionRisk', { | ||
email, | ||
}); | ||
} | ||
closeIsolatedMarginUserDataListenKey(params) { | ||
return this.delete(`sapi/v1/userDataStream/isolated?${(0, requestUtils_1.serialiseParams)(params)}`); | ||
getSubAccountFuturesPositionRiskV2(params) { | ||
return this.getPrivate('sapi/v2/sub-account/futures/positionRisk', params); | ||
} | ||
getSubAccountTransactionStatistics(params) { | ||
return this.getPrivate('sapi/v1/sub-account/transaction-statistics', params); | ||
} | ||
/** | ||
* | ||
* Simple earn Endpoints | ||
* SUB ACCOUNT Endpoints - API management | ||
* | ||
**/ | ||
getFlexibleSavingProducts(params) { | ||
return this.getPrivate(`/sapi/v1/simple-earn/flexible/list`, params); | ||
getSubAccountIPRestriction(params) { | ||
return this.getPrivate('sapi/v1/sub-account/subAccountApi/ipRestriction', params); | ||
} | ||
getSimpleEarnLockedProductList(params) { | ||
return this.getPrivate(`/sapi/v1/simple-earn/locked/list`, params); | ||
subAccountDeleteIPList(params) { | ||
return this.deletePrivate('sapi/v1/sub-account/subAccountApi/ipRestriction/ipList', params); | ||
} | ||
purchaseFlexibleProduct(params) { | ||
return this.postPrivate(`/sapi/v1/simple-earn/flexible/subscribe`, params); | ||
subAccountAddIPRestriction(params) { | ||
return this.postPrivate('sapi/v2/sub-account/subAccountApi/ipRestriction', params); | ||
} | ||
subscribeSimpleEarnLockedProduct(params) { | ||
return this.postPrivate(`/sapi/v1/simple-earn/locked/subscribe`, params); | ||
/** | ||
* @deprecated | ||
* Use subAccountAddIPRestriction instead | ||
**/ | ||
subAccountAddIPList(params) { | ||
return this.postPrivate('sapi/v1/sub-account/subAccountApi/ipRestriction/ipList', params); | ||
} | ||
redeemLockedProduct(params) { | ||
return this.postPrivate(`/sapi/v1/simple-earn/locked/redeem`, params); | ||
/** | ||
* @deprecated | ||
* Use subAccountAddIPRestriction instead, or subAccountDeleteIPList | ||
**/ | ||
subAccountEnableOrDisableIPRestriction(params) { | ||
return this.postPrivate('sapi/v1/sub-account/subAccountApi/ipRestriction', params); | ||
} | ||
redeemFlexibleProduct(params) { | ||
return this.postPrivate(`/sapi/v1/simple-earn/flexible/redeem`, params); | ||
/** | ||
* | ||
* SUB ACCOUNT Endpoints - Asset management | ||
* | ||
**/ | ||
subAccountFuturesTransfer(params) { | ||
return this.postPrivate('sapi/v1/sub-account/futures/transfer', params); | ||
} | ||
getFlexibleProductPosition(params) { | ||
return this.getPrivate(`/sapi/v1/simple-earn/flexible/position`, params); | ||
getSubAccountFuturesAccountDetail(email) { | ||
return this.getPrivate('sapi/v1/sub-account/futures/account', { email }); | ||
} | ||
getLockedProductPosition(params) { | ||
return this.getPrivate(`/sapi/v1/simple-earn/locked/position`, params); | ||
getSubAccountDetailOnFuturesAccountV2(params) { | ||
return this.getPrivate('sapi/v2/sub-account/futures/account', params); | ||
} | ||
getSimpleEarnAccount() { | ||
return this.getPrivate(`/sapi/v1/simple-earn/account`); | ||
getSubAccountDetailOnMarginAccount(email) { | ||
return this.getPrivate('sapi/v1/sub-account/margin/account', { email }); | ||
} | ||
getFlexibleSubscriptionRecord(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/flexible/history/subscriptionRecord', params); | ||
getSubAccountDepositAddress(params) { | ||
return this.getPrivate('sapi/v1/capital/deposit/subAddress', params); | ||
} | ||
getLockedSubscriptionRecord(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/locked/history/subscriptionRecord', params); | ||
getSubAccountDepositHistory(params) { | ||
return this.getPrivate('sapi/v1/capital/deposit/subHisrec', params); | ||
} | ||
getFlexibleRedemptionRecord(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/flexible/history/redemptionRecord', params); | ||
getSubAccountFuturesAccountSummary() { | ||
return this.getPrivate('sapi/v1/sub-account/futures/accountSummary'); | ||
} | ||
getLockedRedemptionRecord(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/locked/history/redemptionRecord', params); | ||
getSubAccountSummaryOnFuturesAccountV2(params) { | ||
return this.getPrivate('sapi/v2/sub-account/futures/accountSummary', params); | ||
} | ||
getFlexibleRewardsHistory(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/flexible/history/rewardsRecord', params); | ||
getSubAccountsSummaryOfMarginAccount() { | ||
return this.getPrivate('sapi/v1/sub-account/margin/accountSummary'); | ||
} | ||
getLockedRewardsHistory(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/locked/history/rewardsRecord', params); | ||
subAccountMarginTransfer(params) { | ||
return this.postPrivate('sapi/v1/sub-account/margin/transfer', params); | ||
} | ||
setFlexibleAutoSubscribe(params) { | ||
return this.postPrivate('sapi/v1/simple-earn/flexible/setAutoSubscribe', params); | ||
getSubAccountAssets(params) { | ||
return this.getPrivate('sapi/v3/sub-account/assets', params); | ||
} | ||
setLockedAutoSubscribe(params) { | ||
return this.postPrivate('sapi/v1/simple-earn/locked/setAutoSubscribe', params); | ||
getSubAccountAssetsMaster(params) { | ||
return this.getPrivate('sapi/v4/sub-account/assets', params); | ||
} | ||
getFlexiblePersonalLeftQuota(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/flexible/personalLeftQuota', params); | ||
getSubAccountFuturesAssetTransferHistory(params) { | ||
return this.getPrivate('sapi/v1/sub-account/futures/internalTransfer', params); | ||
} | ||
getLockedPersonalLeftQuota(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/locked/personalLeftQuota', params); | ||
getSubAccountSpotAssetTransferHistory(params) { | ||
return this.getPrivate('sapi/v1/sub-account/sub/transfer/history', params); | ||
} | ||
getFlexibleSubscriptionPreview(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/flexible/subscriptionPreview', params); | ||
getSubAccountSpotAssetsSummary(params) { | ||
return this.getPrivate('sapi/v1/sub-account/spotSummary', params); | ||
} | ||
getLockedSubscriptionPreview(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/locked/subscriptionPreview', params); | ||
getSubAccountUniversalTransferHistory(params) { | ||
return this.getPrivate('sapi/v1/sub-account/universalTransfer', params); | ||
} | ||
getRateHistory(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/flexible/history/rateHistory', params); | ||
subAccountFuturesAssetTransfer(params) { | ||
return this.postPrivate('sapi/v1/sub-account/futures/internalTransfer', params); | ||
} | ||
getCollateralRecord(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/flexible/history/collateralRecord', params); | ||
subAccountTransferHistory(params) { | ||
return this.getPrivate('sapi/v1/sub-account/transfer/subUserHistory', params); | ||
} | ||
subAccountTransferToMaster(params) { | ||
return this.postPrivate('sapi/v1/sub-account/transfer/subToMaster', params); | ||
} | ||
subAccountTransferToSameMaster(params) { | ||
return this.postPrivate('sapi/v1/sub-account/transfer/subToSub', params); | ||
} | ||
subAccountUniversalTransfer(params) { | ||
return this.postPrivate('sapi/v1/sub-account/universalTransfer', params); | ||
} | ||
/** | ||
* | ||
* Dual Investment Endpoints | ||
* SUB ACCOUNT Endpoints - Managed Sub Account | ||
* | ||
**/ | ||
getDualInvestmentProducts(params) { | ||
return this.getPrivate('sapi/v1/dci/product/list', params); | ||
depositAssetsIntoManagedSubAccount(params) { | ||
return this.postPrivate('sapi/v1/managed-subaccount/deposit', params); | ||
} | ||
subscribeDualInvestmentProduct(params) { | ||
return this.postPrivate('sapi/v1/dci/product/subscribe', params); | ||
getManagedSubAccountDepositAddress(params) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/deposit/address', params); | ||
} | ||
getDualInvestmentPositions(params) { | ||
return this.getPrivate('sapi/v1/dci/product/positions', params); | ||
withdrawAssetsFromManagedSubAccount(params) { | ||
return this.postPrivate('sapi/v1/managed-subaccount/withdraw', params); | ||
} | ||
getDualInvestmentAccounts() { | ||
return this.getPrivate('sapi/v1/dci/product/accounts'); | ||
getManagedSubAccountTransfersParent(params) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/queryTransLogForTradeParent', params); | ||
} | ||
updateAutoCompoundStatus(params) { | ||
return this.postPrivate('sapi/v1/dci/product/auto_compound/edit-status', params); | ||
getManagedSubAccountTransferLog(params) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/query-trans-log', params); | ||
} | ||
getManagedSubAccountTransfersInvestor(params) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/queryTransLogForInvestor', params); | ||
} | ||
getManagedSubAccounts(params) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/info', params); | ||
} | ||
getManagedSubAccountSnapshot(params) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/accountSnapshot', params); | ||
} | ||
getManagedSubAccountAssetDetails(email) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/asset', { email }); | ||
} | ||
getManagedSubAccountMarginAssets(params) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/marginAsset', params); | ||
} | ||
getManagedSubAccountFuturesAssets(params) { | ||
return this.getPrivate('sapi/v1/managed-subaccount/fetch-future-asset', params); | ||
} | ||
/** | ||
* | ||
* Auto Invest Enpoints | ||
* AUTO INVEST Endpoints - Market data | ||
* | ||
**/ | ||
getAutoInvestAssets() { | ||
return this.getPrivate('sapi/v1/lending/auto-invest/all/asset'); | ||
} | ||
getAutoInvestSourceAssets(params) { | ||
return this.getPrivate('sapi/v1/lending/auto-invest/source-asset/list', params); | ||
} | ||
getAutoInvestTargetAssets(params) { | ||
@@ -914,9 +813,20 @@ return this.getPrivate('sapi/v1/lending/auto-invest/target-asset/list', params); | ||
} | ||
getAutoInvestAssets() { | ||
return this.getPrivate('sapi/v1/lending/auto-invest/all/asset'); | ||
getAutoInvestIndex(params) { | ||
return this.getPrivate('sapi/v1/lending/auto-invest/index/info', params); | ||
} | ||
getAutoInvestSourceAssets(params) { | ||
return this.getPrivate('sapi/v1/lending/auto-invest/source-asset/list', params); | ||
getAutoInvestPlans(params) { | ||
return this.getPrivate('sapi/v1/lending/auto-invest/plan/list', params); | ||
} | ||
submitAutoInvestmentPlan(params) { | ||
/** | ||
* | ||
* AUTO INVEST Endpoints - Trade | ||
* | ||
**/ | ||
/** | ||
* https://developers.binance.com/docs/auto_invest/trade/One-Time-Transaction | ||
* | ||
* @param params | ||
* @returns | ||
*/ | ||
submitAutoInvestOneTimeTransaction(params) { | ||
const { details } = params, allParams = __rest(params, ["details"]); | ||
@@ -928,7 +838,15 @@ const requestParameters = Object.assign({}, allParams); | ||
} | ||
return this.postPrivate('sapi/v1/lending/auto-invest/plan/add', requestParameters); | ||
return this.postPrivate('sapi/v1/lending/auto-invest/one-off', requestParameters); | ||
} | ||
submitAutoInvestmentPlanOld(params) { | ||
return this.postPrivate('sapi/v1/lending/auto-invest/plan/add', params); | ||
updateAutoInvestPlanStatus(params) { | ||
return this.postPrivate('sapi/v1/lending/auto-invest/plan/edit-status', params); | ||
} | ||
/** | ||
* | ||
* @deprecated , use updateAutoInvestmentPlan instead | ||
* | ||
**/ | ||
updateAutoInvestmentPlanOld(params) { | ||
return this.postPrivate('sapi/v1/lending/auto-invest/plan/edit', params); | ||
} | ||
updateAutoInvestmentPlan(params) { | ||
@@ -943,30 +861,19 @@ const { details } = params, allParams = __rest(params, ["details"]); | ||
} | ||
updateAutoInvestmentPlanOld(params) { | ||
return this.postPrivate('sapi/v1/lending/auto-invest/plan/edit', params); | ||
submitAutoInvestRedemption(params) { | ||
return this.postPrivate('sapi/v1/lending/auto-invest/redeem', params); | ||
} | ||
updateAutoInvestPlanStatus(params) { | ||
return this.postPrivate('sapi/v1/lending/auto-invest/plan/edit-status', params); | ||
} | ||
getAutoInvestPlans(params) { | ||
return this.getPrivate('sapi/v1/lending/auto-invest/plan/list', params); | ||
} | ||
getAutoInvestPlan(params) { | ||
return this.getPrivate('sapi/v1/lending/auto-invest/plan/id', params); | ||
} | ||
getAutoInvestSubscriptionTransactions(params) { | ||
return this.getPrivate('sapi/v1/lending/auto-invest/history/list', params); | ||
} | ||
getAutoInvestIndex(params) { | ||
return this.getPrivate('sapi/v1/lending/auto-invest/index/info', params); | ||
getOneTimeTransactionStatus(params) { | ||
return this.getPrivate('sapi/v1/lending/auto-invest/one-off/status', params); | ||
} | ||
getAutoInvestUserIndex(params) { | ||
return this.getPrivate('sapi/v1/lending/auto-invest/index/user-summary', params); | ||
} | ||
/** | ||
* https://developers.binance.com/docs/auto_invest/trade/One-Time-Transaction | ||
* @deprecated , use submitAutoInvestmentPlan instead | ||
* | ||
* @param params | ||
* @returns | ||
*/ | ||
submitAutoInvestOneTimeTransaction(params) { | ||
**/ | ||
submitAutoInvestmentPlanOld(params) { | ||
return this.postPrivate('sapi/v1/lending/auto-invest/plan/add', params); | ||
} | ||
submitAutoInvestmentPlan(params) { | ||
const { details } = params, allParams = __rest(params, ["details"]); | ||
@@ -978,13 +885,13 @@ const requestParameters = Object.assign({}, allParams); | ||
} | ||
return this.postPrivate('sapi/v1/lending/auto-invest/one-off', requestParameters); | ||
return this.postPrivate('sapi/v1/lending/auto-invest/plan/add', requestParameters); | ||
} | ||
getOneTimeTransactionStatus(params) { | ||
return this.getPrivate('sapi/v1/lending/auto-invest/one-off/status', params); | ||
} | ||
submitAutoInvestRedemption(params) { | ||
return this.postPrivate('sapi/v1/lending/auto-invest/redeem', params); | ||
} | ||
getAutoInvestRedemptionHistory(params) { | ||
return this.getPrivate('sapi/v1/lending/auto-invest/redeem/history', params); | ||
} | ||
getAutoInvestPlan(params) { | ||
return this.getPrivate('sapi/v1/lending/auto-invest/plan/id', params); | ||
} | ||
getAutoInvestUserIndex(params) { | ||
return this.getPrivate('sapi/v1/lending/auto-invest/index/user-summary', params); | ||
} | ||
getAutoInvestRebalanceHistory(params) { | ||
@@ -995,29 +902,62 @@ return this.getPrivate('sapi/v1/lending/auto-invest/rebalance/history', params); | ||
* | ||
* Staking Endpoints | ||
* CONVERT Endpoints - Market Data | ||
* | ||
**/ | ||
/** | ||
* @deprecated as of 2024-01-19 | ||
*/ | ||
getStakingProducts(params) { | ||
return this.getPrivate(`sapi/v1/staking/productList`, params); | ||
getConvertPairs(params) { | ||
return this.getPrivate('sapi/v1/convert/exchangeInfo', params); | ||
} | ||
getConvertAssetInfo() { | ||
return this.getPrivate('sapi/v1/convert/assetInfo'); | ||
} | ||
/** | ||
* @deprecated as of 2024-01-19 | ||
*/ | ||
getStakingProductPosition(params) { | ||
return this.getPrivate('sapi/v1/staking/position', params); | ||
* | ||
* CONVERT Endpoints - Trade | ||
* | ||
**/ | ||
convertQuoteRequest(params) { | ||
return this.postPrivate('sapi/v1/convert/getQuote', params); | ||
} | ||
acceptQuoteRequest(params) { | ||
return this.postPrivate('sapi/v1/convert/acceptQuote', params); | ||
} | ||
getConvertTradeHistory(params) { | ||
return this.getPrivate('sapi/v1/convert/tradeFlow', params); | ||
} | ||
getOrderStatus(params) { | ||
return this.getPrivate('sapi/v1/convert/orderStatus', params); | ||
} | ||
submitConvertLimitOrder(params) { | ||
return this.postPrivate('sapi/v1/convert/limit/placeOrder', params); | ||
} | ||
cancelConvertLimitOrder(params) { | ||
return this.postPrivate('sapi/v1/convert/limit/cancelOrder', params); | ||
} | ||
getConvertLimitOpenOrders() { | ||
return this.getPrivate('sapi/v1/convert/limit/queryOpenOrders'); | ||
} | ||
/** | ||
* @deprecated as of 2024-01-19 | ||
*/ | ||
getStakingHistory(params) { | ||
return this.getPrivate('sapi/v1/staking/stakingRecord', params); | ||
* | ||
* STAKING Endpoints - Account | ||
* | ||
**/ | ||
/** | ||
* @deprecated use getEthStakingAccountV2 instead | ||
**/ | ||
getEthStakingAccount() { | ||
return this.getPrivate('sapi/v1/eth-staking/account'); | ||
} | ||
getEthStakingAccountV2() { | ||
return this.getPrivate('sapi/v2/eth-staking/account'); | ||
} | ||
getEthStakingQuota() { | ||
return this.getPrivate('sapi/v1/eth-staking/eth/quota'); | ||
} | ||
/** | ||
* @deprecated as of 2024-01-19 | ||
*/ | ||
getPersonalLeftQuotaOfStakingProduct(params) { | ||
return this.getPrivate('sapi/v1/staking/personalLeftQuota', params); | ||
} | ||
* | ||
* STAKING Endpoints - Staking | ||
* | ||
**/ | ||
/** | ||
* @deprecated use subscribeEthStakingV2 instead | ||
**/ | ||
subscribeEthStakingV1(params) { | ||
@@ -1032,2 +972,10 @@ return this.postPrivate('sapi/v1/eth-staking/eth/stake', params); | ||
} | ||
wrapBeth(params) { | ||
return this.postPrivate('sapi/v1/eth-staking/wbeth/wrap', params); | ||
} | ||
/** | ||
* | ||
* STAKING Endpoints - History | ||
* | ||
**/ | ||
getEthStakingHistory(params) { | ||
@@ -1042,4 +990,4 @@ return this.getPrivate('sapi/v1/eth-staking/eth/history/stakingHistory', params); | ||
} | ||
getEthStakingQuota() { | ||
return this.getPrivate('sapi/v1/eth-staking/eth/quota'); | ||
getWbethRewardsHistory(params) { | ||
return this.getPrivate('sapi/v1/eth-staking/eth/history/wbethRewardsHistory', params); | ||
} | ||
@@ -1049,11 +997,2 @@ getEthRateHistory(params) { | ||
} | ||
getEthStakingAccount() { | ||
return this.getPrivate('sapi/v1/eth-staking/account'); | ||
} | ||
getEthStakingAccountV2() { | ||
return this.getPrivate('sapi/v2/eth-staking/account'); | ||
} | ||
wrapBeth(params) { | ||
return this.postPrivate('sapi/v1/eth-staking/wbeth/wrap', params); | ||
} | ||
getBethWrapHistory(params) { | ||
@@ -1065,73 +1004,40 @@ return this.getPrivate('sapi/v1/eth-staking/wbeth/history/wrapHistory', params); | ||
} | ||
getWbethRewardsHistory(params) { | ||
return this.getPrivate('sapi/v1/eth-staking/eth/history/wbethRewardsHistory', params); | ||
} | ||
/** | ||
* | ||
* Savings Endpoints | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
**/ | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
* @deprecated as of 2024-01-19 | ||
*/ | ||
getLeftDailyPurchaseQuotaFlexibleProduct(params) { | ||
return this.getPrivate(`sapi/v1/lending/daily/userLeftQuota`, params); | ||
getStakingProducts(params) { | ||
return this.getPrivate(`sapi/v1/staking/productList`, params); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
* @deprecated as of 2024-01-19 | ||
*/ | ||
getLeftDailyRedemptionQuotaFlexibleProduct(params) { | ||
return this.getPrivate(`sapi/v1/lending/daily/userRedemptionQuota`, params); | ||
getStakingProductPosition(params) { | ||
return this.getPrivate('sapi/v1/staking/position', params); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
* @deprecated as of 2024-01-19 | ||
*/ | ||
purchaseFixedAndActivityProject(params) { | ||
return this.postPrivate(`sapi/v1/lending/customizedFixed/purchase`, params); | ||
getStakingHistory(params) { | ||
return this.getPrivate('sapi/v1/staking/stakingRecord', params); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
* @deprecated as of 2024-01-19 | ||
*/ | ||
getFixedAndActivityProjects(params) { | ||
return this.getPrivate(`sapi/v1/lending/project/list`, params); | ||
getPersonalLeftQuotaOfStakingProduct(params) { | ||
return this.getPrivate('sapi/v1/staking/personalLeftQuota', params); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
*/ | ||
getFixedAndActivityProductPosition(params) { | ||
return this.getPrivate(`sapi/v1/lending/project/position/list`, params); | ||
* | ||
* COPY TRADING Endpoints - Future copy trading | ||
* | ||
**/ | ||
getFuturesLeadTraderStatus() { | ||
return this.getPrivate('sapi/v1/copyTrading/futures/userStatus'); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
*/ | ||
getLendingAccount() { | ||
return this.getPrivate(`sapi/v1/lending/union/account`); | ||
getFuturesLeadTradingSymbolWhitelist() { | ||
return this.getPrivate('sapi/v1/copyTrading/futures/leadSymbol'); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
*/ | ||
getPurchaseRecord(params) { | ||
return this.getPrivate(`sapi/v1/lending/union/purchaseRecord`, params); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
*/ | ||
getRedemptionRecord(params) { | ||
return this.getPrivate(`sapi/v1/lending/union/redemptionRecord`, params); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
*/ | ||
getInterestHistory(params) { | ||
return this.getPrivate(`sapi/v1/lending/union/interestHistory`, params); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
*/ | ||
changeFixedAndActivityPositionToDailyPosition(params) { | ||
return this.postPrivate(`sapi/v1/lending/positionChanged`, params); | ||
} | ||
/** | ||
* | ||
* Mining Endpoints | ||
* MINING Endpoints - rest api | ||
* | ||
@@ -1145,4 +1051,4 @@ **/ | ||
} | ||
getMinerDetails(params) { | ||
return this.getPrivate('sapi/v1/mining/worker/detail', params); | ||
getHashrateResales(params) { | ||
return this.getPrivate('sapi/v1/mining/hash-transfer/config/details/list', params); | ||
} | ||
@@ -1152,4 +1058,4 @@ getMiners(params) { | ||
} | ||
getMiningEarnings(params) { | ||
return this.getPrivate('sapi/v1/mining/payment/list', params); | ||
getMinerDetails(params) { | ||
return this.getPrivate('sapi/v1/mining/worker/detail', params); | ||
} | ||
@@ -1159,91 +1065,28 @@ getExtraBonuses(params) { | ||
} | ||
getHashrateResales(params) { | ||
return this.getPrivate('sapi/v1/mining/hash-transfer/config/details/list', params); | ||
getMiningEarnings(params) { | ||
return this.getPrivate('sapi/v1/mining/payment/list', params); | ||
} | ||
cancelHashrateResaleConfig(params) { | ||
return this.postPrivate('sapi/v1/mining/hash-transfer/config/cancel', params); | ||
} | ||
getHashrateResale(params) { | ||
return this.getPrivate('sapi/v1/mining/hash-transfer/profit/details', params); | ||
} | ||
submitHashrateResale(params) { | ||
return this.postPrivate('sapi/v1/mining/hash-transfer/config', params); | ||
getMiningAccountEarnings(params) { | ||
return this.getPrivate('sapi/v1/mining/payment/uid', params); | ||
} | ||
cancelHashrateResaleConfig(params) { | ||
return this.postPrivate('sapi/v1/mining/hash-transfer/config/cancel', params); | ||
} | ||
getMiningStatistics(params) { | ||
return this.getPrivate('sapi/v1/mining/statistics/user/status', params); | ||
} | ||
submitHashrateResale(params) { | ||
return this.postPrivate('sapi/v1/mining/hash-transfer/config', params); | ||
} | ||
getMiningAccounts(params) { | ||
return this.getPrivate('sapi/v1/mining/statistics/user/list', params); | ||
} | ||
getMiningAccountEarnings(params) { | ||
return this.getPrivate('sapi/v1/mining/payment/uid', params); | ||
} | ||
/** | ||
* | ||
* Futures Management Endpoints: | ||
* https://binance-docs.github.io/apidocs/spot/en/#futures | ||
* ALGO TRADING Endpoints - Future algo | ||
* | ||
* Note: to trade futures use the usdm-client or coinm-client. | ||
* MainClient only has the futures endpoints listed in the "spot" docs category, primarily used for transfers. | ||
* | ||
**/ | ||
/** | ||
* Execute transfer between spot account and futures account. | ||
* | ||
* Type: | ||
* - 1: transfer from spot account to USDT-Ⓜ futures account. | ||
* - 2: transfer from USDT-Ⓜ futures account to spot account. | ||
* - 3: transfer from spot account to COIN-Ⓜ futures account. | ||
* - 4: transfer from COIN-Ⓜ futures account to spot account. | ||
*/ | ||
submitNewFutureAccountTransfer(params) { | ||
return this.postPrivate(`sapi/v1/futures/transfer`, params); | ||
} | ||
getFutureAccountTransferHistory(params) { | ||
return this.getPrivate(`sapi/v1/futures/transfer`, params); | ||
} | ||
getFuturesTickLevelOrderbookDataLink(params) { | ||
return this.getPrivate('sapi/v1/futures/histDataLink', params); | ||
} | ||
/** | ||
* @deprecated as of 2023-09-25 | ||
*/ | ||
getCrossCollateralBorrowHistory(params) { | ||
return this.getPrivate(`sapi/v1/futures/loan/borrow/history`, params); | ||
} | ||
/** | ||
* @deprecated as of 2023-09-25 | ||
*/ | ||
getCrossCollateralRepaymentHistory(params) { | ||
return this.getPrivate(`sapi/v1/futures/loan/repay/history`, params); | ||
} | ||
/** | ||
* @deprecated as of 2023-09-25 | ||
*/ | ||
getCrossCollateralWalletV2() { | ||
return this.getPrivate(`sapi/v2/futures/loan/wallet`); | ||
} | ||
/** | ||
* @deprecated as of 2023-09-25 | ||
*/ | ||
getAdjustCrossCollateralLTVHistory(params) { | ||
return this.getPrivate(`sapi/v1/futures/loan/adjustCollateral/history`, params); | ||
} | ||
/** | ||
* @deprecated as of 2023-09-25 | ||
*/ | ||
getCrossCollateralLiquidationHistory(params) { | ||
return this.getPrivate(`sapi/v1/futures/loan/liquidationHistory`, params); | ||
} | ||
/** | ||
* @deprecated as of 2023-09-25 | ||
*/ | ||
getCrossCollateralInterestHistory(params) { | ||
return this.getPrivate(`sapi/v1/futures/loan/interestHistory`, params); | ||
} | ||
/** | ||
* | ||
* Futures Algo Endpoints | ||
* | ||
**/ | ||
submitVpNewOrder(params) { | ||
@@ -1260,2 +1103,5 @@ this.validateOrderId(params, 'clientAlgoId'); | ||
} | ||
getAlgoSubOrders(params) { | ||
return this.getPrivate('sapi/v1/algo/futures/subOrders', params); | ||
} | ||
getAlgoOpenOrders() { | ||
@@ -1267,8 +1113,5 @@ return this.getPrivate('sapi/v1/algo/futures/openOrders'); | ||
} | ||
getAlgoSubOrders(params) { | ||
return this.getPrivate('sapi/v1/algo/futures/subOrders', params); | ||
} | ||
/** | ||
* | ||
* Spot Algo Endpoints | ||
* ALGO TRADING Endpoints - Spot algo | ||
* | ||
@@ -1283,2 +1126,5 @@ **/ | ||
} | ||
getSpotAlgoSubOrders(params) { | ||
return this.getPrivate('sapi/v1/algo/spot/subOrders', params); | ||
} | ||
getSpotAlgoOpenOrders() { | ||
@@ -1290,110 +1136,223 @@ return this.getPrivate('sapi/v1/algo/spot/openOrders'); | ||
} | ||
getSpotAlgoSubOrders(params) { | ||
return this.getPrivate('sapi/v1/algo/spot/subOrders', params); | ||
/** | ||
* | ||
* CRYPTO LOAN Endpoints - Flexible rate - Market data | ||
* | ||
**/ | ||
getCryptoLoanFlexibleCollateralAssets(params) { | ||
return this.getPrivate('sapi/v2/loan/flexible/collateral/data', params); | ||
} | ||
getCryptoLoanFlexibleAssets(params) { | ||
return this.getPrivate('sapi/v2/loan/flexible/loanable/data', params); | ||
} | ||
/** | ||
* | ||
* Portfolio Margin Pro | ||
* CRYPTO LOAN Endpoints - Flexible rate - Trade | ||
* | ||
**/ | ||
getPortfolioMarginProAccountInfo() { | ||
return this.getPrivate('sapi/v1/portfolio/account'); | ||
borrowCryptoLoanFlexible(params) { | ||
return this.postPrivate('sapi/v2/loan/flexible/borrow', params); | ||
} | ||
getPortfolioMarginProCollateralRate() { | ||
return this.get('sapi/v1/portfolio/collateralRate'); | ||
repayCryptoLoanFlexible(params) { | ||
return this.postPrivate('sapi/v2/loan/flexible/repay', params); | ||
} | ||
getPortfolioMarginProBankruptcyLoanAmount() { | ||
return this.getPrivate('sapi/v1/portfolio/pmLoan'); | ||
adjustCryptoLoanFlexibleLTV(params) { | ||
return this.postPrivate('sapi/v2/loan/flexible/adjust/ltv', params); | ||
} | ||
repayPortfolioMarginProBankruptcyLoan(params) { | ||
return this.postPrivate('sapi/v1/portfolio/repay', params); | ||
/** | ||
* | ||
* CRYPTO LOAN Endpoints - Flexible rate - User info | ||
* | ||
**/ | ||
getCryptoLoanFlexibleLTVAdjustmentHistory(params) { | ||
return this.getPrivate('sapi/v2/loan/flexible/ltv/adjustment/history', params); | ||
} | ||
getPortfolioMarginProInterestHistory(params) { | ||
return this.getPrivate('sapi/v1/portfolio/interest-history', params); | ||
getLoanFlexibleBorrowHistory(params) { | ||
return this.getPrivate('sapi/v2/loan/flexible/borrow/history', params); | ||
} | ||
getPortfolioMarginIndexPrice(params) { | ||
return this.get('sapi/v1/portfolio/asset-index-price', params); | ||
getCryptoLoanFlexibleOngoingOrders(params) { | ||
return this.getPrivate('sapi/v2/loan/flexible/ongoing/orders', params); | ||
} | ||
submitPortfolioMarginProFullTransfer() { | ||
return this.postPrivate('sapi/v1/portfolio/auto-collection'); | ||
getLoanFlexibleRepaymentHistory(params) { | ||
return this.getPrivate('sapi/v2/loan/flexible/repay/history', params); | ||
} | ||
submitPortfolioMarginProSpecificTransfer(params) { | ||
return this.postPrivate('sapi/v1/portfolio/asset-collection', params); | ||
/** | ||
* | ||
* CRYPTO LOAN Endpoints - Stable rate - Market data | ||
* | ||
**/ | ||
getCryptoLoanLoanableAssets(params) { | ||
return this.getPrivate('sapi/v1/loan/loanable/data', params); | ||
} | ||
bnbTransfer(params) { | ||
return this.postPrivate('sapi/v1/portfolio/bnb-transfer', params); | ||
getCryptoLoanCollateralRepayRate(params) { | ||
return this.getPrivate('sapi/v1/loan/repay/collateral/rate', params); | ||
} | ||
updateAutoRepayFuturesStatus(params) { | ||
return this.postPrivate('sapi/v1/portfolio/repay-futures-switch', params); | ||
getCryptoLoanCollateralAssetsData(params) { | ||
return this.getPrivate('sapi/v1/loan/collateral/data', params); | ||
} | ||
getAutoRepayFuturesStatus() { | ||
return this.getPrivate('sapi/v1/portfolio/repay-futures-switch'); | ||
getCryptoLoansIncomeHistory(params) { | ||
return this.getPrivate('sapi/v1/loan/income', params); | ||
} | ||
repayFuturesNegativeBalance() { | ||
return this.postPrivate('sapi/v1/portfolio/repay-futures-negative-balance'); | ||
/** | ||
* | ||
* CRYPTO LOAN Endpoints - Stable rate - Trade | ||
* | ||
**/ | ||
borrowCryptoLoan(params) { | ||
return this.postPrivate('sapi/v1/loan/borrow', params); | ||
} | ||
getPortfolioMarginAssetLeverage() { | ||
return this.getPrivate('sapi/v1/portfolio/margin-asset-leverage'); | ||
repayCryptoLoan(params) { | ||
return this.postPrivate('sapi/v1/loan/repay', params); | ||
} | ||
adjustCryptoLoanLTV(params) { | ||
return this.postPrivate('sapi/v1/loan/adjust/ltv', params); | ||
} | ||
customizeCryptoLoanMarginCall(params) { | ||
return this.postPrivate('sapi/v1/loan/customize/margin_call', params); | ||
} | ||
/** | ||
* | ||
* BLVT Endpoints | ||
* CRYPTO LOAN Endpoints - Stable rate - User info | ||
* | ||
**/ | ||
getBlvtInfo(params) { | ||
return this.get('sapi/v1/blvt/tokenInfo', params); | ||
getCryptoLoanOngoingOrders(params) { | ||
return this.getPrivate('sapi/v1/loan/ongoing/orders', params); | ||
} | ||
subscribeBlvt(params) { | ||
return this.postPrivate('sapi/v1/blvt/subscribe', params); | ||
getCryptoLoanBorrowHistory(params) { | ||
return this.getPrivate('sapi/v1/loan/borrow/history', params); | ||
} | ||
getBlvtSubscriptionRecord(params) { | ||
return this.getPrivate('sapi/v1/blvt/subscribe/record', params); | ||
getCryptoLoanLTVAdjustmentHistory(params) { | ||
return this.getPrivate('sapi/v1/loan/ltv/adjustment/history', params); | ||
} | ||
redeemBlvt(params) { | ||
return this.postPrivate('sapi/v1/blvt/redeem', params); | ||
getCryptoLoanRepaymentHistory(params) { | ||
return this.getPrivate('sapi/v1/loan/repay/history', params); | ||
} | ||
getBlvtRedemptionRecord(params) { | ||
return this.getPrivate('sapi/v1/blvt/redeem/record', params); | ||
/** | ||
* | ||
* SIMPLE EARN Endpoints - Account | ||
* | ||
**/ | ||
getSimpleEarnAccount() { | ||
return this.getPrivate(`/sapi/v1/simple-earn/account`); | ||
} | ||
getBlvtUserLimitInfo(params) { | ||
return this.getPrivate('sapi/v1/blvt/userLimit', params); | ||
getFlexibleSavingProducts(params) { | ||
return this.getPrivate(`/sapi/v1/simple-earn/flexible/list`, params); | ||
} | ||
getSimpleEarnLockedProductList(params) { | ||
return this.getPrivate(`/sapi/v1/simple-earn/locked/list`, params); | ||
} | ||
getFlexibleProductPosition(params) { | ||
return this.getPrivate(`/sapi/v1/simple-earn/flexible/position`, params); | ||
} | ||
getLockedProductPosition(params) { | ||
return this.getPrivate(`/sapi/v1/simple-earn/locked/position`, params); | ||
} | ||
getFlexiblePersonalLeftQuota(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/flexible/personalLeftQuota', params); | ||
} | ||
getLockedPersonalLeftQuota(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/locked/personalLeftQuota', params); | ||
} | ||
/** | ||
* | ||
* Fiat Endpoints | ||
* SIMPLE EARN Endpoints - Earn | ||
* | ||
**/ | ||
getFiatOrderHistory(params) { | ||
return this.getPrivate('sapi/v1/fiat/orders', params); | ||
purchaseFlexibleProduct(params) { | ||
return this.postPrivate(`/sapi/v1/simple-earn/flexible/subscribe`, params); | ||
} | ||
getFiatPaymentsHistory(params) { | ||
return this.getPrivate('sapi/v1/fiat/payments', params); | ||
subscribeSimpleEarnLockedProduct(params) { | ||
return this.postPrivate(`/sapi/v1/simple-earn/locked/subscribe`, params); | ||
} | ||
redeemFlexibleProduct(params) { | ||
return this.postPrivate(`/sapi/v1/simple-earn/flexible/redeem`, params); | ||
} | ||
redeemLockedProduct(params) { | ||
return this.postPrivate(`/sapi/v1/simple-earn/locked/redeem`, params); | ||
} | ||
setFlexibleAutoSubscribe(params) { | ||
return this.postPrivate('sapi/v1/simple-earn/flexible/setAutoSubscribe', params); | ||
} | ||
setLockedAutoSubscribe(params) { | ||
return this.postPrivate('sapi/v1/simple-earn/locked/setAutoSubscribe', params); | ||
} | ||
getFlexibleSubscriptionPreview(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/flexible/subscriptionPreview', params); | ||
} | ||
getLockedSubscriptionPreview(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/locked/subscriptionPreview', params); | ||
} | ||
setLockedProductRedeemOption(params) { | ||
return this.postPrivate('sapi/v1/simple-earn/locked/setRedeemOption', params); | ||
} | ||
/** | ||
* | ||
* C2C Endpoints | ||
* SIMPLE EARN Endpoints - History | ||
* | ||
**/ | ||
getC2CTradeHistory(params) { | ||
return this.getPrivate('sapi/v1/c2c/orderMatch/listUserOrderHistory', params); | ||
getFlexibleSubscriptionRecord(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/flexible/history/subscriptionRecord', params); | ||
} | ||
getLockedSubscriptionRecord(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/locked/history/subscriptionRecord', params); | ||
} | ||
getFlexibleRedemptionRecord(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/flexible/history/redemptionRecord', params); | ||
} | ||
getLockedRedemptionRecord(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/locked/history/redemptionRecord', params); | ||
} | ||
getFlexibleRewardsHistory(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/flexible/history/rewardsRecord', params); | ||
} | ||
getLockedRewardsHistory(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/locked/history/rewardsRecord', params); | ||
} | ||
getCollateralRecord(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/flexible/history/collateralRecord', params); | ||
} | ||
getRateHistory(params) { | ||
return this.getPrivate('sapi/v1/simple-earn/flexible/history/rateHistory', params); | ||
} | ||
/** | ||
* | ||
* VIP Loans Endpoints | ||
* VIP LOAN Endpoints - Market Data | ||
* | ||
**/ | ||
getVipBorrowInterestRate(params) { | ||
return this.getPrivate('sapi/v1/loan/vip/request/interestRate', params); | ||
} | ||
getVipLoanableAssets(params) { | ||
return this.getPrivate('sapi/v1/loan/vip/loanable/data', params); | ||
} | ||
getVipCollateralAssets(params) { | ||
return this.getPrivate('sapi/v1/loan/vip/collateral/data', params); | ||
} | ||
/** | ||
* | ||
* VIP LOAN Endpoints - User Info | ||
* | ||
**/ | ||
getVipLoanOpenOrders(params) { | ||
return this.getPrivate('sapi/v1/loan/vip/ongoing/orders', params); | ||
} | ||
repayVipLoan(params) { | ||
return this.postPrivate('sapi/v1/loan/vip/repay', params); | ||
} | ||
getVipLoanRepaymentHistory(params) { | ||
return this.getPrivate('sapi/v1/loan/vip/repay/history', params); | ||
} | ||
checkVipCollateralAccount(params) { | ||
return this.getPrivate('sapi/v1/loan/vip/collateral/account', params); | ||
} | ||
getVipApplicationStatus(params) { | ||
return this.getPrivate('sapi/v1/loan/vip/request/data', params); | ||
} | ||
/** | ||
* | ||
* VIP LOAN Endpoints - Trade | ||
* | ||
**/ | ||
renewVipLoan(params) { | ||
return this.postPrivate('sapi/v1/loan/vip/renew', params); | ||
} | ||
checkVipCollateralAccount(params) { | ||
return this.getPrivate('sapi/v1/loan/vip/collateral/account', params); | ||
repayVipLoan(params) { | ||
return this.postPrivate('sapi/v1/loan/vip/repay', params); | ||
} | ||
@@ -1403,97 +1362,181 @@ borrowVipLoan(params) { | ||
} | ||
getVipLoanableAssets(params) { | ||
return this.getPrivate('sapi/v1/loan/vip/loanable/data', params); | ||
/** | ||
* | ||
* DUAL INVESTMENT Endpoints - Market Data | ||
* | ||
**/ | ||
getDualInvestmentProducts(params) { | ||
return this.getPrivate('sapi/v1/dci/product/list', params); | ||
} | ||
getVipCollateralAssets(params) { | ||
return this.getPrivate('sapi/v1/loan/vip/collateral/data', params); | ||
/** | ||
* | ||
* DUAL INVESTMENT Endpoints - Trade | ||
* | ||
**/ | ||
subscribeDualInvestmentProduct(params) { | ||
return this.postPrivate('sapi/v1/dci/product/subscribe', params); | ||
} | ||
getVipApplicationStatus(params) { | ||
return this.getPrivate('sapi/v1/loan/vip/request/data', params); | ||
getDualInvestmentPositions(params) { | ||
return this.getPrivate('sapi/v1/dci/product/positions', params); | ||
} | ||
getVipBorrowInterestRate(params) { | ||
return this.getPrivate('sapi/v1/loan/vip/request/interestRate', params); | ||
getDualInvestmentAccounts() { | ||
return this.getPrivate('sapi/v1/dci/product/accounts'); | ||
} | ||
updateAutoCompoundStatus(params) { | ||
return this.postPrivate('sapi/v1/dci/product/auto_compound/edit-status', params); | ||
} | ||
/** | ||
* | ||
* Crypto Loans Endpoints | ||
* GIFT CARD Endpoints - Market Data | ||
* | ||
**/ | ||
getCryptoLoansIncomeHistory(params) { | ||
return this.getPrivate('sapi/v1/loan/income', params); | ||
createGiftCard(params) { | ||
return this.postPrivate('sapi/v1/giftcard/createCode', params); | ||
} | ||
borrowCryptoLoan(params) { | ||
return this.postPrivate('sapi/v1/loan/borrow', params); | ||
createDualTokenGiftCard(params) { | ||
return this.postPrivate('sapi/v1/giftcard/buyCode', params); | ||
} | ||
getCryptoLoanBorrowHistory(params) { | ||
return this.getPrivate('sapi/v1/loan/borrow/history', params); | ||
redeemGiftCard(params) { | ||
return this.postPrivate('sapi/v1/giftcard/redeemCode', params); | ||
} | ||
getCryptoLoanOngoingOrders(params) { | ||
return this.getPrivate('sapi/v1/loan/ongoing/orders', params); | ||
verifyGiftCard(params) { | ||
return this.getPrivate('sapi/v1/giftcard/verify', params); | ||
} | ||
repayCryptoLoan(params) { | ||
return this.postPrivate('sapi/v1/loan/repay', params); | ||
getTokenLimit(params) { | ||
return this.getPrivate('sapi/v1/giftcard/buyCode/token-limit', params); | ||
} | ||
getCryptoLoanRepaymentHistory(params) { | ||
return this.getPrivate('sapi/v1/loan/repay/history', params); | ||
getRsaPublicKey() { | ||
return this.getPrivate('sapi/v1/giftcard/cryptography/rsa-public-key'); | ||
} | ||
adjustCryptoLoanLTV(params) { | ||
return this.postPrivate('sapi/v1/loan/adjust/ltv', params); | ||
/** | ||
* | ||
* NFT Endpoints - REST api | ||
* | ||
**/ | ||
getNftTransactionHistory(params) { | ||
return this.getPrivate('sapi/v1/nft/history/transactions', params); | ||
} | ||
getCryptoLoanLTVAdjustmentHistory(params) { | ||
return this.getPrivate('sapi/v1/loan/ltv/adjustment/history', params); | ||
getNftDepositHistory(params) { | ||
return this.getPrivate('sapi/v1/nft/history/deposit', params); | ||
} | ||
getCryptoLoanLoanableAssets(params) { | ||
return this.getPrivate('sapi/v1/loan/loanable/data', params); | ||
getNftWithdrawHistory(params) { | ||
return this.getPrivate('sapi/v1/nft/history/withdraw', params); | ||
} | ||
getCryptoLoanCollateralAssetsData(params) { | ||
return this.getPrivate('sapi/v1/loan/collateral/data', params); | ||
getNftAsset(params) { | ||
return this.getPrivate('sapi/v1/nft/user/getAsset', params); | ||
} | ||
getCryptoLoanCollateralRepayRate(params) { | ||
return this.getPrivate('sapi/v1/loan/repay/collateral/rate', params); | ||
/** | ||
* | ||
* C2C Endpoints | ||
* | ||
**/ | ||
getC2CTradeHistory(params) { | ||
return this.getPrivate('sapi/v1/c2c/orderMatch/listUserOrderHistory', params); | ||
} | ||
customizeCryptoLoanMarginCall(params) { | ||
return this.postPrivate('sapi/v1/loan/customize/margin_call', params); | ||
/** | ||
* | ||
* FIAT Endpoints - REST api | ||
* | ||
**/ | ||
getFiatOrderHistory(params) { | ||
return this.getPrivate('sapi/v1/fiat/orders', params); | ||
} | ||
borrowCryptoLoanFlexible(params) { | ||
return this.postPrivate('sapi/v2/loan/flexible/borrow', params); | ||
getFiatPaymentsHistory(params) { | ||
return this.getPrivate('sapi/v1/fiat/payments', params); | ||
} | ||
getCryptoLoanFlexibleOngoingOrders(params) { | ||
return this.getPrivate('sapi/v2/loan/flexible/ongoing/orders', params); | ||
/** | ||
* | ||
* Rebate Endpoints | ||
* | ||
**/ | ||
getSpotRebateHistoryRecords(params) { | ||
return this.getPrivate('sapi/v1/rebate/taxQuery', params); | ||
} | ||
getLoanFlexibleBorrowHistory(params) { | ||
return this.getPrivate('sapi/v2/loan/flexible/borrow/history', params); | ||
/** | ||
* | ||
* DERIVATIVES - Portfolio Margin Pro - Market Data | ||
* This is in mainclient because it shares the same base url | ||
* | ||
**/ | ||
getPortfolioMarginIndexPrice(params) { | ||
return this.get('sapi/v1/portfolio/asset-index-price', params); | ||
} | ||
repayCryptoLoanFlexible(params) { | ||
return this.postPrivate('sapi/v2/loan/flexible/repay', params); | ||
getPortfolioMarginAssetLeverage() { | ||
return this.getPrivate('sapi/v1/portfolio/margin-asset-leverage'); | ||
} | ||
getLoanFlexibleRepaymentHistory(params) { | ||
return this.getPrivate('sapi/v2/loan/flexible/repay/history', params); | ||
/** | ||
* | ||
* DERIVATIVES - Portfolio Margin Pro - Account | ||
* This is in mainclient because it shares the same base url | ||
* | ||
**/ | ||
getPortfolioMarginProCollateralRate() { | ||
return this.get('sapi/v1/portfolio/collateralRate'); | ||
} | ||
adjustCryptoLoanFlexibleLTV(params) { | ||
return this.postPrivate('sapi/v2/loan/flexible/adjust/ltv', params); | ||
getPortfolioMarginProAccountInfo() { | ||
return this.getPrivate('sapi/v1/portfolio/account'); | ||
} | ||
getCryptoLoanFlexibleLTVAdjustmentHistory(params) { | ||
return this.getPrivate('sapi/v2/loan/flexible/ltv/adjustment/history', params); | ||
bnbTransfer(params) { | ||
return this.postPrivate('sapi/v1/portfolio/bnb-transfer', params); | ||
} | ||
getCryptoLoanFlexibleAssets(params) { | ||
return this.getPrivate('sapi/v2/loan/flexible/loanable/data', params); | ||
submitPortfolioMarginProFullTransfer() { | ||
return this.postPrivate('sapi/v1/portfolio/auto-collection'); | ||
} | ||
getCryptoLoanFlexibleCollateralAssets(params) { | ||
return this.getPrivate('sapi/v2/loan/flexible/collateral/data', params); | ||
submitPortfolioMarginProSpecificTransfer(params) { | ||
return this.postPrivate('sapi/v1/portfolio/asset-collection', params); | ||
} | ||
repayPortfolioMarginProBankruptcyLoan(params) { | ||
return this.postPrivate('sapi/v1/portfolio/repay', params); | ||
} | ||
getPortfolioMarginProBankruptcyLoanAmount() { | ||
return this.getPrivate('sapi/v1/portfolio/pmLoan'); | ||
} | ||
repayFuturesNegativeBalance() { | ||
return this.postPrivate('sapi/v1/portfolio/repay-futures-negative-balance'); | ||
} | ||
updateAutoRepayFuturesStatus(params) { | ||
return this.postPrivate('sapi/v1/portfolio/repay-futures-switch', params); | ||
} | ||
getAutoRepayFuturesStatus() { | ||
return this.getPrivate('sapi/v1/portfolio/repay-futures-switch'); | ||
} | ||
getPortfolioMarginProInterestHistory(params) { | ||
return this.getPrivate('sapi/v1/portfolio/interest-history', params); | ||
} | ||
/** | ||
* | ||
* Copy trading endpoints | ||
* DERIVATIVES - Futures Data - Market | ||
* This is in mainclient because it shares the same base url | ||
* | ||
**/ | ||
getFuturesLeadTraderStatus() { | ||
return this.getPrivate('sapi/v1/copyTrading/futures/userStatus'); | ||
getFuturesTickLevelOrderbookDataLink(params) { | ||
return this.getPrivate('sapi/v1/futures/histDataLink', params); | ||
} | ||
getFuturesLeadTradingSymbolWhitelist() { | ||
return this.getPrivate('sapi/v1/copyTrading/futures/leadSymbol'); | ||
/** | ||
* | ||
* BLVT Endpoints | ||
* BLVT category is possibly @deprecated, found only in old docs | ||
**/ | ||
getBlvtInfo(params) { | ||
return this.get('sapi/v1/blvt/tokenInfo', params); | ||
} | ||
subscribeBlvt(params) { | ||
return this.postPrivate('sapi/v1/blvt/subscribe', params); | ||
} | ||
getBlvtSubscriptionRecord(params) { | ||
return this.getPrivate('sapi/v1/blvt/subscribe/record', params); | ||
} | ||
redeemBlvt(params) { | ||
return this.postPrivate('sapi/v1/blvt/redeem', params); | ||
} | ||
getBlvtRedemptionRecord(params) { | ||
return this.getPrivate('sapi/v1/blvt/redeem/record', params); | ||
} | ||
getBlvtUserLimitInfo(params) { | ||
return this.getPrivate('sapi/v1/blvt/userLimit', params); | ||
} | ||
/** | ||
* | ||
* Pay endpoints | ||
* | ||
* Found only in old docs, possibly @deprecated | ||
**/ | ||
@@ -1505,82 +1548,186 @@ getPayTransactions(params) { | ||
* | ||
* Convert endpoints | ||
* | ||
**/ | ||
getConvertPairs(params) { | ||
return this.getPrivate('sapi/v1/convert/exchangeInfo', params); | ||
* EXCHANGE LINK - Account Endpoints | ||
* https://developers.binance.com/docs/binance_link | ||
*/ | ||
createBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccount', params); | ||
} | ||
getConvertAssetInfo() { | ||
return this.getPrivate('sapi/v1/convert/assetInfo'); | ||
getBrokerSubAccount(params) { | ||
return this.getPrivate('sapi/v1/broker/subAccount', params); | ||
} | ||
convertQuoteRequest(params) { | ||
return this.postPrivate('sapi/v1/convert/getQuote', params); | ||
enableMarginBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccount/futures', params); | ||
} | ||
acceptQuoteRequest(params) { | ||
return this.postPrivate('sapi/v1/convert/acceptQuote', params); | ||
createApiKeyBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccountApi', params); | ||
} | ||
getOrderStatus(params) { | ||
return this.getPrivate('sapi/v1/convert/orderStatus', params); | ||
changePermissionApiKeyBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccountApi/permission', params); | ||
} | ||
submitConvertLimitOrder(params) { | ||
return this.postPrivate('sapi/v1/convert/limit/placeOrder', params); | ||
changeComissionBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccountApi/permission', params); | ||
} | ||
cancelConvertLimitOrder(params) { | ||
return this.postPrivate('sapi/v1/convert/limit/cancelOrder', params); | ||
enableUniversalTransferApiKeyBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccountApi/permission/universalTransfer', params); | ||
} | ||
getConvertLimitOpenOrders() { | ||
return this.getPrivate('sapi/v1/convert/limit/queryOpenOrders'); | ||
updateIpRestrictionForSubAccountApiKey(params) { | ||
return this.postPrivate('sapi/v2/broker/subAccountApi/ipRestriction', params); | ||
} | ||
getConvertTradeHistory(params) { | ||
return this.getPrivate('sapi/v1/convert/tradeFlow', params); | ||
deleteIPRestrictionForSubAccountApiKey(params) { | ||
return this.deletePrivate('sapi/v1/broker/subAccountApi/ipRestriction/ipList', params); | ||
} | ||
deleteApiKeyBrokerSubAccount(params) { | ||
return this.deletePrivate('sapi/v1/broker/subAccountApi', params); | ||
} | ||
getSubAccountBrokerIpRestriction(params) { | ||
return this.getPrivate('sapi/v1/broker/subAccountApi/ipRestriction', params); | ||
} | ||
getApiKeyBrokerSubAccount(params) { | ||
return this.getPrivate('sapi/v1/broker/subAccountApi', params); | ||
} | ||
getBrokerInfo() { | ||
return this.getPrivate('sapi/v1/broker/info'); | ||
} | ||
/** | ||
* | ||
* Rebate Endpoints | ||
* | ||
**/ | ||
getSpotRebateHistoryRecords(params) { | ||
return this.getPrivate('sapi/v1/rebate/taxQuery', params); | ||
* EXCHANGE LINK - Account Endpoints | ||
* https://developers.binance.com/docs/binance_link | ||
*/ | ||
transferBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/transfer', params); | ||
} | ||
getBrokerSubAccountHistory(params) { | ||
return this.getPrivate('sapi/v1/broker/transfer', params); | ||
} | ||
submitBrokerSubFuturesTransfer(params) { | ||
return this.postPrivate('sapi/v1/broker/transfer/futures', params); | ||
} | ||
getSubAccountFuturesTransferHistory(params) { | ||
return this.getPrivate('sapi/v1/broker/transfer/futures', params); | ||
} | ||
universalTransferBroker(params) { | ||
return this.postPrivate('sapi/v1/broker/universalTransfer', params); | ||
} | ||
getUniversalTransferBroker(params) { | ||
return this.getPrivate('sapi/v1/broker/universalTransfer', params); | ||
} | ||
/** | ||
* | ||
* NFT Endpoints | ||
* EXCHANGE LINK - Fee Endpoints | ||
* https://developers.binance.com/docs/binance_link | ||
*/ | ||
/** | ||
* | ||
* @deprecated | ||
*/ | ||
// USD & Coin-M can be found under API getIncome() (find "API rebate" in results) | ||
getBrokerSpotRebateHistory(days, customerId) { | ||
if (days === 7) { | ||
return this.getPrivate('sapi/v1/apiReferral/rebate/recentRecord', { | ||
customerId, | ||
}); | ||
} | ||
if (days === 30) { | ||
return this.getPrivate('sapi/v1/apiReferral/rebate/historicalRecord', { | ||
customerId, | ||
}); | ||
} | ||
} | ||
/** | ||
* Broker Endpoints - only on old docs | ||
* @deprecated, found only in old docs | ||
* Use EXCHANGE LINK endpoints instead - https://developers.binance.com/docs/binance_link | ||
*/ | ||
/** | ||
* @deprecated, found only in old docs | ||
* Use EXCHANGE LINK endpoints instead | ||
**/ | ||
getNftTransactionHistory(params) { | ||
return this.getPrivate('sapi/v1/nft/history/transactions', params); | ||
getBrokerIfNewSpotUser() { | ||
return this.getPrivate('sapi/v1/apiReferral/ifNewUser'); | ||
} | ||
getNftDepositHistory(params) { | ||
return this.getPrivate('sapi/v1/nft/history/deposit', params); | ||
/** | ||
* @deprecated, found only in old docs | ||
* Use EXCHANGE LINK endpoints instead | ||
**/ | ||
getBrokerSubAccountDepositHistory(params) { | ||
return this.getPrivate('sapi/v1/bv1/apiReferral/ifNewUser', params); | ||
} | ||
getNftWithdrawHistory(params) { | ||
return this.getPrivate('sapi/v1/nft/history/withdraw', params); | ||
/** | ||
* @deprecated, found only in old docs | ||
* Use EXCHANGE LINK endpoints instead | ||
**/ | ||
getBrokerUserCustomisedId(market) { | ||
const prefix = market === 'spot' ? 'sapi' : 'fapi'; | ||
return this.getPrivate(prefix + '/v1/apiReferral/userCustomization'); | ||
} | ||
getNftAsset(params) { | ||
return this.getPrivate('sapi/v1/nft/user/getAsset', params); | ||
/** | ||
* @deprecated, found only in old docs | ||
* Use EXCHANGE LINK endpoints instead | ||
**/ | ||
enableFuturesBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccount', params); | ||
} | ||
/** | ||
* @deprecated, found only in old docs | ||
* Use EXCHANGE LINK endpoints instead | ||
**/ | ||
enableMarginApiKeyBrokerSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccount/margin', params); | ||
} | ||
/** | ||
* Validate syntax meets requirements set by binance. Log warning if not. | ||
*/ | ||
validateOrderId(params, orderIdProperty) { | ||
const apiCategory = 'spot'; | ||
if (!params[orderIdProperty]) { | ||
params[orderIdProperty] = (0, requestUtils_1.generateNewOrderId)(apiCategory); | ||
return; | ||
} | ||
const expectedOrderIdPrefix = `x-${(0, requestUtils_1.getOrderIdPrefix)(apiCategory)}`; | ||
if (!params[orderIdProperty].startsWith(expectedOrderIdPrefix)) { | ||
(0, requestUtils_1.logInvalidOrderId)(orderIdProperty, expectedOrderIdPrefix, params); | ||
} | ||
} | ||
/** | ||
* | ||
* Binance GiftCard Endpoints | ||
* User Data Stream Endpoints | ||
* | ||
**/ | ||
createGiftCard(params) { | ||
return this.postPrivate('sapi/v1/giftcard/createCode', params); | ||
// spot | ||
getSpotUserDataListenKey() { | ||
return this.post('api/v3/userDataStream'); | ||
} | ||
createDualTokenGiftCard(params) { | ||
return this.postPrivate('sapi/v1/giftcard/buyCode', params); | ||
keepAliveSpotUserDataListenKey(listenKey) { | ||
return this.put(`api/v3/userDataStream?listenKey=${listenKey}`); | ||
} | ||
redeemGiftCard(params) { | ||
return this.postPrivate('sapi/v1/giftcard/redeemCode', params); | ||
closeSpotUserDataListenKey(listenKey) { | ||
return this.delete(`api/v3/userDataStream?listenKey=${listenKey}`); | ||
} | ||
verifyGiftCard(params) { | ||
return this.getPrivate('sapi/v1/giftcard/verify', params); | ||
// margin | ||
getMarginUserDataListenKey() { | ||
return this.post('sapi/v1/userDataStream'); | ||
} | ||
getRsaPublicKey() { | ||
return this.getPrivate('sapi/v1/giftcard/cryptography/rsa-public-key'); | ||
keepAliveMarginUserDataListenKey(listenKey) { | ||
return this.put(`sapi/v1/userDataStream?listenKey=${listenKey}`); | ||
} | ||
getTokenLimit(params) { | ||
return this.getPrivate('sapi/v1/giftcard/buyCode/token-limit', params); | ||
closeMarginUserDataListenKey(listenKey) { | ||
return this.delete(`sapi/v1/userDataStream?listenKey=${listenKey}`); | ||
} | ||
// isolated margin | ||
getIsolatedMarginUserDataListenKey(params) { | ||
return this.post(`sapi/v1/userDataStream/isolated?${(0, requestUtils_1.serialiseParams)(params)}`); | ||
} | ||
keepAliveIsolatedMarginUserDataListenKey(params) { | ||
return this.put(`sapi/v1/userDataStream/isolated?${(0, requestUtils_1.serialiseParams)(params)}`); | ||
} | ||
closeIsolatedMarginUserDataListenKey(params) { | ||
return this.delete(`sapi/v1/userDataStream/isolated?${(0, requestUtils_1.serialiseParams)(params)}`); | ||
} | ||
/** | ||
* | ||
* DEPRECATED ENDPOINTS | ||
* | ||
**/ | ||
/** | ||
* | ||
* BSwap Endpoints | ||
@@ -1614,15 +1761,89 @@ * @deprecated as of 2024-01-19 | ||
/** | ||
* Validate syntax meets requirements set by binance. Log warning if not. | ||
* | ||
* Savings Endpoints | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
**/ | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
*/ | ||
validateOrderId(params, orderIdProperty) { | ||
const apiCategory = 'spot'; | ||
if (!params[orderIdProperty]) { | ||
params[orderIdProperty] = (0, requestUtils_1.generateNewOrderId)(apiCategory); | ||
return; | ||
} | ||
const expectedOrderIdPrefix = `x-${(0, requestUtils_1.getOrderIdPrefix)(apiCategory)}`; | ||
if (!params[orderIdProperty].startsWith(expectedOrderIdPrefix)) { | ||
(0, requestUtils_1.logInvalidOrderId)(orderIdProperty, expectedOrderIdPrefix, params); | ||
} | ||
getLeftDailyPurchaseQuotaFlexibleProduct(params) { | ||
return this.getPrivate(`sapi/v1/lending/daily/userLeftQuota`, params); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
*/ | ||
getLeftDailyRedemptionQuotaFlexibleProduct(params) { | ||
return this.getPrivate(`sapi/v1/lending/daily/userRedemptionQuota`, params); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
*/ | ||
purchaseFixedAndActivityProject(params) { | ||
return this.postPrivate(`sapi/v1/lending/customizedFixed/purchase`, params); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
*/ | ||
getFixedAndActivityProjects(params) { | ||
return this.getPrivate(`sapi/v1/lending/project/list`, params); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
*/ | ||
getFixedAndActivityProductPosition(params) { | ||
return this.getPrivate(`sapi/v1/lending/project/position/list`, params); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
*/ | ||
getLendingAccount() { | ||
return this.getPrivate(`sapi/v1/lending/union/account`); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
*/ | ||
getPurchaseRecord(params) { | ||
return this.getPrivate(`sapi/v1/lending/union/purchaseRecord`, params); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
*/ | ||
getRedemptionRecord(params) { | ||
return this.getPrivate(`sapi/v1/lending/union/redemptionRecord`, params); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
*/ | ||
getInterestHistory(params) { | ||
return this.getPrivate(`sapi/v1/lending/union/interestHistory`, params); | ||
} | ||
/** | ||
* @deprecated as of 2023-06-22, now Simple Earn | ||
*/ | ||
changeFixedAndActivityPositionToDailyPosition(params) { | ||
return this.postPrivate(`sapi/v1/lending/positionChanged`, params); | ||
} | ||
/** | ||
* | ||
* Wallet Endpoints | ||
* @deprecated | ||
**/ | ||
/** | ||
* @deprecated | ||
*/ | ||
enableConvertSubAccount(params) { | ||
return this.postPrivate('sapi/v1/broker/subAccount/convert', params); | ||
} | ||
/** | ||
* @deprecated | ||
*/ | ||
convertBUSD(params) { | ||
return this.postPrivate('sapi/v1/asset/convert-transfer', params); | ||
} | ||
/** | ||
* @deprecated | ||
*/ | ||
getConvertBUSDHistory(params) { | ||
return this.getPrivate('sapi/v1/asset/convert-transfer/queryByPage', params); | ||
} | ||
} | ||
@@ -1629,0 +1850,0 @@ exports.MainClient = MainClient; |
@@ -566,2 +566,25 @@ import { BooleanString, BooleanStringCapitalised, ExchangeFilter, KlineInterval, numberInString, OrderBookRow, OrderResponseType, OrderSide, OrderStatus, OrderTimeInForce, OrderType, RateLimiter, SymbolIcebergPartsFilter, SymbolLotSizeFilter, SymbolMarketLotSizeFilter, SymbolMaxIcebergOrdersFilter, SymbolMaxPositionFilter, SymbolPriceFilter } from './shared'; | ||
} | ||
export interface FuturesAccountConfig { | ||
feeTier: number; | ||
canTrade: boolean; | ||
canDeposit: boolean; | ||
canWithdraw: boolean; | ||
dualSidePosition: boolean; | ||
updateTime: number; | ||
multiAssetsMargin: boolean; | ||
tradeGroupId: number; | ||
} | ||
export interface SymbolConfig { | ||
symbol: string; | ||
marginType: string; | ||
isAutoAddMargin: string; | ||
leverage: number; | ||
maxNotionalValue: string; | ||
} | ||
export interface UserForceOrder { | ||
rateLimitType: string; | ||
interval: string; | ||
intervalNum: number; | ||
limit: number; | ||
} | ||
export interface RebateDataOverview { | ||
@@ -568,0 +591,0 @@ brokerId: string; |
import { AxiosRequestConfig } from 'axios'; | ||
import { BasicSymbolPaginatedParams, BasicSymbolParam, GetOrderParams, OrderBookParams, HistoricalTradesParams, KlinesParams, Kline, RecentTradesParams, CancelOrderParams, SymbolFromPaginatedRequestFromId, GetAllOrdersParams, GenericCodeMsgError, SymbolPrice } from './types/shared'; | ||
import { ContinuousContractKlinesParams, IndexPriceKlinesParams, SymbolKlinePaginatedParams, FuturesDataPaginatedParams, MultiAssetsMode, NewFuturesOrderParams, CancelMultipleOrdersParams, CancelOrdersTimeoutParams, SetLeverageParams, SetMarginTypeParams, SetIsolatedMarginParams, GetPositionMarginChangeHistoryParams, GetIncomeHistoryParams, GetForceOrdersParams, FuturesExchangeInfo, FuturesOrderBook, RawFuturesTrade, AggregateFuturesTrade, FundingRateHistory, FuturesSymbolOrderBookTicker, OpenInterest, ModeChangeResult, PositionModeParams, PositionModeResponse, MultiAssetModeResponse, NewOrderResult, NewOrderError, OrderResult, CancelFuturesOrderResult, CancelAllOpenOrdersResult, FuturesAccountBalance, FuturesAccountInformation, SetLeverageResult, SetIsolatedMarginResult, FuturesPosition, FuturesPositionTrade, ForceOrderResult, SymbolLeverageBracketsResult, IncomeHistory, RebateDataOverview, SetCancelTimeoutResult, ChangeStats24hr, MarkPrice, HistoricOpenInterest, UserCommissionRate, ModifyFuturesOrderParams, ModifyFuturesOrderResult, QuarterlyContractSettlementPrice, BasisParams, Basis, IndexPriceConstituents, ModifyOrderParams, FuturesTransactionDownloadLink, PortfolioMarginProAccountInfo, GetFuturesOrderModifyHistoryParams, FuturesTradeHistoryDownloadId } from './types/futures'; | ||
import { ContinuousContractKlinesParams, IndexPriceKlinesParams, SymbolKlinePaginatedParams, FuturesDataPaginatedParams, MultiAssetsMode, NewFuturesOrderParams, CancelMultipleOrdersParams, CancelOrdersTimeoutParams, SetLeverageParams, SetMarginTypeParams, SetIsolatedMarginParams, GetPositionMarginChangeHistoryParams, GetIncomeHistoryParams, GetForceOrdersParams, FuturesExchangeInfo, FuturesOrderBook, RawFuturesTrade, AggregateFuturesTrade, FundingRateHistory, FuturesSymbolOrderBookTicker, OpenInterest, ModeChangeResult, PositionModeParams, PositionModeResponse, MultiAssetModeResponse, NewOrderResult, NewOrderError, OrderResult, CancelFuturesOrderResult, CancelAllOpenOrdersResult, FuturesAccountBalance, FuturesAccountInformation, SetLeverageResult, SetIsolatedMarginResult, FuturesPosition, FuturesPositionTrade, ForceOrderResult, SymbolLeverageBracketsResult, IncomeHistory, RebateDataOverview, SetCancelTimeoutResult, ChangeStats24hr, MarkPrice, HistoricOpenInterest, UserCommissionRate, ModifyFuturesOrderParams, ModifyFuturesOrderResult, QuarterlyContractSettlementPrice, BasisParams, Basis, IndexPriceConstituents, ModifyOrderParams, FuturesTransactionDownloadLink, PortfolioMarginProAccountInfo, GetFuturesOrderModifyHistoryParams, FuturesTradeHistoryDownloadId, FuturesAccountConfig, SymbolConfig, UserForceOrder } from './types/futures'; | ||
import { RestClientOptions } from './util/requestUtils'; | ||
@@ -16,3 +16,3 @@ import BaseRestClient from './util/BaseRestClient'; | ||
* | ||
* Market Data Endpoints | ||
* MARKET DATA endpoints - Rest API | ||
* | ||
@@ -26,6 +26,2 @@ **/ | ||
getAggregateTrades(params: SymbolFromPaginatedRequestFromId): Promise<AggregateFuturesTrade[]>; | ||
getMarkPrice(params: BasicSymbolParam): Promise<MarkPrice>; | ||
getMarkPrice(): Promise<MarkPrice[]>; | ||
getFundingRateHistory(params?: Partial<BasicSymbolPaginatedParams>): Promise<FundingRateHistory[]>; | ||
getFundingRates(): Promise<FundingRate[]>; | ||
getKlines(params: KlinesParams): Promise<Kline[]>; | ||
@@ -36,2 +32,6 @@ getContinuousContractKlines(params: ContinuousContractKlinesParams): Promise<Kline[]>; | ||
getPremiumIndexKlines(params: SymbolKlinePaginatedParams): Promise<Kline[]>; | ||
getMarkPrice(params: BasicSymbolParam): Promise<MarkPrice>; | ||
getMarkPrice(): Promise<MarkPrice[]>; | ||
getFundingRateHistory(params?: Partial<BasicSymbolPaginatedParams>): Promise<FundingRateHistory[]>; | ||
getFundingRates(): Promise<FundingRate[]>; | ||
/** | ||
@@ -47,6 +47,9 @@ * @deprecated use get24hrChangeStatistics() instead (method without the typo) | ||
getSymbolOrderBookTicker(params?: Partial<BasicSymbolParam>): Promise<FuturesSymbolOrderBookTicker | FuturesSymbolOrderBookTicker[]>; | ||
getQuarterlyContractSettlementPrices(params: { | ||
pair: string; | ||
}): Promise<QuarterlyContractSettlementPrice[]>; | ||
getOpenInterest(params: BasicSymbolParam): Promise<OpenInterest>; | ||
getOpenInterestStatistics(params: FuturesDataPaginatedParams): Promise<HistoricOpenInterest[]>; | ||
getTopTradersLongShortPositionRatio(params: FuturesDataPaginatedParams): Promise<any>; | ||
getTopTradersLongShortAccountRatio(params: FuturesDataPaginatedParams): Promise<any>; | ||
getTopTradersLongShortPositionRatio(params: FuturesDataPaginatedParams): Promise<any>; | ||
getGlobalLongShortAccountRatio(params: FuturesDataPaginatedParams): Promise<any>; | ||
@@ -56,9 +59,12 @@ getTakerBuySellVolume(params: FuturesDataPaginatedParams): Promise<any>; | ||
getCompositeSymbolIndex(params?: Partial<BasicSymbolParam>): Promise<any>; | ||
getQuarterlyContractSettlementPrices(params: { | ||
pair: string; | ||
}): Promise<QuarterlyContractSettlementPrice[]>; | ||
getBasis(params: BasisParams): Promise<Basis[]>; | ||
getMultiAssetsModeAssetIndex(params?: { | ||
symbol?: string; | ||
}): Promise<any>; | ||
/** | ||
* Possibly @deprecated, found only in old docs | ||
**/ | ||
getBasis(params: BasisParams): Promise<Basis[]>; | ||
/** | ||
* Possibly @deprecated, found only in old docs | ||
**/ | ||
getIndexPriceConstituents(params: { | ||
@@ -69,23 +75,13 @@ symbol: string; | ||
* | ||
* USD-Futures Account/Trade Endpoints | ||
* TRADE endpoints - Rest API | ||
* | ||
**/ | ||
setPositionMode(params: PositionModeParams): Promise<ModeChangeResult>; | ||
getCurrentPositionMode(): Promise<PositionModeResponse>; | ||
setMultiAssetsMode(params: { | ||
multiAssetsMargin: MultiAssetsMode; | ||
}): Promise<ModeChangeResult>; | ||
getMultiAssetsMode(): Promise<MultiAssetModeResponse>; | ||
setBNBBurnEnabled(params: { | ||
feeBurn: 'true' | 'false'; | ||
}): Promise<{ | ||
code: number; | ||
msg: string; | ||
}>; | ||
getBNBBurnStatus(): Promise<{ | ||
feeBurn: boolean; | ||
}>; | ||
submitNewOrder(params: NewFuturesOrderParams): Promise<NewOrderResult>; | ||
testOrder(params: NewFuturesOrderParams): Promise<any>; | ||
/** | ||
* Warning: max 5 orders at a time! This method does not throw, instead it returns individual errors in the response array if any orders were rejected. | ||
* | ||
* Known issue: `quantity` and `price` should be sent as strings | ||
*/ | ||
submitMultipleOrders(orders: NewFuturesOrderParams<string>[]): Promise<(NewOrderResult | NewOrderError)[]>; | ||
/** | ||
* Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue | ||
@@ -96,35 +92,50 @@ */ | ||
getOrderModifyHistory(params: GetFuturesOrderModifyHistoryParams): Promise<any>; | ||
/** | ||
* Warning: max 5 orders at a time! This method does not throw, instead it returns individual errors in the response array if any orders were rejected. | ||
* | ||
* Known issue: `quantity` and `price` should be sent as strings | ||
*/ | ||
submitMultipleOrders(orders: NewFuturesOrderParams<string>[]): Promise<(NewOrderResult | NewOrderError)[]>; | ||
getOrder(params: GetOrderParams): Promise<OrderResult>; | ||
cancelOrder(params: CancelOrderParams): Promise<CancelFuturesOrderResult>; | ||
cancelMultipleOrders(params: CancelMultipleOrdersParams): Promise<(CancelFuturesOrderResult | GenericCodeMsgError)[]>; | ||
cancelAllOpenOrders(params: BasicSymbolParam): Promise<CancelAllOpenOrdersResult>; | ||
cancelMultipleOrders(params: CancelMultipleOrdersParams): Promise<(CancelFuturesOrderResult | GenericCodeMsgError)[]>; | ||
setCancelOrdersOnTimeout(params: CancelOrdersTimeoutParams): Promise<SetCancelTimeoutResult>; | ||
getOrder(params: GetOrderParams): Promise<OrderResult>; | ||
getAllOrders(params: GetAllOrdersParams): Promise<OrderResult[]>; | ||
getAllOpenOrders(params?: Partial<BasicSymbolParam>): Promise<OrderResult[]>; | ||
getCurrentOpenOrder(params: GetOrderParams): Promise<OrderResult>; | ||
getAllOpenOrders(params?: Partial<BasicSymbolParam>): Promise<OrderResult[]>; | ||
getAllOrders(params: GetAllOrdersParams): Promise<OrderResult[]>; | ||
getBalance(): Promise<FuturesAccountBalance[]>; | ||
getAccountInformation(): Promise<FuturesAccountInformation>; | ||
getForceOrders(params?: GetForceOrdersParams): Promise<ForceOrderResult[]>; | ||
getAccountTrades(params: SymbolFromPaginatedRequestFromId & { | ||
orderId?: number; | ||
}): Promise<FuturesPositionTrade[]>; | ||
setMarginType(params: SetMarginTypeParams): Promise<ModeChangeResult>; | ||
setPositionMode(params: PositionModeParams): Promise<ModeChangeResult>; | ||
setLeverage(params: SetLeverageParams): Promise<SetLeverageResult>; | ||
setMarginType(params: SetMarginTypeParams): Promise<ModeChangeResult>; | ||
setMultiAssetsMode(params: { | ||
multiAssetsMargin: MultiAssetsMode; | ||
}): Promise<ModeChangeResult>; | ||
setIsolatedPositionMargin(params: SetIsolatedMarginParams): Promise<SetIsolatedMarginResult>; | ||
getPositions(params?: Partial<BasicSymbolParam>): Promise<FuturesPosition[]>; | ||
getPositionsV3(params?: { | ||
symbol?: string; | ||
}): Promise<FuturesPosition[]>; | ||
getADLQuantileEstimation(params?: Partial<BasicSymbolParam>): Promise<any>; | ||
getPositionMarginChangeHistory(params: GetPositionMarginChangeHistoryParams): Promise<any>; | ||
getPositions(params?: Partial<BasicSymbolParam>): Promise<FuturesPosition[]>; | ||
getAccountTrades(params: SymbolFromPaginatedRequestFromId & { | ||
orderId?: number; | ||
}): Promise<FuturesPositionTrade[]>; | ||
getIncomeHistory(params?: GetIncomeHistoryParams): Promise<IncomeHistory[]>; | ||
/** | ||
* | ||
* ACCOUNT endpoints - Rest API | ||
* | ||
**/ | ||
getBalanceV3(): Promise<FuturesAccountBalance[]>; | ||
getBalance(): Promise<FuturesAccountBalance[]>; | ||
getAccountInformationV3(): Promise<FuturesAccountInformation>; | ||
getAccountInformation(): Promise<FuturesAccountInformation>; | ||
getAccountComissionRate(params: BasicSymbolParam): Promise<UserCommissionRate>; | ||
getFuturesAccountConfig(): Promise<FuturesAccountConfig>; | ||
getFuturesSymbolConfig(params: { | ||
symbol?: string; | ||
}): Promise<SymbolConfig[]>; | ||
getUserForceOrders(): Promise<UserForceOrder[]>; | ||
/** | ||
* Contrary to what the docs say - if symbol is provided, this returns an array with length 1 (assuming the symbol exists) | ||
*/ | ||
getNotionalAndLeverageBrackets(params?: Partial<BasicSymbolParam>): Promise<SymbolLeverageBracketsResult[]>; | ||
getADLQuantileEstimation(params?: Partial<BasicSymbolParam>): Promise<any>; | ||
getForceOrders(params?: GetForceOrdersParams): Promise<ForceOrderResult[]>; | ||
getMultiAssetsMode(): Promise<MultiAssetModeResponse>; | ||
getCurrentPositionMode(): Promise<PositionModeResponse>; | ||
getIncomeHistory(params?: GetIncomeHistoryParams): Promise<IncomeHistory[]>; | ||
getApiQuantitativeRulesIndicators(params?: Partial<BasicSymbolParam>): Promise<any>; | ||
getAccountComissionRate(params: BasicSymbolParam): Promise<UserCommissionRate>; | ||
getFuturesTransactionHistoryDownloadId(params: { | ||
@@ -151,2 +162,12 @@ startTime: number; | ||
}): Promise<FuturesTransactionDownloadLink>; | ||
setBNBBurnEnabled(params: { | ||
feeBurn: 'true' | 'false'; | ||
}): Promise<{ | ||
code: number; | ||
msg: string; | ||
}>; | ||
getBNBBurnStatus(): Promise<{ | ||
feeBurn: boolean; | ||
}>; | ||
testOrder(params: NewFuturesOrderParams): Promise<any>; | ||
/** | ||
@@ -163,4 +184,9 @@ * | ||
* Broker Futures Endpoints | ||
* Possibly @deprecated, found only in old docs | ||
* All broker endpoints start with /sapi/v1/broker or sapi/v2/broker or sapi/v3/broker | ||
* | ||
**/ | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerIfNewFuturesUser(brokerId: string, type?: 1 | 2): Promise<{ | ||
@@ -171,2 +197,5 @@ brokerId: string; | ||
}>; | ||
/** | ||
* @deprecated | ||
**/ | ||
setBrokerCustomIdForClient(customerId: string, email: string): Promise<{ | ||
@@ -176,7 +205,25 @@ customerId: string; | ||
}>; | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerClientCustomIds(customerId: string, email: string, page?: number, limit?: number): Promise<any>; | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerUserCustomId(brokerId: string): Promise<any>; | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerRebateDataOverview(type?: 1 | 2): Promise<RebateDataOverview>; | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerUserTradeVolume(type?: 1 | 2, startTime?: number, endTime?: number, limit?: number): Promise<any>; | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerRebateVolume(type?: 1 | 2, startTime?: number, endTime?: number, limit?: number): Promise<any>; | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerTradeDetail(type?: 1 | 2, startTime?: number, endTime?: number, limit?: number): Promise<any>; | ||
@@ -183,0 +230,0 @@ /** |
@@ -35,3 +35,3 @@ "use strict"; | ||
* | ||
* Market Data Endpoints | ||
* MARKET DATA endpoints - Rest API | ||
* | ||
@@ -57,14 +57,2 @@ **/ | ||
} | ||
/** | ||
* Index Price and Mark Price | ||
*/ | ||
getMarkPrice(params) { | ||
return this.get('fapi/v1/premiumIndex', params); | ||
} | ||
getFundingRateHistory(params) { | ||
return this.get('fapi/v1/fundingRate', params); | ||
} | ||
getFundingRates() { | ||
return this.get('fapi/v1/fundingInfo'); | ||
} | ||
getKlines(params) { | ||
@@ -85,2 +73,11 @@ return this.get('fapi/v1/klines', params); | ||
} | ||
getMarkPrice(params) { | ||
return this.get('fapi/v1/premiumIndex', params); | ||
} | ||
getFundingRateHistory(params) { | ||
return this.get('fapi/v1/fundingRate', params); | ||
} | ||
getFundingRates() { | ||
return this.get('fapi/v1/fundingInfo'); | ||
} | ||
/** | ||
@@ -104,2 +101,5 @@ * @deprecated use get24hrChangeStatistics() instead (method without the typo) | ||
} | ||
getQuarterlyContractSettlementPrices(params) { | ||
return this.get('futures/data/delivery-price', params); | ||
} | ||
getOpenInterest(params) { | ||
@@ -111,8 +111,8 @@ return this.get('fapi/v1/openInterest', params); | ||
} | ||
getTopTradersLongShortPositionRatio(params) { | ||
return this.get('futures/data/topLongShortPositionRatio', params); | ||
} | ||
getTopTradersLongShortAccountRatio(params) { | ||
return this.get('futures/data/topLongShortAccountRatio', params); | ||
} | ||
getTopTradersLongShortPositionRatio(params) { | ||
return this.get('futures/data/topLongShortPositionRatio', params); | ||
} | ||
getGlobalLongShortAccountRatio(params) { | ||
@@ -130,11 +130,14 @@ return this.get('futures/data/globalLongShortAccountRatio', params); | ||
} | ||
getQuarterlyContractSettlementPrices(params) { | ||
return this.get('futures/data/delivery-price', params); | ||
getMultiAssetsModeAssetIndex(params) { | ||
return this.get('fapi/v1/assetIndex', params); | ||
} | ||
/** | ||
* Possibly @deprecated, found only in old docs | ||
**/ | ||
getBasis(params) { | ||
return this.get('futures/data/basis', params); | ||
} | ||
getMultiAssetsModeAssetIndex(params) { | ||
return this.get('fapi/v1/assetIndex', params); | ||
} | ||
/** | ||
* Possibly @deprecated, found only in old docs | ||
**/ | ||
getIndexPriceConstituents(params) { | ||
@@ -145,23 +148,5 @@ return this.get('fapi/v1/constituents', params); | ||
* | ||
* USD-Futures Account/Trade Endpoints | ||
* TRADE endpoints - Rest API | ||
* | ||
**/ | ||
setPositionMode(params) { | ||
return this.postPrivate('fapi/v1/positionSide/dual', params); | ||
} | ||
getCurrentPositionMode() { | ||
return this.getPrivate('fapi/v1/positionSide/dual'); | ||
} | ||
setMultiAssetsMode(params) { | ||
return this.postPrivate('fapi/v1/multiAssetsMargin', params); | ||
} | ||
getMultiAssetsMode() { | ||
return this.getPrivate('fapi/v1/multiAssetsMargin'); | ||
} | ||
setBNBBurnEnabled(params) { | ||
return this.postPrivate('fapi/v1/feeBurn', params); | ||
} | ||
getBNBBurnStatus() { | ||
return this.getPrivate('fapi/v1/feeBurn'); | ||
} | ||
submitNewOrder(params) { | ||
@@ -171,5 +156,17 @@ this.validateOrderId(params, 'newClientOrderId'); | ||
} | ||
testOrder(params) { | ||
this.validateOrderId(params, 'newClientOrderId'); | ||
return this.postPrivate('fapi/v1/order/test', params); | ||
/** | ||
* Warning: max 5 orders at a time! This method does not throw, instead it returns individual errors in the response array if any orders were rejected. | ||
* | ||
* Known issue: `quantity` and `price` should be sent as strings | ||
*/ | ||
submitMultipleOrders(orders) { | ||
const stringOrders = orders.map((order) => { | ||
const orderToStringify = Object.assign({}, order); | ||
this.validateOrderId(orderToStringify, 'newClientOrderId'); | ||
return JSON.stringify(orderToStringify); | ||
}); | ||
const requestBody = { | ||
batchOrders: `[${stringOrders.join(',')}]`, | ||
}; | ||
return this.postPrivate('fapi/v1/batchOrders', requestBody); | ||
} | ||
@@ -192,27 +189,5 @@ /** | ||
} | ||
/** | ||
* Warning: max 5 orders at a time! This method does not throw, instead it returns individual errors in the response array if any orders were rejected. | ||
* | ||
* Known issue: `quantity` and `price` should be sent as strings | ||
*/ | ||
submitMultipleOrders(orders) { | ||
const stringOrders = orders.map((order) => { | ||
const orderToStringify = Object.assign({}, order); | ||
this.validateOrderId(orderToStringify, 'newClientOrderId'); | ||
return JSON.stringify(orderToStringify); | ||
}); | ||
const requestBody = { | ||
batchOrders: `[${stringOrders.join(',')}]`, | ||
}; | ||
return this.postPrivate('fapi/v1/batchOrders', requestBody); | ||
} | ||
getOrder(params) { | ||
return this.getPrivate('fapi/v1/order', params); | ||
} | ||
cancelOrder(params) { | ||
return this.deletePrivate('fapi/v1/order', params); | ||
} | ||
cancelAllOpenOrders(params) { | ||
return this.deletePrivate('fapi/v1/allOpenOrders', params); | ||
} | ||
cancelMultipleOrders(params) { | ||
@@ -228,2 +203,5 @@ const requestParams = Object.assign({}, params); | ||
} | ||
cancelAllOpenOrders(params) { | ||
return this.deletePrivate('fapi/v1/allOpenOrders', params); | ||
} | ||
// Auto-cancel all open orders | ||
@@ -233,22 +211,31 @@ setCancelOrdersOnTimeout(params) { | ||
} | ||
getCurrentOpenOrder(params) { | ||
return this.getPrivate('fapi/v1/openOrder', params); | ||
getOrder(params) { | ||
return this.getPrivate('fapi/v1/order', params); | ||
} | ||
getAllOrders(params) { | ||
return this.getPrivate('fapi/v1/allOrders', params); | ||
} | ||
getAllOpenOrders(params) { | ||
return this.getPrivate('fapi/v1/openOrders', params); | ||
} | ||
getAllOrders(params) { | ||
return this.getPrivate('fapi/v1/allOrders', params); | ||
getCurrentOpenOrder(params) { | ||
return this.getPrivate('fapi/v1/openOrder', params); | ||
} | ||
getBalance() { | ||
return this.getPrivate('fapi/v2/balance'); | ||
getForceOrders(params) { | ||
return this.getPrivate('fapi/v1/forceOrders', params); | ||
} | ||
getAccountInformation() { | ||
return this.getPrivate('fapi/v2/account'); | ||
getAccountTrades(params) { | ||
return this.getPrivate('fapi/v1/userTrades', params); | ||
} | ||
setMarginType(params) { | ||
return this.postPrivate('fapi/v1/marginType', params); | ||
} | ||
setPositionMode(params) { | ||
return this.postPrivate('fapi/v1/positionSide/dual', params); | ||
} | ||
setLeverage(params) { | ||
return this.postPrivate('fapi/v1/leverage', params); | ||
} | ||
setMarginType(params) { | ||
return this.postPrivate('fapi/v1/marginType', params); | ||
setMultiAssetsMode(params) { | ||
return this.postPrivate('fapi/v1/multiAssetsMargin', params); | ||
} | ||
@@ -258,14 +245,43 @@ setIsolatedPositionMargin(params) { | ||
} | ||
getPositions(params) { | ||
return this.getPrivate('fapi/v2/positionRisk', params); | ||
} | ||
getPositionsV3(params) { | ||
return this.getPrivate('fapi/v3/positionRisk', params); | ||
} | ||
getADLQuantileEstimation(params) { | ||
return this.getPrivate('fapi/v1/adlQuantile', params); | ||
} | ||
getPositionMarginChangeHistory(params) { | ||
return this.getPrivate('fapi/v1/positionMargin/history', params); | ||
} | ||
getPositions(params) { | ||
return this.getPrivate('fapi/v2/positionRisk', params); | ||
/** | ||
* | ||
* ACCOUNT endpoints - Rest API | ||
* | ||
**/ | ||
getBalanceV3() { | ||
return this.getPrivate('fapi/v3/balance'); | ||
} | ||
getAccountTrades(params) { | ||
return this.getPrivate('fapi/v1/userTrades', params); | ||
getBalance() { | ||
return this.getPrivate('fapi/v2/balance'); | ||
} | ||
getIncomeHistory(params) { | ||
return this.getPrivate('fapi/v1/income', params); | ||
getAccountInformationV3() { | ||
return this.getPrivate('fapi/v3/account'); | ||
} | ||
getAccountInformation() { | ||
return this.getPrivate('fapi/v2/account'); | ||
} | ||
getAccountComissionRate(params) { | ||
return this.getPrivate('fapi/v1/commissionRate', params); | ||
} | ||
getFuturesAccountConfig() { | ||
return this.getPrivate('fapi/v1/accountConfig'); | ||
} | ||
getFuturesSymbolConfig(params) { | ||
return this.getPrivate('fapi/v1/symbolConfig', params); | ||
} | ||
getUserForceOrders() { | ||
return this.getPrivate('fapi/v1/rateLimit/order'); | ||
} | ||
/** | ||
@@ -277,14 +293,14 @@ * Contrary to what the docs say - if symbol is provided, this returns an array with length 1 (assuming the symbol exists) | ||
} | ||
getADLQuantileEstimation(params) { | ||
return this.getPrivate('fapi/v1/adlQuantile', params); | ||
getMultiAssetsMode() { | ||
return this.getPrivate('fapi/v1/multiAssetsMargin'); | ||
} | ||
getForceOrders(params) { | ||
return this.getPrivate('fapi/v1/forceOrders', params); | ||
getCurrentPositionMode() { | ||
return this.getPrivate('fapi/v1/positionSide/dual'); | ||
} | ||
getIncomeHistory(params) { | ||
return this.getPrivate('fapi/v1/income', params); | ||
} | ||
getApiQuantitativeRulesIndicators(params) { | ||
return this.getPrivate('fapi/v1/apiTradingStatus', params); | ||
} | ||
getAccountComissionRate(params) { | ||
return this.getPrivate('fapi/v1/commissionRate', params); | ||
} | ||
getFuturesTransactionHistoryDownloadId(params) { | ||
@@ -308,2 +324,12 @@ return this.getPrivate('fapi/v1/income/asyn', params); | ||
} | ||
setBNBBurnEnabled(params) { | ||
return this.postPrivate('fapi/v1/feeBurn', params); | ||
} | ||
getBNBBurnStatus() { | ||
return this.getPrivate('fapi/v1/feeBurn'); | ||
} | ||
testOrder(params) { | ||
this.validateOrderId(params, 'newClientOrderId'); | ||
return this.postPrivate('fapi/v1/order/test', params); | ||
} | ||
/** | ||
@@ -320,5 +346,9 @@ * | ||
* Broker Futures Endpoints | ||
* Possibly @deprecated, found only in old docs | ||
* All broker endpoints start with /sapi/v1/broker or sapi/v2/broker or sapi/v3/broker | ||
* | ||
**/ | ||
// 1 == USDT-Margined, 2 == Coin-margined | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerIfNewFuturesUser(brokerId, type = 1) { | ||
@@ -330,2 +360,5 @@ return this.getPrivate('fapi/v1/apiReferral/ifNewUser', { | ||
} | ||
/** | ||
* @deprecated | ||
**/ | ||
setBrokerCustomIdForClient(customerId, email) { | ||
@@ -337,2 +370,5 @@ return this.postPrivate('fapi/v1/apiReferral/customization', { | ||
} | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerClientCustomIds(customerId, email, page, limit) { | ||
@@ -346,2 +382,5 @@ return this.getPrivate('fapi/v1/apiReferral/customization', { | ||
} | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerUserCustomId(brokerId) { | ||
@@ -352,2 +391,5 @@ return this.getPrivate('fapi/v1/apiReferral/userCustomization', { | ||
} | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerRebateDataOverview(type = 1) { | ||
@@ -358,2 +400,5 @@ return this.getPrivate('fapi/v1/apiReferral/overview', { | ||
} | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerUserTradeVolume(type = 1, startTime, endTime, limit) { | ||
@@ -367,2 +412,5 @@ return this.getPrivate('fapi/v1/apiReferral/tradeVol', { | ||
} | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerRebateVolume(type = 1, startTime, endTime, limit) { | ||
@@ -376,2 +424,5 @@ return this.getPrivate('fapi/v1/apiReferral/rebateVol', { | ||
} | ||
/** | ||
* @deprecated | ||
**/ | ||
getBrokerTradeDetail(type = 1, startTime, endTime, limit) { | ||
@@ -378,0 +429,0 @@ return this.getPrivate('fapi/v1/apiReferral/traderSummary', { |
{ | ||
"name": "binance", | ||
"version": "2.12.3", | ||
"version": "2.13.0", | ||
"description": "Node.js & JavaScript SDK for Binance REST APIs & WebSockets, with TypeScript & end-to-end tests.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
665926
14509