bybit-api
Advanced tools
Comparing version 3.6.1 to 3.7.0
@@ -50,3 +50,8 @@ import { APIResponseV3, APIResponseWithTime, ContractActiveOrdersRequest, ContractCancelOrderRequest, ContractClosedPNLRequest, ContractHistoricOrder, ContractHistoricOrdersRequest, ContractListResult, ContractModifyOrderRequest, ContractOrderRequest, ContractPositionsRequest, ContractSetAutoAddMarginRequest, ContractSetMarginSwitchRequest, ContractSetPositionModeRequest, ContractSetTPSLRequest, ContractSymbolTicker, ContractUserExecutionHistoryRequest, ContractWalletFundRecordRequest, PaginatedResult, UMCandlesRequest, UMCategory, UMFundingRateHistoryRequest, UMInstrumentInfoRequest, UMOpenInterestRequest, UMOptionDeliveryPriceRequest, UMPublicTradesRequest } from './types'; | ||
submitOrder(params: ContractOrderRequest): Promise<APIResponseV3<any>>; | ||
/** Query order history. As order creation/cancellation is asynchronous, the data returned from the interface may be delayed. To access order information in real-time, call getActiveOrders() */ | ||
/** | ||
* Query order history. | ||
* | ||
* As order creation/cancellation is asynchronous, the data returned from the interface may be delayed. | ||
* To access order information in real-time, call getActiveOrders(). | ||
*/ | ||
getHistoricOrders(params: ContractHistoricOrdersRequest): Promise<APIResponseV3<PaginatedResult<ContractHistoricOrder>>>; | ||
@@ -57,3 +62,10 @@ /** Cancel order */ | ||
cancelAllOrders(symbol: string): Promise<APIResponseV3<any>>; | ||
/** Replace order : Active order parameters (such as quantity, price) and stop order parameters cannot be modified in one request at the same time. Please request modification separately. */ | ||
/** | ||
* Replace order | ||
* | ||
* Active order parameters (such as quantity, price) and stop order parameters | ||
* cannot be modified in one request at the same time. | ||
* | ||
* Please request modification separately. | ||
*/ | ||
modifyOrder(params: ContractModifyOrderRequest): Promise<APIResponseV3<any>>; | ||
@@ -109,3 +121,5 @@ /** Query Open Order(s) (real-time) */ | ||
* Get wallet fund records. | ||
* This endpoint also shows exchanges from the Asset Exchange, where the types for the exchange are ExchangeOrderWithdraw and ExchangeOrderDeposit. | ||
* This endpoint also shows exchanges from the Asset Exchange, | ||
* where the types for the exchange are ExchangeOrderWithdraw and ExchangeOrderDeposit. | ||
* | ||
* This endpoint returns incomplete information for transfers involving the derivatives wallet. | ||
@@ -112,0 +126,0 @@ * Use the account asset API for creating and querying internal transfers. |
@@ -104,3 +104,8 @@ "use strict"; | ||
} | ||
/** Query order history. As order creation/cancellation is asynchronous, the data returned from the interface may be delayed. To access order information in real-time, call getActiveOrders() */ | ||
/** | ||
* Query order history. | ||
* | ||
* As order creation/cancellation is asynchronous, the data returned from the interface may be delayed. | ||
* To access order information in real-time, call getActiveOrders(). | ||
*/ | ||
getHistoricOrders(params) { | ||
@@ -119,3 +124,10 @@ return this.getPrivate('/contract/v3/private/order/list', params); | ||
} | ||
/** Replace order : Active order parameters (such as quantity, price) and stop order parameters cannot be modified in one request at the same time. Please request modification separately. */ | ||
/** | ||
* Replace order | ||
* | ||
* Active order parameters (such as quantity, price) and stop order parameters | ||
* cannot be modified in one request at the same time. | ||
* | ||
* Please request modification separately. | ||
*/ | ||
modifyOrder(params) { | ||
@@ -218,3 +230,5 @@ return this.postPrivate('/contract/v3/private/order/replace', params); | ||
* Get wallet fund records. | ||
* This endpoint also shows exchanges from the Asset Exchange, where the types for the exchange are ExchangeOrderWithdraw and ExchangeOrderDeposit. | ||
* This endpoint also shows exchanges from the Asset Exchange, | ||
* where the types for the exchange are ExchangeOrderWithdraw and ExchangeOrderDeposit. | ||
* | ||
* This endpoint returns incomplete information for transfers involving the derivatives wallet. | ||
@@ -221,0 +235,0 @@ * Use the account asset API for creating and querying internal transfers. |
@@ -1,2 +0,2 @@ | ||
import { APIResponseV3, APIResponseV3WithTime, AccountCoinBalanceV5, AccountInfoV5, AccountMarginModeV5, AccountOrderV5, AccountTypeV5, AllCoinsBalanceV5, AllowedDepositCoinInfoV5, AmendOrderParamsV5, ApiKeyInfoV5, AssetInfoV5, BatchAmendOrderParamsV5, BatchAmendOrderResultV5, BatchCancelOrderParamsV5, BatchCancelOrderResultV5, BatchCreateOrderResultV5, BatchOrderParamsV5, BatchOrdersResponseV5, BorrowHistoryRecordV5, CancelAllOrdersParamsV5, CancelOrderParamsV5, CategoryCursorListV5, CategoryListV5, CategorySymbolListV5, CategoryV5, ClosedPnLV5, CoinExchangeRecordV5, CoinGreeksV5, CoinInfoV5, CollateralInfoV5, CreateSubApiKeyParamsV5, CreateSubApiKeyResultV5, CreateSubMemberParamsV5, CreateSubMemberResultV5, CursorListV5, DeliveryRecordV5, DepositAddressResultV5, DepositRecordV5, ExecutionV5, FeeRateV5, FundingRateHistoryResponseV5, GetAccountCoinBalanceParamsV5, GetAccountOrdersParams, GetAllCoinsBalanceParamsV5, GetAllowedDepositCoinInfoParamsV5, GetAssetInfoParamsV5, GetBorrowHistoryParamsV5, GetClosedPnLParamsV5, GetCoinExchangeRecordParamsV5, GetDeliveryRecordParamsV5, GetDepositRecordParamsV5, GetExecutionListParamsV5, GetFundingRateHistoryParamsV5, GetHistoricalVolatilityParamsV5, GetIndexPriceKlineParamsV5, GetInstrumentsInfoParamsV5, GetInsuranceParamsV5, GetInternalDepositRecordParamsV5, GetInternalTransferParamsV5, GetKlineParamsV5, GetMarkPriceKlineParamsV5, GetOpenInterestParamsV5, GetOptionDeliveryPriceParamsV5, GetOrderbookParamsV5, GetPremiumIndexPriceKlineParamsV5, GetPublicTradingHistoryParamsV5, GetRiskLimitParamsV5, GetSettlementRecordParamsV5, GetSpotLeveragedTokenOrderHistoryParamsV5, GetSubAccountDepositRecordParamsV5, GetTickersParamsV5, GetTransactionLogParamsV5, GetUniversalTransferRecordsParamsV5, GetWalletBalanceParamsV5, GetWithdrawalRecordsParamsV5, HistoricalVolatilityV5, InstrumentInfoResponseV5, InsuranceResponseV5, InternalDepositRecordV5, InternalTransferRecordV5, LeverageTokenInfoV5, LeveragedTokenMarketResultV5, MMPModifyParamsV5, MMPStateV5, OHLCKlineV5, OHLCVKlineV5, OpenInterestResponseV5, OptionDeliveryPriceV5, OrderParamsV5, OrderResultV5, OrderSideV5, OrderbookResponseV5, PositionInfoParamsV5, PositionV5, PublicTradeV5, PurchaseSpotLeveragedTokenParamsV5, PurchaseSpotLeveragedTokenResultV5, RedeemSpotLeveragedTokenParamsV5, RedeemSpotLeveragedTokenResultV5, RiskLimitV5, SetAutoAddMarginParamsV5, SetLeverageParamsV5, SetRiskLimitParamsV5, SetRiskLimitResultV5, SetTPSLModeParamsV5, SetTradingStopParamsV5, SettlementRecordV5, SpotBorrowCheckResultV5, SpotLeveragedTokenOrderHistoryV5, SubMemberV5, SwitchIsolatedMarginParamsV5, SwitchPositionModeParamsV5, TPSLModeV5, TickerLinearInverseV5, TickerOptionV5, TickerSpotV5, TransactionLogV5, UnifiedAccountUpgradeResultV5, UniversalTransferParamsV5, UniversalTransferRecordV5, UpdateApiKeyParamsV5, UpdateApiKeyResultV5, WalletBalanceV5, WithdrawParamsV5, WithdrawalRecordV5 } from './types'; | ||
import { APIResponseV3, APIResponseV3WithTime, AccountCoinBalanceV5, AccountInfoV5, AccountMarginModeV5, AccountOrderV5, AccountTypeV5, AddOrReduceMarginParamsV5, AddOrReduceMarginResultV5, AllCoinsBalanceV5, AllowedDepositCoinInfoV5, AmendOrderParamsV5, ApiKeyInfoV5, AssetInfoV5, BatchAmendOrderParamsV5, BatchAmendOrderResultV5, BatchCancelOrderParamsV5, BatchCancelOrderResultV5, BatchCreateOrderResultV5, BatchOrderParamsV5, BatchOrdersResponseV5, BorrowHistoryRecordV5, CancelAllOrdersParamsV5, CancelOrderParamsV5, CategoryCursorListV5, CategoryListV5, CategorySymbolListV5, CategoryV5, ClosedPnLV5, CoinExchangeRecordV5, CoinGreeksV5, CoinInfoV5, CollateralInfoV5, CreateSubApiKeyParamsV5, CreateSubApiKeyResultV5, CreateSubMemberParamsV5, CreateSubMemberResultV5, CursorListV5, DeliveryPriceV5, DeliveryRecordV5, DepositAddressResultV5, DepositRecordV5, ExecutionV5, FeeRateV5, FundingRateHistoryResponseV5, GetAccountCoinBalanceParamsV5, GetAccountHistoricOrdersPArams, GetAccountOrdersParams, GetAllCoinsBalanceParamsV5, GetAllowedDepositCoinInfoParamsV5, GetAssetInfoParamsV5, GetBorrowHistoryParamsV5, GetClosedPnLParamsV5, GetCoinExchangeRecordParamsV5, GetDeliveryPriceParamsV5, GetDeliveryRecordParamsV5, GetDepositRecordParamsV5, GetExecutionListParamsV5, GetFeeRateParamsV5, GetFundingRateHistoryParamsV5, GetHistoricalVolatilityParamsV5, GetIndexPriceKlineParamsV5, GetInstrumentsInfoParamsV5, GetInsuranceParamsV5, GetInternalDepositRecordParamsV5, GetInternalTransferParamsV5, GetKlineParamsV5, GetMarkPriceKlineParamsV5, GetOpenInterestParamsV5, GetOptionDeliveryPriceParamsV5, GetOrderbookParamsV5, GetPreUpgradeClosedPnlParamsV5, GetPreUpgradeOrderHistoryParamsV5, GetPreUpgradeTradeHistoryParamsV5, GetPremiumIndexPriceKlineParamsV5, GetPublicTradingHistoryParamsV5, GetRiskLimitParamsV5, GetSettlementRecordParamsV5, GetSpotLeveragedTokenOrderHistoryParamsV5, GetSubAccountDepositRecordParamsV5, GetTickersParamsV5, GetTransactionLogParamsV5, GetUniversalTransferRecordsParamsV5, GetWalletBalanceParamsV5, GetWithdrawalRecordsParamsV5, HistoricalVolatilityV5, InstrumentInfoResponseV5, InsuranceResponseV5, InternalDepositRecordV5, InternalTransferRecordV5, LeverageTokenInfoV5, LeveragedTokenMarketResultV5, MMPModifyParamsV5, MMPStateV5, OHLCKlineV5, OHLCVKlineV5, OpenInterestResponseV5, OptionDeliveryPriceV5, OrderParamsV5, OrderResultV5, OrderSideV5, OrderbookResponseV5, PositionInfoParamsV5, PositionV5, PublicTradeV5, PurchaseSpotLeveragedTokenParamsV5, PurchaseSpotLeveragedTokenResultV5, RedeemSpotLeveragedTokenParamsV5, RedeemSpotLeveragedTokenResultV5, RiskLimitV5, SetAutoAddMarginParamsV5, SetLeverageParamsV5, SetRiskLimitParamsV5, SetRiskLimitResultV5, SetTPSLModeParamsV5, SetTradingStopParamsV5, SettlementRecordV5, SpotBorrowCheckResultV5, SpotLeveragedTokenOrderHistoryV5, SubMemberV5, SwitchIsolatedMarginParamsV5, SwitchPositionModeParamsV5, TPSLModeV5, TickerLinearInverseV5, TickerOptionV5, TickerSpotV5, TransactionLogV5, UnifiedAccountUpgradeResultV5, UniversalTransferParamsV5, UniversalTransferRecordV5, UpdateApiKeyParamsV5, UpdateApiKeyResultV5, WalletBalanceV5, WithdrawParamsV5, WithdrawalRecordV5 } from './types'; | ||
import BaseRestClient from './util/BaseRestClient'; | ||
@@ -101,6 +101,14 @@ /** | ||
* Covers: Option | ||
* | ||
* @deprecated use getDeliveryPrice() instead | ||
*/ | ||
getOptionDeliveryPrice(params: GetOptionDeliveryPriceParamsV5): Promise<APIResponseV3WithTime<CategoryCursorListV5<OptionDeliveryPriceV5[]>>>; | ||
/** | ||
* Get the delivery price of Inverse futures, USDC futures and Options | ||
* | ||
* Covers: USDC futures / Inverse futures / Option | ||
*/ | ||
getDeliveryPrice(params: GetDeliveryPriceParamsV5): Promise<APIResponseV3WithTime<CategoryCursorListV5<DeliveryPriceV5[]>>>; | ||
/** | ||
* | ||
****** Trade APIs | ||
@@ -124,3 +132,3 @@ * | ||
*/ | ||
getHistoricOrders(params: GetAccountOrdersParams): Promise<APIResponseV3WithTime<CategoryCursorListV5<AccountOrderV5[]>>>; | ||
getHistoricOrders(params: GetAccountHistoricOrdersPArams): Promise<APIResponseV3WithTime<CategoryCursorListV5<AccountOrderV5[]>>>; | ||
/** | ||
@@ -249,2 +257,9 @@ * This endpoint allows you to place more than one order in a single request. Covers: option (unified account). | ||
/** | ||
* Manually add or reduce margin for isolated margin position | ||
* | ||
* Unified account covers: USDT perpetual / USDC perpetual / USDC futures / Inverse contract | ||
* Normal account covers: USDT perpetual / Inverse contract | ||
*/ | ||
addOrReduceMargin(params: AddOrReduceMarginParamsV5): Promise<APIResponseV3WithTime<AddOrReduceMarginResultV5>>; | ||
/** | ||
* Query users' execution records, sorted by execTime in descending order | ||
@@ -265,2 +280,32 @@ * | ||
* | ||
****** Pre-upgrade APIs | ||
* | ||
*/ | ||
/** | ||
* Get those orders which occurred before you upgrade the account to Unified account. | ||
* | ||
* For now, it only supports to query USDT perpetual, USDC perpetual, Inverse perpetual and futures. | ||
* | ||
* - can get all status in 7 days | ||
* - can only get filled orders beyond 7 days | ||
*/ | ||
getPreUpgradeOrderHistory(params: GetPreUpgradeOrderHistoryParamsV5): Promise<APIResponseV3WithTime<CategoryCursorListV5<AccountOrderV5[]>>>; | ||
/** | ||
* Get users' execution records which occurred before you upgrade the account to Unified account, sorted by execTime in descending order | ||
* | ||
* For now, it only supports to query USDT perpetual, Inverse perpetual and futures. | ||
* | ||
* - You may have multiple executions in a single order. | ||
* - You can query by symbol, baseCoin, orderId and orderLinkId, and if you pass multiple params, | ||
* the system will process them according to this priority: orderId > orderLinkId > symbol > baseCoin. | ||
*/ | ||
getPreUpgradeTradeHistory(params: GetPreUpgradeTradeHistoryParamsV5): Promise<APIResponseV3WithTime<CategoryCursorListV5<ExecutionV5[]>>>; | ||
/** | ||
* Query user's closed profit and loss records. The results are sorted by createdTime in descending order. | ||
* | ||
* For now, it only supports to query USDT perpetual, Inverse perpetual and futures. | ||
*/ | ||
getPreUpgradeClosedPnl(params: GetPreUpgradeClosedPnlParamsV5): Promise<APIResponseV3WithTime<CategoryCursorListV5<ClosedPnLV5[]>>>; | ||
/** | ||
* | ||
****** Account APIs | ||
@@ -303,8 +348,6 @@ * | ||
/** | ||
* Get the trading fee rate of derivatives. | ||
* Covers: USDT perpetual / Inverse perpetual / Inverse futures | ||
* Get the trading fee rate. | ||
* Covers: Spot / USDT perpetual / Inverse perpetual / Inverse futures / Options | ||
*/ | ||
getFeeRate(symbol?: string): Promise<APIResponseV3WithTime<{ | ||
list: FeeRateV5[]; | ||
}>>; | ||
getFeeRate(params: GetFeeRateParamsV5): Promise<APIResponseV3WithTime<CategoryCursorListV5<FeeRateV5[]>>>; | ||
/** | ||
@@ -448,2 +491,10 @@ * Query the margin mode and the upgraded status of account | ||
/** | ||
* Set auto transfer account after deposit. The same function as the setting for Deposit on web GUI | ||
*/ | ||
setDepositAccount(params: { | ||
accountType: AccountTypeV5; | ||
}): Promise<APIResponseV3WithTime<{ | ||
status: 0 | 1; | ||
}>>; | ||
/** | ||
* Query deposit records. | ||
@@ -489,2 +540,6 @@ * | ||
* Query the deposit address information of SUB account. | ||
*/ | ||
getSubDepositAddress(coin: string, chainType: string, subMemberId: string): Promise<APIResponseV3WithTime<DepositAddressResultV5>>; | ||
/** | ||
* Query the deposit address information of SUB account. | ||
* | ||
@@ -508,2 +563,10 @@ * CAUTION | ||
/** | ||
* Query withdrawable amount. | ||
*/ | ||
getWithdrawableAmount(params: { | ||
coin: string; | ||
}): Promise<APIResponseV3<{ | ||
rows: WithdrawalRecordV5[]; | ||
}>>; | ||
/** | ||
* Withdraw assets from the SPOT account. | ||
@@ -634,10 +697,10 @@ * | ||
* | ||
****** Spot Margin Trade APIs | ||
****** Spot Margin Trade APIs (UTA) | ||
* | ||
*/ | ||
/** | ||
* Turn spot margin trade on / off. | ||
* Turn spot margin trade on / off in your UTA account. | ||
* | ||
* CAUTION | ||
* Your account needs to turn on spot margin first | ||
* Your account needs to turn on spot margin first. | ||
*/ | ||
@@ -652,2 +715,188 @@ toggleSpotMarginTrade(spotMarginMode: '1' | '0'): Promise<APIResponseV3WithTime<{ | ||
setSpotMarginLeverage(leverage: string): Promise<APIResponseV3WithTime<{}>>; | ||
/** | ||
* | ||
****** Spot Margin Trade APIs (Normal) | ||
* | ||
*/ | ||
/** | ||
* Get Margin Coin Info | ||
*/ | ||
getSpotMarginCoinInfo(coin?: string): Promise<APIResponseV3WithTime<{ | ||
list: { | ||
coin: string; | ||
conversionRate: string; | ||
liquidationOrder: number; | ||
}[]; | ||
}>>; | ||
/** | ||
* Get Borrowable Coin Info | ||
*/ | ||
getSpotMarginBorrowableCoinInfo(coin?: string): Promise<APIResponseV3WithTime<{ | ||
list: { | ||
coin: string; | ||
borrowingPrecision: number; | ||
repaymentPrecision: number; | ||
}[]; | ||
}>>; | ||
/** | ||
* Get Interest & Quota | ||
*/ | ||
getSpotMarginInterestAndQuota(coin: string): Promise<APIResponseV3WithTime<{ | ||
list: { | ||
coin: string; | ||
interestRate: string; | ||
loanAbleAmount: string; | ||
maxLoanAmount: string; | ||
}[]; | ||
}>>; | ||
/** | ||
* Get Loan Account Info | ||
*/ | ||
getSpotMarginLoanAccountInfo(): Promise<APIResponseV3WithTime<{ | ||
acctBalanceSum: string; | ||
debtBalanceSum: string; | ||
loanAccountList: { | ||
free: string; | ||
interest: string; | ||
loan: string; | ||
remainAmount: string; | ||
locked: string; | ||
tokenId: string; | ||
total: string; | ||
}[]; | ||
riskRate: string; | ||
status: number; | ||
switchStatus: number; | ||
}>>; | ||
/** | ||
* Borrow | ||
*/ | ||
spotMarginBorrow(params: { | ||
coin: string; | ||
qty: string; | ||
}): Promise<APIResponseV3WithTime<{ | ||
transactId: string; | ||
}>>; | ||
/** | ||
* Repay | ||
*/ | ||
spotMarginRepay(params: { | ||
coin: string; | ||
qty?: string; | ||
completeRepayment: 0 | 1; | ||
}): Promise<APIResponseV3WithTime<{ | ||
repayId: string; | ||
}>>; | ||
/** | ||
* Get Borrow Order Detail | ||
*/ | ||
getSpotMarginBorrowOrderDetail(params?: { | ||
startTime?: number; | ||
endTime?: number; | ||
coin?: string; | ||
status?: 0 | 1 | 2; | ||
limit?: number; | ||
}): Promise<APIResponseV3WithTime<{ | ||
list: { | ||
accountId: string; | ||
coin: string; | ||
createdTime: number; | ||
id: string; | ||
interestAmount: string; | ||
interestBalance: string; | ||
loanAmount: string; | ||
loanBalance: string; | ||
remainAmount: string; | ||
status: string; | ||
type: string; | ||
}[]; | ||
}>>; | ||
/** | ||
* Get Repayment Order Detail | ||
*/ | ||
getSpotMarginRepaymentOrderDetail(params?: { | ||
startTime?: number; | ||
endTime?: number; | ||
coin?: string; | ||
limit?: number; | ||
}): Promise<APIResponseV3WithTime<{ | ||
list: { | ||
accountId: string; | ||
coin: string; | ||
repaidAmount: string; | ||
repayId: string; | ||
repayMarginOrderId: string; | ||
repayTime: string; | ||
transactIds: { | ||
repaidInterest: string; | ||
repaidPrincipal: string; | ||
repaidSerialNumber: string; | ||
transactId: string; | ||
}[]; | ||
}[]; | ||
}>>; | ||
/** | ||
* Turn spot margin trade on / off in your NORMAL account. | ||
*/ | ||
toggleSpotCrossMarginTrade(params: { | ||
switch: 1 | 0; | ||
}): Promise<APIResponseV3WithTime<{ | ||
switchStatus: '1' | '0'; | ||
}>>; | ||
/** | ||
* | ||
****** Institutional Lending | ||
* | ||
*/ | ||
/** | ||
* Get Product Info | ||
*/ | ||
getInstitutionalLendingProductInfo(productId?: string): Promise<APIResponseV3WithTime<{ | ||
marginProductInfo: any[]; | ||
}>>; | ||
/** | ||
* Get Margin Coin Info | ||
*/ | ||
getInstitutionalLendingMarginCoinInfo(productId?: string): Promise<APIResponseV3WithTime<{ | ||
marginToken: any[]; | ||
}>>; | ||
/** | ||
* Get Margin Coin Info With Conversion Rate | ||
*/ | ||
getInstitutionalLendingMarginCoinInfoWithConversionRate(productId?: string): Promise<APIResponseV3WithTime<{ | ||
marginToken: any[]; | ||
}>>; | ||
/** | ||
* Get Loan Orders | ||
*/ | ||
getInstitutionalLendingLoanOrders(params?: { | ||
orderId?: string; | ||
startTime?: number; | ||
endTime?: number; | ||
limit?: number; | ||
}): Promise<APIResponseV3WithTime<{ | ||
marginToken: any[]; | ||
}>>; | ||
/** | ||
* Get Repay Orders | ||
*/ | ||
getInstitutionalLendingRepayOrders(params?: { | ||
startTime?: number; | ||
endTime?: number; | ||
limit?: number; | ||
}): Promise<APIResponseV3WithTime<{ | ||
repayInfo: any[]; | ||
}>>; | ||
/** | ||
* Get LTV | ||
*/ | ||
getInstitutionalLendingLTV(): Promise<APIResponseV3WithTime<{ | ||
ltvInfo: any[]; | ||
}>>; | ||
/** | ||
* Get LTV with Ladder Conversion Rate | ||
*/ | ||
getInstitutionalLendingLTVWithLadderConversionRate(): Promise<APIResponseV3WithTime<{ | ||
ltvInfo: any[]; | ||
}>>; | ||
} |
@@ -148,2 +148,4 @@ "use strict"; | ||
* Covers: Option | ||
* | ||
* @deprecated use getDeliveryPrice() instead | ||
*/ | ||
@@ -154,3 +156,11 @@ getOptionDeliveryPrice(params) { | ||
/** | ||
* Get the delivery price of Inverse futures, USDC futures and Options | ||
* | ||
* Covers: USDC futures / Inverse futures / Option | ||
*/ | ||
getDeliveryPrice(params) { | ||
return this.get('/v5/market/delivery-price', params); | ||
} | ||
/** | ||
* | ||
****** Trade APIs | ||
@@ -348,2 +358,11 @@ * | ||
/** | ||
* Manually add or reduce margin for isolated margin position | ||
* | ||
* Unified account covers: USDT perpetual / USDC perpetual / USDC futures / Inverse contract | ||
* Normal account covers: USDT perpetual / Inverse contract | ||
*/ | ||
addOrReduceMargin(params) { | ||
return this.postPrivate('/v5/position/add-margin', params); | ||
} | ||
/** | ||
* Query users' execution records, sorted by execTime in descending order | ||
@@ -368,2 +387,38 @@ * | ||
* | ||
****** Pre-upgrade APIs | ||
* | ||
*/ | ||
/** | ||
* Get those orders which occurred before you upgrade the account to Unified account. | ||
* | ||
* For now, it only supports to query USDT perpetual, USDC perpetual, Inverse perpetual and futures. | ||
* | ||
* - can get all status in 7 days | ||
* - can only get filled orders beyond 7 days | ||
*/ | ||
getPreUpgradeOrderHistory(params) { | ||
return this.getPrivate('/v5/pre-upgrade/order/history', params); | ||
} | ||
/** | ||
* Get users' execution records which occurred before you upgrade the account to Unified account, sorted by execTime in descending order | ||
* | ||
* For now, it only supports to query USDT perpetual, Inverse perpetual and futures. | ||
* | ||
* - You may have multiple executions in a single order. | ||
* - You can query by symbol, baseCoin, orderId and orderLinkId, and if you pass multiple params, | ||
* the system will process them according to this priority: orderId > orderLinkId > symbol > baseCoin. | ||
*/ | ||
getPreUpgradeTradeHistory(params) { | ||
return this.getPrivate('/v5/pre-upgrade/execution/list', params); | ||
} | ||
/** | ||
* Query user's closed profit and loss records. The results are sorted by createdTime in descending order. | ||
* | ||
* For now, it only supports to query USDT perpetual, Inverse perpetual and futures. | ||
*/ | ||
getPreUpgradeClosedPnl(params) { | ||
return this.getPrivate('/v5/pre-upgrade/position/closed-pnl', params); | ||
} | ||
/** | ||
* | ||
****** Account APIs | ||
@@ -410,7 +465,7 @@ * | ||
/** | ||
* Get the trading fee rate of derivatives. | ||
* Covers: USDT perpetual / Inverse perpetual / Inverse futures | ||
* Get the trading fee rate. | ||
* Covers: Spot / USDT perpetual / Inverse perpetual / Inverse futures / Options | ||
*/ | ||
getFeeRate(symbol) { | ||
return this.getPrivate('/v5/account/fee-rate', symbol ? { symbol } : undefined); | ||
getFeeRate(params) { | ||
return this.getPrivate('/v5/account/fee-rate', params); | ||
} | ||
@@ -584,2 +639,8 @@ /** | ||
/** | ||
* Set auto transfer account after deposit. The same function as the setting for Deposit on web GUI | ||
*/ | ||
setDepositAccount(params) { | ||
return this.postPrivate('/v5/asset/deposit/deposit-to-account', params); | ||
} | ||
/** | ||
* Query deposit records. | ||
@@ -627,2 +688,12 @@ * | ||
* Query the deposit address information of SUB account. | ||
*/ | ||
getSubDepositAddress(coin, chainType, subMemberId) { | ||
return this.getPrivate('/v5/asset/deposit/query-sub-member-address', { | ||
coin, | ||
chainType, | ||
subMemberId, | ||
}); | ||
} | ||
/** | ||
* Query the deposit address information of SUB account. | ||
* | ||
@@ -652,2 +723,8 @@ * CAUTION | ||
/** | ||
* Query withdrawable amount. | ||
*/ | ||
getWithdrawableAmount(params) { | ||
return this.getPrivate('/v5/asset/withdraw/withdrawable-amount', params); | ||
} | ||
/** | ||
* Withdraw assets from the SPOT account. | ||
@@ -800,10 +877,10 @@ * | ||
* | ||
****** Spot Margin Trade APIs | ||
****** Spot Margin Trade APIs (UTA) | ||
* | ||
*/ | ||
/** | ||
* Turn spot margin trade on / off. | ||
* Turn spot margin trade on / off in your UTA account. | ||
* | ||
* CAUTION | ||
* Your account needs to turn on spot margin first | ||
* Your account needs to turn on spot margin first. | ||
*/ | ||
@@ -822,4 +899,116 @@ toggleSpotMarginTrade(spotMarginMode) { | ||
} | ||
/** | ||
* | ||
****** Spot Margin Trade APIs (Normal) | ||
* | ||
*/ | ||
/** | ||
* Get Margin Coin Info | ||
*/ | ||
getSpotMarginCoinInfo(coin) { | ||
return this.getPrivate('/v5/spot-cross-margin-trade/pledge-token', { | ||
coin, | ||
}); | ||
} | ||
/** | ||
* Get Borrowable Coin Info | ||
*/ | ||
getSpotMarginBorrowableCoinInfo(coin) { | ||
return this.getPrivate('/v5/spot-cross-margin-trade/borrow-token', { | ||
coin, | ||
}); | ||
} | ||
/** | ||
* Get Interest & Quota | ||
*/ | ||
getSpotMarginInterestAndQuota(coin) { | ||
return this.getPrivate('/v5/spot-cross-margin-trade/loan-info', { | ||
coin, | ||
}); | ||
} | ||
/** | ||
* Get Loan Account Info | ||
*/ | ||
getSpotMarginLoanAccountInfo() { | ||
return this.getPrivate('/v5/spot-cross-margin-trade/account'); | ||
} | ||
/** | ||
* Borrow | ||
*/ | ||
spotMarginBorrow(params) { | ||
return this.postPrivate('/v5/spot-cross-margin-trade/loan', params); | ||
} | ||
/** | ||
* Repay | ||
*/ | ||
spotMarginRepay(params) { | ||
return this.postPrivate('/v5/spot-cross-margin-trade/repay', params); | ||
} | ||
/** | ||
* Get Borrow Order Detail | ||
*/ | ||
getSpotMarginBorrowOrderDetail(params) { | ||
return this.getPrivate('/v5/spot-cross-margin-trade/orders', params); | ||
} | ||
/** | ||
* Get Repayment Order Detail | ||
*/ | ||
getSpotMarginRepaymentOrderDetail(params) { | ||
return this.getPrivate('/v5/spot-cross-margin-trade/repay-history', params); | ||
} | ||
/** | ||
* Turn spot margin trade on / off in your NORMAL account. | ||
*/ | ||
toggleSpotCrossMarginTrade(params) { | ||
return this.postPrivate('/v5/spot-cross-margin-trade/switch', params); | ||
} | ||
/** | ||
* | ||
****** Institutional Lending | ||
* | ||
*/ | ||
/** | ||
* Get Product Info | ||
*/ | ||
getInstitutionalLendingProductInfo(productId) { | ||
return this.get('/v5/ins-loan/product-infos', { productId }); | ||
} | ||
/** | ||
* Get Margin Coin Info | ||
*/ | ||
getInstitutionalLendingMarginCoinInfo(productId) { | ||
return this.get('/v5/ins-loan/ensure-tokens', { productId }); | ||
} | ||
/** | ||
* Get Margin Coin Info With Conversion Rate | ||
*/ | ||
getInstitutionalLendingMarginCoinInfoWithConversionRate(productId) { | ||
return this.get('/v5/ins-loan/ensure-tokens-convert', { productId }); | ||
} | ||
/** | ||
* Get Loan Orders | ||
*/ | ||
getInstitutionalLendingLoanOrders(params) { | ||
return this.getPrivate('/v5/ins-loan/loan-order', params); | ||
} | ||
/** | ||
* Get Repay Orders | ||
*/ | ||
getInstitutionalLendingRepayOrders(params) { | ||
return this.getPrivate('/v5/ins-loan/repaid-history', params); | ||
} | ||
/** | ||
* Get LTV | ||
*/ | ||
getInstitutionalLendingLTV() { | ||
return this.getPrivate('/v5/ins-loan/ltv'); | ||
} | ||
/** | ||
* Get LTV with Ladder Conversion Rate | ||
*/ | ||
getInstitutionalLendingLTVWithLadderConversionRate() { | ||
return this.getPrivate('/v5/ins-loan/ltv-convert'); | ||
} | ||
} | ||
exports.RestClientV5 = RestClientV5; | ||
//# sourceMappingURL=rest-client-v5.js.map |
@@ -7,5 +7,5 @@ import { OrderSide } from '../shared'; | ||
side: OrderSide; | ||
positionIdx?: '0' | '1' | '2'; | ||
orderType: UMOrderType; | ||
qty: string; | ||
timeInForce: USDCTimeInForce; | ||
price?: string; | ||
@@ -15,10 +15,13 @@ triggerDirection?: '1' | '2'; | ||
triggerBy?: string; | ||
tpTriggerBy?: string; | ||
slTriggerBy?: string; | ||
timeInForce: USDCTimeInForce; | ||
positionIdx?: '0' | '1' | '2'; | ||
orderLinkId?: string; | ||
takeProfit?: string; | ||
stopLoss?: string; | ||
tpTriggerBy?: string; | ||
slTriggerBy?: string; | ||
reduceOnly?: boolean; | ||
closeOnTrigger?: boolean; | ||
tpslMode?: 'Partial' | 'Full'; | ||
tpOrderType?: UMOrderType; | ||
slOrderType?: UMOrderType; | ||
} | ||
@@ -40,7 +43,8 @@ export interface ContractHistoricOrdersRequest { | ||
export interface ContractModifyOrderRequest { | ||
symbol: string; | ||
orderId?: string; | ||
orderLinkId?: string; | ||
symbol: string; | ||
price?: string; | ||
qty?: string; | ||
price?: string; | ||
triggerPrice?: string; | ||
takeProfit?: string; | ||
@@ -51,3 +55,4 @@ stopLoss?: string; | ||
triggerBy?: string; | ||
triggerPrice?: string; | ||
tpLimitPrice?: string; | ||
slLimitPrice?: string; | ||
} | ||
@@ -88,8 +93,13 @@ export interface ContractActiveOrdersRequest { | ||
stopLoss?: string; | ||
activePrice?: string; | ||
trailingStop?: string; | ||
tpslMode?: 'Full' | 'Partial'; | ||
tpSize?: string; | ||
slSize?: string; | ||
tpTriggerBy?: string; | ||
slTriggerBy?: string; | ||
slSize?: string; | ||
tpSize?: string; | ||
trailingStop?: string; | ||
activePrice?: string; | ||
tpLimitPrice?: string; | ||
slLimitPrice?: string; | ||
tpOrderType?: UMOrderType; | ||
slOrderType?: UMOrderType; | ||
/** 0-one-way, 1-buy side, 2-sell side */ | ||
@@ -96,0 +106,0 @@ positionIdx?: 0 | 1 | 2; |
@@ -15,4 +15,5 @@ export * from './account-asset'; | ||
export * from './v5-position'; | ||
export * from './v5-pre-upgrade'; | ||
export * from './v5-trade'; | ||
export * from './v5-user'; | ||
export * from './v5-spot-leverage-token'; |
@@ -27,2 +27,3 @@ "use strict"; | ||
__exportStar(require("./v5-position"), exports); | ||
__exportStar(require("./v5-pre-upgrade"), exports); | ||
__exportStar(require("./v5-trade"), exports); | ||
@@ -29,0 +30,0 @@ __exportStar(require("./v5-user"), exports); |
@@ -13,2 +13,7 @@ import { AccountTypeV5, CategoryV5, TransactionTypeV5 } from '../v5-shared'; | ||
} | ||
export interface GetFeeRateParamsV5 { | ||
category: CategoryV5; | ||
symbol?: string; | ||
baseCoin?: string; | ||
} | ||
export interface GetTransactionLogParamsV5 { | ||
@@ -15,0 +20,0 @@ accountType?: AccountTypeV5; |
import { KlineIntervalV3 } from '../shared'; | ||
import { CategoryV5, OptionTypeV5 } from '../v5-shared'; | ||
import { CategoryV5, InstrumentStatusV5, OptionTypeV5 } from '../v5-shared'; | ||
export interface GetKlineParamsV5 { | ||
@@ -38,2 +38,3 @@ category: 'spot' | 'linear' | 'inverse'; | ||
symbol?: string; | ||
status?: InstrumentStatusV5; | ||
baseCoin?: string; | ||
@@ -81,3 +82,3 @@ limit?: number; | ||
baseCoin?: string; | ||
period?: number; | ||
period?: 7 | 14 | 21 | 30 | 60 | 90 | 180 | 270; | ||
startTime?: number; | ||
@@ -100,1 +101,8 @@ endTime?: number; | ||
} | ||
export interface GetDeliveryPriceParamsV5 { | ||
category: 'linear' | 'inverse' | 'option'; | ||
symbol?: string; | ||
baseCoin?: string; | ||
limit?: number; | ||
cursor?: string; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { CategoryV5, ExecTypeV5, OrderTriggerByV5, PositionIdx, TPSLModeV5 } from '../v5-shared'; | ||
import { CategoryV5, ExecTypeV5, OrderTriggerByV5, OrderTypeV5, PositionIdx, TPSLModeV5 } from '../v5-shared'; | ||
export interface PositionInfoParamsV5 { | ||
@@ -41,4 +41,4 @@ category: CategoryV5; | ||
export interface SetTradingStopParamsV5 { | ||
category: CategoryV5; | ||
symbol: string; | ||
category: CategoryV5; | ||
takeProfit?: string; | ||
@@ -50,4 +50,9 @@ stopLoss?: string; | ||
activePrice?: string; | ||
tpslMode?: TPSLModeV5; | ||
tpSize?: string; | ||
slSize?: string; | ||
tpLimitPrice?: string; | ||
slLimitPrice?: string; | ||
tpOrderType?: OrderTypeV5; | ||
slOrderType?: OrderTypeV5; | ||
positionIdx: PositionIdx; | ||
@@ -61,2 +66,8 @@ } | ||
} | ||
export interface AddOrReduceMarginParamsV5 { | ||
category: 'linear' | 'inverse'; | ||
symbol: string; | ||
margin: string; | ||
positionIDex?: PositionIdx; | ||
} | ||
export interface GetExecutionListParamsV5 { | ||
@@ -63,0 +74,0 @@ category: CategoryV5; |
@@ -1,2 +0,2 @@ | ||
import { CategoryV5, OrderFilterV5, OrderSideV5, OrderTimeInForceV5, OrderTriggerByV5, OrderTypeV5, PositionIdx } from '../v5-shared'; | ||
import { CategoryV5, OrderFilterV5, OrderSMPTypeV5, OrderSideV5, OrderStatusV5, OrderTimeInForceV5, OrderTriggerByV5, OrderTypeV5, PositionIdx } from '../v5-shared'; | ||
export interface OrderParamsV5 { | ||
@@ -24,3 +24,9 @@ category: CategoryV5; | ||
closeOnTrigger?: boolean; | ||
smpType?: OrderSMPTypeV5; | ||
mmp?: boolean; | ||
tpslMode?: 'Full' | 'Partial'; | ||
tpLimitPrice?: string; | ||
slLimitPrice?: string; | ||
tpOrderType?: OrderTypeV5; | ||
slOrderType?: OrderTypeV5; | ||
} | ||
@@ -41,2 +47,4 @@ export interface AmendOrderParamsV5 { | ||
triggerBy?: OrderTriggerByV5; | ||
tpLimitPrice?: string; | ||
slLimitPrice?: string; | ||
} | ||
@@ -59,5 +67,19 @@ export interface CancelOrderParamsV5 { | ||
orderFilter?: OrderFilterV5; | ||
orderStatus?: OrderStatusV5; | ||
limit?: number; | ||
cursor?: string; | ||
} | ||
export interface GetAccountHistoricOrdersPArams { | ||
category: CategoryV5; | ||
symbol?: string; | ||
baseCoin?: string; | ||
orderId?: string; | ||
orderLinkId?: string; | ||
orderFilter?: OrderFilterV5; | ||
orderStatus?: OrderStatusV5; | ||
startTime?: number; | ||
endTime?: number; | ||
limit?: number; | ||
cursor?: string; | ||
} | ||
export interface CancelAllOrdersParamsV5 { | ||
@@ -81,2 +103,3 @@ category: CategoryV5; | ||
mmp?: boolean; | ||
smpType?: OrderSMPTypeV5; | ||
} | ||
@@ -83,0 +106,0 @@ export interface BatchAmendOrderParamsV5 { |
@@ -11,29 +11,39 @@ export interface PaginatedResult<TList = any> { | ||
symbol: string; | ||
orderId: string; | ||
orderLinkId: string; | ||
side: string; | ||
orderType: string; | ||
price: string; | ||
iv: string; | ||
qty: string; | ||
reduceOnly: boolean; | ||
timeInForce: string; | ||
orderStatus: string; | ||
leavesQty: string; | ||
leavesValue: string; | ||
cumExecQty: string; | ||
cumExecValue: string; | ||
cumExecFee: string; | ||
positionIdx: number; | ||
lastPriceOnCreated: string; | ||
rejectReason: string; | ||
orderLinkId: string; | ||
createdTime: string; | ||
updatedTime: string; | ||
orderId: string; | ||
cancelType: string; | ||
rejectReason: string; | ||
stopOrderType: string; | ||
triggerDirection: number; | ||
triggerBy: string; | ||
triggerPrice: string; | ||
cumExecValue: string; | ||
cumExecFee: string; | ||
cumExecQty: string; | ||
leavesValue: string; | ||
leavesQty: string; | ||
takeProfit: string; | ||
stopLoss: string; | ||
tpslMode: string; | ||
tpLimitPrice: string; | ||
slLimitPrice: string; | ||
tpTriggerBy: string; | ||
slTriggerBy: string; | ||
triggerPrice: string; | ||
reduceOnly: boolean; | ||
closeOnTrigger: boolean; | ||
triggerDirection: number; | ||
positionIdx: number; | ||
blockTradeId: string; | ||
smpType: string; | ||
smpGroup: number; | ||
smpOrderId: string; | ||
} | ||
@@ -40,0 +50,0 @@ export interface ContractSymbolTicker { |
@@ -68,2 +68,3 @@ import { AccountMarginModeV5, AccountTypeV5, CategoryV5, TransactionTypeV5, UnifiedUpdateStatusV5 } from '../v5-shared'; | ||
symbol: string; | ||
baseCoin: string; | ||
takerFeeRate: string; | ||
@@ -70,0 +71,0 @@ makerFeeRate: string; |
@@ -230,2 +230,3 @@ import { CategoryCursorListV5, ContractTypeV5, InstrumentStatusV5, OptionTypeV5, OrderSideV5 } from '../v5-shared'; | ||
} | ||
/** @deprecated use DeliveryPriceV5 instead */ | ||
export interface OptionDeliveryPriceV5 { | ||
@@ -236,1 +237,6 @@ symbol: string; | ||
} | ||
export interface DeliveryPriceV5 { | ||
symbol: string; | ||
deliveryPrice: string; | ||
deliveryTime: string; | ||
} |
@@ -34,2 +34,27 @@ import { CategoryV5, ExecTypeV5, OrderSideV5, OrderTypeV5, PositionIdx, StopOrderTypeV5, TPSLModeV5, TradeModeV5 } from '../v5-shared'; | ||
} | ||
export interface AddOrReduceMarginResultV5 { | ||
category: CategoryV5; | ||
symbol: string; | ||
positionIdx: PositionIdx; | ||
riskId: number; | ||
riskLimitValue: string; | ||
size: string; | ||
avgPrice: string; | ||
liqPrice: string; | ||
bustPrice: string; | ||
markPrice: string; | ||
positionValue: string; | ||
leverage: string; | ||
autoAddMargin: 0 | 1; | ||
positionStatus: 'Normal' | 'Liq' | 'Adl'; | ||
positionIM: string; | ||
positionMM: string; | ||
takeProfit: string; | ||
stopLoss: string; | ||
trailingStop: string; | ||
unrealisedPnl: string; | ||
cumRealisedPnl: string; | ||
createdTime: string; | ||
updatedTime: string; | ||
} | ||
export interface ExecutionV5 { | ||
@@ -60,2 +85,3 @@ symbol: string; | ||
blockTradeId?: string; | ||
closedSize?: string; | ||
} | ||
@@ -62,0 +88,0 @@ export interface ClosedPnLV5 { |
@@ -32,2 +32,5 @@ import { CategoryV5, OrderCancelTypeV5, OrderRejectReasonV5, OrderSideV5, OrderStatusV5, OrderTimeInForceV5, OrderTriggerByV5, OrderTypeV5, PositionIdx, StopOrderTypeV5 } from '../v5-shared'; | ||
stopLoss?: string; | ||
tpslMode: 'Full' | 'Partial' | ''; | ||
tpLimitPrice: string; | ||
slLimitPrice: string; | ||
tpTriggerBy?: OrderTriggerByV5; | ||
@@ -40,2 +43,6 @@ slTriggerBy?: OrderTriggerByV5; | ||
closeOnTrigger?: boolean; | ||
placeType: 'iv' | 'price' | ''; | ||
smpType: string; | ||
smpGroup: string; | ||
smpOrderId: string; | ||
createdTime: string; | ||
@@ -42,0 +49,0 @@ updatedTime: string; |
export declare type CategoryV5 = 'spot' | 'linear' | 'inverse' | 'option'; | ||
export declare type ContractTypeV5 = 'InversePerpetual' | 'LinearPerpetual' | 'InverseFutures'; | ||
export declare type InstrumentStatusV5 = 'Pending' | 'Trading' | 'Settling' | 'Closed'; | ||
export declare type InstrumentStatusV5 = 'PreLaunch' | 'Trading' | 'Settling' | 'Delivering' | 'Closed'; | ||
export declare type OrderFilterV5 = 'Order' | 'tpslOrder'; | ||
@@ -9,2 +9,3 @@ export declare type OrderSideV5 = 'Buy' | 'Sell'; | ||
export declare type OrderTriggerByV5 = 'LastPrice' | 'IndexPrice' | 'MarkPrice'; | ||
export declare type OrderSMPTypeV5 = 'None' | 'CancelMaker' | 'CancelTaker' | 'CancelBoth'; | ||
export declare type OrderStatusV5 = 'Created' | 'New' | 'Rejected' | 'PartiallyFilled' | 'PartiallyFilledCanceled' | 'Filled' | 'Cancelled' | 'Untriggered' | 'Triggered' | 'Deactivated' | 'Active'; | ||
@@ -65,2 +66,4 @@ export declare type OrderCancelTypeV5 = 'CancelByUser' | 'CancelByReduceOnly' | 'CancelByPrepareLiq' | 'CancelAllBeforeLiq' | 'CancelByPrepareAdl' | 'CancelAllBeforeAdl' | 'CancelByAdmin' | 'CancelByTpSlTsClear' | 'CancelByPzSideCh'; | ||
Derivatives?: string[]; | ||
CopyTrading?: string[]; | ||
BlockTrade?: string[]; | ||
Exchange?: string[]; | ||
@@ -67,0 +70,0 @@ NFT?: string[]; |
{ | ||
"name": "bybit-api", | ||
"version": "3.6.1", | ||
"version": "3.7.0", | ||
"description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong 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 not supported yet
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
564325
196
11379