ccxt 4.5.0 → 4.5.2
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 +110 -112
- package/dist/ccxt.browser.min.js +5 -5
- package/dist/cjs/ccxt.js +1 -9
- package/dist/cjs/src/ascendex.js +1 -1
- package/dist/cjs/src/base/Exchange.js +13 -0
- package/dist/cjs/src/binance.js +20 -14
- package/dist/cjs/src/bitget.js +1 -1
- package/dist/cjs/src/coinbase.js +46 -34
- package/dist/cjs/src/gate.js +39 -18
- package/dist/cjs/src/gemini.js +1 -1
- package/dist/cjs/src/hibachi.js +1 -1
- package/dist/cjs/src/hyperliquid.js +16 -2
- package/dist/cjs/src/indodax.js +11 -12
- package/dist/cjs/src/kraken.js +1 -12
- package/dist/cjs/src/krakenfutures.js +25 -25
- package/dist/cjs/src/mexc.js +2 -1
- package/dist/cjs/src/okx.js +2 -2
- package/dist/cjs/src/poloniex.js +1 -1
- package/dist/cjs/src/pro/bitget.js +352 -75
- package/dist/cjs/src/pro/bitmart.js +1 -1
- package/dist/cjs/src/pro/bybit.js +8 -15
- package/dist/cjs/src/pro/gate.js +6 -1
- package/dist/cjs/src/pro/gemini.js +7 -2
- package/dist/cjs/src/pro/hyperliquid.js +9 -1
- package/dist/cjs/src/pro/kraken.js +5 -6
- package/dist/cjs/src/pro/lbank.js +55 -1
- package/dist/cjs/src/pro/mexc.js +1 -1
- package/dist/cjs/src/timex.js +35 -0
- package/dist/cjs/src/tradeogre.js +32 -0
- package/dist/cjs/src/wavesexchange.js +33 -0
- package/dist/cjs/src/zonda.js +12 -0
- package/js/ccxt.d.ts +2 -11
- package/js/ccxt.js +2 -8
- package/js/src/ascendex.js +1 -1
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +14 -1
- package/js/src/binance.d.ts +1 -1
- package/js/src/binance.js +20 -14
- package/js/src/bitget.js +1 -1
- package/js/src/coinbase.js +46 -34
- package/js/src/gate.d.ts +2 -1
- package/js/src/gate.js +39 -18
- package/js/src/gemini.js +1 -1
- package/js/src/hibachi.js +1 -1
- package/js/src/hyperliquid.d.ts +1 -0
- package/js/src/hyperliquid.js +16 -2
- package/js/src/indodax.js +11 -12
- package/js/src/kraken.d.ts +0 -1
- package/js/src/kraken.js +1 -12
- package/js/src/krakenfutures.d.ts +24 -24
- package/js/src/krakenfutures.js +25 -25
- package/js/src/mexc.js +2 -1
- package/js/src/okx.js +2 -2
- package/js/src/poloniex.js +1 -1
- package/js/src/pro/bitget.d.ts +12 -2
- package/js/src/pro/bitget.js +358 -75
- package/js/src/pro/bitmart.js +1 -1
- package/js/src/pro/bybit.js +8 -15
- package/js/src/pro/gate.d.ts +5 -0
- package/js/src/pro/gate.js +6 -1
- package/js/src/pro/gemini.d.ts +1 -1
- package/js/src/pro/gemini.js +7 -2
- package/js/src/pro/hyperliquid.js +9 -1
- package/js/src/pro/kraken.js +5 -6
- package/js/src/pro/lbank.d.ts +11 -1
- package/js/src/pro/lbank.js +55 -1
- package/js/src/pro/mexc.js +1 -1
- package/js/src/timex.js +35 -0
- package/js/src/tradeogre.js +32 -0
- package/js/src/wavesexchange.js +33 -0
- package/js/src/zonda.js +12 -0
- package/package.json +2 -1
- package/js/src/abstract/ellipx.d.ts +0 -28
- package/js/src/abstract/ellipx.js +0 -11
- package/js/src/abstract/vertex.d.ts +0 -22
- package/js/src/abstract/vertex.js +0 -11
- package/js/src/ellipx.d.ts +0 -237
- package/js/src/ellipx.js +0 -2071
- package/js/src/pro/vertex.d.ts +0 -104
- package/js/src/pro/vertex.js +0 -999
- package/js/src/vertex.d.ts +0 -346
- package/js/src/vertex.js +0 -3146
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, RestrictedLocation, 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.
|
|
41
|
+
const version = '4.5.1';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import alpaca from './src/alpaca.js';
|
|
@@ -94,7 +94,6 @@ import delta from './src/delta.js';
|
|
|
94
94
|
import deribit from './src/deribit.js';
|
|
95
95
|
import derive from './src/derive.js';
|
|
96
96
|
import digifinex from './src/digifinex.js';
|
|
97
|
-
import ellipx from './src/ellipx.js';
|
|
98
97
|
import exmo from './src/exmo.js';
|
|
99
98
|
import fmfwio from './src/fmfwio.js';
|
|
100
99
|
import foxbit from './src/foxbit.js';
|
|
@@ -139,7 +138,6 @@ import timex from './src/timex.js';
|
|
|
139
138
|
import tokocrypto from './src/tokocrypto.js';
|
|
140
139
|
import tradeogre from './src/tradeogre.js';
|
|
141
140
|
import upbit from './src/upbit.js';
|
|
142
|
-
import vertex from './src/vertex.js';
|
|
143
141
|
import wavesexchange from './src/wavesexchange.js';
|
|
144
142
|
import whitebit from './src/whitebit.js';
|
|
145
143
|
import woo from './src/woo.js';
|
|
@@ -217,7 +215,6 @@ import poloniexPro from './src/pro/poloniex.js';
|
|
|
217
215
|
import probitPro from './src/pro/probit.js';
|
|
218
216
|
import tradeogrePro from './src/pro/tradeogre.js';
|
|
219
217
|
import upbitPro from './src/pro/upbit.js';
|
|
220
|
-
import vertexPro from './src/pro/vertex.js';
|
|
221
218
|
import whitebitPro from './src/pro/whitebit.js';
|
|
222
219
|
import wooPro from './src/pro/woo.js';
|
|
223
220
|
import woofiproPro from './src/pro/woofipro.js';
|
|
@@ -276,7 +273,6 @@ const exchanges = {
|
|
|
276
273
|
'deribit': deribit,
|
|
277
274
|
'derive': derive,
|
|
278
275
|
'digifinex': digifinex,
|
|
279
|
-
'ellipx': ellipx,
|
|
280
276
|
'exmo': exmo,
|
|
281
277
|
'fmfwio': fmfwio,
|
|
282
278
|
'foxbit': foxbit,
|
|
@@ -321,7 +317,6 @@ const exchanges = {
|
|
|
321
317
|
'tokocrypto': tokocrypto,
|
|
322
318
|
'tradeogre': tradeogre,
|
|
323
319
|
'upbit': upbit,
|
|
324
|
-
'vertex': vertex,
|
|
325
320
|
'wavesexchange': wavesexchange,
|
|
326
321
|
'whitebit': whitebit,
|
|
327
322
|
'woo': woo,
|
|
@@ -400,7 +395,6 @@ const pro = {
|
|
|
400
395
|
'probit': probitPro,
|
|
401
396
|
'tradeogre': tradeogrePro,
|
|
402
397
|
'upbit': upbitPro,
|
|
403
|
-
'vertex': vertexPro,
|
|
404
398
|
'whitebit': whitebitPro,
|
|
405
399
|
'woo': wooPro,
|
|
406
400
|
'woofipro': woofiproPro,
|
|
@@ -418,6 +412,6 @@ pro.exchanges = Object.keys(pro);
|
|
|
418
412
|
pro['Exchange'] = Exchange; // now the same for rest and ts
|
|
419
413
|
//-----------------------------------------------------------------------------
|
|
420
414
|
const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
|
|
421
|
-
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, 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, alpaca, apex, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitfinex, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitrue, bitso, bitstamp, bitteam, bittrade, bitvavo, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex,
|
|
415
|
+
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, 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, alpaca, apex, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitfinex, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitrue, bitso, bitstamp, bitteam, bittrade, bitvavo, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex, exmo, fmfwio, foxbit, gate, gateio, gemini, hashkey, hibachi, hitbtc, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mercado, mexc, modetrade, myokx, ndax, novadax, oceanex, okcoin, okx, okxus, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
|
|
422
416
|
export default ccxt;
|
|
423
417
|
//-----------------------------------------------------------------------------
|
package/js/src/ascendex.js
CHANGED
|
@@ -1632,7 +1632,7 @@ export default class ascendex extends Exchange {
|
|
|
1632
1632
|
// "code": "0",
|
|
1633
1633
|
// "data": {
|
|
1634
1634
|
// "domain": "spot",
|
|
1635
|
-
// "userUID": "
|
|
1635
|
+
// "userUID": "U1479576457",
|
|
1636
1636
|
// "vipLevel": "0",
|
|
1637
1637
|
// "fees": [
|
|
1638
1638
|
// { symbol: 'HT/USDT', fee: { taker: '0.001', maker: "0.001" } },
|
|
@@ -422,6 +422,7 @@ export default class Exchange {
|
|
|
422
422
|
handleDelta(bookside: any, delta: any): void;
|
|
423
423
|
handleDeltasWithKeys(bookSide: any, deltas: any, priceKey?: IndexType, amountKey?: IndexType, countOrIdKey?: IndexType): void;
|
|
424
424
|
getCacheIndex(orderbook: any, deltas: any): number;
|
|
425
|
+
arraysConcat(arraysOfArrays: any[]): any[];
|
|
425
426
|
findTimeframe(timeframe: any, timeframes?: any): string;
|
|
426
427
|
checkProxyUrlSettings(url?: Str, method?: Str, headers?: any, body?: any): any;
|
|
427
428
|
urlEncoderForProxyUrl(targetUrl: string): string;
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -11,7 +11,7 @@ const { isNode, selfIsDefined, deepExtend, extend, clone, flatten, unique, index
|
|
|
11
11
|
import { keys as keysFunc, values as valuesFunc, vwap as vwapFunc } from './functions.js';
|
|
12
12
|
// import exceptions from "./errors.js"
|
|
13
13
|
import { // eslint-disable-line object-curly-newline
|
|
14
|
-
ExchangeError, BadSymbol, NullResponse, InvalidAddress, InvalidOrder, NotSupported, OperationFailed, BadResponse, AuthenticationError, DDoSProtection, RequestTimeout, NetworkError, InvalidProxySettings, ExchangeNotAvailable, ArgumentsRequired, RateLimitExceeded, BadRequest, UnsubscribeError } from "./errors.js";
|
|
14
|
+
ExchangeError, BadSymbol, NullResponse, InvalidAddress, InvalidOrder, NotSupported, OperationFailed, BadResponse, AuthenticationError, DDoSProtection, RequestTimeout, NetworkError, InvalidProxySettings, ExchangeNotAvailable, ArgumentsRequired, RateLimitExceeded, BadRequest, UnsubscribeError, ExchangeClosedByUser } from "./errors.js";
|
|
15
15
|
import { Precise } from './Precise.js';
|
|
16
16
|
//-----------------------------------------------------------------------------
|
|
17
17
|
import WsClient from './ws/WsClient.js';
|
|
@@ -1144,8 +1144,14 @@ export default class Exchange {
|
|
|
1144
1144
|
}
|
|
1145
1145
|
}
|
|
1146
1146
|
async close() {
|
|
1147
|
+
// test by running ts/src/pro/test/base/test.close.ts
|
|
1147
1148
|
const clients = Object.values(this.clients || {});
|
|
1148
1149
|
const closedClients = [];
|
|
1150
|
+
for (let i = 0; i < clients.length; i++) {
|
|
1151
|
+
const client = clients[i];
|
|
1152
|
+
client.error = new ExchangeClosedByUser(this.id + ' closedByUser');
|
|
1153
|
+
closedClients.push(client.close());
|
|
1154
|
+
}
|
|
1149
1155
|
for (let i = 0; i < clients.length; i++) {
|
|
1150
1156
|
const client = clients[i];
|
|
1151
1157
|
delete this.clients[client.url];
|
|
@@ -1825,6 +1831,13 @@ export default class Exchange {
|
|
|
1825
1831
|
// return the first index of the cache that can be applied to the orderbook or -1 if not possible
|
|
1826
1832
|
return -1;
|
|
1827
1833
|
}
|
|
1834
|
+
arraysConcat(arraysOfArrays) {
|
|
1835
|
+
let result = [];
|
|
1836
|
+
for (let i = 0; i < arraysOfArrays.length; i++) {
|
|
1837
|
+
result = this.arrayConcat(result, arraysOfArrays[i]);
|
|
1838
|
+
}
|
|
1839
|
+
return result;
|
|
1840
|
+
}
|
|
1828
1841
|
findTimeframe(timeframe, timeframes = undefined) {
|
|
1829
1842
|
if (timeframes === undefined) {
|
|
1830
1843
|
timeframes = this.timeframes;
|
package/js/src/binance.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ export default class binance extends Exchange {
|
|
|
13
13
|
market(symbol: string): MarketInterface;
|
|
14
14
|
safeMarket(marketId?: Str, market?: Market, delimiter?: Str, marketType?: Str): MarketInterface;
|
|
15
15
|
costToPrecision(symbol: any, cost: any): string;
|
|
16
|
-
currencyToPrecision(code: any, fee: any, networkCode?: any): string;
|
|
17
16
|
nonce(): number;
|
|
18
17
|
/**
|
|
19
18
|
* @method
|
|
@@ -614,6 +613,7 @@ export default class binance extends Exchange {
|
|
|
614
613
|
* @param {string[]} ids order ids
|
|
615
614
|
* @param {string} [symbol] unified market symbol
|
|
616
615
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
616
|
+
* @param {string[]} [params.clientOrderIds] alternative to ids, array of client order ids
|
|
617
617
|
*
|
|
618
618
|
* EXCHANGE SPECIFIC PARAMETERS
|
|
619
619
|
* @param {string[]} [params.origClientOrderIdList] max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
|
package/js/src/binance.js
CHANGED
|
@@ -1288,6 +1288,7 @@ export default class binance extends Exchange {
|
|
|
1288
1288
|
'defaultSubType': undefined,
|
|
1289
1289
|
'hasAlreadyAuthenticatedSuccessfully': false,
|
|
1290
1290
|
'warnOnFetchOpenOrdersWithoutSymbol': true,
|
|
1291
|
+
'currencyToPrecisionRoundingMode': TRUNCATE,
|
|
1291
1292
|
// not an error
|
|
1292
1293
|
// https://github.com/ccxt/ccxt/issues/11268
|
|
1293
1294
|
// https://github.com/ccxt/ccxt/pull/11624
|
|
@@ -2755,15 +2756,6 @@ export default class binance extends Exchange {
|
|
|
2755
2756
|
costToPrecision(symbol, cost) {
|
|
2756
2757
|
return this.decimalToPrecision(cost, TRUNCATE, this.markets[symbol]['precision']['quote'], this.precisionMode, this.paddingMode);
|
|
2757
2758
|
}
|
|
2758
|
-
currencyToPrecision(code, fee, networkCode = undefined) {
|
|
2759
|
-
// info is available in currencies only if the user has configured his api keys
|
|
2760
|
-
if (this.safeValue(this.currencies[code], 'precision') !== undefined) {
|
|
2761
|
-
return this.decimalToPrecision(fee, TRUNCATE, this.currencies[code]['precision'], this.precisionMode, this.paddingMode);
|
|
2762
|
-
}
|
|
2763
|
-
else {
|
|
2764
|
-
return this.numberToString(fee);
|
|
2765
|
-
}
|
|
2766
|
-
}
|
|
2767
2759
|
nonce() {
|
|
2768
2760
|
return this.milliseconds() - this.options['timeDifference'];
|
|
2769
2761
|
}
|
|
@@ -7830,6 +7822,7 @@ export default class binance extends Exchange {
|
|
|
7830
7822
|
* @param {string[]} ids order ids
|
|
7831
7823
|
* @param {string} [symbol] unified market symbol
|
|
7832
7824
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7825
|
+
* @param {string[]} [params.clientOrderIds] alternative to ids, array of client order ids
|
|
7833
7826
|
*
|
|
7834
7827
|
* EXCHANGE SPECIFIC PARAMETERS
|
|
7835
7828
|
* @param {string[]} [params.origClientOrderIdList] max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
|
|
@@ -7847,8 +7840,16 @@ export default class binance extends Exchange {
|
|
|
7847
7840
|
}
|
|
7848
7841
|
const request = {
|
|
7849
7842
|
'symbol': market['id'],
|
|
7850
|
-
'orderidlist': ids,
|
|
7843
|
+
// 'orderidlist': ids,
|
|
7851
7844
|
};
|
|
7845
|
+
const origClientOrderIdList = this.safeList2(params, 'origClientOrderIdList', 'clientOrderIds');
|
|
7846
|
+
if (origClientOrderIdList !== undefined) {
|
|
7847
|
+
params = this.omit(params, ['clientOrderIds']);
|
|
7848
|
+
request['origClientOrderIdList'] = origClientOrderIdList;
|
|
7849
|
+
}
|
|
7850
|
+
else {
|
|
7851
|
+
request['orderidlist'] = ids;
|
|
7852
|
+
}
|
|
7852
7853
|
let response = undefined;
|
|
7853
7854
|
if (market['linear']) {
|
|
7854
7855
|
response = await this.fapiPrivateDeleteBatchOrders(this.extend(request, params));
|
|
@@ -9434,7 +9435,6 @@ export default class binance extends Exchange {
|
|
|
9434
9435
|
const request = {
|
|
9435
9436
|
'coin': currency['id'],
|
|
9436
9437
|
'address': address,
|
|
9437
|
-
'amount': this.currencyToPrecision(code, amount),
|
|
9438
9438
|
// issue sapiGetCapitalConfigGetall () to get networks for withdrawing USDT ERC20 vs USDT Omni
|
|
9439
9439
|
// 'network': 'ETH', // 'BTC', 'TRX', etc, optional
|
|
9440
9440
|
};
|
|
@@ -9448,6 +9448,7 @@ export default class binance extends Exchange {
|
|
|
9448
9448
|
request['network'] = network;
|
|
9449
9449
|
params = this.omit(params, 'network');
|
|
9450
9450
|
}
|
|
9451
|
+
request['amount'] = this.currencyToPrecision(code, amount, network);
|
|
9451
9452
|
const response = await this.sapiPostCapitalWithdrawApply(this.extend(request, params));
|
|
9452
9453
|
// { id: '9a67628b16ba4988ae20d329333f16bc' }
|
|
9453
9454
|
return this.parseTransaction(response, currency);
|
|
@@ -12064,8 +12065,8 @@ export default class binance extends Exchange {
|
|
|
12064
12065
|
else if ((path === 'batchOrders') || (path.indexOf('sub-account') >= 0) || (path === 'capital/withdraw/apply') || (path.indexOf('staking') >= 0) || (path.indexOf('simple-earn') >= 0)) {
|
|
12065
12066
|
if ((method === 'DELETE') && (path === 'batchOrders')) {
|
|
12066
12067
|
const orderidlist = this.safeList(extendedParams, 'orderidlist', []);
|
|
12067
|
-
const origclientorderidlist = this.
|
|
12068
|
-
extendedParams = this.omit(extendedParams, ['orderidlist', 'origclientorderidlist']);
|
|
12068
|
+
const origclientorderidlist = this.safeList2(extendedParams, 'origclientorderidlist', 'origClientOrderIdList', []);
|
|
12069
|
+
extendedParams = this.omit(extendedParams, ['orderidlist', 'origclientorderidlist', 'origClientOrderIdList']);
|
|
12069
12070
|
query = this.rawencode(extendedParams);
|
|
12070
12071
|
const orderidlistLength = orderidlist.length;
|
|
12071
12072
|
const origclientorderidlistLength = origclientorderidlist.length;
|
|
@@ -12073,7 +12074,12 @@ export default class binance extends Exchange {
|
|
|
12073
12074
|
query = query + '&' + 'orderidlist=%5B' + orderidlist.join('%2C') + '%5D';
|
|
12074
12075
|
}
|
|
12075
12076
|
if (origclientorderidlistLength > 0) {
|
|
12076
|
-
|
|
12077
|
+
// wrap clientOrderids around ""
|
|
12078
|
+
const newClientOrderIds = [];
|
|
12079
|
+
for (let i = 0; i < origclientorderidlistLength; i++) {
|
|
12080
|
+
newClientOrderIds.push('%22' + origclientorderidlist[i] + '%22');
|
|
12081
|
+
}
|
|
12082
|
+
query = query + '&' + 'origclientorderidlist=%5B' + newClientOrderIds.join('%2C') + '%5D';
|
|
12077
12083
|
}
|
|
12078
12084
|
}
|
|
12079
12085
|
else {
|
package/js/src/bitget.js
CHANGED
|
@@ -1919,7 +1919,7 @@ export default class bitget extends Exchange {
|
|
|
1919
1919
|
const res = this.safeDict(results, i);
|
|
1920
1920
|
const data = this.safeList(res, 'data', []);
|
|
1921
1921
|
const firstData = this.safeDict(data, 0, {});
|
|
1922
|
-
const isBorrowable = this.
|
|
1922
|
+
const isBorrowable = this.safeBool(firstData, 'isBorrowable');
|
|
1923
1923
|
if (fetchMargins && isBorrowable !== undefined) {
|
|
1924
1924
|
const keysList = Object.keys(this.indexBy(data, 'symbol'));
|
|
1925
1925
|
this.options['crossMarginPairsData'] = keysList;
|
package/js/src/coinbase.js
CHANGED
|
@@ -2249,34 +2249,44 @@ export default class coinbase extends Exchange {
|
|
|
2249
2249
|
// fetchTickersV3
|
|
2250
2250
|
//
|
|
2251
2251
|
// [
|
|
2252
|
-
//
|
|
2253
|
-
//
|
|
2254
|
-
//
|
|
2255
|
-
//
|
|
2256
|
-
//
|
|
2257
|
-
//
|
|
2258
|
-
//
|
|
2259
|
-
//
|
|
2260
|
-
//
|
|
2261
|
-
//
|
|
2262
|
-
//
|
|
2263
|
-
//
|
|
2264
|
-
//
|
|
2265
|
-
//
|
|
2266
|
-
//
|
|
2267
|
-
//
|
|
2268
|
-
//
|
|
2269
|
-
//
|
|
2270
|
-
//
|
|
2271
|
-
//
|
|
2272
|
-
//
|
|
2273
|
-
//
|
|
2274
|
-
//
|
|
2275
|
-
//
|
|
2276
|
-
//
|
|
2277
|
-
//
|
|
2278
|
-
//
|
|
2279
|
-
//
|
|
2252
|
+
// {
|
|
2253
|
+
// "product_id": "ETH-USD",
|
|
2254
|
+
// "price": "4471.59",
|
|
2255
|
+
// "price_percentage_change_24h": "0.14243387238731",
|
|
2256
|
+
// "volume_24h": "87329.92990204",
|
|
2257
|
+
// "volume_percentage_change_24h": "-60.7789801794578",
|
|
2258
|
+
// "base_increment": "0.00000001",
|
|
2259
|
+
// "quote_increment": "0.01",
|
|
2260
|
+
// "quote_min_size": "1",
|
|
2261
|
+
// "quote_max_size": "150000000",
|
|
2262
|
+
// "base_min_size": "0.00000001",
|
|
2263
|
+
// "base_max_size": "42000",
|
|
2264
|
+
// "base_name": "Ethereum",
|
|
2265
|
+
// "quote_name": "US Dollar",
|
|
2266
|
+
// "watched": false,
|
|
2267
|
+
// "is_disabled": false,
|
|
2268
|
+
// "new": false,
|
|
2269
|
+
// "status": "online",
|
|
2270
|
+
// "cancel_only": false,
|
|
2271
|
+
// "limit_only": false,
|
|
2272
|
+
// "post_only": false,
|
|
2273
|
+
// "trading_disabled": false,
|
|
2274
|
+
// "auction_mode": false,
|
|
2275
|
+
// "product_type": "SPOT",
|
|
2276
|
+
// "quote_currency_id": "USD",
|
|
2277
|
+
// "base_currency_id": "ETH",
|
|
2278
|
+
// "fcm_trading_session_details": null,
|
|
2279
|
+
// "mid_market_price": "",
|
|
2280
|
+
// "alias": "",
|
|
2281
|
+
// "alias_to": [ "ETH-USDC" ],
|
|
2282
|
+
// "base_display_symbol": "ETH",
|
|
2283
|
+
// "quote_display_symbol": "USD",
|
|
2284
|
+
// "view_only": false,
|
|
2285
|
+
// "price_increment": "0.01",
|
|
2286
|
+
// "display_name": "ETH-USD",
|
|
2287
|
+
// "product_venue": "CBE",
|
|
2288
|
+
// "approximate_quote_24h_volume": "390503641.25",
|
|
2289
|
+
// "new_at": "2023-01-01T00:00:00Z"
|
|
2280
2290
|
// },
|
|
2281
2291
|
// ...
|
|
2282
2292
|
// ]
|
|
@@ -2307,10 +2317,12 @@ export default class coinbase extends Exchange {
|
|
|
2307
2317
|
if (('bids' in ticker)) {
|
|
2308
2318
|
const bids = this.safeList(ticker, 'bids', []);
|
|
2309
2319
|
const asks = this.safeList(ticker, 'asks', []);
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2320
|
+
const firstBid = this.safeDict(bids, 0, {});
|
|
2321
|
+
const firstAsk = this.safeDict(asks, 0, {});
|
|
2322
|
+
bid = this.safeNumber(firstBid, 'price');
|
|
2323
|
+
bidVolume = this.safeNumber(firstBid, 'size');
|
|
2324
|
+
ask = this.safeNumber(firstAsk, 'price');
|
|
2325
|
+
askVolume = this.safeNumber(firstAsk, 'size');
|
|
2314
2326
|
}
|
|
2315
2327
|
const marketId = this.safeString(ticker, 'product_id');
|
|
2316
2328
|
market = this.safeMarket(marketId, market);
|
|
@@ -2334,8 +2346,8 @@ export default class coinbase extends Exchange {
|
|
|
2334
2346
|
'change': undefined,
|
|
2335
2347
|
'percentage': this.safeNumber(ticker, 'price_percentage_change_24h'),
|
|
2336
2348
|
'average': undefined,
|
|
2337
|
-
'baseVolume':
|
|
2338
|
-
'quoteVolume':
|
|
2349
|
+
'baseVolume': this.safeNumber(ticker, 'volume_24h'),
|
|
2350
|
+
'quoteVolume': this.safeNumber(ticker, 'approximate_quote_24h_volume'),
|
|
2339
2351
|
'info': ticker,
|
|
2340
2352
|
}, market);
|
|
2341
2353
|
}
|
package/js/src/gate.d.ts
CHANGED
|
@@ -42,7 +42,8 @@ export default class gate extends Exchange {
|
|
|
42
42
|
*/
|
|
43
43
|
fetchMarkets(params?: {}): Promise<Market[]>;
|
|
44
44
|
fetchSpotMarkets(params?: {}): Promise<any[]>;
|
|
45
|
-
|
|
45
|
+
fetchSwapMarkets(params?: {}): Promise<any[]>;
|
|
46
|
+
fetchFutureMarkets(params?: {}): Promise<any[]>;
|
|
46
47
|
parseContractMarket(market: any, settleId: any): {
|
|
47
48
|
id: string;
|
|
48
49
|
symbol: string;
|
package/js/src/gate.js
CHANGED
|
@@ -750,6 +750,9 @@ export default class gate extends Exchange {
|
|
|
750
750
|
'option': 'options',
|
|
751
751
|
'options': 'options',
|
|
752
752
|
},
|
|
753
|
+
'fetchMarkets': {
|
|
754
|
+
'types': ['spot', 'swap', 'future', 'option'],
|
|
755
|
+
},
|
|
753
756
|
'swap': {
|
|
754
757
|
'fetchMarkets': {
|
|
755
758
|
'settlementCurrencies': ['usdt', 'btc'],
|
|
@@ -1227,22 +1230,30 @@ export default class gate extends Exchange {
|
|
|
1227
1230
|
if (this.checkRequiredCredentials(false)) {
|
|
1228
1231
|
await this.loadUnifiedStatus();
|
|
1229
1232
|
}
|
|
1233
|
+
const rawPromises = [];
|
|
1230
1234
|
const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1235
|
+
const fetchMarketsOptions = this.safeDict(this.options, 'fetchMarkets');
|
|
1236
|
+
const types = this.safeList(fetchMarketsOptions, 'types', ['spot', 'swap', 'future', 'option']);
|
|
1237
|
+
for (let i = 0; i < types.length; i++) {
|
|
1238
|
+
const marketType = types[i];
|
|
1239
|
+
if (marketType === 'spot') {
|
|
1240
|
+
if (!sandboxMode) {
|
|
1241
|
+
// gate doesn't have a sandbox for spot markets
|
|
1242
|
+
rawPromises.push(this.fetchSpotMarkets(params));
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
else if (marketType === 'swap') {
|
|
1246
|
+
rawPromises.push(this.fetchSwapMarkets(params));
|
|
1247
|
+
}
|
|
1248
|
+
else if (marketType === 'future') {
|
|
1249
|
+
rawPromises.push(this.fetchFutureMarkets(params));
|
|
1250
|
+
}
|
|
1251
|
+
else if (marketType === 'option') {
|
|
1252
|
+
rawPromises.push(this.fetchOptionMarkets(params));
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
const results = await Promise.all(rawPromises);
|
|
1256
|
+
return this.arraysConcat(results);
|
|
1246
1257
|
}
|
|
1247
1258
|
async fetchSpotMarkets(params = {}) {
|
|
1248
1259
|
const marginPromise = this.publicMarginGetCurrencyPairs(params);
|
|
@@ -1358,10 +1369,9 @@ export default class gate extends Exchange {
|
|
|
1358
1369
|
}
|
|
1359
1370
|
return result;
|
|
1360
1371
|
}
|
|
1361
|
-
async
|
|
1372
|
+
async fetchSwapMarkets(params = {}) {
|
|
1362
1373
|
const result = [];
|
|
1363
1374
|
const swapSettlementCurrencies = this.getSettlementCurrencies('swap', 'fetchMarkets');
|
|
1364
|
-
const futureSettlementCurrencies = this.getSettlementCurrencies('future', 'fetchMarkets');
|
|
1365
1375
|
for (let c = 0; c < swapSettlementCurrencies.length; c++) {
|
|
1366
1376
|
const settleId = swapSettlementCurrencies[c];
|
|
1367
1377
|
const request = {
|
|
@@ -1373,6 +1383,11 @@ export default class gate extends Exchange {
|
|
|
1373
1383
|
result.push(parsedMarket);
|
|
1374
1384
|
}
|
|
1375
1385
|
}
|
|
1386
|
+
return result;
|
|
1387
|
+
}
|
|
1388
|
+
async fetchFutureMarkets(params = {}) {
|
|
1389
|
+
const result = [];
|
|
1390
|
+
const futureSettlementCurrencies = this.getSettlementCurrencies('future', 'fetchMarkets');
|
|
1376
1391
|
for (let c = 0; c < futureSettlementCurrencies.length; c++) {
|
|
1377
1392
|
const settleId = futureSettlementCurrencies[c];
|
|
1378
1393
|
const request = {
|
|
@@ -2599,7 +2614,13 @@ export default class gate extends Exchange {
|
|
|
2599
2614
|
//
|
|
2600
2615
|
const [request, query] = this.prepareRequest(market, market['type'], params);
|
|
2601
2616
|
if (limit !== undefined) {
|
|
2602
|
-
|
|
2617
|
+
if (market['spot']) {
|
|
2618
|
+
limit = Math.min(limit, 1000);
|
|
2619
|
+
}
|
|
2620
|
+
else {
|
|
2621
|
+
limit = Math.min(limit, 300);
|
|
2622
|
+
}
|
|
2623
|
+
request['limit'] = limit;
|
|
2603
2624
|
}
|
|
2604
2625
|
request['with_id'] = true;
|
|
2605
2626
|
let response = undefined;
|
package/js/src/gemini.js
CHANGED
|
@@ -264,7 +264,7 @@ export default class gemini extends Exchange {
|
|
|
264
264
|
'fetchMarketFromWebRetries': 10,
|
|
265
265
|
'fetchMarketsFromAPI': {
|
|
266
266
|
'fetchDetailsForAllSymbols': false,
|
|
267
|
-
'quoteCurrencies': ['USDT', 'GUSD', 'USD', 'DAI', 'EUR', 'GBP', 'SGD', 'BTC', 'ETH', 'LTC', 'BCH', 'SOL'],
|
|
267
|
+
'quoteCurrencies': ['USDT', 'GUSD', 'USD', 'DAI', 'EUR', 'GBP', 'SGD', 'BTC', 'ETH', 'LTC', 'BCH', 'SOL', 'USDC'],
|
|
268
268
|
},
|
|
269
269
|
'fetchMarkets': {
|
|
270
270
|
'webApiEnable': true,
|
package/js/src/hibachi.js
CHANGED
|
@@ -1596,7 +1596,7 @@ export default class hibachi extends Exchange {
|
|
|
1596
1596
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
1597
1597
|
const endpoint = '/' + this.implodeParams(path, params);
|
|
1598
1598
|
let url = this.urls['api'][api] + endpoint;
|
|
1599
|
-
headers = {};
|
|
1599
|
+
headers = { 'Hibachi-Client': 'HibachiCCXT/unversioned' };
|
|
1600
1600
|
if (method === 'GET') {
|
|
1601
1601
|
const request = this.omit(params, this.extractParams(path));
|
|
1602
1602
|
const query = this.urlencode(request);
|
package/js/src/hyperliquid.d.ts
CHANGED
|
@@ -400,6 +400,7 @@ export default class hyperliquid extends Exchange {
|
|
|
400
400
|
* @param {string} id order id
|
|
401
401
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
402
402
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
403
|
+
* @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
|
|
403
404
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
404
405
|
* @param {string} [params.subAccountAddress] sub account user address
|
|
405
406
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
package/js/src/hyperliquid.js
CHANGED
|
@@ -2381,6 +2381,7 @@ export default class hyperliquid extends Exchange {
|
|
|
2381
2381
|
* @param {string} id order id
|
|
2382
2382
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
2383
2383
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2384
|
+
* @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
|
|
2384
2385
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
2385
2386
|
* @param {string} [params.subAccountAddress] sub account user address
|
|
2386
2387
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -2390,12 +2391,20 @@ export default class hyperliquid extends Exchange {
|
|
|
2390
2391
|
[userAddress, params] = this.handlePublicAddress('fetchOrder', params);
|
|
2391
2392
|
await this.loadMarkets();
|
|
2392
2393
|
const market = this.safeMarket(symbol);
|
|
2393
|
-
const
|
|
2394
|
+
const clientOrderId = this.safeString(params, 'clientOrderId');
|
|
2394
2395
|
const request = {
|
|
2395
2396
|
'type': 'orderStatus',
|
|
2396
|
-
'oid': isClientOrderId ? id : this.parseToNumeric(id),
|
|
2397
|
+
// 'oid': isClientOrderId ? id : this.parseToNumeric (id),
|
|
2397
2398
|
'user': userAddress,
|
|
2398
2399
|
};
|
|
2400
|
+
if (clientOrderId !== undefined) {
|
|
2401
|
+
params = this.omit(params, 'clientOrderId');
|
|
2402
|
+
request['oid'] = clientOrderId;
|
|
2403
|
+
}
|
|
2404
|
+
else {
|
|
2405
|
+
const isClientOrderId = id.length >= 34;
|
|
2406
|
+
request['oid'] = isClientOrderId ? id : this.parseToNumeric(id);
|
|
2407
|
+
}
|
|
2399
2408
|
const response = await this.publicPostInfo(this.extend(request, params));
|
|
2400
2409
|
//
|
|
2401
2410
|
// {
|
|
@@ -3846,12 +3855,17 @@ export default class hyperliquid extends Exchange {
|
|
|
3846
3855
|
// }
|
|
3847
3856
|
// {"status":"ok","response":{"type":"order","data":{"statuses":[{"error":"Insufficient margin to place order. asset=84"}]}}}
|
|
3848
3857
|
//
|
|
3858
|
+
// {"status":"unknownOid"}
|
|
3859
|
+
//
|
|
3849
3860
|
const status = this.safeString(response, 'status', '');
|
|
3850
3861
|
const error = this.safeString(response, 'error');
|
|
3851
3862
|
let message = undefined;
|
|
3852
3863
|
if (status === 'err') {
|
|
3853
3864
|
message = this.safeString(response, 'response');
|
|
3854
3865
|
}
|
|
3866
|
+
else if (status === 'unknownOid') {
|
|
3867
|
+
throw new OrderNotFound(this.id + ' ' + body); // {"status":"unknownOid"}
|
|
3868
|
+
}
|
|
3855
3869
|
else if (error !== undefined) {
|
|
3856
3870
|
message = error;
|
|
3857
3871
|
}
|
package/js/src/indodax.js
CHANGED
|
@@ -198,6 +198,16 @@ export default class indodax extends Exchange {
|
|
|
198
198
|
'Minimum order': InvalidOrder,
|
|
199
199
|
},
|
|
200
200
|
},
|
|
201
|
+
'timeframes': {
|
|
202
|
+
'1m': '1',
|
|
203
|
+
'15m': '15',
|
|
204
|
+
'30m': '30',
|
|
205
|
+
'1h': '60',
|
|
206
|
+
'4h': '240',
|
|
207
|
+
'1d': '1D',
|
|
208
|
+
'3d': '3D',
|
|
209
|
+
'1w': '1W',
|
|
210
|
+
},
|
|
201
211
|
// exchange-specific options
|
|
202
212
|
'options': {
|
|
203
213
|
'recvWindow': 5 * 1000,
|
|
@@ -221,16 +231,6 @@ export default class indodax extends Exchange {
|
|
|
221
231
|
// 'ETH': 'eth'
|
|
222
232
|
// 'BASE': 'base'
|
|
223
233
|
},
|
|
224
|
-
'timeframes': {
|
|
225
|
-
'1m': '1',
|
|
226
|
-
'15m': '15',
|
|
227
|
-
'30m': '30',
|
|
228
|
-
'1h': '60',
|
|
229
|
-
'4h': '240',
|
|
230
|
-
'1d': '1D',
|
|
231
|
-
'3d': '3D',
|
|
232
|
-
'1w': '1W',
|
|
233
|
-
},
|
|
234
234
|
},
|
|
235
235
|
'features': {
|
|
236
236
|
'spot': {
|
|
@@ -688,8 +688,7 @@ export default class indodax extends Exchange {
|
|
|
688
688
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
689
689
|
await this.loadMarkets();
|
|
690
690
|
const market = this.market(symbol);
|
|
691
|
-
const
|
|
692
|
-
const selectedTimeframe = this.safeString(timeframes, timeframe, timeframe);
|
|
691
|
+
const selectedTimeframe = this.safeString(this.timeframes, timeframe, timeframe);
|
|
693
692
|
const now = this.seconds();
|
|
694
693
|
const until = this.safeInteger(params, 'until', now);
|
|
695
694
|
params = this.omit(params, ['until']);
|
package/js/src/kraken.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ export default class kraken extends Exchange {
|
|
|
17
17
|
* @returns {object[]} an array of objects representing market data
|
|
18
18
|
*/
|
|
19
19
|
fetchMarkets(params?: {}): Promise<Market[]>;
|
|
20
|
-
safeCurrency(currencyId: any, currency?: Currency): import("./base/types.js").CurrencyInterface;
|
|
21
20
|
/**
|
|
22
21
|
* @method
|
|
23
22
|
* @name kraken#fetchStatus
|
package/js/src/kraken.js
CHANGED
|
@@ -236,6 +236,7 @@ export default class kraken extends Exchange {
|
|
|
236
236
|
'UST': 'USTC',
|
|
237
237
|
'XBT': 'BTC',
|
|
238
238
|
'XDG': 'DOGE',
|
|
239
|
+
'FEE': 'KFEE',
|
|
239
240
|
},
|
|
240
241
|
'options': {
|
|
241
242
|
'timeDifference': 0,
|
|
@@ -706,18 +707,6 @@ export default class kraken extends Exchange {
|
|
|
706
707
|
this.options['marketsByAltname'] = this.indexBy(result, 'altname');
|
|
707
708
|
return result;
|
|
708
709
|
}
|
|
709
|
-
safeCurrency(currencyId, currency = undefined) {
|
|
710
|
-
if (currencyId !== undefined) {
|
|
711
|
-
if (currencyId.length > 3) {
|
|
712
|
-
if ((currencyId.indexOf('X') === 0) || (currencyId.indexOf('Z') === 0)) {
|
|
713
|
-
if (!(currencyId.indexOf('.') > 0) && (currencyId !== 'ZEUS')) {
|
|
714
|
-
currencyId = currencyId.slice(1);
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
return super.safeCurrency(currencyId, currency);
|
|
720
|
-
}
|
|
721
710
|
/**
|
|
722
711
|
* @method
|
|
723
712
|
* @name kraken#fetchStatus
|