ccxt 4.4.69 → 4.4.71

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.
Files changed (80) hide show
  1. package/README.md +5 -8
  2. package/dist/ccxt.browser.min.js +7 -7
  3. package/dist/cjs/ccxt.js +1 -6
  4. package/dist/cjs/src/abstract/poloniexfutures.js +1 -1
  5. package/dist/cjs/src/base/Exchange.js +22 -1
  6. package/dist/cjs/src/binance.js +107 -102
  7. package/dist/cjs/src/bingx.js +64 -42
  8. package/dist/cjs/src/bitget.js +50 -340
  9. package/dist/cjs/src/bitmart.js +15 -1
  10. package/dist/cjs/src/bitopro.js +1 -0
  11. package/dist/cjs/src/bitrue.js +1 -0
  12. package/dist/cjs/src/bybit.js +7 -0
  13. package/dist/cjs/src/cex.js +1 -0
  14. package/dist/cjs/src/coinbase.js +24 -4
  15. package/dist/cjs/src/coinbaseexchange.js +1 -0
  16. package/dist/cjs/src/deribit.js +1 -0
  17. package/dist/cjs/src/hashkey.js +4 -2
  18. package/dist/cjs/src/hyperliquid.js +18 -7
  19. package/dist/cjs/src/kraken.js +83 -6
  20. package/dist/cjs/src/kucoin.js +4 -2
  21. package/dist/cjs/src/mexc.js +8 -4
  22. package/dist/cjs/src/okx.js +62 -46
  23. package/dist/cjs/src/poloniex.js +1311 -81
  24. package/dist/cjs/src/poloniexfutures.js +1 -1
  25. package/dist/cjs/src/pro/binance.js +94 -94
  26. package/dist/cjs/src/pro/bingx.js +63 -52
  27. package/dist/cjs/src/pro/bitget.js +40 -7
  28. package/dist/cjs/src/pro/bybit.js +86 -38
  29. package/dist/cjs/src/pro/poloniexfutures.js +1 -1
  30. package/dist/cjs/src/tradeogre.js +22 -4
  31. package/dist/cjs/src/whitebit.js +4 -2
  32. package/js/ccxt.d.ts +3 -9
  33. package/js/ccxt.js +2 -6
  34. package/js/src/abstract/bingx.d.ts +1 -0
  35. package/js/src/abstract/bitmart.d.ts +1 -0
  36. package/js/src/abstract/bybit.d.ts +4 -0
  37. package/js/src/abstract/myokx.d.ts +3 -0
  38. package/js/src/abstract/okx.d.ts +3 -0
  39. package/js/src/abstract/poloniex.d.ts +36 -0
  40. package/js/src/abstract/poloniexfutures.js +6 -0
  41. package/js/src/abstract/tradeogre.d.ts +1 -1
  42. package/js/src/base/Exchange.d.ts +11 -2
  43. package/js/src/base/Exchange.js +22 -1
  44. package/js/src/base/types.d.ts +33 -2
  45. package/js/src/binance.d.ts +98 -97
  46. package/js/src/binance.js +107 -102
  47. package/js/src/bingx.js +64 -42
  48. package/js/src/bitget.d.ts +0 -1
  49. package/js/src/bitget.js +50 -340
  50. package/js/src/bitmart.d.ts +1 -0
  51. package/js/src/bitmart.js +15 -1
  52. package/js/src/bitopro.js +1 -0
  53. package/js/src/bitrue.js +1 -0
  54. package/js/src/bybit.js +7 -0
  55. package/js/src/cex.js +1 -0
  56. package/js/src/coinbase.js +24 -4
  57. package/js/src/coinbaseexchange.js +1 -0
  58. package/js/src/deribit.js +1 -0
  59. package/js/src/hashkey.js +4 -2
  60. package/js/src/hyperliquid.js +18 -7
  61. package/js/src/kraken.d.ts +1 -0
  62. package/js/src/kraken.js +83 -6
  63. package/js/src/kucoin.js +4 -2
  64. package/js/src/mexc.js +8 -4
  65. package/js/src/okx.d.ts +1 -0
  66. package/js/src/okx.js +62 -46
  67. package/js/src/poloniex.d.ts +109 -1
  68. package/js/src/poloniex.js +1311 -81
  69. package/js/src/poloniexfutures.js +6 -0
  70. package/js/src/pro/binance.d.ts +94 -94
  71. package/js/src/pro/binance.js +94 -94
  72. package/js/src/pro/bingx.js +63 -52
  73. package/js/src/pro/bitget.js +40 -7
  74. package/js/src/pro/bybit.d.ts +1 -0
  75. package/js/src/pro/bybit.js +86 -38
  76. package/js/src/pro/poloniexfutures.js +6 -0
  77. package/js/src/tradeogre.d.ts +1 -0
  78. package/js/src/tradeogre.js +22 -4
  79. package/js/src/whitebit.js +4 -2
  80. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import * as functions from './functions.js';
2
2
  import WsClient from './ws/WsClient.js';
3
3
  import { OrderBook as WsOrderBook, IndexedOrderBook, CountedOrderBook } from './ws/OrderBook.js';
4
- import type { Market, Trade, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRate, DepositWithdrawFeeNetwork, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion, CancellationRequest, IsolatedBorrowRate, IsolatedBorrowRates, CrossBorrowRates, CrossBorrowRate, Dict, FundingRates, LeverageTiers, Bool, int, DepositAddress, LongShortRatio, OrderBooks, OpenInterests } from './types.js';
4
+ import type { Market, Trade, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRate, DepositWithdrawFeeNetwork, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion, CancellationRequest, IsolatedBorrowRate, IsolatedBorrowRates, CrossBorrowRates, CrossBorrowRate, Dict, FundingRates, LeverageTiers, Bool, int, DepositAddress, LongShortRatio, OrderBooks, OpenInterests, ConstructorArgs } from './types.js';
5
5
  export type { Market, Trade, Fee, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, Bool, OrderType, OrderSide, Position, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, CrossBorrowRate, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings, Conversion, DepositAddress, LongShortRatio } from './types.js';
6
6
  import { ArrayCache, ArrayCacheByTimestamp } from './ws/Cache.js';
7
7
  import { OrderBook as Ob } from './ws/OrderBook.js';
@@ -310,7 +310,7 @@ export default class Exchange {
310
310
  crc32: typeof functions.crc32;
311
311
  packb: typeof functions.packb;
312
312
  urlencodeBase64: (payload: string | Uint8Array) => string;
313
- constructor(userConfig?: {});
313
+ constructor(userConfig?: ConstructorArgs);
314
314
  encodeURIComponent(...args: any[]): string;
315
315
  checkRequiredVersion(requiredVersion: any, error?: boolean): boolean;
316
316
  throttle(cost?: any): any;
@@ -609,6 +609,15 @@ export default class Exchange {
609
609
  handleParamInteger2(params: object, paramName1: string, paramName2: string, defaultValue?: Int): [Int, object];
610
610
  handleParamBool(params: object, paramName: string, defaultValue?: Bool): [Bool, object];
611
611
  handleParamBool2(params: object, paramName1: string, paramName2: string, defaultValue?: Bool): [Bool, object];
612
+ /**
613
+ * @param {object} params - extra parameters
614
+ * @param {object} request - existing dictionary of request
615
+ * @param {string} exchangeSpecificKey - the key for chain id to be set in request
616
+ * @param {object} currencyCode - (optional) existing dictionary of request
617
+ * @param {boolean} isRequired - (optional) whether that param is required to be present
618
+ * @returns {object[]} - returns [request, params] where request is the modified request object and params is the modified params object
619
+ */
620
+ handleRequestNetwork(params: Dict, request: Dict, exchangeSpecificKey: string, currencyCode?: Str, isRequired?: boolean): Dict[];
612
621
  resolvePath(path: any, params: any): any[];
613
622
  getListFromObjectValues(objects: any, key: IndexType): any[];
614
623
  getSymbolsForMarketType(marketType?: Str, subType?: Str, symbolWithActiveStatus?: boolean, symbolWithUnknownStatus?: boolean): any[];
@@ -338,6 +338,9 @@ export default class Exchange {
338
338
  }
339
339
  this.newUpdates = (this.options.newUpdates !== undefined) ? this.options.newUpdates : true;
340
340
  this.afterConstruct();
341
+ if (this.safeBool(userConfig, 'sandbox') || this.safeBool(userConfig, 'testnet')) {
342
+ this.setSandboxMode(true);
343
+ }
341
344
  }
342
345
  encodeURIComponent(...args) {
343
346
  // @ts-expect-error
@@ -1568,7 +1571,6 @@ export default class Exchange {
1568
1571
  },
1569
1572
  'commonCurrencies': {
1570
1573
  'XBT': 'BTC',
1571
- 'BCC': 'BCH',
1572
1574
  'BCHSV': 'BSV',
1573
1575
  },
1574
1576
  'precisionMode': TICK_SIZE,
@@ -4129,6 +4131,25 @@ export default class Exchange {
4129
4131
  }
4130
4132
  return [value, params];
4131
4133
  }
4134
+ /**
4135
+ * @param {object} params - extra parameters
4136
+ * @param {object} request - existing dictionary of request
4137
+ * @param {string} exchangeSpecificKey - the key for chain id to be set in request
4138
+ * @param {object} currencyCode - (optional) existing dictionary of request
4139
+ * @param {boolean} isRequired - (optional) whether that param is required to be present
4140
+ * @returns {object[]} - returns [request, params] where request is the modified request object and params is the modified params object
4141
+ */
4142
+ handleRequestNetwork(params, request, exchangeSpecificKey, currencyCode = undefined, isRequired = false) {
4143
+ let networkCode = undefined;
4144
+ [networkCode, params] = this.handleNetworkCodeAndParams(params);
4145
+ if (networkCode !== undefined) {
4146
+ request[exchangeSpecificKey] = this.networkCodeToId(networkCode, currencyCode);
4147
+ }
4148
+ else if (isRequired) {
4149
+ throw new ArgumentsRequired(this.id + ' - "network" param is required for this request');
4150
+ }
4151
+ return [request, params];
4152
+ }
4132
4153
  resolvePath(path, params) {
4133
4154
  return [
4134
4155
  this.implodeParams(path, params),
@@ -542,9 +542,9 @@ export interface MarginModes extends Dictionary<MarginMode> {
542
542
  }
543
543
  export interface OptionChain extends Dictionary<Option> {
544
544
  }
545
- export interface IsolatedBorrowRates extends Dictionary<IsolatedBorrowRates> {
545
+ export interface IsolatedBorrowRates extends Dictionary<IsolatedBorrowRate> {
546
546
  }
547
- export interface CrossBorrowRates extends Dictionary<CrossBorrowRates> {
547
+ export interface CrossBorrowRates extends Dictionary<CrossBorrowRate> {
548
548
  }
549
549
  export interface LeverageTiers extends Dictionary<LeverageTier[]> {
550
550
  }
@@ -555,3 +555,34 @@ export declare type OHLCVC = [Num, Num, Num, Num, Num, Num, Num];
555
555
  export declare type implicitReturnType = any;
556
556
  export declare type Market = MarketInterface | undefined;
557
557
  export declare type Currency = CurrencyInterface | undefined;
558
+ interface BaseConstructorArgs {
559
+ apiKey?: string;
560
+ secret?: string;
561
+ password?: string;
562
+ privateKey?: string;
563
+ walletAddress?: string;
564
+ uid?: string;
565
+ verbose?: boolean;
566
+ sandbox?: boolean;
567
+ testnet?: boolean;
568
+ options?: Dict;
569
+ enableRateLimit?: boolean;
570
+ httpsProxy?: string;
571
+ socksProxy?: string;
572
+ wssProxy?: string;
573
+ proxy?: string;
574
+ rateLimit?: number;
575
+ commonCurrencies?: Dict;
576
+ userAgent?: string;
577
+ userAgents?: Dict;
578
+ timeout?: number;
579
+ markets?: Dict;
580
+ currencies?: Dict;
581
+ hostname?: string;
582
+ urls?: Dict;
583
+ headers?: Dict;
584
+ }
585
+ export declare type ConstructorArgs = Partial<BaseConstructorArgs> & {
586
+ [key: string]: any;
587
+ };
588
+ export {};