ccxt 4.3.93 → 4.3.95

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.
@@ -448,164 +448,82 @@ class mexc extends mexc$1 {
448
448
  'LTC': 'LTC',
449
449
  },
450
450
  'networks': {
451
- 'ABBC': 'ABBC',
451
+ 'TRC20': 'TRX',
452
+ 'TON': 'TONCOIN',
453
+ 'AVAXC': 'AVAX_CCHAIN',
454
+ 'ERC20': 'ETH',
452
455
  'ACA': 'ACALA',
453
- 'ADA': 'Cardano(ADA)',
454
- 'AE': 'AE',
455
- 'ALGO': 'Algorand(ALGO)',
456
- 'ALPH': 'Alephium(ALPH)',
457
- 'AME': 'AME',
458
- 'AOK': 'AOK',
459
- 'APT': 'APTOS(APT)',
460
- 'AR': 'AR',
461
- 'ARB': 'Arbitrum One(ARB)',
462
- 'ARBNOVA': 'ARBNOVA',
463
- 'ARBONE': 'ArbitrumOne(ARB)',
464
- 'ARK': 'ARK',
456
+ // 'ADA': 'Cardano(ADA)',
457
+ // 'AE': 'AE',
458
+ // 'ALGO': 'Algorand(ALGO)',
459
+ // 'ALPH': 'Alephium(ALPH)',
460
+ // 'ARB': 'Arbitrum One(ARB)',
461
+ // 'ARBONE': 'ArbitrumOne(ARB)',
465
462
  'ASTR': 'ASTAR',
466
- 'ATOM': 'Cosmos(ATOM)',
467
- 'AVAXC': 'Avalanche C Chain(AVAX CCHAIN)',
468
- 'AVAXX': 'Avalanche X Chain(AVAX XCHAIN)',
469
- 'AZERO': 'Aleph Zero(AZERO)',
470
- 'BCH': 'Bitcoin Cash(BCH)',
471
- 'BDX': 'BDX',
472
- 'BEAM': 'BEAM',
473
- 'BEP2': 'BNB Beacon Chain(BEP2)',
474
- 'BEP20': 'BNB Smart Chain(BEP20)',
475
- 'BITCI': 'BITCI',
476
- 'BNC': 'BNC',
477
- 'BNCDOT': 'BNCPOLKA',
478
- 'BOBA': 'BOBA',
479
- 'BSC': 'BEP20(BSC)',
480
- 'BSV': 'Bitcoin SV(BSV)',
481
- 'BTC': 'Bitcoin(BTC)',
463
+ // 'ATOM': 'Cosmos(ATOM)',
464
+ // 'AVAXC': 'Avalanche C Chain(AVAX CCHAIN)',
465
+ // 'AVAXX': 'Avalanche X Chain(AVAX XCHAIN)',
466
+ // 'AZERO': 'Aleph Zero(AZERO)',
467
+ // 'BCH': 'Bitcoin Cash(BCH)',
468
+ // 'BNCDOT': 'BNCPOLKA',
469
+ // 'BSV': 'Bitcoin SV(BSV)',
470
+ // 'BTC': 'Bitcoin(BTC)',
482
471
  'BTM': 'BTM2',
483
- 'CELO': 'CELO',
484
- 'CFX': 'CFX',
485
- 'CHZ': 'Chiliz Legacy Chain(CHZ)',
486
- 'CHZ2': 'Chiliz Chain(CHZ2)',
487
- 'CKB': 'CKB',
488
- 'CLORE': 'Clore.ai(CLORE)',
472
+ // 'CHZ': 'Chiliz Legacy Chain(CHZ)',
473
+ // 'CHZ2': 'Chiliz Chain(CHZ2)',
474
+ // 'CLORE': 'Clore.ai(CLORE)',
489
475
  'CRC20': 'CRONOS',
490
- 'CSPR': 'CSPR',
491
- 'DASH': 'DASH',
492
- 'DC': 'Dogechain(DC)',
493
- 'DCR': 'DCR',
494
- 'DNX': 'Dynex(DNX)',
495
- 'DOGE': 'Dogecoin(DOGE)',
496
- 'DOT': 'Polkadot(DOT)',
497
- 'DYM': 'Dymension(DYM)',
498
- 'EDG': 'EDG',
499
- 'EGLD': 'EGLD',
500
- 'EOS': 'EOS',
501
- 'ERC20': 'Ethereum(ERC20)',
502
- 'ETC': 'Ethereum Classic(ETC)',
476
+ // 'DC': 'Dogechain(DC)',
477
+ // 'DNX': 'Dynex(DNX)',
478
+ // 'DOGE': 'Dogecoin(DOGE)',
479
+ // 'DOT': 'Polkadot(DOT)',
480
+ // 'DYM': 'Dymension(DYM)',
503
481
  'ETHF': 'ETF',
504
- 'ETHW': 'ETHW',
505
- 'EVER': 'EVER',
506
- 'FET': 'FET',
507
- 'FIL': 'FIL',
508
- 'FIO': 'FIO',
509
- 'FLOW': 'FLOW',
510
- 'FSN': 'FSN',
511
- 'FTM': 'Fantom(FTM)',
512
- 'FUSE': 'FUSE',
513
- 'GLMR': 'GLMR',
514
- 'GRIN': 'GRIN',
515
- 'HBAR': 'Hedera(HBAR)',
516
- 'HIVE': 'HIVE',
517
482
  'HRC20': 'HECO',
518
- 'HYDRA': 'HYDRA',
519
- 'ICP': 'Internet Computer(ICP)',
520
- 'INDEX': 'Index Chain',
521
- 'IOST': 'IOST',
522
- 'IOTA': 'IOTA',
523
- 'IOTX': 'IOTX',
524
- 'IRIS': 'IRIS',
525
- 'KAR': 'KAR',
526
- 'KAS': 'Kaspa(KAS)',
527
- 'KAVA': 'KAVA',
528
- 'KDA': 'KDA',
529
- 'KILT': 'KILT',
530
- 'KLAY': 'Klaytn(KLAY)',
531
- 'KMA': 'KMA',
532
- 'KSM': 'KSM',
533
- 'LAT': 'LAT',
534
- 'LAVA': 'Elysium(LAVA)',
535
- 'LTC': 'Litecoin(LTC)',
536
- 'LUNA': 'Terra(LUNA)',
537
- 'MASS': 'MASS',
538
- 'MATIC': 'Polygon(MATIC)',
539
- 'MCOIN': 'Mcoin Network',
540
- 'METIS': 'METIS',
541
- 'MINA': 'MINA',
542
- 'MNT': 'Mantle(MNT)',
543
- 'MOVR': 'MOVR',
544
- 'MTRG': 'Meter(MTRG)',
545
- 'NAS': 'NAS',
546
- 'NEAR': 'NEAR Protocol(NEAR)',
547
- 'NEBL': 'NEBL',
548
- 'NEM': 'NEM',
549
- 'NEO': 'NEO',
550
- 'NEO3': 'NEO3',
551
- 'NEOXA': 'Neoxa Network',
552
- 'NULS': 'NULS',
483
+ // 'KLAY': 'Klaytn(KLAY)',
553
484
  'OASIS': 'ROSE',
554
- 'OASYS': 'OASYS',
555
485
  'OKC': 'OKT',
556
- 'OMN': 'Omega Network(OMN)',
557
- 'OMNI': 'OMNI',
558
- 'ONE': 'ONE',
559
- 'ONT': 'ONT',
560
- 'OPTIMISM': 'Optimism(OP)',
561
- 'OSMO': 'OSMO',
562
- 'PLCU': 'PLCU',
563
- 'POKT': 'POKT',
564
- 'QKC': 'QKC',
565
- 'QTUM': 'QTUM',
566
- 'RAP20': 'RAP20' + ' ' + '(Rangers Mainnet)',
567
- 'REI': 'REI',
568
486
  'RSK': 'RBTC',
569
- 'RVN': 'Ravencoin(RVN)',
570
- 'SATOX': 'Satoxcoin(SATOX)',
571
- 'SC': 'SC',
572
- 'SCRT': 'SCRT',
573
- 'SDN': 'SDN',
574
- 'SGB': 'SGB',
575
- 'SOL': 'Solana(SOL)',
576
- 'STAR': 'STAR',
577
- 'STARK': 'Starknet(STARK)',
578
- 'STEEM': 'STEEM',
579
- 'SYS': 'SYS',
580
- 'TAO': 'Bittensor(TAO)',
581
- 'TIA': 'Celestia(TIA)',
582
- 'TOMO': 'TOMO',
583
- 'TON': 'Toncoin(TON)',
584
- 'TRC10': 'TRC10',
585
- 'TRC20': 'Tron(TRC20)',
586
- 'UGAS': 'UGAS(Ultrain)',
587
- 'VET': 'VeChain(VET)',
588
- 'VEX': 'Vexanium(VEX)',
589
- 'VSYS': 'VSYS',
590
- 'WAVES': 'WAVES',
591
- 'WAX': 'WAX',
592
- 'WEMIX': 'WEMIX',
593
- 'XCH': 'Chia(XCH)',
594
- 'XDC': 'XDC',
595
- 'XEC': 'XEC',
596
- 'XLM': 'Stellar(XLM)',
597
- 'XMR': 'Monero(XMR)',
598
- 'XNA': 'Neurai(XNA)',
599
- 'XPR': 'XPR Network',
600
- 'XRD': 'XRD',
601
- 'XRP': 'Ripple(XRP)',
602
- 'XTZ': 'XTZ',
603
- 'XVG': 'XVG',
604
- 'XYM': 'XYM',
605
- 'ZEC': 'ZEC',
606
- 'ZEN': 'ZEN',
607
- 'ZIL': 'Zilliqa(ZIL)',
608
- 'ZTG': 'ZTG',
487
+ // 'RVN': 'Ravencoin(RVN)',
488
+ // 'SATOX': 'Satoxcoin(SATOX)',
489
+ // 'SC': 'SC',
490
+ // 'SCRT': 'SCRT',
491
+ // 'SDN': 'SDN',
492
+ // 'SGB': 'SGB',
493
+ // 'SOL': 'Solana(SOL)',
494
+ // 'STAR': 'STAR',
495
+ // 'STARK': 'Starknet(STARK)',
496
+ // 'STEEM': 'STEEM',
497
+ // 'SYS': 'SYS',
498
+ // 'TAO': 'Bittensor(TAO)',
499
+ // 'TIA': 'Celestia(TIA)',
500
+ // 'TOMO': 'TOMO',
501
+ // 'TON': 'Toncoin(TON)',
502
+ // 'TRC10': 'TRC10',
503
+ // 'TRC20': 'Tron(TRC20)',
504
+ // 'UGAS': 'UGAS(Ultrain)',
505
+ // 'VET': 'VeChain(VET)',
506
+ // 'VEX': 'Vexanium(VEX)',
507
+ // 'VSYS': 'VSYS',
508
+ // 'WAVES': 'WAVES',
509
+ // 'WAX': 'WAX',
510
+ // 'WEMIX': 'WEMIX',
511
+ // 'XCH': 'Chia(XCH)',
512
+ // 'XDC': 'XDC',
513
+ // 'XEC': 'XEC',
514
+ // 'XLM': 'Stellar(XLM)',
515
+ // 'XMR': 'Monero(XMR)',
516
+ // 'XNA': 'Neurai(XNA)',
517
+ // 'XPR': 'XPR Network',
518
+ // 'XRD': 'XRD',
519
+ // 'XRP': 'Ripple(XRP)',
520
+ // 'XTZ': 'XTZ',
521
+ // 'XVG': 'XVG',
522
+ // 'XYM': 'XYM',
523
+ // 'ZEC': 'ZEC',
524
+ // 'ZEN': 'ZEN',
525
+ // 'ZIL': 'Zilliqa(ZIL)',
526
+ // 'ZTG': 'ZTG',
609
527
  // todo: uncomment below after concensus
610
528
  // 'ALAYA': 'ATP',
611
529
  // 'ANDUSCHAIN': 'DEB',
@@ -1008,7 +926,7 @@ class mexc extends mexc$1 {
1008
926
  const chains = this.safeValue(currency, 'networkList', []);
1009
927
  for (let j = 0; j < chains.length; j++) {
1010
928
  const chain = chains[j];
1011
- const networkId = this.safeString2(chain, 'network', 'netWork');
929
+ const networkId = this.safeString2(chain, 'netWork', 'network');
1012
930
  const network = this.networkIdToCode(networkId);
1013
931
  const isDepositEnabled = this.safeBool(chain, 'depositEnable', false);
1014
932
  const isWithdrawEnabled = this.safeBool(chain, 'withdrawEnable', false);
@@ -4390,7 +4308,7 @@ class mexc extends mexc$1 {
4390
4308
  //
4391
4309
  const address = this.safeString(depositAddress, 'address');
4392
4310
  const currencyId = this.safeString(depositAddress, 'coin');
4393
- const networkId = this.safeString(depositAddress, 'network');
4311
+ const networkId = this.safeString(depositAddress, 'netWork');
4394
4312
  this.checkAddress(address);
4395
4313
  return {
4396
4314
  'currency': this.safeCurrencyCode(currencyId, currency),
@@ -5171,14 +5089,14 @@ class mexc extends mexc$1 {
5171
5089
  * @param {object} [params] extra parameters specific to the exchange API endpoint
5172
5090
  * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
5173
5091
  */
5092
+ await this.loadMarkets();
5093
+ const currency = this.currency(code);
5174
5094
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
5175
5095
  const networks = this.safeDict(this.options, 'networks', {});
5176
5096
  let network = this.safeString2(params, 'network', 'netWork'); // this line allows the user to specify either ERC20 or ETH
5177
5097
  network = this.safeString(networks, network, network); // handle ETH > ERC-20 alias
5178
- network = this.networkIdToCode(network);
5098
+ network = this.networkCodeToId(network, currency['code']);
5179
5099
  this.checkAddress(address);
5180
- await this.loadMarkets();
5181
- const currency = this.currency(code);
5182
5100
  const request = {
5183
5101
  'coin': currency['id'],
5184
5102
  'address': address,
@@ -324,6 +324,7 @@ class okx extends okx$1 {
324
324
  'account/account-position-risk': 2,
325
325
  'account/bills': 5 / 3,
326
326
  'account/bills-archive': 5 / 3,
327
+ 'account/bills-history-archive': 2,
327
328
  'account/config': 4,
328
329
  'account/max-size': 1,
329
330
  'account/max-avail-size': 1,
@@ -478,6 +479,7 @@ class okx extends okx$1 {
478
479
  'account/fixed-loan/amend-borrowing-order': 5,
479
480
  'account/fixed-loan/manual-reborrow': 5,
480
481
  'account/fixed-loan/repay-borrowing-order': 5,
482
+ 'account/bills-history-archive': 72000,
481
483
  // subaccount
482
484
  'users/subaccount/modify-apikey': 10,
483
485
  'asset/subaccount/transfer': 10,
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers } from './src/base/types.js';
6
6
  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';
7
- declare const version = "4.3.92";
7
+ declare const version = "4.3.94";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
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.3.93';
41
+ const version = '4.3.95';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -126,6 +126,7 @@ interface Exchange {
126
126
  privateGetAccountAccountPositionRisk(params?: {}): Promise<implicitReturnType>;
127
127
  privateGetAccountBills(params?: {}): Promise<implicitReturnType>;
128
128
  privateGetAccountBillsArchive(params?: {}): Promise<implicitReturnType>;
129
+ privateGetAccountBillsHistoryArchive(params?: {}): Promise<implicitReturnType>;
129
130
  privateGetAccountConfig(params?: {}): Promise<implicitReturnType>;
130
131
  privateGetAccountMaxSize(params?: {}): Promise<implicitReturnType>;
131
132
  privateGetAccountMaxAvailSize(params?: {}): Promise<implicitReturnType>;
@@ -266,6 +267,7 @@ interface Exchange {
266
267
  privatePostAccountFixedLoanAmendBorrowingOrder(params?: {}): Promise<implicitReturnType>;
267
268
  privatePostAccountFixedLoanManualReborrow(params?: {}): Promise<implicitReturnType>;
268
269
  privatePostAccountFixedLoanRepayBorrowingOrder(params?: {}): Promise<implicitReturnType>;
270
+ privatePostAccountBillsHistoryArchive(params?: {}): Promise<implicitReturnType>;
269
271
  privatePostUsersSubaccountModifyApikey(params?: {}): Promise<implicitReturnType>;
270
272
  privatePostAssetSubaccountTransfer(params?: {}): Promise<implicitReturnType>;
271
273
  privatePostUsersSubaccountSetTransferOut(params?: {}): Promise<implicitReturnType>;
@@ -388,7 +388,7 @@ export default class ascendex extends Exchange {
388
388
  * @param {object} [params] extra parameters specific to the exchange API endpoint
389
389
  * @returns {object} an associative dictionary of currencies
390
390
  */
391
- const assets = await this.v1PublicGetAssets(params);
391
+ const assetsPromise = this.v1PublicGetAssets(params);
392
392
  //
393
393
  // {
394
394
  // "code":0,
@@ -405,7 +405,7 @@ export default class ascendex extends Exchange {
405
405
  // ]
406
406
  // }
407
407
  //
408
- const margin = await this.v1PublicGetMarginAssets(params);
408
+ const marginPromise = this.v1PublicGetMarginAssets(params);
409
409
  //
410
410
  // {
411
411
  // "code":0,
@@ -425,7 +425,7 @@ export default class ascendex extends Exchange {
425
425
  // ]
426
426
  // }
427
427
  //
428
- const cash = await this.v1PublicGetCashAssets(params);
428
+ const cashPromise = this.v1PublicGetCashAssets(params);
429
429
  //
430
430
  // {
431
431
  // "code":0,
@@ -442,6 +442,7 @@ export default class ascendex extends Exchange {
442
442
  // ]
443
443
  // }
444
444
  //
445
+ const [assets, margin, cash] = await Promise.all([assetsPromise, marginPromise, cashPromise]);
445
446
  const assetsData = this.safeList(assets, 'data', []);
446
447
  const marginData = this.safeList(margin, 'data', []);
447
448
  const cashData = this.safeList(cash, 'data', []);
@@ -496,7 +497,7 @@ export default class ascendex extends Exchange {
496
497
  * @param {object} [params] extra parameters specific to the exchange API endpoint
497
498
  * @returns {object[]} an array of objects representing market data
498
499
  */
499
- const products = await this.v1PublicGetProducts(params);
500
+ const productsPromise = this.v1PublicGetProducts(params);
500
501
  //
501
502
  // {
502
503
  // "code": 0,
@@ -517,7 +518,7 @@ export default class ascendex extends Exchange {
517
518
  // ]
518
519
  // }
519
520
  //
520
- const cash = await this.v1PublicGetCashProducts(params);
521
+ const cashPromise = this.v1PublicGetCashProducts(params);
521
522
  //
522
523
  // {
523
524
  // "code": 0,
@@ -547,7 +548,7 @@ export default class ascendex extends Exchange {
547
548
  // ]
548
549
  // }
549
550
  //
550
- const perpetuals = await this.v2PublicGetFuturesContract(params);
551
+ const perpetualsPromise = this.v2PublicGetFuturesContract(params);
551
552
  //
552
553
  // {
553
554
  // "code": 0,
@@ -585,6 +586,7 @@ export default class ascendex extends Exchange {
585
586
  // ]
586
587
  // }
587
588
  //
589
+ const [products, cash, perpetuals] = await Promise.all([productsPromise, cashPromise, perpetualsPromise]);
588
590
  const productsData = this.safeList(products, 'data', []);
589
591
  const productsById = this.indexBy(productsData, 'symbol');
590
592
  const cashData = this.safeList(cash, 'data', []);
@@ -880,7 +880,7 @@ export default class Exchange {
880
880
  selectNetworkKeyFromNetworks(currencyCode: any, networkCode: any, indexedNetworkEntries: any, isIndexedByUnifiedNetworkCode?: boolean): any;
881
881
  safeNumber2(dictionary: object, key1: IndexType, key2: IndexType, d?: any): number;
882
882
  parseOrderBook(orderbook: object, symbol: string, timestamp?: Int, bidsKey?: string, asksKey?: string, priceKey?: IndexType, amountKey?: IndexType, countOrIdKey?: IndexType): OrderBook;
883
- parseOHLCVs(ohlcvs: object[], market?: any, timeframe?: string, since?: Int, limit?: Int): OHLCV[];
883
+ parseOHLCVs(ohlcvs: object[], market?: any, timeframe?: string, since?: Int, limit?: Int, tail?: Bool): OHLCV[];
884
884
  parseLeverageTiers(response: any, symbols?: string[], marketIdKey?: any): LeverageTiers;
885
885
  loadTradingLimits(symbols?: Strings, reload?: boolean, params?: {}): Promise<Dictionary<any>>;
886
886
  safePosition(position: Dict): Position;
@@ -3453,7 +3453,7 @@ export default class Exchange {
3453
3453
  if (currencyCode === undefined) {
3454
3454
  const currencies = Object.values(this.currencies);
3455
3455
  for (let i = 0; i < currencies.length; i++) {
3456
- const currency = [i];
3456
+ const currency = currencies[i];
3457
3457
  const networks = this.safeDict(currency, 'networks');
3458
3458
  const network = this.safeDict(networks, networkCode);
3459
3459
  networkId = this.safeString(network, 'id');
@@ -3598,13 +3598,13 @@ export default class Exchange {
3598
3598
  'nonce': undefined,
3599
3599
  };
3600
3600
  }
3601
- parseOHLCVs(ohlcvs, market = undefined, timeframe = '1m', since = undefined, limit = undefined) {
3601
+ parseOHLCVs(ohlcvs, market = undefined, timeframe = '1m', since = undefined, limit = undefined, tail = false) {
3602
3602
  const results = [];
3603
3603
  for (let i = 0; i < ohlcvs.length; i++) {
3604
3604
  results.push(this.parseOHLCV(ohlcvs[i], market));
3605
3605
  }
3606
3606
  const sorted = this.sortBy(results, 0);
3607
- return this.filterBySinceLimit(sorted, since, limit, 0);
3607
+ return this.filterBySinceLimit(sorted, since, limit, 0, tail);
3608
3608
  }
3609
3609
  parseLeverageTiers(response, symbols = undefined, marketIdKey = undefined) {
3610
3610
  // marketIdKey should only be undefined when response is a dictionary
package/js/src/bingx.js CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  // ---------------------------------------------------------------------------
8
8
  import Exchange from './abstract/bingx.js';
9
- import { AuthenticationError, PermissionDenied, AccountSuspended, ExchangeError, InsufficientFunds, BadRequest, OrderNotFound, DDoSProtection, BadSymbol, ArgumentsRequired, NotSupported, OperationFailed } from './base/errors.js';
9
+ import { AuthenticationError, PermissionDenied, AccountSuspended, ExchangeError, InsufficientFunds, BadRequest, OrderNotFound, DDoSProtection, BadSymbol, ArgumentsRequired, NotSupported, OperationFailed, InvalidOrder } from './base/errors.js';
10
10
  import { Precise } from './base/Precise.js';
11
11
  import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
12
12
  import { TICK_SIZE } from './base/functions/number.js';
@@ -460,7 +460,8 @@ export default class bingx extends Exchange {
460
460
  '100414': AccountSuspended,
461
461
  '100419': PermissionDenied,
462
462
  '100437': BadRequest,
463
- '101204': InsufficientFunds, // {"code":101204,"msg":"","data":{}}
463
+ '101204': InsufficientFunds,
464
+ '110425': InvalidOrder, // {"code":110425,"msg":"Please ensure that the minimum nominal value of the order placed must be greater than 2u","data":{}}
464
465
  },
465
466
  'broad': {},
466
467
  },
@@ -2559,6 +2560,7 @@ export default class bingx extends Exchange {
2559
2560
  let positionSide = undefined;
2560
2561
  const hedged = this.safeBool(params, 'hedged', false);
2561
2562
  if (hedged) {
2563
+ params = this.omit(params, 'reduceOnly');
2562
2564
  if (reduceOnly) {
2563
2565
  positionSide = (side === 'buy') ? 'SHORT' : 'LONG';
2564
2566
  }
@@ -2572,7 +2574,7 @@ export default class bingx extends Exchange {
2572
2574
  request['positionSide'] = positionSide;
2573
2575
  request['quantity'] = (market['inverse']) ? amount : this.parseToNumeric(this.amountToPrecision(symbol, amount)); // precision not available for inverse contracts
2574
2576
  }
2575
- params = this.omit(params, ['hedged', 'reduceOnly', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingPercent', 'trailingType', 'takeProfit', 'stopLoss', 'clientOrderId']);
2577
+ params = this.omit(params, ['hedged', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingPercent', 'trailingType', 'takeProfit', 'stopLoss', 'clientOrderId']);
2576
2578
  return this.extend(request, params);
2577
2579
  }
2578
2580
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
@@ -566,11 +566,11 @@ export default class bitfinex extends Exchange {
566
566
  * @param {object} [params] extra parameters specific to the exchange API endpoint
567
567
  * @returns {object[]} an array of objects representing market data
568
568
  */
569
- const ids = await this.publicGetSymbols();
569
+ const idsPromise = this.publicGetSymbols();
570
570
  //
571
571
  // [ "btcusd", "ltcusd", "ltcbtc" ]
572
572
  //
573
- const details = await this.publicGetSymbolsDetails();
573
+ const detailsPromise = this.publicGetSymbolsDetails();
574
574
  //
575
575
  // [
576
576
  // {
@@ -585,6 +585,7 @@ export default class bitfinex extends Exchange {
585
585
  // },
586
586
  // ]
587
587
  //
588
+ const [ids, details] = await Promise.all([idsPromise, detailsPromise]);
588
589
  const result = [];
589
590
  for (let i = 0; i < details.length; i++) {
590
591
  const market = details[i];
@@ -523,12 +523,13 @@ export default class bitfinex2 extends Exchange {
523
523
  * @param {object} [params] extra parameters specific to the exchange API endpoint
524
524
  * @returns {object[]} an array of objects representing market data
525
525
  */
526
- let spotMarketsInfo = await this.publicGetConfPubInfoPair(params);
527
- let futuresMarketsInfo = await this.publicGetConfPubInfoPairFutures(params);
528
- spotMarketsInfo = this.safeValue(spotMarketsInfo, 0, []);
529
- futuresMarketsInfo = this.safeValue(futuresMarketsInfo, 0, []);
526
+ const spotMarketsInfoPromise = this.publicGetConfPubInfoPair(params);
527
+ const futuresMarketsInfoPromise = this.publicGetConfPubInfoPairFutures(params);
528
+ const marginIdsPromise = this.publicGetConfPubListPairMargin(params);
529
+ let [spotMarketsInfo, futuresMarketsInfo, marginIds] = await Promise.all([spotMarketsInfoPromise, futuresMarketsInfoPromise, marginIdsPromise]);
530
+ spotMarketsInfo = this.safeList(spotMarketsInfo, 0, []);
531
+ futuresMarketsInfo = this.safeList(futuresMarketsInfo, 0, []);
530
532
  const markets = this.arrayConcat(spotMarketsInfo, futuresMarketsInfo);
531
- let marginIds = await this.publicGetConfPubListPairMargin(params);
532
533
  marginIds = this.safeValue(marginIds, 0, []);
533
534
  //
534
535
  // [
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/btcturk.js';
2
- import type { Balances, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, int } from './base/types.js';
2
+ import type { Balances, Bool, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, int } from './base/types.js';
3
3
  /**
4
4
  * @class btcturk
5
5
  * @augments Exchange
@@ -18,7 +18,7 @@ export default class btcturk extends Exchange {
18
18
  fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
19
19
  parseOHLCV(ohlcv: any, market?: Market): OHLCV;
20
20
  fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
21
- parseOHLCVs(ohlcvs: any, market?: any, timeframe?: string, since?: Int, limit?: Int): OHLCV[];
21
+ parseOHLCVs(ohlcvs: any, market?: any, timeframe?: string, since?: Int, limit?: Int, tail?: Bool): OHLCV[];
22
22
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
23
23
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
24
24
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
package/js/src/btcturk.js CHANGED
@@ -643,7 +643,7 @@ export default class btcturk extends Exchange {
643
643
  //
644
644
  return this.parseOHLCVs(response, market, timeframe, since, limit);
645
645
  }
646
- parseOHLCVs(ohlcvs, market = undefined, timeframe = '1m', since = undefined, limit = undefined) {
646
+ parseOHLCVs(ohlcvs, market = undefined, timeframe = '1m', since = undefined, limit = undefined, tail = false) {
647
647
  const results = [];
648
648
  const timestamp = this.safeValue(ohlcvs, 't');
649
649
  const high = this.safeValue(ohlcvs, 'h');
@@ -663,7 +663,7 @@ export default class btcturk extends Exchange {
663
663
  results.push(this.parseOHLCV(ohlcv, market));
664
664
  }
665
665
  const sorted = this.sortBy(results, 0);
666
- return this.filterBySinceLimit(sorted, since, limit, 0);
666
+ return this.filterBySinceLimit(sorted, since, limit, 0, tail);
667
667
  }
668
668
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
669
669
  /**
package/js/src/gate.js CHANGED
@@ -984,8 +984,9 @@ export default class gate extends Exchange {
984
984
  return this.arrayConcat(markets, optionMarkets);
985
985
  }
986
986
  async fetchSpotMarkets(params = {}) {
987
- const marginResponse = await this.publicMarginGetCurrencyPairs(params);
988
- const spotMarketsResponse = await this.publicSpotGetCurrencyPairs(params);
987
+ const marginPromise = this.publicMarginGetCurrencyPairs(params);
988
+ const spotMarketsPromise = this.publicSpotGetCurrencyPairs(params);
989
+ const [marginResponse, spotMarketsResponse] = await Promise.all([marginPromise, spotMarketsPromise]);
989
990
  const marginMarkets = this.indexBy(marginResponse, 'id');
990
991
  //
991
992
  // Spot
package/js/src/gemini.js CHANGED
@@ -845,8 +845,9 @@ export default class gemini extends Exchange {
845
845
  return this.parseTicker(response, market);
846
846
  }
847
847
  async fetchTickerV1AndV2(symbol, params = {}) {
848
- const tickerA = await this.fetchTickerV1(symbol, params);
849
- const tickerB = await this.fetchTickerV2(symbol, params);
848
+ const tickerPromiseA = this.fetchTickerV1(symbol, params);
849
+ const tickerPromiseB = this.fetchTickerV2(symbol, params);
850
+ const [tickerA, tickerB] = await Promise.all([tickerPromiseA, tickerPromiseB]);
850
851
  return this.deepExtend(tickerA, {
851
852
  'open': tickerB['open'],
852
853
  'high': tickerB['high'],
@@ -65,6 +65,9 @@ export default class hyperliquid extends Exchange {
65
65
  fetchFundingRateHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
66
66
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
67
67
  fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
68
+ fetchCanceledOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
69
+ fetchCanceledAndClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
70
+ fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
68
71
  fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
69
72
  parseOrder(order: Dict, market?: Market): Order;
70
73
  parseOrderStatus(status: Str): string;