Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More

okx-api

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

okx-api - npm Package Compare versions

Comparing version 1.4.6 to 1.4.7

import { AxiosRequestConfig } from 'axios';
import BaseRestClient from './util/BaseRestClient';
import { ContractGridDirection, GridAlgoOrderType, GridAlgoSubOrderType, InstrumentType, MarginMode, numberInString, Ticker, AmendOrderRequest, CancelAlgoOrderRequest, OrderIdRequest, ClosePositionRequest, OrderRequest, OrderHistoryRequest, FillsHistoryRequest, AlgoRecentHistoryRequest, AlgoLongHistoryRequest, PaginatedSymbolRequest, OrderResult, CancelledOrderResult, AmendedOrder, ClosedPositions, OrderDetails, OrderListItem, HistoricOrder, OrderFill, AlgoOrderResult, AlgoOrderListItem, HistoricAlgoOrder, BlockCounterParty, CreateBlockRFQRequest, CreateRFQResult, CancelBlockRFQRequest, CancelBlockQuoteResult, CancelMultipleBlockRFQRequest, TimestampObject, ExecuteBlockQuoteResult, ExecuteBlockQuoteRequest, CreateBlockQuoteRequest, CreateBlockQuoteResult, CancelBlockRFQResult, CancelBlockQuoteRequest, CancelMultipleBlockQuoteRequest, BlockRFQResult, GetBlockRFQSParams, GetBlockQuoteParams, GetBlockQuoteResult, FundingCurrency, FundingBalance, AccountAssetValuation, FundTransferResult, FundTransferState, AssetBillDetails, AccountBalance, GetPositionsParams, AccountPosition, GetHistoricPositionParams, HistoricAccountPosition, AccountPositionRisk, AccountBill, AccountConfiguration, AccountPositionModeResult, AccountLeverageResult, AccountMaxOrderAmount, AccountMaxTradableAmount, AccountChangeMarginResult, AccountLevel, AccountLeverage, AccountMaxLoan, AccountModeResult, AccountFeeRate, AccountIsolatedMode, AutoLoanResult, SubAccount, SubAccountAPIReset, SubAccountBalances, SubAccountTransferResult, IndexTicker, OrderBook, Candle, CandleNoVolume, Trade, Pagination, APIResponse, GetGridAlgoOrdersRequest, FundsTransferRequest, WithdrawRequest, WithdrawResponse, ConvertTradeRequest, ConvertQuoteEstimateRequest, SetLeverageRequest, ChangePositionMarginRequest, SubAccountTransferRequest, GridAlgoOrderRequest, StopGridAlgoOrderRequest, APICredentials, RestClientOptions, APIMarket, Instrument, PosMode, AlgoOrderDetailsRequest, AlgoOrderDetailsResult, AmendAlgoOrderRequest, AmendAlgoOrderResult, AlgoOrderRequest, EconomicCalendarData, UnitConvertData, EconomicCalendarRequest, UnitConvertRequest, PositionSide, AdjustLeverageInfo, InterestAccrued, InterestRate, Greeks, AccountRiskState, SystemTime, MaxWithdrawal, WithdrawalHistoryRequest, FundingRateRequest, GetInstrumentsRequest, QuickMarginBorrowRepayRequest, GetQuickMarginBorrowRepayHistoryRequest, GetVIPInterestRequest, VIPInterest, GetVIPLoanOrderListRequest, VIPLoanOrder, GetVIPLoanOrderDetailRequest, VIPLoanOrderDetail, FixedLoanBorrowingLimit, GetFixedLoanBorrowQuoteRequest, FixedLoanBorrowQuote, SubmitFixedLoanBorrowingOrderRequest, UpdateFixedLoanBorrowingOrderRequest, GetFixedLoanBorrowingOrdersListRequest, PositionBuilderRequest, SetMMPConfigRequest, MMPConfig, CancelAllAfterResponse, CloseContractGridPositionRequest, GetRSIBackTestingRequest, SubAccountMaxWithdrawal, GetSubAccountMaxWithdrawalsRequest, GetManagedSubAccountTransferHistoryRequest, ManagedSubAccountTransfer, SetSubAccountLoanAllocationRequest, NonTradableAsset, GetDepositWithdrawStatusRequest, GetPremiumHistoryRequest, GetContractOpenInterestHistoryRequest, GetContractTakerVolumeRequest, GetTopTradersContractLongShortRatioRequest, GetLendingOrderListRequest, GetLendingSubOrderListRequest, LendingOrder, CreateSignalRequest, GetSignalsRequest, CreateSignalBotRequest, AdjustMarginBalanceRequest, AmendTPSLRequest, SetSignalInstrumentsRequest, GetSignalBotRequest, GetSignalBotPositionHistoryRequest, PlaceSubOrderRequest, CancelSubOrderRequest, GetSignalBotSubOrdersRequest, GetSignalBotEventHistoryRequest, GetCurrentSubpositionsRequest, GetSubpositionsHistoryRequest, PlaceCTAlgoOrderRequest, CloseSubpositionRequest, GetCTProfitDetailsRequest, CopySettingsRequest, AmendRecurringBuyOrderRequest, GetRecurringBuyOrderListRequest, PlaceRecurringBuyOrderRequest, SetCTBatchLeverageRequest, GetCTBatchLeverageInfoRequest, GetCTHistoryLeadTradersRequest, GetLeadTraderRanksRequest, LeadTraderPnl, LeadTraderStats, GetLeadTraderStatsRequest, LeadTraderPreference, LeadTraderCurrentPosition, GetLeadTraderPositionsRequest, LeadTraderPositionHistory, GetCopyTradersRequest, GetPrivateLeadTraderRanksRequest, OptionTrade, GetOptionTradesRequest, OptionTrades, BlockMakerInstrumentSettings, SetQuoteProductsRequest, SetMmpConfigRequest, PlaceSpreadOrderRequest, PlaceSpreadOrderResponse, CancelSpreadOrderResponse, UpdateSpreadOrderRequest, UpdateSpreadOrderResponse, SpreadOrder, GetActiveSpreadOrdersRequest, GetSpreadOrderHistoryRequest, GetSpreadOrderHistoryArchiveRequest, GetSpreadTradesRequest, SpreadTrade, SpreadDetails, GetSpreadsRequest, SpreadOrderBook, SpreadTicker, PublicSpreadTrade, GetSpreadCandlesRequest, SpreadCandle, CandleRequest, AccountInstrument, SetMMPConfigResult, CreateSignalResult, GetSignalsResult, CreateSignalBotResult, CancelSignalBotsResult, RecurringBuyOrderResult, RecurringBuyOrder, RecurringBuySubOrder, SubpositionsHistory, CurrentSubposition, GetAccountConfigurationResult, GetCTBatchLeverageInfoResult, GetCTHistoryLeadTradersResult, GetCTMyLeadTradersResult, GetCTProfitDetailsResult, GetCTTotalProfitResult, GetCTUnrealizedProfitResult, GetCopySettingsResult, GetCopyTradersResult, GetCopyTradingConfigResult, GetLeadTraderRanksResult, GetPrivateLeadTraderRanksResult, PlaceCTAlgoOrderResult, SetCTBatchLeverageResult, QuickMarginBorrowRepayRecord, BlockMMPConfig, PublicBlockTrade, QuickMarginBorrowRepayResult, SetMmpConfigResult, OrderPrecheckRequest, AccountHistoryBill, MaxGridQuantityRequest, Announcement } from './types';
import { ContractGridDirection, GridAlgoOrderType, GridAlgoSubOrderType, InstrumentType, MarginMode, numberInString, Ticker, AmendOrderRequest, CancelAlgoOrderRequest, OrderIdRequest, ClosePositionRequest, OrderRequest, OrderHistoryRequest, FillsHistoryRequest, AlgoRecentHistoryRequest, AlgoLongHistoryRequest, PaginatedSymbolRequest, OrderResult, CancelledOrderResult, AmendedOrder, ClosedPositions, OrderDetails, OrderListItem, HistoricOrder, OrderFill, AlgoOrderResult, AlgoOrderListItem, HistoricAlgoOrder, BlockCounterParty, CreateBlockRFQRequest, CreateRFQResult, CancelBlockRFQRequest, CancelBlockQuoteResult, CancelMultipleBlockRFQRequest, TimestampObject, ExecuteBlockQuoteResult, ExecuteBlockQuoteRequest, CreateBlockQuoteRequest, CreateBlockQuoteResult, CancelBlockRFQResult, CancelBlockQuoteRequest, CancelMultipleBlockQuoteRequest, BlockRFQResult, GetBlockRFQSParams, GetBlockQuoteParams, GetBlockQuoteResult, FundingCurrency, FundingBalance, AccountAssetValuation, FundTransferResult, FundTransferState, AssetBillDetails, AccountBalance, GetPositionsParams, AccountPosition, GetHistoricPositionParams, HistoricAccountPosition, AccountPositionRisk, AccountBill, AccountConfiguration, AccountPositionModeResult, AccountLeverageResult, AccountMaxOrderAmount, AccountMaxTradableAmount, AccountChangeMarginResult, AccountLevel, AccountLeverage, AccountMaxLoan, AccountModeResult, AccountFeeRate, AccountIsolatedMode, AutoLoanResult, SubAccount, SubAccountAPIReset, SubAccountBalances, SubAccountTransferResult, IndexTicker, OrderBook, Candle, CandleNoVolume, Trade, Pagination, APIResponse, GetGridAlgoOrdersRequest, FundsTransferRequest, WithdrawRequest, WithdrawResponse, ConvertTradeRequest, ConvertQuoteEstimateRequest, SetLeverageRequest, ChangePositionMarginRequest, SubAccountTransferRequest, GridAlgoOrderRequest, StopGridAlgoOrderRequest, APICredentials, RestClientOptions, APIMarket, Instrument, PosMode, AlgoOrderDetailsRequest, AlgoOrderDetailsResult, AmendAlgoOrderRequest, AmendAlgoOrderResult, AlgoOrderRequest, EconomicCalendarData, UnitConvertData, EconomicCalendarRequest, UnitConvertRequest, PositionSide, AdjustLeverageInfo, InterestAccrued, InterestRate, Greeks, AccountRiskState, SystemTime, MaxWithdrawal, WithdrawalHistoryRequest, FundingRateRequest, GetInstrumentsRequest, QuickMarginBorrowRepayRequest, GetQuickMarginBorrowRepayHistoryRequest, GetVIPInterestRequest, VIPInterest, GetVIPLoanOrderListRequest, VIPLoanOrder, GetVIPLoanOrderDetailRequest, VIPLoanOrderDetail, FixedLoanBorrowingLimit, GetFixedLoanBorrowQuoteRequest, FixedLoanBorrowQuote, SubmitFixedLoanBorrowingOrderRequest, UpdateFixedLoanBorrowingOrderRequest, GetFixedLoanBorrowingOrdersListRequest, PositionBuilderRequest, SetMMPConfigRequest, MMPConfig, CancelAllAfterResponse, CloseContractGridPositionRequest, GetRSIBackTestingRequest, SubAccountMaxWithdrawal, GetSubAccountMaxWithdrawalsRequest, GetManagedSubAccountTransferHistoryRequest, ManagedSubAccountTransfer, SetSubAccountLoanAllocationRequest, NonTradableAsset, GetDepositWithdrawStatusRequest, GetPremiumHistoryRequest, GetContractOpenInterestHistoryRequest, GetContractTakerVolumeRequest, GetTopTradersContractLongShortRatioRequest, GetLendingOrderListRequest, GetLendingSubOrderListRequest, LendingOrder, CreateSignalRequest, GetSignalsRequest, CreateSignalBotRequest, AdjustMarginBalanceRequest, AmendTPSLRequest, SetSignalInstrumentsRequest, GetSignalBotRequest, GetSignalBotPositionHistoryRequest, PlaceSubOrderRequest, CancelSubOrderRequest, GetSignalBotSubOrdersRequest, GetSignalBotEventHistoryRequest, GetCurrentSubpositionsRequest, GetSubpositionsHistoryRequest, PlaceCTAlgoOrderRequest, CloseSubpositionRequest, GetCTProfitDetailsRequest, CopySettingsRequest, AmendRecurringBuyOrderRequest, GetRecurringBuyOrderListRequest, PlaceRecurringBuyOrderRequest, SetCTBatchLeverageRequest, GetCTBatchLeverageInfoRequest, GetCTHistoryLeadTradersRequest, GetLeadTraderRanksRequest, LeadTraderPnl, LeadTraderStats, GetLeadTraderStatsRequest, LeadTraderPreference, LeadTraderCurrentPosition, GetLeadTraderPositionsRequest, LeadTraderPositionHistory, GetCopyTradersRequest, GetPrivateLeadTraderRanksRequest, OptionTrade, GetOptionTradesRequest, OptionTrades, BlockMakerInstrumentSettings, SetQuoteProductsRequest, SetMmpConfigRequest, PlaceSpreadOrderRequest, PlaceSpreadOrderResponse, CancelSpreadOrderResponse, UpdateSpreadOrderRequest, UpdateSpreadOrderResponse, SpreadOrder, GetActiveSpreadOrdersRequest, GetSpreadOrderHistoryRequest, GetSpreadOrderHistoryArchiveRequest, GetSpreadTradesRequest, SpreadTrade, SpreadDetails, GetSpreadsRequest, SpreadOrderBook, SpreadTicker, PublicSpreadTrade, GetSpreadCandlesRequest, SpreadCandle, CandleRequest, AccountInstrument, SetMMPConfigResult, CreateSignalResult, GetSignalsResult, CreateSignalBotResult, CancelSignalBotsResult, RecurringBuyOrderResult, RecurringBuyOrder, RecurringBuySubOrder, SubpositionsHistory, CurrentSubposition, GetAccountConfigurationResult, GetCTBatchLeverageInfoResult, GetCTHistoryLeadTradersResult, GetCTMyLeadTradersResult, GetCTProfitDetailsResult, GetCTTotalProfitResult, GetCTUnrealizedProfitResult, GetCopySettingsResult, GetCopyTradersResult, GetCopyTradingConfigResult, GetLeadTraderRanksResult, GetPrivateLeadTraderRanksResult, PlaceCTAlgoOrderResult, SetCTBatchLeverageResult, QuickMarginBorrowRepayRecord, BlockMMPConfig, PublicBlockTrade, QuickMarginBorrowRepayResult, SetMmpConfigResult, OrderPrecheckRequest, AccountHistoryBill, MaxGridQuantityRequest, GetBorrowRepayHistoryRequest, BorrowRepayHistoryItem, Announcement } from './types';
import { ASSET_BILL_TYPE } from './constants';

@@ -65,3 +65,11 @@ export declare class RestClient extends BaseRestClient {

changePositionMargin(params: ChangePositionMarginRequest): Promise<AccountChangeMarginResult[]>;
/**
* @deprecated - Use getLeverageV2() instead, which uses an object for all parameters.
*/
getLeverage(instId: string, mgnMode: MarginMode): Promise<AccountLeverage[]>;
getLeverageV2(params: {
instId?: string;
ccy?: string;
mgnMode: MarginMode;
}): Promise<AccountLeverage[]>;
getLeverageEstimatedInfo(params: {

@@ -146,2 +154,17 @@ instType: string;

getFixedLoanBorrowOrders(params: GetFixedLoanBorrowingOrdersListRequest): Promise<any[]>;
manualBorrowRepay(params: {
ccy: string;
side: 'borrow' | 'repay';
amt: string;
}): Promise<{
ccy: string;
side: 'borrow' | 'repay';
amt: string;
}[]>;
setAutoRepay(params: {
autoRepay: boolean;
}): Promise<{
autoRepay: boolean;
}[]>;
getBorrowRepayHistory(params?: GetBorrowRepayHistoryRequest): Promise<BorrowRepayHistoryItem[]>;
positionBuilder(params: PositionBuilderRequest): Promise<any[]>;

@@ -148,0 +171,0 @@ updateRiskOffsetAmount(params: {

@@ -106,2 +106,5 @@ "use strict";

}
/**
* @deprecated - Use getLeverageV2() instead, which uses an object for all parameters.
*/
getLeverage(instId, mgnMode) {

@@ -113,2 +116,5 @@ return this.getPrivate('/api/v5/account/leverage-info', {

}
getLeverageV2(params) {
return this.getPrivate('/api/v5/account/leverage-info', params);
}
getLeverageEstimatedInfo(params) {

@@ -220,2 +226,11 @@ return this.getPrivate('/api/v5/account/adjust-leverage-info', params);

}
manualBorrowRepay(params) {
return this.postPrivate('/api/v5/account/spot-manual-borrow-repay', params);
}
setAutoRepay(params) {
return this.postPrivate('/api/v5/account/set-auto-repay', params);
}
getBorrowRepayHistory(params) {
return this.getPrivate('/api/v5/account/spot-borrow-repay-history', params);
}
positionBuilder(params) {

@@ -222,0 +237,0 @@ return this.postPrivate('/api/v5/account/position-builder', params);

@@ -117,3 +117,11 @@ import { InstrumentType, MarginMode, PositionSide, WithdrawState } from '../shared';

limit?: string;
term?: string;
}
export interface GetBorrowRepayHistoryRequest {
ccy?: string;
type?: 'auto_borrow' | 'auto_repay' | 'manual_borrow' | 'manual_repay';
after?: string;
before?: string;
limit?: string;
}
export interface PositionBuilderRequest {

@@ -120,0 +128,0 @@ inclRealPosAndEq?: boolean;

@@ -6,3 +6,3 @@ export interface PlaceSpreadOrderRequest {

side: 'buy' | 'sell';
ordType: 'limit' | 'post_only' | 'ioc';
ordType: 'limit' | 'post_only' | 'ioc' | 'market';
sz: string;

@@ -20,3 +20,3 @@ px: string;

sprdId?: string;
ordType?: 'limit' | 'post_only' | 'ioc';
ordType?: 'limit' | 'post_only' | 'ioc' | 'market';
state?: 'live' | 'partially_filled';

@@ -29,3 +29,3 @@ beginId?: string;

sprdId?: string;
ordType?: 'limit' | 'post_only' | 'ioc';
ordType?: 'limit' | 'post_only' | 'ioc' | 'market';
state?: 'canceled' | 'filled';

@@ -40,3 +40,3 @@ beginId?: string;

sprdId?: string;
ordType?: 'limit' | 'post_only' | 'ioc';
ordType?: 'limit' | 'post_only' | 'ioc' | 'market';
state?: 'canceled' | 'filled';

@@ -43,0 +43,0 @@ instType?: 'SPOT' | 'FUTURES' | 'SWAP';

@@ -392,2 +392,3 @@ import { AccountLevel, MarginMode, PositionSide, WithdrawState } from '../shared';

minBorrow: string;
term: string;
}

@@ -426,1 +427,8 @@ export interface FixedLoanBorrowingLimit {

}
export interface BorrowRepayHistoryItem {
ccy: string;
type: 'auto_borrow' | 'auto_repay' | 'manual_borrow' | 'manual_repay';
amt: string;
accBorrowed: string;
ts: string;
}

@@ -22,2 +22,3 @@ import { ASSET_BILL_TYPE } from '../../../constants';

wdTickSz: string;
burningFeeRate: string;
}

@@ -90,2 +91,4 @@ export interface FundingBalance {

needTag: boolean;
burningFeeRate: string;
feeCcy: string;
}
{
"name": "okx-api",
"version": "1.4.6",
"version": "1.4.7",
"description": "Complete & robust Node.js SDK for OKX's REST APIs and 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