ccxt 4.3.6 → 4.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +5 -0
- package/dist/cjs/src/alpaca.js +6 -0
- package/dist/cjs/src/base/Exchange.js +47 -3
- package/dist/cjs/src/binance.js +3 -1
- package/dist/cjs/src/bingx.js +3 -1
- package/dist/cjs/src/bitbank.js +3 -0
- package/dist/cjs/src/bitget.js +75 -2
- package/dist/cjs/src/bithumb.js +4 -0
- package/dist/cjs/src/bitmex.js +2 -0
- package/dist/cjs/src/bitopro.js +5 -0
- package/dist/cjs/src/bitso.js +3 -0
- package/dist/cjs/src/bitstamp.js +3 -0
- package/dist/cjs/src/bitteam.js +4 -0
- package/dist/cjs/src/bitvavo.js +3 -0
- package/dist/cjs/src/bl3p.js +3 -0
- package/dist/cjs/src/btcalpha.js +3 -0
- package/dist/cjs/src/btcbox.js +3 -0
- package/dist/cjs/src/btcmarkets.js +3 -0
- package/dist/cjs/src/btcturk.js +3 -0
- package/dist/cjs/src/bybit.js +123 -12
- package/dist/cjs/src/cex.js +6 -0
- package/dist/cjs/src/coinbase.js +95 -17
- package/dist/cjs/src/coinbaseinternational.js +2 -0
- package/dist/cjs/src/coinbasepro.js +6 -0
- package/dist/cjs/src/coincheck.js +3 -0
- package/dist/cjs/src/coinex.js +257 -190
- package/dist/cjs/src/coinlist.js +4 -0
- package/dist/cjs/src/coinmate.js +3 -0
- package/dist/cjs/src/coinone.js +3 -0
- package/dist/cjs/src/coinsph.js +4 -0
- package/dist/cjs/src/coinspot.js +3 -0
- package/dist/cjs/src/cryptocom.js +2 -0
- package/dist/cjs/src/exmo.js +5 -0
- package/dist/cjs/src/gate.js +124 -22
- package/dist/cjs/src/hitbtc.js +4 -3
- package/dist/cjs/src/htx.js +2 -0
- package/dist/cjs/src/idex.js +3 -0
- package/dist/cjs/src/independentreserve.js +3 -0
- package/dist/cjs/src/indodax.js +3 -0
- package/dist/cjs/src/kucoin.js +2 -0
- package/dist/cjs/src/kucoinfutures.js +2 -0
- package/dist/cjs/src/latoken.js +6 -0
- package/dist/cjs/src/luno.js +3 -0
- package/dist/cjs/src/lykke.js +5 -0
- package/dist/cjs/src/mercado.js +3 -0
- package/dist/cjs/src/mexc.js +111 -0
- package/dist/cjs/src/ndax.js +4 -0
- package/dist/cjs/src/novadax.js +4 -0
- package/dist/cjs/src/okx.js +84 -1
- package/dist/cjs/src/onetrading.js +3 -0
- package/dist/cjs/src/p2b.js +3 -0
- package/dist/cjs/src/pro/bybit.js +1 -1
- package/dist/cjs/src/pro/coinbase.js +30 -29
- package/dist/cjs/src/probit.js +3 -0
- package/dist/cjs/src/timex.js +3 -0
- package/dist/cjs/src/tradeogre.js +3 -0
- package/dist/cjs/src/wavesexchange.js +3 -0
- package/dist/cjs/src/wazirx.js +3 -0
- package/dist/cjs/src/woo.js +3 -1
- package/dist/cjs/src/yobit.js +3 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/coinbase.d.ts +5 -0
- package/js/src/ace.js +5 -0
- package/js/src/alpaca.js +6 -0
- package/js/src/ascendex.d.ts +2 -2
- package/js/src/base/Exchange.d.ts +23 -19
- package/js/src/base/Exchange.js +47 -3
- package/js/src/base/functions/generic.d.ts +20 -19
- package/js/src/bigone.d.ts +1 -1
- package/js/src/binance.d.ts +3 -3
- package/js/src/binance.js +3 -1
- package/js/src/bingx.d.ts +3 -3
- package/js/src/bingx.js +3 -1
- package/js/src/bitbank.d.ts +1 -1
- package/js/src/bitbank.js +3 -0
- package/js/src/bitfinex.d.ts +1 -1
- package/js/src/bitfinex2.d.ts +1 -1
- package/js/src/bitflyer.d.ts +1 -1
- package/js/src/bitget.d.ts +4 -3
- package/js/src/bitget.js +75 -2
- package/js/src/bithumb.d.ts +1 -1
- package/js/src/bithumb.js +4 -0
- package/js/src/bitmart.d.ts +1 -1
- package/js/src/bitmex.d.ts +1 -1
- package/js/src/bitmex.js +2 -0
- package/js/src/bitopro.d.ts +1 -1
- package/js/src/bitopro.js +5 -0
- package/js/src/bitrue.d.ts +1 -1
- package/js/src/bitso.d.ts +1 -1
- package/js/src/bitso.js +3 -0
- package/js/src/bitstamp.d.ts +1 -1
- package/js/src/bitstamp.js +3 -0
- package/js/src/bitteam.js +4 -0
- package/js/src/bitvavo.d.ts +1 -1
- package/js/src/bitvavo.js +3 -0
- package/js/src/bl3p.js +3 -0
- package/js/src/blockchaincom.d.ts +1 -1
- package/js/src/btcalpha.js +3 -0
- package/js/src/btcbox.js +3 -0
- package/js/src/btcmarkets.d.ts +1 -1
- package/js/src/btcmarkets.js +3 -0
- package/js/src/btcturk.js +3 -0
- package/js/src/bybit.d.ts +8 -7
- package/js/src/bybit.js +123 -12
- package/js/src/cex.js +6 -0
- package/js/src/coinbase.d.ts +2 -2
- package/js/src/coinbase.js +95 -17
- package/js/src/coinbaseinternational.d.ts +2 -2
- package/js/src/coinbaseinternational.js +2 -0
- package/js/src/coinbasepro.d.ts +1 -1
- package/js/src/coinbasepro.js +6 -0
- package/js/src/coincheck.js +3 -0
- package/js/src/coinex.d.ts +8 -7
- package/js/src/coinex.js +257 -190
- package/js/src/coinlist.d.ts +1 -1
- package/js/src/coinlist.js +4 -0
- package/js/src/coinmate.d.ts +1 -1
- package/js/src/coinmate.js +3 -0
- package/js/src/coinone.js +3 -0
- package/js/src/coinsph.d.ts +1 -1
- package/js/src/coinsph.js +4 -0
- package/js/src/coinspot.js +3 -0
- package/js/src/cryptocom.d.ts +1 -1
- package/js/src/cryptocom.js +2 -0
- package/js/src/delta.d.ts +2 -2
- package/js/src/deribit.d.ts +1 -1
- package/js/src/digifinex.d.ts +3 -3
- package/js/src/exmo.d.ts +3 -3
- package/js/src/exmo.js +5 -0
- package/js/src/gate.d.ts +8 -7
- package/js/src/gate.js +124 -22
- package/js/src/gemini.d.ts +2 -2
- package/js/src/hitbtc.d.ts +3 -3
- package/js/src/hitbtc.js +4 -3
- package/js/src/hollaex.d.ts +2 -2
- package/js/src/htx.d.ts +3 -3
- package/js/src/htx.js +2 -0
- package/js/src/huobijp.d.ts +1 -1
- package/js/src/hyperliquid.d.ts +2 -2
- package/js/src/idex.d.ts +2 -2
- package/js/src/idex.js +3 -0
- package/js/src/independentreserve.js +3 -0
- package/js/src/indodax.d.ts +1 -1
- package/js/src/indodax.js +3 -0
- package/js/src/kraken.d.ts +1 -1
- package/js/src/kucoin.d.ts +2 -2
- package/js/src/kucoin.js +2 -0
- package/js/src/kucoinfutures.d.ts +1 -1
- package/js/src/kucoinfutures.js +2 -0
- package/js/src/kuna.d.ts +1 -1
- package/js/src/latoken.js +6 -0
- package/js/src/lbank.d.ts +1 -1
- package/js/src/luno.js +3 -0
- package/js/src/lykke.d.ts +1 -1
- package/js/src/lykke.js +5 -0
- package/js/src/mercado.d.ts +1 -1
- package/js/src/mercado.js +3 -0
- package/js/src/mexc.d.ts +5 -4
- package/js/src/mexc.js +111 -0
- package/js/src/ndax.d.ts +1 -1
- package/js/src/ndax.js +4 -0
- package/js/src/novadax.d.ts +1 -1
- package/js/src/novadax.js +4 -0
- package/js/src/okcoin.d.ts +2 -2
- package/js/src/okx.d.ts +10 -9
- package/js/src/okx.js +84 -1
- package/js/src/onetrading.d.ts +1 -1
- package/js/src/onetrading.js +3 -0
- package/js/src/p2b.js +3 -0
- package/js/src/paymium.d.ts +1 -1
- package/js/src/phemex.d.ts +1 -1
- package/js/src/poloniex.d.ts +1 -1
- package/js/src/pro/bybit.js +1 -1
- package/js/src/pro/coinbase.d.ts +2 -2
- package/js/src/pro/coinbase.js +30 -29
- package/js/src/pro/luno.d.ts +2 -2
- package/js/src/probit.d.ts +2 -2
- package/js/src/probit.js +3 -0
- package/js/src/timex.js +3 -0
- package/js/src/tokocrypto.d.ts +1 -1
- package/js/src/tradeogre.js +3 -0
- package/js/src/upbit.d.ts +2 -2
- package/js/src/wavesexchange.d.ts +1 -1
- package/js/src/wavesexchange.js +3 -0
- package/js/src/wazirx.js +3 -0
- package/js/src/whitebit.d.ts +2 -2
- package/js/src/woo.d.ts +1 -1
- package/js/src/woo.js +3 -1
- package/js/src/yobit.d.ts +1 -1
- package/js/src/yobit.js +3 -0
- package/js/src/zaif.d.ts +1 -1
- package/js/src/zonda.d.ts +2 -2
- package/package.json +1 -1
package/js/src/btcbox.js
CHANGED
|
@@ -58,8 +58,11 @@ export default class btcbox extends Exchange {
|
|
|
58
58
|
'fetchOrderBook': true,
|
|
59
59
|
'fetchOrders': true,
|
|
60
60
|
'fetchPosition': false,
|
|
61
|
+
'fetchPositionHistory': false,
|
|
61
62
|
'fetchPositionMode': false,
|
|
62
63
|
'fetchPositions': false,
|
|
64
|
+
'fetchPositionsForSymbol': false,
|
|
65
|
+
'fetchPositionsHistory': false,
|
|
63
66
|
'fetchPositionsRisk': false,
|
|
64
67
|
'fetchPremiumIndexOHLCV': false,
|
|
65
68
|
'fetchTicker': true,
|
package/js/src/btcmarkets.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export default class btcmarkets extends Exchange {
|
|
|
42
42
|
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
43
43
|
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
44
44
|
fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
45
|
-
withdraw(code: string, amount: number, address:
|
|
45
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
46
46
|
nonce(): number;
|
|
47
47
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
48
48
|
url: string;
|
package/js/src/btcmarkets.js
CHANGED
|
@@ -68,8 +68,11 @@ export default class btcmarkets extends Exchange {
|
|
|
68
68
|
'fetchOrderBook': true,
|
|
69
69
|
'fetchOrders': true,
|
|
70
70
|
'fetchPosition': false,
|
|
71
|
+
'fetchPositionHistory': false,
|
|
71
72
|
'fetchPositionMode': false,
|
|
72
73
|
'fetchPositions': false,
|
|
74
|
+
'fetchPositionsForSymbol': false,
|
|
75
|
+
'fetchPositionsHistory': false,
|
|
73
76
|
'fetchPositionsRisk': false,
|
|
74
77
|
'fetchPremiumIndexOHLCV': false,
|
|
75
78
|
'fetchTicker': true,
|
package/js/src/btcturk.js
CHANGED
|
@@ -63,8 +63,11 @@ export default class btcturk extends Exchange {
|
|
|
63
63
|
'fetchOrderBook': true,
|
|
64
64
|
'fetchOrders': true,
|
|
65
65
|
'fetchPosition': false,
|
|
66
|
+
'fetchPositionHistory': false,
|
|
66
67
|
'fetchPositionMode': false,
|
|
67
68
|
'fetchPositions': false,
|
|
69
|
+
'fetchPositionsForSymbol': false,
|
|
70
|
+
'fetchPositionsHistory': false,
|
|
68
71
|
'fetchPositionsRisk': false,
|
|
69
72
|
'fetchPremiumIndexOHLCV': false,
|
|
70
73
|
'fetchTicker': true,
|
package/js/src/bybit.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/bybit.js';
|
|
2
|
-
import type { Int, OrderSide, OrderType, Trade, Order, OHLCV, FundingRateHistory, OpenInterest, OrderRequest, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry, Liquidation, Leverage, Num, FundingHistory, Option, OptionChain, TradingFeeInterface, Currencies, TradingFees, CancellationRequest } from './base/types.js';
|
|
2
|
+
import type { Int, OrderSide, OrderType, Trade, Order, OHLCV, FundingRateHistory, OpenInterest, OrderRequest, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry, Liquidation, Leverage, Num, FundingHistory, Option, OptionChain, TradingFeeInterface, Currencies, TradingFees, CancellationRequest, Position } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class bybit
|
|
5
5
|
* @augments Exchange
|
|
@@ -91,7 +91,7 @@ export default class bybit extends Exchange {
|
|
|
91
91
|
network: string;
|
|
92
92
|
info: any;
|
|
93
93
|
};
|
|
94
|
-
fetchDepositAddressesByNetwork(code: string, params?: {}): Promise<
|
|
94
|
+
fetchDepositAddressesByNetwork(code: string, params?: {}): Promise<import("./base/types.js").Dictionary<any>>;
|
|
95
95
|
fetchDepositAddress(code: string, params?: {}): Promise<{
|
|
96
96
|
currency: string;
|
|
97
97
|
address: string;
|
|
@@ -122,11 +122,11 @@ export default class bybit extends Exchange {
|
|
|
122
122
|
info: any;
|
|
123
123
|
};
|
|
124
124
|
parseLedgerEntryType(type: any): string;
|
|
125
|
-
withdraw(code: string, amount: number, address:
|
|
126
|
-
fetchPosition(symbol: string, params?: {}): Promise<
|
|
127
|
-
fetchUsdcPositions(symbols?: Strings, params?: {}): Promise<
|
|
128
|
-
fetchPositions(symbols?: Strings, params?: {}): Promise<
|
|
129
|
-
parsePosition(position: any, market?: Market):
|
|
125
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
126
|
+
fetchPosition(symbol: string, params?: {}): Promise<Position>;
|
|
127
|
+
fetchUsdcPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
128
|
+
fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
129
|
+
parsePosition(position: any, market?: Market): Position;
|
|
130
130
|
fetchLeverage(symbol: string, params?: {}): Promise<Leverage>;
|
|
131
131
|
parseLeverage(leverage: any, market?: any): Leverage;
|
|
132
132
|
setMarginMode(marginMode: string, symbol?: Str, params?: {}): Promise<any>;
|
|
@@ -278,6 +278,7 @@ export default class bybit extends Exchange {
|
|
|
278
278
|
baseVolume: number;
|
|
279
279
|
quoteVolume: any;
|
|
280
280
|
};
|
|
281
|
+
fetchPositionsHistory(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
|
|
281
282
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
282
283
|
url: string;
|
|
283
284
|
method: string;
|
package/js/src/bybit.js
CHANGED
|
@@ -105,7 +105,9 @@ export default class bybit extends Exchange {
|
|
|
105
105
|
'fetchOrders': false,
|
|
106
106
|
'fetchOrderTrades': true,
|
|
107
107
|
'fetchPosition': true,
|
|
108
|
+
'fetchPositionHistory': 'emulated',
|
|
108
109
|
'fetchPositions': true,
|
|
110
|
+
'fetchPositionsHistory': true,
|
|
109
111
|
'fetchPremiumIndexOHLCV': true,
|
|
110
112
|
'fetchSettlementHistory': true,
|
|
111
113
|
'fetchTicker': true,
|
|
@@ -6460,37 +6462,64 @@ export default class bybit extends Exchange {
|
|
|
6460
6462
|
// "tradeMode": 0
|
|
6461
6463
|
// }
|
|
6462
6464
|
//
|
|
6465
|
+
// fetchPositionsHistory
|
|
6466
|
+
//
|
|
6467
|
+
// {
|
|
6468
|
+
// symbol: 'XRPUSDT',
|
|
6469
|
+
// orderType: 'Market',
|
|
6470
|
+
// leverage: '10',
|
|
6471
|
+
// updatedTime: '1712717265572',
|
|
6472
|
+
// side: 'Sell',
|
|
6473
|
+
// orderId: '071749f3-a9fa-427b-b5ca-27b2f52b81de',
|
|
6474
|
+
// closedPnl: '-0.00049568',
|
|
6475
|
+
// avgEntryPrice: '0.6045',
|
|
6476
|
+
// qty: '3',
|
|
6477
|
+
// cumEntryValue: '1.8135',
|
|
6478
|
+
// createdTime: '1712717265566',
|
|
6479
|
+
// orderPrice: '0.5744',
|
|
6480
|
+
// closedSize: '3',
|
|
6481
|
+
// avgExitPrice: '0.605',
|
|
6482
|
+
// execType: 'Trade',
|
|
6483
|
+
// fillCount: '1',
|
|
6484
|
+
// cumExitValue: '1.815'
|
|
6485
|
+
// }
|
|
6486
|
+
//
|
|
6487
|
+
const closedSize = this.safeString(position, 'closedSize');
|
|
6488
|
+
const isHistory = (closedSize !== undefined);
|
|
6463
6489
|
const contract = this.safeString(position, 'symbol');
|
|
6464
6490
|
market = this.safeMarket(contract, market, undefined, 'contract');
|
|
6465
|
-
const size = Precise.stringAbs(this.
|
|
6491
|
+
const size = Precise.stringAbs(this.safeString2(position, 'size', 'qty'));
|
|
6466
6492
|
let side = this.safeString(position, 'side');
|
|
6467
6493
|
if (side !== undefined) {
|
|
6468
6494
|
if (side === 'Buy') {
|
|
6469
|
-
side = 'long';
|
|
6495
|
+
side = isHistory ? 'short' : 'long';
|
|
6470
6496
|
}
|
|
6471
6497
|
else if (side === 'Sell') {
|
|
6472
|
-
side = 'short';
|
|
6498
|
+
side = isHistory ? 'long' : 'short';
|
|
6473
6499
|
}
|
|
6474
6500
|
else {
|
|
6475
6501
|
side = undefined;
|
|
6476
6502
|
}
|
|
6477
6503
|
}
|
|
6478
|
-
const notional = this.
|
|
6504
|
+
const notional = this.safeString2(position, 'positionValue', 'cumExitValue');
|
|
6479
6505
|
const unrealisedPnl = this.omitZero(this.safeString(position, 'unrealisedPnl'));
|
|
6480
|
-
let initialMarginString = this.
|
|
6506
|
+
let initialMarginString = this.safeStringN(position, ['positionIM', 'cumEntryValue']);
|
|
6481
6507
|
let maintenanceMarginString = this.safeString(position, 'positionMM');
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6508
|
+
const timestamp = this.safeIntegerN(position, ['createdTime', 'createdAt']);
|
|
6509
|
+
let lastUpdateTimestamp = this.parse8601(this.safeString(position, 'updated_at'));
|
|
6510
|
+
if (lastUpdateTimestamp === undefined) {
|
|
6511
|
+
lastUpdateTimestamp = this.safeIntegerN(position, ['updatedTime', 'updatedAt', 'updatedTime']);
|
|
6485
6512
|
}
|
|
6486
6513
|
const tradeMode = this.safeInteger(position, 'tradeMode', 0);
|
|
6487
6514
|
let marginMode = undefined;
|
|
6488
6515
|
if ((!this.options['enableUnifiedAccount']) || (this.options['enableUnifiedAccount'] && market['inverse'])) {
|
|
6489
6516
|
// tradeMode would work for classic and UTA(inverse)
|
|
6490
|
-
marginMode
|
|
6517
|
+
if (!isHistory) { // cannot tell marginMode for fetchPositionsHistory, and closedSize will only be defined for fetchPositionsHistory response
|
|
6518
|
+
marginMode = (tradeMode === 1) ? 'isolated' : 'cross';
|
|
6519
|
+
}
|
|
6491
6520
|
}
|
|
6492
6521
|
let collateralString = this.safeString(position, 'positionBalance');
|
|
6493
|
-
const entryPrice = this.omitZero(this.
|
|
6522
|
+
const entryPrice = this.omitZero(this.safeStringN(position, ['entryPrice', 'avgPrice', 'avgEntryPrice']));
|
|
6494
6523
|
const liquidationPrice = this.omitZero(this.safeString(position, 'liqPrice'));
|
|
6495
6524
|
const leverage = this.safeString(position, 'leverage');
|
|
6496
6525
|
if (liquidationPrice !== undefined) {
|
|
@@ -6536,7 +6565,7 @@ export default class bybit extends Exchange {
|
|
|
6536
6565
|
'symbol': market['symbol'],
|
|
6537
6566
|
'timestamp': timestamp,
|
|
6538
6567
|
'datetime': this.iso8601(timestamp),
|
|
6539
|
-
'lastUpdateTimestamp':
|
|
6568
|
+
'lastUpdateTimestamp': lastUpdateTimestamp,
|
|
6540
6569
|
'initialMargin': this.parseNumber(initialMarginString),
|
|
6541
6570
|
'initialMarginPercentage': this.parseNumber(Precise.stringDiv(initialMarginString, notional)),
|
|
6542
6571
|
'maintenanceMargin': this.parseNumber(maintenanceMarginString),
|
|
@@ -6545,12 +6574,13 @@ export default class bybit extends Exchange {
|
|
|
6545
6574
|
'notional': this.parseNumber(notional),
|
|
6546
6575
|
'leverage': this.parseNumber(leverage),
|
|
6547
6576
|
'unrealizedPnl': this.parseNumber(unrealisedPnl),
|
|
6577
|
+
'realizedPnl': this.safeNumber(position, 'closedPnl'),
|
|
6548
6578
|
'contracts': this.parseNumber(size),
|
|
6549
6579
|
'contractSize': this.safeNumber(market, 'contractSize'),
|
|
6550
6580
|
'marginRatio': this.parseNumber(marginRatio),
|
|
6551
6581
|
'liquidationPrice': this.parseNumber(liquidationPrice),
|
|
6552
6582
|
'markPrice': this.safeNumber(position, 'markPrice'),
|
|
6553
|
-
'lastPrice':
|
|
6583
|
+
'lastPrice': this.safeNumber(position, 'avgExitPrice'),
|
|
6554
6584
|
'collateral': this.parseNumber(collateralString),
|
|
6555
6585
|
'marginMode': marginMode,
|
|
6556
6586
|
'side': side,
|
|
@@ -8477,6 +8507,87 @@ export default class bybit extends Exchange {
|
|
|
8477
8507
|
'quoteVolume': undefined,
|
|
8478
8508
|
};
|
|
8479
8509
|
}
|
|
8510
|
+
async fetchPositionsHistory(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
8511
|
+
/**
|
|
8512
|
+
* @method
|
|
8513
|
+
* @name bybit#fetchPositionsHistory
|
|
8514
|
+
* @description fetches historical positions
|
|
8515
|
+
* @see https://bybit-exchange.github.io/docs/v5/position/close-pnl
|
|
8516
|
+
* @param {string} [symbol] unified market symbols, symbols must have the same subType (must all be linear or all be inverse)
|
|
8517
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch, params["until"] - since <= 7 days
|
|
8518
|
+
* @param {int} [limit] the maximum amount of records to fetch, default=50, max=100
|
|
8519
|
+
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
8520
|
+
* @param {int} [params.until] timestamp in ms of the latest position to fetch, params["until"] - since <= 7 days
|
|
8521
|
+
* @param {string} [params.subType] 'linear' or 'inverse'
|
|
8522
|
+
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
8523
|
+
*/
|
|
8524
|
+
await this.loadMarkets();
|
|
8525
|
+
let market = undefined;
|
|
8526
|
+
let subType = undefined;
|
|
8527
|
+
let symbolsLength = 0;
|
|
8528
|
+
if (symbols !== undefined) {
|
|
8529
|
+
symbolsLength = symbols.length;
|
|
8530
|
+
if (symbolsLength > 0) {
|
|
8531
|
+
market = this.market(symbols[0]);
|
|
8532
|
+
}
|
|
8533
|
+
}
|
|
8534
|
+
const until = this.safeInteger(params, 'until');
|
|
8535
|
+
[subType, params] = this.handleSubTypeAndParams('fetchPositionsHistory', market, params, 'linear');
|
|
8536
|
+
params = this.omit(params, 'until');
|
|
8537
|
+
const request = {
|
|
8538
|
+
'category': subType,
|
|
8539
|
+
};
|
|
8540
|
+
if ((symbols !== undefined) && (symbolsLength === 1)) {
|
|
8541
|
+
request['symbol'] = market['id'];
|
|
8542
|
+
}
|
|
8543
|
+
if (since !== undefined) {
|
|
8544
|
+
request['startTime'] = since;
|
|
8545
|
+
}
|
|
8546
|
+
if (limit !== undefined) {
|
|
8547
|
+
request['limit'] = limit;
|
|
8548
|
+
}
|
|
8549
|
+
if (until !== undefined) {
|
|
8550
|
+
request['endTime'] = until;
|
|
8551
|
+
}
|
|
8552
|
+
const response = await this.privateGetV5PositionClosedPnl(this.extend(request, params));
|
|
8553
|
+
//
|
|
8554
|
+
// {
|
|
8555
|
+
// retCode: '0',
|
|
8556
|
+
// retMsg: 'OK',
|
|
8557
|
+
// result: {
|
|
8558
|
+
// nextPageCursor: '071749f3-a9fa-427b-b5ca-27b2f52b81de%3A1712717265566520788%2C071749f3-a9fa-427b-b5ca-27b2f52b81de%3A1712717265566520788',
|
|
8559
|
+
// category: 'linear',
|
|
8560
|
+
// list: [
|
|
8561
|
+
// {
|
|
8562
|
+
// symbol: 'XRPUSDT',
|
|
8563
|
+
// orderType: 'Market',
|
|
8564
|
+
// leverage: '10',
|
|
8565
|
+
// updatedTime: '1712717265572',
|
|
8566
|
+
// side: 'Sell',
|
|
8567
|
+
// orderId: '071749f3-a9fa-427b-b5ca-27b2f52b81de',
|
|
8568
|
+
// closedPnl: '-0.00049568',
|
|
8569
|
+
// avgEntryPrice: '0.6045',
|
|
8570
|
+
// qty: '3',
|
|
8571
|
+
// cumEntryValue: '1.8135',
|
|
8572
|
+
// createdTime: '1712717265566',
|
|
8573
|
+
// orderPrice: '0.5744',
|
|
8574
|
+
// closedSize: '3',
|
|
8575
|
+
// avgExitPrice: '0.605',
|
|
8576
|
+
// execType: 'Trade',
|
|
8577
|
+
// fillCount: '1',
|
|
8578
|
+
// cumExitValue: '1.815'
|
|
8579
|
+
// }
|
|
8580
|
+
// ]
|
|
8581
|
+
// },
|
|
8582
|
+
// retExtInfo: {},
|
|
8583
|
+
// time: '1712717286073'
|
|
8584
|
+
// }
|
|
8585
|
+
//
|
|
8586
|
+
const result = this.safeDict(response, 'result');
|
|
8587
|
+
const rawPositions = this.safeList(result, 'list');
|
|
8588
|
+
const positions = this.parsePositions(rawPositions, symbols, params);
|
|
8589
|
+
return this.filterBySinceLimit(positions, since, limit);
|
|
8590
|
+
}
|
|
8480
8591
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
8481
8592
|
let url = this.implodeHostname(this.urls['api'][api]) + '/' + path;
|
|
8482
8593
|
if (api === 'public') {
|
package/js/src/cex.js
CHANGED
|
@@ -65,7 +65,13 @@ export default class cex extends Exchange {
|
|
|
65
65
|
'fetchOrder': true,
|
|
66
66
|
'fetchOrderBook': true,
|
|
67
67
|
'fetchOrders': true,
|
|
68
|
+
'fetchPosition': false,
|
|
69
|
+
'fetchPositionHistory': false,
|
|
68
70
|
'fetchPositionMode': false,
|
|
71
|
+
'fetchPositions': false,
|
|
72
|
+
'fetchPositionsForSymbol': false,
|
|
73
|
+
'fetchPositionsHistory': false,
|
|
74
|
+
'fetchPositionsRisk': false,
|
|
69
75
|
'fetchPremiumIndexOHLCV': false,
|
|
70
76
|
'fetchTicker': true,
|
|
71
77
|
'fetchTickers': true,
|
package/js/src/coinbase.d.ts
CHANGED
|
@@ -93,8 +93,8 @@ export default class coinbase extends Exchange {
|
|
|
93
93
|
fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
94
94
|
fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
|
|
95
95
|
fetchBidsAsks(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Dictionary<Ticker>>;
|
|
96
|
-
withdraw(code: string, amount: number, address:
|
|
97
|
-
fetchDepositAddressesByNetwork(code: string, params?: {}): Promise<
|
|
96
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
97
|
+
fetchDepositAddressesByNetwork(code: string, params?: {}): Promise<import("./base/types.js").Dictionary<any>>;
|
|
98
98
|
parseDepositAddress(depositAddress: any, currency?: Currency): {
|
|
99
99
|
info: any;
|
|
100
100
|
currency: string;
|
package/js/src/coinbase.js
CHANGED
|
@@ -205,6 +205,11 @@ export default class coinbase extends Exchange {
|
|
|
205
205
|
'public': {
|
|
206
206
|
'get': {
|
|
207
207
|
'brokerage/time': 3,
|
|
208
|
+
'brokerage/market/product_book': 3,
|
|
209
|
+
'brokerage/market/products': 3,
|
|
210
|
+
'brokerage/market/products/{product_id}': 3,
|
|
211
|
+
'brokerage/market/products/{product_id}/candles': 3,
|
|
212
|
+
'brokerage/market/products/{product_id}/ticker': 3,
|
|
208
213
|
},
|
|
209
214
|
},
|
|
210
215
|
'private': {
|
|
@@ -1094,7 +1099,7 @@ export default class coinbase extends Exchange {
|
|
|
1094
1099
|
/**
|
|
1095
1100
|
* @method
|
|
1096
1101
|
* @name coinbase#fetchMarkets
|
|
1097
|
-
* @see https://docs.cloud.coinbase.com/advanced-trade-api/reference/
|
|
1102
|
+
* @see https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_getpublicproducts
|
|
1098
1103
|
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-currencies#get-fiat-currencies
|
|
1099
1104
|
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-exchange-rates#get-exchange-rates
|
|
1100
1105
|
* @description retrieves data on all markets for coinbase
|
|
@@ -1181,20 +1186,92 @@ export default class coinbase extends Exchange {
|
|
|
1181
1186
|
}
|
|
1182
1187
|
async fetchMarketsV3(params = {}) {
|
|
1183
1188
|
const spotUnresolvedPromises = [
|
|
1184
|
-
this.
|
|
1185
|
-
|
|
1189
|
+
this.v3PublicGetBrokerageMarketProducts(params),
|
|
1190
|
+
//
|
|
1191
|
+
// {
|
|
1192
|
+
// products: [
|
|
1193
|
+
// {
|
|
1194
|
+
// product_id: 'BTC-USD',
|
|
1195
|
+
// price: '67060',
|
|
1196
|
+
// price_percentage_change_24h: '3.30054960636883',
|
|
1197
|
+
// volume_24h: '10967.87426597',
|
|
1198
|
+
// volume_percentage_change_24h: '141.73048325503036',
|
|
1199
|
+
// base_increment: '0.00000001',
|
|
1200
|
+
// quote_increment: '0.01',
|
|
1201
|
+
// quote_min_size: '1',
|
|
1202
|
+
// quote_max_size: '150000000',
|
|
1203
|
+
// base_min_size: '0.00000001',
|
|
1204
|
+
// base_max_size: '3400',
|
|
1205
|
+
// base_name: 'Bitcoin',
|
|
1206
|
+
// quote_name: 'US Dollar',
|
|
1207
|
+
// watched: false,
|
|
1208
|
+
// is_disabled: false,
|
|
1209
|
+
// new: false,
|
|
1210
|
+
// status: 'online',
|
|
1211
|
+
// cancel_only: false,
|
|
1212
|
+
// limit_only: false,
|
|
1213
|
+
// post_only: false,
|
|
1214
|
+
// trading_disabled: false,
|
|
1215
|
+
// auction_mode: false,
|
|
1216
|
+
// product_type: 'SPOT',
|
|
1217
|
+
// quote_currency_id: 'USD',
|
|
1218
|
+
// base_currency_id: 'BTC',
|
|
1219
|
+
// fcm_trading_session_details: null,
|
|
1220
|
+
// mid_market_price: '',
|
|
1221
|
+
// alias: '',
|
|
1222
|
+
// alias_to: [ 'BTC-USDC' ],
|
|
1223
|
+
// base_display_symbol: 'BTC',
|
|
1224
|
+
// quote_display_symbol: 'USD',
|
|
1225
|
+
// view_only: false,
|
|
1226
|
+
// price_increment: '0.01',
|
|
1227
|
+
// display_name: 'BTC-USD',
|
|
1228
|
+
// product_venue: 'CBE'
|
|
1229
|
+
// },
|
|
1230
|
+
// ...
|
|
1231
|
+
// ],
|
|
1232
|
+
// num_products: '646'
|
|
1233
|
+
// }
|
|
1234
|
+
//
|
|
1186
1235
|
];
|
|
1236
|
+
if (this.checkRequiredCredentials(false)) {
|
|
1237
|
+
spotUnresolvedPromises.push(this.v3PrivateGetBrokerageTransactionSummary(params));
|
|
1238
|
+
}
|
|
1239
|
+
//
|
|
1240
|
+
// {
|
|
1241
|
+
// total_volume: '9.995989116664404',
|
|
1242
|
+
// total_fees: '0.07996791093331522',
|
|
1243
|
+
// fee_tier: {
|
|
1244
|
+
// pricing_tier: 'Advanced 1',
|
|
1245
|
+
// usd_from: '0',
|
|
1246
|
+
// usd_to: '1000',
|
|
1247
|
+
// taker_fee_rate: '0.008',
|
|
1248
|
+
// maker_fee_rate: '0.006',
|
|
1249
|
+
// aop_from: '',
|
|
1250
|
+
// aop_to: ''
|
|
1251
|
+
// },
|
|
1252
|
+
// margin_rate: null,
|
|
1253
|
+
// goods_and_services_tax: null,
|
|
1254
|
+
// advanced_trade_only_volume: '9.995989116664404',
|
|
1255
|
+
// advanced_trade_only_fees: '0.07996791093331522',
|
|
1256
|
+
// coinbase_pro_volume: '0',
|
|
1257
|
+
// coinbase_pro_fees: '0',
|
|
1258
|
+
// total_balance: '',
|
|
1259
|
+
// has_promo_fee: false
|
|
1260
|
+
// }
|
|
1261
|
+
//
|
|
1187
1262
|
let unresolvedContractPromises = [];
|
|
1188
1263
|
try {
|
|
1189
1264
|
unresolvedContractPromises = [
|
|
1190
|
-
this.
|
|
1191
|
-
this.
|
|
1192
|
-
this.v3PrivateGetBrokerageTransactionSummary(this.extend(params, { 'product_type': 'FUTURE' })),
|
|
1193
|
-
this.v3PrivateGetBrokerageTransactionSummary(this.extend(params, { 'product_type': 'FUTURE', 'contract_expiry_type': 'PERPETUAL' })),
|
|
1265
|
+
this.v3PublicGetBrokerageMarketProducts(this.extend(params, { 'product_type': 'FUTURE' })),
|
|
1266
|
+
this.v3PublicGetBrokerageMarketProducts(this.extend(params, { 'product_type': 'FUTURE', 'contract_expiry_type': 'PERPETUAL' })),
|
|
1194
1267
|
];
|
|
1268
|
+
if (this.checkRequiredCredentials(false)) {
|
|
1269
|
+
unresolvedContractPromises.push(this.extend(params, { 'product_type': 'FUTURE' }));
|
|
1270
|
+
unresolvedContractPromises.push(this.extend(params, { 'product_type': 'FUTURE', 'contract_expiry_type': 'PERPETUAL' }));
|
|
1271
|
+
}
|
|
1195
1272
|
}
|
|
1196
1273
|
catch (e) {
|
|
1197
|
-
unresolvedContractPromises = []; // the sync version of ccxt won't have the promise.all line so the request is made here
|
|
1274
|
+
unresolvedContractPromises = []; // the sync version of ccxt won't have the promise.all line so the request is made here. Some users can't access perpetual products
|
|
1198
1275
|
}
|
|
1199
1276
|
const promises = await Promise.all(spotUnresolvedPromises);
|
|
1200
1277
|
let contractPromises = undefined;
|
|
@@ -1463,6 +1540,7 @@ export default class coinbase extends Exchange {
|
|
|
1463
1540
|
const contractSize = this.safeNumber(futureProductDetails, 'contract_size');
|
|
1464
1541
|
const contractExpire = this.safeString(futureProductDetails, 'contract_expiry');
|
|
1465
1542
|
const expireTimestamp = this.parse8601(contractExpire);
|
|
1543
|
+
const expireDateTime = this.iso8601(expireTimestamp);
|
|
1466
1544
|
const isSwap = (contractExpiryType === 'PERPETUAL');
|
|
1467
1545
|
const baseId = this.safeString(futureProductDetails, 'contract_root_unit');
|
|
1468
1546
|
const quoteId = this.safeString(market, 'quote_currency_id');
|
|
@@ -1506,7 +1584,7 @@ export default class coinbase extends Exchange {
|
|
|
1506
1584
|
'maker': maker,
|
|
1507
1585
|
'contractSize': contractSize,
|
|
1508
1586
|
'expiry': expireTimestamp,
|
|
1509
|
-
'expiryDatetime':
|
|
1587
|
+
'expiryDatetime': expireDateTime,
|
|
1510
1588
|
'strike': undefined,
|
|
1511
1589
|
'optionType': undefined,
|
|
1512
1590
|
'precision': {
|
|
@@ -1731,7 +1809,7 @@ export default class coinbase extends Exchange {
|
|
|
1731
1809
|
if (symbols !== undefined) {
|
|
1732
1810
|
request['product_ids'] = this.marketIds(symbols);
|
|
1733
1811
|
}
|
|
1734
|
-
const response = await this.
|
|
1812
|
+
const response = await this.v3PublicGetBrokerageMarketProducts(this.extend(request, params));
|
|
1735
1813
|
//
|
|
1736
1814
|
// {
|
|
1737
1815
|
// "products": [
|
|
@@ -1834,7 +1912,7 @@ export default class coinbase extends Exchange {
|
|
|
1834
1912
|
'product_id': market['id'],
|
|
1835
1913
|
'limit': 1,
|
|
1836
1914
|
};
|
|
1837
|
-
const response = await this.
|
|
1915
|
+
const response = await this.v3PublicGetBrokerageMarketProductsProductIdTicker(this.extend(request, params));
|
|
1838
1916
|
//
|
|
1839
1917
|
// {
|
|
1840
1918
|
// "trades": [
|
|
@@ -3395,7 +3473,7 @@ export default class coinbase extends Exchange {
|
|
|
3395
3473
|
* @method
|
|
3396
3474
|
* @name coinbase#fetchOHLCV
|
|
3397
3475
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
3398
|
-
* @see https://docs.cloud.coinbase.com/advanced-trade-api/reference/
|
|
3476
|
+
* @see https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_getpubliccandles
|
|
3399
3477
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
3400
3478
|
* @param {string} timeframe the length of time each candle represents
|
|
3401
3479
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -3438,7 +3516,7 @@ export default class coinbase extends Exchange {
|
|
|
3438
3516
|
// 300 candles max
|
|
3439
3517
|
request['end'] = Precise.stringAdd(sinceString, requestedDuration.toString());
|
|
3440
3518
|
}
|
|
3441
|
-
const response = await this.
|
|
3519
|
+
const response = await this.v3PublicGetBrokerageMarketProductsProductIdCandles(this.extend(request, params));
|
|
3442
3520
|
//
|
|
3443
3521
|
// {
|
|
3444
3522
|
// "candles": [
|
|
@@ -3483,7 +3561,7 @@ export default class coinbase extends Exchange {
|
|
|
3483
3561
|
* @method
|
|
3484
3562
|
* @name coinbase#fetchTrades
|
|
3485
3563
|
* @description get the list of most recent trades for a particular symbol
|
|
3486
|
-
* @see https://docs.cloud.coinbase.com/advanced-trade-api/reference/
|
|
3564
|
+
* @see https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_getpublicmarkettrades
|
|
3487
3565
|
* @param {string} symbol unified market symbol of the trades
|
|
3488
3566
|
* @param {int} [since] not used by coinbase fetchTrades
|
|
3489
3567
|
* @param {int} [limit] the maximum number of trade structures to fetch
|
|
@@ -3509,7 +3587,7 @@ export default class coinbase extends Exchange {
|
|
|
3509
3587
|
else if (since !== undefined) {
|
|
3510
3588
|
throw new ArgumentsRequired(this.id + ' fetchTrades() requires a `until` parameter when you use `since` argument');
|
|
3511
3589
|
}
|
|
3512
|
-
const response = await this.
|
|
3590
|
+
const response = await this.v3PublicGetBrokerageMarketProductsProductIdTicker(this.extend(request, params));
|
|
3513
3591
|
//
|
|
3514
3592
|
// {
|
|
3515
3593
|
// "trades": [
|
|
@@ -3606,7 +3684,7 @@ export default class coinbase extends Exchange {
|
|
|
3606
3684
|
* @method
|
|
3607
3685
|
* @name coinbase#fetchOrderBook
|
|
3608
3686
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
3609
|
-
* @see https://docs.cloud.coinbase.com/advanced-trade-api/reference/
|
|
3687
|
+
* @see https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_getpublicproductbook
|
|
3610
3688
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
3611
3689
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
3612
3690
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -3620,7 +3698,7 @@ export default class coinbase extends Exchange {
|
|
|
3620
3698
|
if (limit !== undefined) {
|
|
3621
3699
|
request['limit'] = limit;
|
|
3622
3700
|
}
|
|
3623
|
-
const response = await this.
|
|
3701
|
+
const response = await this.v3PublicGetBrokerageMarketProductBook(this.extend(request, params));
|
|
3624
3702
|
//
|
|
3625
3703
|
// {
|
|
3626
3704
|
// "pricebook": {
|
|
@@ -42,7 +42,7 @@ export default class coinbaseinternational extends Exchange {
|
|
|
42
42
|
address: string;
|
|
43
43
|
info: any;
|
|
44
44
|
}>;
|
|
45
|
-
findDefaultNetwork(networks: any):
|
|
45
|
+
findDefaultNetwork(networks: any): any;
|
|
46
46
|
loadCurrencyNetworks(code: any, params?: {}): Promise<void>;
|
|
47
47
|
parseNetworks(networks: any, params?: {}): {};
|
|
48
48
|
parseNetwork(network: any, params?: {}): {
|
|
@@ -114,7 +114,7 @@ export default class coinbaseinternational extends Exchange {
|
|
|
114
114
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
115
115
|
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
116
116
|
fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
117
|
-
withdraw(code: string, amount: number, address:
|
|
117
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
118
118
|
safeNetwork(network: any): {
|
|
119
119
|
info: any;
|
|
120
120
|
id: string;
|
|
@@ -93,8 +93,10 @@ export default class coinbaseinternational extends Exchange {
|
|
|
93
93
|
'fetchOrderBook': false,
|
|
94
94
|
'fetchOrders': false,
|
|
95
95
|
'fetchPosition': true,
|
|
96
|
+
'fetchPositionHistory': false,
|
|
96
97
|
'fetchPositionMode': false,
|
|
97
98
|
'fetchPositions': true,
|
|
99
|
+
'fetchPositionsHistory': false,
|
|
98
100
|
'fetchPositionsRisk': false,
|
|
99
101
|
'fetchPremiumIndexOHLCV': false,
|
|
100
102
|
'fetchTicker': true,
|
package/js/src/coinbasepro.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export default class coinbasepro extends Exchange {
|
|
|
39
39
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
|
|
40
40
|
cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
|
|
41
41
|
fetchPaymentMethods(params?: {}): Promise<any>;
|
|
42
|
-
withdraw(code: string, amount: number, address:
|
|
42
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
43
43
|
parseLedgerEntryType(type: any): string;
|
|
44
44
|
parseLedgerEntry(item: any, currency?: Currency): {
|
|
45
45
|
id: string;
|
package/js/src/coinbasepro.js
CHANGED
|
@@ -56,7 +56,13 @@ export default class coinbasepro extends Exchange {
|
|
|
56
56
|
'fetchOrderBook': true,
|
|
57
57
|
'fetchOrders': true,
|
|
58
58
|
'fetchOrderTrades': true,
|
|
59
|
+
'fetchPosition': false,
|
|
60
|
+
'fetchPositionHistory': false,
|
|
59
61
|
'fetchPositionMode': false,
|
|
62
|
+
'fetchPositions': false,
|
|
63
|
+
'fetchPositionsForSymbol': false,
|
|
64
|
+
'fetchPositionsHistory': false,
|
|
65
|
+
'fetchPositionsRisk': false,
|
|
60
66
|
'fetchTicker': true,
|
|
61
67
|
'fetchTickers': true,
|
|
62
68
|
'fetchTime': true,
|
package/js/src/coincheck.js
CHANGED
|
@@ -55,8 +55,11 @@ export default class coincheck extends Exchange {
|
|
|
55
55
|
'fetchOpenOrders': true,
|
|
56
56
|
'fetchOrderBook': true,
|
|
57
57
|
'fetchPosition': false,
|
|
58
|
+
'fetchPositionHistory': false,
|
|
58
59
|
'fetchPositionMode': false,
|
|
59
60
|
'fetchPositions': false,
|
|
61
|
+
'fetchPositionsForSymbol': false,
|
|
62
|
+
'fetchPositionsHistory': false,
|
|
60
63
|
'fetchPositionsRisk': false,
|
|
61
64
|
'fetchPremiumIndexOHLCV': false,
|
|
62
65
|
'fetchTicker': true,
|
package/js/src/coinex.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/coinex.js';
|
|
2
|
-
import type { Balances, Currency, FundingHistory, FundingRateHistory, Int, Market, OHLCV, Order, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, OrderRequest, TransferEntry, Leverage, Leverages, Num, MarginModification, TradingFeeInterface, Currencies, TradingFees } from './base/types.js';
|
|
2
|
+
import type { Balances, Currency, FundingHistory, FundingRateHistory, Int, Market, OHLCV, Order, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, OrderRequest, TransferEntry, Leverage, Leverages, Num, MarginModification, TradingFeeInterface, Currencies, TradingFees, Position } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class coinex
|
|
5
5
|
* @augments Exchange
|
|
@@ -65,17 +65,17 @@ export default class coinex extends Exchange {
|
|
|
65
65
|
network: any;
|
|
66
66
|
};
|
|
67
67
|
fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
68
|
-
fetchPositions(symbols?: Strings, params?: {}): Promise<
|
|
69
|
-
fetchPosition(symbol: string, params?: {}): Promise<
|
|
70
|
-
parsePosition(position: any, market?: Market):
|
|
68
|
+
fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
69
|
+
fetchPosition(symbol: string, params?: {}): Promise<Position>;
|
|
70
|
+
parsePosition(position: any, market?: Market): Position;
|
|
71
71
|
setMarginMode(marginMode: string, symbol?: Str, params?: {}): Promise<any>;
|
|
72
72
|
setLeverage(leverage: Int, symbol?: Str, params?: {}): Promise<any>;
|
|
73
73
|
fetchLeverageTiers(symbols?: Strings, params?: {}): Promise<{}>;
|
|
74
74
|
parseMarketLeverageTiers(item: any, market?: Market): any[];
|
|
75
75
|
modifyMarginHelper(symbol: string, amount: any, addOrReduce: any, params?: {}): Promise<any>;
|
|
76
76
|
parseMarginModification(data: any, market?: Market): MarginModification;
|
|
77
|
-
addMargin(symbol: string, amount:
|
|
78
|
-
reduceMargin(symbol: string, amount:
|
|
77
|
+
addMargin(symbol: string, amount: number, params?: {}): Promise<MarginModification>;
|
|
78
|
+
reduceMargin(symbol: string, amount: number, params?: {}): Promise<MarginModification>;
|
|
79
79
|
fetchFundingHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingHistory[]>;
|
|
80
80
|
fetchFundingRate(symbol: string, params?: {}): Promise<{
|
|
81
81
|
info: any;
|
|
@@ -116,7 +116,7 @@ export default class coinex extends Exchange {
|
|
|
116
116
|
previousFundingDatetime: any;
|
|
117
117
|
};
|
|
118
118
|
fetchFundingRates(symbols?: Strings, params?: {}): Promise<any>;
|
|
119
|
-
withdraw(code: string, amount: number, address:
|
|
119
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
120
120
|
parseTransactionStatus(status: any): string;
|
|
121
121
|
fetchFundingRateHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
|
|
122
122
|
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
|
@@ -188,6 +188,7 @@ export default class coinex extends Exchange {
|
|
|
188
188
|
parseDepositWithdrawFees(response: any, codes?: any, currencyIdKey?: any): {};
|
|
189
189
|
fetchLeverages(symbols?: string[], params?: {}): Promise<Leverages>;
|
|
190
190
|
parseLeverage(leverage: any, market?: any): Leverage;
|
|
191
|
+
fetchPositionHistory(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Position>;
|
|
191
192
|
handleMarginModeAndParams(methodName: any, params?: {}, defaultValue?: any): any[];
|
|
192
193
|
nonce(): number;
|
|
193
194
|
sign(path: any, api?: any[], method?: string, params?: {}, headers?: any, body?: any): {
|