bybit-api
Advanced tools
Comparing version 2.3.0 to 2.3.1
@@ -41,1 +41,10 @@ export declare const linearPositionModeEnum: { | ||
}; | ||
/** | ||
* Position idx, used to identify positions in different position modes. | ||
* Required if you are under One-Way Mode: | ||
*/ | ||
export declare enum LinearPositionIdx { | ||
OneWayMode = 0, | ||
BuySide = 1, | ||
SellSide = 2 | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.API_ERROR_CODE = exports.positionTpSlModeEnum = exports.linearPositionModeEnum = void 0; | ||
exports.LinearPositionIdx = exports.API_ERROR_CODE = exports.positionTpSlModeEnum = exports.linearPositionModeEnum = void 0; | ||
exports.linearPositionModeEnum = { | ||
@@ -44,2 +44,12 @@ OneWayMode: 'MergedSingle', | ||
}; | ||
/** | ||
* Position idx, used to identify positions in different position modes. | ||
* Required if you are under One-Way Mode: | ||
*/ | ||
var LinearPositionIdx; | ||
(function (LinearPositionIdx) { | ||
LinearPositionIdx[LinearPositionIdx["OneWayMode"] = 0] = "OneWayMode"; | ||
LinearPositionIdx[LinearPositionIdx["BuySide"] = 1] = "BuySide"; | ||
LinearPositionIdx[LinearPositionIdx["SellSide"] = 2] = "SellSide"; | ||
})(LinearPositionIdx = exports.LinearPositionIdx || (exports.LinearPositionIdx = {})); | ||
//# sourceMappingURL=enum.js.map |
@@ -7,5 +7,4 @@ export * from './inverse-client'; | ||
export * from './logger'; | ||
export * from './types/shared'; | ||
export * from './types/spot'; | ||
export * from './types'; | ||
export * from './util/WsStore'; | ||
export * from './constants/enum'; |
@@ -19,6 +19,5 @@ "use strict"; | ||
__exportStar(require("./logger"), exports); | ||
__exportStar(require("./types/shared"), exports); | ||
__exportStar(require("./types/spot"), exports); | ||
__exportStar(require("./types"), exports); | ||
__exportStar(require("./util/WsStore"), exports); | ||
__exportStar(require("./constants/enum"), exports); | ||
//# sourceMappingURL=index.js.map |
import { AxiosRequestConfig } from 'axios'; | ||
import { RestClientOptions } from './util/requestUtils'; | ||
import { APIResponse, APIResponseWithTime, AssetExchangeRecordsReq, CoinParam, SymbolInfo, SymbolIntervalFromLimitParam, SymbolLimitParam, SymbolParam, SymbolPeriodLimitParam, WalletFundRecordsReq, WithdrawRecordsReq } from './types/shared'; | ||
import { APIResponse, APIResponseWithTime, AssetExchangeRecordsReq, CoinParam, LinearOrder, NewLinearOrder, PerpPosition, PerpPositionRoot, SymbolInfo, SymbolIntervalFromLimitParam, SymbolLimitParam, SymbolParam, SymbolPeriodLimitParam, WalletBalances, WalletFundRecordsReq, WithdrawRecordsReq } from './types'; | ||
import { linearPositionModeEnum, positionTpSlModeEnum } from './constants/enum'; | ||
@@ -54,3 +54,3 @@ import BaseRestClient from './util/BaseRestClient'; | ||
*/ | ||
getWalletBalance(params?: Partial<CoinParam>): Promise<APIResponseWithTime<any>>; | ||
getWalletBalance(params?: Partial<CoinParam>): Promise<APIResponseWithTime<WalletBalances>>; | ||
getWalletFundRecords(params?: WalletFundRecordsReq): Promise<APIResponseWithTime<any>>; | ||
@@ -71,18 +71,3 @@ getWithdrawRecords(params?: WithdrawRecordsReq): Promise<APIResponseWithTime<any>>; | ||
*/ | ||
placeActiveOrder(params: { | ||
side: string; | ||
symbol: string; | ||
order_type: string; | ||
qty: number; | ||
price?: number; | ||
time_in_force: string; | ||
take_profit?: number; | ||
stop_loss?: number; | ||
tp_trigger_by?: string; | ||
sl_trigger_by?: string; | ||
reduce_only: boolean; | ||
close_on_trigger: boolean; | ||
order_link_id?: string; | ||
position_idx?: number; | ||
}): Promise<APIResponseWithTime<any>>; | ||
placeActiveOrder(params: NewLinearOrder): Promise<APIResponseWithTime<LinearOrder | null>>; | ||
getActiveOrderList(params: { | ||
@@ -175,3 +160,4 @@ order_id?: string; | ||
*/ | ||
getPosition(params?: Partial<SymbolParam>): Promise<APIResponseWithTime<any>>; | ||
getPosition(): Promise<APIResponseWithTime<PerpPositionRoot[]>>; | ||
getPosition(params: Partial<SymbolParam>): Promise<APIResponseWithTime<PerpPosition[]>>; | ||
setAutoAddMargin(params?: { | ||
@@ -178,0 +164,0 @@ symbol: string; |
@@ -167,5 +167,2 @@ "use strict"; | ||
} | ||
/** | ||
* Position | ||
*/ | ||
getPosition(params) { | ||
@@ -172,0 +169,0 @@ return this.getPrivate('private/linear/position/list', params); |
@@ -6,3 +6,3 @@ "use strict"; | ||
silly: (...params) => { | ||
console.log(params); | ||
// console.log(params); | ||
}, | ||
@@ -9,0 +9,0 @@ debug: (...params) => { |
import { AxiosRequestConfig } from 'axios'; | ||
import { APIResponse, KlineInterval } from './types/shared'; | ||
import { NewSpotOrder, OrderSide, OrderTypeSpot, SpotOrderQueryById, SpotSymbolInfo } from './types/spot'; | ||
import { NewSpotOrder, APIResponse, KlineInterval, OrderSide, OrderTypeSpot, SpotBalances, SpotLastPrice, SpotOrderQueryById, SpotSymbolInfo } from './types'; | ||
import BaseRestClient from './util/BaseRestClient'; | ||
@@ -30,3 +29,4 @@ import { RestClientOptions } from './util/requestUtils'; | ||
get24hrTicker(symbol?: string): Promise<APIResponse<any>>; | ||
getLastTradedPrice(symbol?: string): Promise<APIResponse<any>>; | ||
getLastTradedPrice(): Promise<APIResponse<SpotLastPrice[]>>; | ||
getLastTradedPrice(symbol: string): Promise<APIResponse<SpotLastPrice>>; | ||
getBestBidAskPrice(symbol?: string): Promise<APIResponse<any>>; | ||
@@ -50,3 +50,3 @@ /** | ||
*/ | ||
getBalances(): Promise<APIResponse<any>>; | ||
getBalances(): Promise<APIResponse<SpotBalances>>; | ||
} |
@@ -0,3 +1,4 @@ | ||
export declare type numberInString = string; | ||
export declare type OrderSide = 'Buy' | 'Sell'; | ||
export declare type KlineInterval = '1m' | '3m' | '5m' | '15m' | '30m' | '1h' | '2h' | '4h' | '6h' | '12h' | '1d' | '1w' | '1M'; | ||
export declare type numberInString = string; | ||
export interface APIResponse<T> { | ||
@@ -4,0 +5,0 @@ ret_code: number; |
@@ -1,3 +0,2 @@ | ||
import { numberInString } from './shared'; | ||
export declare type OrderSide = 'Buy' | 'Sell'; | ||
import { numberInString, OrderSide } from './shared'; | ||
export declare type OrderTypeSpot = 'LIMIT' | 'MARKET' | 'LIMIT_MAKER'; | ||
@@ -4,0 +3,0 @@ export declare type OrderTimeInForce = 'GTC' | 'FOK' | 'IOC'; |
{ | ||
"name": "bybit-api", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Node.js connector for Bybit's REST APIs and WebSockets, with TypeScript & integration 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
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
181703
70
3193