ccxt 4.4.72 → 4.4.73

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/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.4.72';
41
+ const version = '4.4.73';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -56,7 +56,6 @@ import bitbank from './src/bitbank.js';
56
56
  import bitbns from './src/bitbns.js';
57
57
  import bitcoincom from './src/bitcoincom.js';
58
58
  import bitfinex from './src/bitfinex.js';
59
- import bitfinex1 from './src/bitfinex1.js';
60
59
  import bitflyer from './src/bitflyer.js';
61
60
  import bitget from './src/bitget.js';
62
61
  import bithumb from './src/bithumb.js';
@@ -162,7 +161,6 @@ import binanceusdmPro from './src/pro/binanceusdm.js';
162
161
  import bingxPro from './src/pro/bingx.js';
163
162
  import bitcoincomPro from './src/pro/bitcoincom.js';
164
163
  import bitfinexPro from './src/pro/bitfinex.js';
165
- import bitfinex1Pro from './src/pro/bitfinex1.js';
166
164
  import bitgetPro from './src/pro/bitget.js';
167
165
  import bithumbPro from './src/pro/bithumb.js';
168
166
  import bitmartPro from './src/pro/bitmart.js';
@@ -241,7 +239,6 @@ const exchanges = {
241
239
  'bitbns': bitbns,
242
240
  'bitcoincom': bitcoincom,
243
241
  'bitfinex': bitfinex,
244
- 'bitfinex1': bitfinex1,
245
242
  'bitflyer': bitflyer,
246
243
  'bitget': bitget,
247
244
  'bithumb': bithumb,
@@ -348,7 +345,6 @@ const pro = {
348
345
  'bingx': bingxPro,
349
346
  'bitcoincom': bitcoincomPro,
350
347
  'bitfinex': bitfinexPro,
351
- 'bitfinex1': bitfinex1Pro,
352
348
  'bitget': bitgetPro,
353
349
  'bithumb': bithumbPro,
354
350
  'bitmart': bitmartPro,
@@ -424,6 +420,6 @@ pro.exchanges = Object.keys(pro);
424
420
  pro['Exchange'] = Exchange; // now the same for rest and ts
425
421
  //-----------------------------------------------------------------------------
426
422
  const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
427
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitcoincom, bitfinex, bitfinex1, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex, ellipx, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, mercado, mexc, myokx, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
423
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitcoincom, bitfinex, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex, ellipx, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, mercado, mexc, myokx, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
428
424
  export default ccxt;
429
425
  //-----------------------------------------------------------------------------
package/js/src/ace.js CHANGED
@@ -25,22 +25,28 @@ export default class ace extends Exchange {
25
25
  'rateLimit': 100,
26
26
  'pro': false,
27
27
  'has': {
28
- 'CORS': undefined,
29
- 'spot': true,
30
- 'margin': false,
31
- 'swap': false,
32
- 'future': false,
33
- 'option': false,
28
+ 'addMargin': false,
29
+ 'borrowCrossMargin': false,
30
+ 'borrowIsolatedMargin': false,
31
+ 'borrowMargin': false,
34
32
  'cancelAllOrders': false,
35
33
  'cancelOrder': true,
36
34
  'cancelOrders': false,
37
35
  'closeAllPositions': false,
38
36
  'closePosition': false,
37
+ 'CORS': undefined,
39
38
  'createOrder': true,
39
+ 'createOrderWithTakeProfitAndStopLoss': false,
40
+ 'createOrderWithTakeProfitAndStopLossWs': false,
41
+ 'createReduceOnlyOrder': false,
40
42
  'editOrder': false,
41
43
  'fetchBalance': true,
44
+ 'fetchBorrowInterest': false,
45
+ 'fetchBorrowRate': false,
42
46
  'fetchBorrowRateHistories': false,
43
47
  'fetchBorrowRateHistory': false,
48
+ 'fetchBorrowRates': false,
49
+ 'fetchBorrowRatesPerSymbol': false,
44
50
  'fetchClosedOrders': false,
45
51
  'fetchCrossBorrowRate': false,
46
52
  'fetchCrossBorrowRates': false,
@@ -48,18 +54,36 @@ export default class ace extends Exchange {
48
54
  'fetchDepositAddress': false,
49
55
  'fetchDeposits': false,
50
56
  'fetchFundingHistory': false,
57
+ 'fetchFundingInterval': false,
58
+ 'fetchFundingIntervals': false,
51
59
  'fetchFundingRate': false,
52
60
  'fetchFundingRateHistory': false,
53
61
  'fetchFundingRates': false,
62
+ 'fetchGreeks': false,
54
63
  'fetchIndexOHLCV': false,
55
64
  'fetchIsolatedBorrowRate': false,
56
65
  'fetchIsolatedBorrowRates': false,
66
+ 'fetchIsolatedPositions': false,
67
+ 'fetchLeverage': false,
68
+ 'fetchLeverages': false,
69
+ 'fetchLeverageTiers': false,
70
+ 'fetchLiquidations': false,
71
+ 'fetchLongShortRatio': false,
72
+ 'fetchLongShortRatioHistory': false,
73
+ 'fetchMarginAdjustmentHistory': false,
57
74
  'fetchMarginMode': false,
75
+ 'fetchMarginModes': false,
76
+ 'fetchMarketLeverageTiers': false,
58
77
  'fetchMarkets': true,
59
78
  'fetchMarkOHLCV': false,
79
+ 'fetchMarkPrices': false,
80
+ 'fetchMyLiquidations': false,
81
+ 'fetchMySettlementHistory': false,
60
82
  'fetchMyTrades': true,
61
83
  'fetchOHLCV': true,
84
+ 'fetchOpenInterest': false,
62
85
  'fetchOpenInterestHistory': false,
86
+ 'fetchOpenInterests': false,
63
87
  'fetchOpenOrders': true,
64
88
  'fetchOrder': true,
65
89
  'fetchOrderBook': true,
@@ -73,6 +97,7 @@ export default class ace extends Exchange {
73
97
  'fetchPositionsHistory': false,
74
98
  'fetchPositionsRisk': false,
75
99
  'fetchPremiumIndexOHLCV': false,
100
+ 'fetchSettlementHistory': false,
76
101
  'fetchTicker': true,
77
102
  'fetchTickers': true,
78
103
  'fetchTime': false,
@@ -85,8 +110,18 @@ export default class ace extends Exchange {
85
110
  'fetchTransfers': false,
86
111
  'fetchWithdrawal': false,
87
112
  'fetchWithdrawals': false,
113
+ 'future': false,
114
+ 'margin': false,
115
+ 'option': false,
116
+ 'reduceMargin': false,
117
+ 'repayCrossMargin': false,
118
+ 'repayIsolatedMargin': false,
88
119
  'setLeverage': false,
120
+ 'setMargin': false,
89
121
  'setMarginMode': false,
122
+ 'setPositionMode': false,
123
+ 'spot': true,
124
+ 'swap': false,
90
125
  'transfer': false,
91
126
  'withdraw': false,
92
127
  'ws': false,
@@ -471,7 +506,7 @@ export default class ace extends Exchange {
471
506
  // ],
472
507
  // [
473
508
  // "0.001",
474
- // "20948.12"
509
+ // "20948.13"
475
510
  // ]
476
511
  // ]
477
512
  // },
package/js/src/alpaca.js CHANGED
@@ -49,6 +49,10 @@ export default class alpaca extends Exchange {
49
49
  'swap': false,
50
50
  'future': false,
51
51
  'option': false,
52
+ 'addMargin': false,
53
+ 'borrowCrossMargin': false,
54
+ 'borrowIsolatedMargin': false,
55
+ 'borrowMargin': false,
52
56
  'cancelAllOrders': true,
53
57
  'cancelOrder': true,
54
58
  'closeAllPositions': false,
@@ -57,26 +61,61 @@ export default class alpaca extends Exchange {
57
61
  'createMarketBuyOrderWithCost': true,
58
62
  'createMarketOrderWithCost': true,
59
63
  'createOrder': true,
64
+ 'createOrderWithTakeProfitAndStopLoss': false,
65
+ 'createOrderWithTakeProfitAndStopLossWs': false,
66
+ 'createReduceOnlyOrder': false,
60
67
  'createStopOrder': true,
61
68
  'createTriggerOrder': true,
62
69
  'editOrder': true,
63
70
  'fetchBalance': true,
64
71
  'fetchBidsAsks': false,
72
+ 'fetchBorrowInterest': false,
73
+ 'fetchBorrowRate': false,
74
+ 'fetchBorrowRateHistories': false,
75
+ 'fetchBorrowRateHistory': false,
76
+ 'fetchBorrowRates': false,
77
+ 'fetchBorrowRatesPerSymbol': false,
65
78
  'fetchClosedOrders': true,
79
+ 'fetchCrossBorrowRate': false,
80
+ 'fetchCrossBorrowRates': false,
66
81
  'fetchCurrencies': false,
67
82
  'fetchDepositAddress': true,
68
83
  'fetchDepositAddressesByNetwork': false,
69
84
  'fetchDeposits': true,
70
85
  'fetchDepositsWithdrawals': true,
71
86
  'fetchFundingHistory': false,
87
+ 'fetchFundingInterval': false,
88
+ 'fetchFundingIntervals': false,
72
89
  'fetchFundingRate': false,
73
90
  'fetchFundingRateHistory': false,
74
91
  'fetchFundingRates': false,
92
+ 'fetchGreeks': false,
93
+ 'fetchIndexOHLCV': false,
94
+ 'fetchIsolatedBorrowRate': false,
95
+ 'fetchIsolatedBorrowRates': false,
96
+ 'fetchIsolatedPositions': false,
75
97
  'fetchL1OrderBook': true,
76
98
  'fetchL2OrderBook': false,
99
+ 'fetchLeverage': false,
100
+ 'fetchLeverages': false,
101
+ 'fetchLeverageTiers': false,
102
+ 'fetchLiquidations': false,
103
+ 'fetchLongShortRatio': false,
104
+ 'fetchLongShortRatioHistory': false,
105
+ 'fetchMarginAdjustmentHistory': false,
106
+ 'fetchMarginMode': false,
107
+ 'fetchMarginModes': false,
108
+ 'fetchMarketLeverageTiers': false,
77
109
  'fetchMarkets': true,
110
+ 'fetchMarkOHLCV': false,
111
+ 'fetchMarkPrices': false,
112
+ 'fetchMyLiquidations': false,
113
+ 'fetchMySettlementHistory': false,
78
114
  'fetchMyTrades': true,
79
115
  'fetchOHLCV': true,
116
+ 'fetchOpenInterest': false,
117
+ 'fetchOpenInterestHistory': false,
118
+ 'fetchOpenInterests': false,
80
119
  'fetchOpenOrder': false,
81
120
  'fetchOpenOrders': true,
82
121
  'fetchOrder': true,
@@ -89,6 +128,8 @@ export default class alpaca extends Exchange {
89
128
  'fetchPositionsForSymbol': false,
90
129
  'fetchPositionsHistory': false,
91
130
  'fetchPositionsRisk': false,
131
+ 'fetchPremiumIndexOHLCV': false,
132
+ 'fetchSettlementHistory': false,
92
133
  'fetchStatus': false,
93
134
  'fetchTicker': true,
94
135
  'fetchTickers': true,
@@ -100,9 +141,14 @@ export default class alpaca extends Exchange {
100
141
  'fetchTransactions': false,
101
142
  'fetchTransfers': false,
102
143
  'fetchWithdrawals': true,
144
+ 'reduceMargin': false,
145
+ 'repayCrossMargin': false,
146
+ 'repayIsolatedMargin': false,
103
147
  'sandbox': true,
104
148
  'setLeverage': false,
149
+ 'setMargin': false,
105
150
  'setMarginMode': false,
151
+ 'setPositionMode': false,
106
152
  'transfer': false,
107
153
  'withdraw': true,
108
154
  },
@@ -550,7 +550,7 @@ export default class ascendex extends Exchange {
550
550
  const ids = Object.keys(dataById);
551
551
  const result = {};
552
552
  for (let i = 0; i < ids.length; i++) {
553
- const id = ids[i];
553
+ const id = this.safeString(ids, i);
554
554
  const currency = dataById[id];
555
555
  const code = this.safeCurrencyCode(id);
556
556
  const scale = this.safeString2(currency, 'precisionScale', 'nativeScale');
@@ -858,7 +858,7 @@ export default class Exchange {
858
858
  fetchPaginatedCallCursor(method: string, symbol?: Str, since?: any, limit?: any, params?: {}, cursorReceived?: any, cursorSent?: any, cursorIncrement?: any, maxEntriesPerRequest?: any): Promise<any>;
859
859
  fetchPaginatedCallIncremental(method: string, symbol?: Str, since?: any, limit?: any, params?: {}, pageKey?: any, maxEntriesPerRequest?: any): Promise<any>;
860
860
  sortCursorPaginatedResult(result: any): any;
861
- removeRepeatedElementsFromArray(input: any): any;
861
+ removeRepeatedElementsFromArray(input: any, fallbackToTimestamp?: boolean): any;
862
862
  handleUntilOption(key: string, request: any, params: any, multiplier?: number): any[];
863
863
  safeOpenInterest(interest: Dict, market?: Market): OpenInterest;
864
864
  parseLiquidation(liquidation: any, market?: Market): Liquidation;
@@ -66,7 +66,7 @@ export default class Exchange {
66
66
  this.validateClientSsl = false;
67
67
  this.timeout = 10000; // milliseconds
68
68
  this.verbose = false;
69
- this.twofa = undefined; // two-factor authentication (2FA)
69
+ this.twofa = undefined; // two-factor authentication (2-FA)
70
70
  this.balance = {};
71
71
  this.liquidations = {};
72
72
  this.orderbooks = {};
@@ -545,7 +545,7 @@ export default class Exchange {
545
545
  if (proxyUrl !== undefined) {
546
546
  // part only for node-js
547
547
  if (isNode) {
548
- // in node we need to set header to *
548
+ // in node-js we need to set header to *
549
549
  headers = this.extend({ 'Origin': this.origin }, headers);
550
550
  // only for http proxy
551
551
  if (proxyUrl.substring(0, 5) === 'http:') {
@@ -6716,23 +6716,13 @@ export default class Exchange {
6716
6716
  }
6717
6717
  return result;
6718
6718
  }
6719
- removeRepeatedElementsFromArray(input) {
6719
+ removeRepeatedElementsFromArray(input, fallbackToTimestamp = true) {
6720
6720
  const uniqueResult = {};
6721
6721
  for (let i = 0; i < input.length; i++) {
6722
6722
  const entry = input[i];
6723
- const id = this.safeString(entry, 'id');
6724
- if (id !== undefined) {
6725
- if (this.safeString(uniqueResult, id) === undefined) {
6726
- uniqueResult[id] = entry;
6727
- }
6728
- }
6729
- else {
6730
- const timestamp = this.safeInteger2(entry, 'timestamp', 0);
6731
- if (timestamp !== undefined) {
6732
- if (this.safeString(uniqueResult, timestamp) === undefined) {
6733
- uniqueResult[timestamp] = entry;
6734
- }
6735
- }
6723
+ const uniqValue = fallbackToTimestamp ? this.safeStringN(entry, ['id', 'timestamp', 0]) : this.safeString(entry, 'id');
6724
+ if (uniqValue !== undefined && !(uniqValue in uniqueResult)) {
6725
+ uniqueResult[uniqValue] = entry;
6736
6726
  }
6737
6727
  }
6738
6728
  const values = Object.values(uniqueResult);
package/js/src/binance.js CHANGED
@@ -1297,12 +1297,13 @@ export default class binance extends Exchange {
1297
1297
  },
1298
1298
  'quoteOrderQty': true,
1299
1299
  'broker': {
1300
- 'spot': 'x-R4BD3S82',
1301
- 'margin': 'x-R4BD3S82',
1302
- 'future': 'x-xcKtGhcu',
1300
+ 'spot': 'x-TKT5PX2F',
1301
+ 'margin': 'x-TKT5PX2F',
1302
+ 'future': 'x-cvBPrNm9',
1303
1303
  'delivery': 'x-xcKtGhcu',
1304
- 'swap': 'x-xcKtGhcu',
1304
+ 'swap': 'x-cvBPrNm9',
1305
1305
  'option': 'x-xcKtGhcu',
1306
+ 'inverse': 'x-xcKtGhcu',
1306
1307
  },
1307
1308
  'accountsByType': {
1308
1309
  'main': 'MAIN',
@@ -4178,7 +4179,7 @@ export default class binance extends Exchange {
4178
4179
  //
4179
4180
  // {
4180
4181
  // "symbol": "BTCUSDT",
4181
- // "markPrice": "11793.63104562", // mark price
4182
+ // "markPrice": "11793.63104562", // mark price
4182
4183
  // "indexPrice": "11781.80495970", // index price
4183
4184
  // "estimatedSettlePrice": "11781.16138815", // Estimated Settle Price, only useful in the last hour before the settlement starts
4184
4185
  // "lastFundingRate": "0.00038246", // This is the lastest estimated funding rate
@@ -5331,7 +5332,7 @@ export default class binance extends Exchange {
5331
5332
  // "symbol": "BTCUSDT",
5332
5333
  // "orderId": 16383176297,
5333
5334
  // "orderListId": -1,
5334
- // "clientOrderId": "x-R4BD3S8222ecb58eb9074fb1be018c",
5335
+ // "clientOrderId": "x-TKT5PX2F22ecb58eb9074fb1be018c",
5335
5336
  // "transactTime": 1670891847932,
5336
5337
  // "price": "13500.00000000",
5337
5338
  // "origQty": "0.00085000",
@@ -5738,7 +5739,7 @@ export default class binance extends Exchange {
5738
5739
  // "symbol": "BTCUSDT",
5739
5740
  // "orderId": 16383176297,
5740
5741
  // "orderListId": -1,
5741
- // "clientOrderId": "x-R4BD3S8222ecb58eb9074fb1be018c",
5742
+ // "clientOrderId": "x-TKT5PX2F22ecb58eb9074fb1be018c",
5742
5743
  // "transactTime": 1670891847932,
5743
5744
  // "price": "13500.00000000",
5744
5745
  // "origQty": "0.00085000",
@@ -5801,7 +5802,7 @@ export default class binance extends Exchange {
5801
5802
  // "symbol": "BTCUSDT",
5802
5803
  // "orderId": 5403233939,
5803
5804
  // "orderListId": -1,
5804
- // "clientOrderId": "x-R4BD3S825e669e75b6c14f69a2c43e",
5805
+ // "clientOrderId": "x-TKT5PX2F5e669e75b6c14f69a2c43e",
5805
5806
  // "transactTime": 1617151923742,
5806
5807
  // "price": "0.00000000",
5807
5808
  // "origQty": "0.00050000",
@@ -5976,7 +5977,7 @@ export default class binance extends Exchange {
5976
5977
  // createOrder, cancelAllOrders, cancelOrder: portfolio margin spot margin
5977
5978
  //
5978
5979
  // {
5979
- // "clientOrderId": "x-R4BD3S82e9ef29d8346440f0b28b86",
5980
+ // "clientOrderId": "x-TKT5PX2Fe9ef29d8346440f0b28b86",
5980
5981
  // "cummulativeQuoteQty": "0.00000000",
5981
5982
  // "executedQty": "0.00000000",
5982
5983
  // "fills": [],
@@ -5997,7 +5998,7 @@ export default class binance extends Exchange {
5997
5998
  // {
5998
5999
  // "symbol": "BTCUSDT",
5999
6000
  // "orderId": 24700763749,
6000
- // "clientOrderId": "x-R4BD3S826f724c2a4af6425f98c7b6",
6001
+ // "clientOrderId": "x-TKT5PX2F6f724c2a4af6425f98c7b6",
6001
6002
  // "price": "35000.00000000",
6002
6003
  // "origQty": "0.00100000",
6003
6004
  // "executedQty": "0.00000000",
@@ -6594,8 +6595,12 @@ export default class binance extends Exchange {
6594
6595
  const clientOrderIdRequest = isPortfolioMarginConditional ? 'newClientStrategyId' : 'newClientOrderId';
6595
6596
  if (clientOrderId === undefined) {
6596
6597
  const broker = this.safeDict(this.options, 'broker', {});
6597
- const defaultId = (market['contract']) ? 'x-xcKtGhcu' : 'x-R4BD3S82';
6598
- const brokerId = this.safeString(broker, marketType, defaultId);
6598
+ const defaultId = (market['contract']) ? 'x-xcKtGhcu' : 'x-TKT5PX2F';
6599
+ let idMarketType = 'spot';
6600
+ if (market['contract']) {
6601
+ idMarketType = (market['swap'] && market['linear']) ? 'swap' : 'inverse';
6602
+ }
6603
+ const brokerId = this.safeString(broker, idMarketType, defaultId);
6599
6604
  request[clientOrderIdRequest] = brokerId + this.uuid22();
6600
6605
  }
6601
6606
  else {
@@ -7209,7 +7214,7 @@ export default class binance extends Exchange {
7209
7214
  // {
7210
7215
  // "symbol": "BTCUSDT",
7211
7216
  // "orderId": 24684460474,
7212
- // "clientOrderId": "x-R4BD3S82e9ef29d8346440f0b28b86",
7217
+ // "clientOrderId": "x-TKT5PX2Fe9ef29d8346440f0b28b86",
7213
7218
  // "price": "35000.00000000",
7214
7219
  // "origQty": "0.00100000",
7215
7220
  // "executedQty": "0.00000000",
@@ -7902,7 +7907,7 @@ export default class binance extends Exchange {
7902
7907
  // [
7903
7908
  // {
7904
7909
  // "symbol": "ADAUSDT",
7905
- // "origClientOrderId": "x-R4BD3S82662cde7a90114475b86e21",
7910
+ // "origClientOrderId": "x-TKT5PX2F662cde7a90114475b86e21",
7906
7911
  // "orderId": 3935107,
7907
7912
  // "orderListId": -1,
7908
7913
  // "clientOrderId": "bqM2w1oTlugfRAjnTIFBE8",
@@ -12115,7 +12120,7 @@ export default class binance extends Exchange {
12115
12120
  if (newClientOrderId === undefined) {
12116
12121
  const isSpotOrMargin = (api.indexOf('sapi') > -1 || api === 'private');
12117
12122
  const marketType = isSpotOrMargin ? 'spot' : 'future';
12118
- const defaultId = (!isSpotOrMargin) ? 'x-xcKtGhcu' : 'x-R4BD3S82';
12123
+ const defaultId = (!isSpotOrMargin) ? 'x-xcKtGhcu' : 'x-TKT5PX2F';
12119
12124
  const broker = this.safeDict(this.options, 'broker', {});
12120
12125
  const brokerId = this.safeString(broker, marketType, defaultId);
12121
12126
  params['newClientOrderId'] = brokerId + this.uuid22();
package/js/src/bit2c.js CHANGED
@@ -57,24 +57,35 @@ export default class bit2c extends Exchange {
57
57
  'fetchMarginMode': false,
58
58
  'fetchMarkOHLCV': false,
59
59
  'fetchMyTrades': true,
60
+ 'fetchOpenInterest': false,
61
+ 'fetchOpenInterests': false,
60
62
  'fetchOpenInterestHistory': false,
61
63
  'fetchOpenOrders': true,
62
64
  'fetchOrder': true,
63
65
  'fetchOrderBook': true,
64
66
  'fetchPosition': false,
67
+ 'fetchPositionHistory': false,
68
+ 'fetchPositionsHistory': false,
69
+ 'fetchPositionsForSymbol': false,
65
70
  'fetchPositionMode': false,
66
71
  'fetchPositions': false,
67
72
  'fetchPositionsRisk': false,
68
73
  'fetchPremiumIndexOHLCV': false,
74
+ 'fetchSettlementHistory': false,
69
75
  'fetchTicker': true,
70
76
  'fetchTrades': true,
71
77
  'fetchTradingFee': false,
72
78
  'fetchTradingFees': true,
73
79
  'fetchTransfer': false,
74
80
  'fetchTransfers': false,
81
+ 'fetchUnderlyingAssets': false,
75
82
  'reduceMargin': false,
83
+ 'repayCrossMargin': false,
84
+ 'repayIsolatedMargin': false,
85
+ 'repayMargin': false,
76
86
  'setLeverage': false,
77
87
  'setMarginMode': false,
88
+ 'setMargin': false,
78
89
  'setPositionMode': false,
79
90
  'transfer': false,
80
91
  'ws': false,
package/js/src/bitget.js CHANGED
@@ -1925,7 +1925,7 @@ export default class bitget extends Exchange {
1925
1925
  const priceDecimals = this.safeInteger(market, 'pricePlace');
1926
1926
  const amountDecimals = this.safeInteger(market, 'volumePlace');
1927
1927
  const priceStep = this.safeString(market, 'priceEndStep');
1928
- const amountStep = this.safeString(market, 'minTradeNum');
1928
+ const amountStep = this.safeString(market, 'sizeMultiplier');
1929
1929
  const precise = new Precise(priceStep);
1930
1930
  precise.decimals = Math.max(precise.decimals, priceDecimals);
1931
1931
  precise.reduce();
@@ -2448,18 +2448,20 @@ export default class bitget extends Exchange {
2448
2448
  if (paginate) {
2449
2449
  return await this.fetchPaginatedCallCursor('fetchWithdrawals', undefined, since, limit, params, 'idLessThan', 'idLessThan', undefined, 100);
2450
2450
  }
2451
- if (code === undefined) {
2452
- throw new ArgumentsRequired(this.id + ' fetchWithdrawals() requires a `code` argument');
2451
+ let currency = undefined;
2452
+ if (code !== undefined) {
2453
+ currency = this.currency(code);
2453
2454
  }
2454
- const currency = this.currency(code);
2455
2455
  if (since === undefined) {
2456
2456
  since = this.milliseconds() - 7776000000; // 90 days
2457
2457
  }
2458
2458
  let request = {
2459
- 'coin': currency['id'],
2460
2459
  'startTime': since,
2461
2460
  'endTime': this.milliseconds(),
2462
2461
  };
2462
+ if (currency !== undefined) {
2463
+ request['coin'] = currency['id'];
2464
+ }
2463
2465
  [request, params] = this.handleUntilOption('endTime', request, params);
2464
2466
  if (limit !== undefined) {
2465
2467
  request['limit'] = limit;
package/js/src/bitrue.js CHANGED
@@ -1247,7 +1247,7 @@ export default class bitrue extends Exchange {
1247
1247
  // "time": 1699338305000
1248
1248
  // }
1249
1249
  //
1250
- const timestamp = this.safeInteger(response, 'time');
1250
+ const timestamp = this.safeInteger2(response, 'time', 'lastUpdateId');
1251
1251
  const orderbook = this.parseOrderBook(response, symbol, timestamp);
1252
1252
  orderbook['nonce'] = this.safeInteger(response, 'lastUpdateId');
1253
1253
  return orderbook;
package/js/src/bybit.d.ts CHANGED
@@ -639,6 +639,7 @@ export default class bybit extends Exchange {
639
639
  * @param {string} [params.subType] market subType, ['linear', 'inverse']
640
640
  * @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
641
641
  * @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
642
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times
642
643
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
643
644
  */
644
645
  fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
@@ -814,15 +815,7 @@ export default class bybit extends Exchange {
814
815
  * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
815
816
  */
816
817
  repayCrossMargin(code: string, amount: any, params?: {}): Promise<any>;
817
- parseMarginLoan(info: any, currency?: Currency): {
818
- id: string;
819
- currency: string;
820
- amount: any;
821
- symbol: any;
822
- timestamp: any;
823
- datetime: any;
824
- info: any;
825
- };
818
+ parseMarginLoan(info: any, currency?: Currency): Dict;
826
819
  parseTransferStatus(status: Str): Str;
827
820
  parseTransfer(transfer: Dict, currency?: Currency): TransferEntry;
828
821
  fetchDerivativesMarketLeverageTiers(symbol: string, params?: {}): Promise<LeverageTier[]>;
@@ -857,7 +850,7 @@ export default class bybit extends Exchange {
857
850
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
858
851
  */
859
852
  fetchTradingFees(params?: {}): Promise<TradingFees>;
860
- parseDepositWithdrawFee(fee: any, currency?: Currency): Dict;
853
+ parseDepositWithdrawFee(fee: any, currency?: Currency): any;
861
854
  /**
862
855
  * @method
863
856
  * @name bybit#fetchDepositWithdrawFees
@@ -971,16 +964,7 @@ export default class bybit extends Exchange {
971
964
  * @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
972
965
  */
973
966
  fetchFundingHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingHistory[]>;
974
- parseIncome(income: any, market?: Market): {
975
- info: any;
976
- symbol: string;
977
- code: string;
978
- timestamp: number;
979
- datetime: string;
980
- id: string;
981
- amount: number;
982
- rate: number;
983
- };
967
+ parseIncome(income: any, market?: Market): object;
984
968
  /**
985
969
  * @method
986
970
  * @name bybit#fetchOption
package/js/src/bybit.js CHANGED
@@ -6318,10 +6318,16 @@ export default class bybit extends Exchange {
6318
6318
  * @param {string} [params.subType] market subType, ['linear', 'inverse']
6319
6319
  * @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
6320
6320
  * @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
6321
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times
6321
6322
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
6322
6323
  */
6323
6324
  async fetchPositions(symbols = undefined, params = {}) {
6324
6325
  await this.loadMarkets();
6326
+ let paginate = false;
6327
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchPositions', 'paginate');
6328
+ if (paginate) {
6329
+ return await this.fetchPaginatedCallCursor('fetchPositions', symbols, undefined, undefined, params, 'nextPageCursor', 'cursor', undefined, 200);
6330
+ }
6325
6331
  let symbol = undefined;
6326
6332
  if ((symbols !== undefined) && Array.isArray(symbols)) {
6327
6333
  const symbolsLength = symbols.length;
@@ -6362,6 +6368,9 @@ export default class bybit extends Exchange {
6362
6368
  }
6363
6369
  }
6364
6370
  }
6371
+ if (this.safeInteger(params, 'limit') === undefined) {
6372
+ request['limit'] = 200; // max limit
6373
+ }
6365
6374
  params = this.omit(params, ['type']);
6366
6375
  request['category'] = type;
6367
6376
  const response = await this.privateGetV5PositionList(this.extend(request, params));
package/js/src/defx.js CHANGED
@@ -613,7 +613,7 @@ export default class defx extends Exchange {
613
613
  'active': this.safeString(market, 'status', '') === 'active',
614
614
  'contract': true,
615
615
  'linear': true,
616
- 'inverse': undefined,
616
+ 'inverse': false,
617
617
  'taker': this.safeNumber(fees, 'taker'),
618
618
  'maker': this.safeNumber(fees, 'maker'),
619
619
  'contractSize': this.parseNumber('1'),
package/js/src/derive.js CHANGED
@@ -638,6 +638,8 @@ export default class derive extends Exchange {
638
638
  else {
639
639
  optionType = 'call';
640
640
  }
641
+ linear = true;
642
+ inverse = false;
641
643
  }
642
644
  return this.safeMarketStructure({
643
645
  'id': marketId,
@@ -4,7 +4,7 @@ import Client from '../base/ws/Client.js';
4
4
  /**
5
5
  * @class bitget
6
6
  * @augments Exchange
7
- * @description watching delivery future markets is not yet implemented (perpertual future / swap is implemented)
7
+ * @description watching delivery future markets is not yet implemented (perpertual future & swap is implemented)
8
8
  */
9
9
  export default class bitget extends bitgetRest {
10
10
  describe(): any;
@@ -14,7 +14,7 @@ import { sha256 } from '../static_dependencies/noble-hashes/sha256.js';
14
14
  /**
15
15
  * @class bitget
16
16
  * @augments Exchange
17
- * @description watching delivery future markets is not yet implemented (perpertual future / swap is implemented)
17
+ * @description watching delivery future markets is not yet implemented (perpertual future & swap is implemented)
18
18
  */
19
19
  export default class bitget extends bitgetRest {
20
20
  describe() {