ccxt 4.4.82 → 4.4.85

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 (103) hide show
  1. package/README.md +5 -7
  2. package/dist/ccxt.browser.min.js +7 -7
  3. package/dist/cjs/ccxt.js +1 -9
  4. package/dist/cjs/src/apex.js +2 -1
  5. package/dist/cjs/src/base/Exchange.js +15 -2
  6. package/dist/cjs/src/bitget.js +1 -3
  7. package/dist/cjs/src/bitrue.js +14 -35
  8. package/dist/cjs/src/bitso.js +33 -0
  9. package/dist/cjs/src/bitstamp.js +33 -0
  10. package/dist/cjs/src/blofin.js +154 -13
  11. package/dist/cjs/src/btcbox.js +25 -5
  12. package/dist/cjs/src/bybit.js +16 -40
  13. package/dist/cjs/src/cex.js +2 -4
  14. package/dist/cjs/src/coinbase.js +56 -40
  15. package/dist/cjs/src/coinbaseexchange.js +142 -32
  16. package/dist/cjs/src/coincatch.js +14 -67
  17. package/dist/cjs/src/coinex.js +29 -32
  18. package/dist/cjs/src/coinlist.js +16 -15
  19. package/dist/cjs/src/coinmetro.js +22 -11
  20. package/dist/cjs/src/coinone.js +8 -10
  21. package/dist/cjs/src/coinsph.js +126 -1
  22. package/dist/cjs/src/cryptocom.js +111 -1
  23. package/dist/cjs/src/cryptomus.js +43 -89
  24. package/dist/cjs/src/delta.js +76 -36
  25. package/dist/cjs/src/derive.js +46 -10
  26. package/dist/cjs/src/ellipx.js +175 -79
  27. package/dist/cjs/src/gate.js +1 -1
  28. package/dist/cjs/src/gemini.js +3 -5
  29. package/dist/cjs/src/hitbtc.js +56 -69
  30. package/dist/cjs/src/hyperliquid.js +2 -2
  31. package/dist/cjs/src/kraken.js +29 -24
  32. package/dist/cjs/src/kucoinfutures.js +6 -0
  33. package/dist/cjs/src/lbank.js +1 -1
  34. package/dist/cjs/src/paradex.js +119 -3
  35. package/dist/cjs/src/pro/binance.js +31 -33
  36. package/dist/cjs/src/pro/bithumb.js +5 -3
  37. package/dist/cjs/src/pro/kraken.js +289 -79
  38. package/dist/cjs/src/pro/mexc.js +302 -8
  39. package/dist/cjs/src/pro/poloniex.js +6 -2
  40. package/examples/js/cli.js +127 -13
  41. package/js/ccxt.d.ts +2 -11
  42. package/js/ccxt.js +2 -8
  43. package/js/src/abstract/blofin.d.ts +8 -0
  44. package/js/src/abstract/btcbox.d.ts +1 -0
  45. package/js/src/apex.js +2 -1
  46. package/js/src/base/Exchange.d.ts +15 -1
  47. package/js/src/base/Exchange.js +15 -2
  48. package/js/src/base/types.d.ts +3 -0
  49. package/js/src/bitget.js +1 -3
  50. package/js/src/bitrue.js +14 -35
  51. package/js/src/bitso.js +33 -0
  52. package/js/src/bitstamp.js +33 -0
  53. package/js/src/blofin.d.ts +42 -2
  54. package/js/src/blofin.js +154 -13
  55. package/js/src/btcbox.js +25 -5
  56. package/js/src/bybit.js +16 -40
  57. package/js/src/cex.js +2 -4
  58. package/js/src/coinbase.js +56 -40
  59. package/js/src/coinbaseexchange.js +142 -32
  60. package/js/src/coincatch.js +14 -67
  61. package/js/src/coinex.js +28 -29
  62. package/js/src/coinlist.js +16 -15
  63. package/js/src/coinmetro.js +22 -11
  64. package/js/src/coinone.js +8 -10
  65. package/js/src/coinsph.d.ts +10 -1
  66. package/js/src/coinsph.js +126 -1
  67. package/js/src/cryptocom.d.ts +10 -1
  68. package/js/src/cryptocom.js +111 -1
  69. package/js/src/cryptomus.js +43 -89
  70. package/js/src/delta.js +76 -36
  71. package/js/src/derive.js +46 -10
  72. package/js/src/ellipx.d.ts +2 -3
  73. package/js/src/ellipx.js +175 -80
  74. package/js/src/gate.js +1 -1
  75. package/js/src/gemini.js +3 -5
  76. package/js/src/hitbtc.js +56 -69
  77. package/js/src/hyperliquid.js +2 -2
  78. package/js/src/kraken.js +29 -24
  79. package/js/src/kucoinfutures.d.ts +1 -0
  80. package/js/src/kucoinfutures.js +6 -0
  81. package/js/src/lbank.js +1 -1
  82. package/js/src/paradex.d.ts +12 -1
  83. package/js/src/paradex.js +119 -3
  84. package/js/src/pro/binance.d.ts +26 -26
  85. package/js/src/pro/binance.js +31 -33
  86. package/js/src/pro/bithumb.js +5 -3
  87. package/js/src/pro/kraken.d.ts +7 -6
  88. package/js/src/pro/kraken.js +290 -80
  89. package/js/src/pro/mexc.d.ts +58 -0
  90. package/js/src/pro/mexc.js +302 -8
  91. package/js/src/pro/poloniex.d.ts +1 -1
  92. package/js/src/pro/poloniex.js +6 -2
  93. package/package.json +1 -1
  94. package/js/src/abstract/bl3p.d.ts +0 -22
  95. package/js/src/abstract/bl3p.js +0 -11
  96. package/js/src/abstract/idex.d.ts +0 -29
  97. package/js/src/abstract/idex.js +0 -11
  98. package/js/src/bl3p.d.ts +0 -116
  99. package/js/src/bl3p.js +0 -552
  100. package/js/src/idex.d.ts +0 -312
  101. package/js/src/idex.js +0 -1961
  102. package/js/src/pro/idex.d.ts +0 -81
  103. package/js/src/pro/idex.js +0 -720
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.81';
41
+ const version = '4.4.84';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import alpaca from './src/alpaca.js';
@@ -66,7 +66,6 @@ import bitso from './src/bitso.js';
66
66
  import bitstamp from './src/bitstamp.js';
67
67
  import bitteam from './src/bitteam.js';
68
68
  import bitvavo from './src/bitvavo.js';
69
- import bl3p from './src/bl3p.js';
70
69
  import blockchaincom from './src/blockchaincom.js';
71
70
  import blofin from './src/blofin.js';
72
71
  import btcalpha from './src/btcalpha.js';
@@ -108,7 +107,6 @@ import htx from './src/htx.js';
108
107
  import huobi from './src/huobi.js';
109
108
  import huobijp from './src/huobijp.js';
110
109
  import hyperliquid from './src/hyperliquid.js';
111
- import idex from './src/idex.js';
112
110
  import independentreserve from './src/independentreserve.js';
113
111
  import indodax from './src/indodax.js';
114
112
  import kraken from './src/kraken.js';
@@ -194,7 +192,6 @@ import htxPro from './src/pro/htx.js';
194
192
  import huobiPro from './src/pro/huobi.js';
195
193
  import huobijpPro from './src/pro/huobijp.js';
196
194
  import hyperliquidPro from './src/pro/hyperliquid.js';
197
- import idexPro from './src/pro/idex.js';
198
195
  import independentreservePro from './src/pro/independentreserve.js';
199
196
  import krakenPro from './src/pro/kraken.js';
200
197
  import krakenfuturesPro from './src/pro/krakenfutures.js';
@@ -247,7 +244,6 @@ const exchanges = {
247
244
  'bitstamp': bitstamp,
248
245
  'bitteam': bitteam,
249
246
  'bitvavo': bitvavo,
250
- 'bl3p': bl3p,
251
247
  'blockchaincom': blockchaincom,
252
248
  'blofin': blofin,
253
249
  'btcalpha': btcalpha,
@@ -289,7 +285,6 @@ const exchanges = {
289
285
  'huobi': huobi,
290
286
  'huobijp': huobijp,
291
287
  'hyperliquid': hyperliquid,
292
- 'idex': idex,
293
288
  'independentreserve': independentreserve,
294
289
  'indodax': indodax,
295
290
  'kraken': kraken,
@@ -376,7 +371,6 @@ const pro = {
376
371
  'huobi': huobiPro,
377
372
  'huobijp': huobijpPro,
378
373
  'hyperliquid': hyperliquidPro,
379
- 'idex': idexPro,
380
374
  'independentreserve': independentreservePro,
381
375
  'kraken': krakenPro,
382
376
  'krakenfutures': krakenfuturesPro,
@@ -416,6 +410,6 @@ pro.exchanges = Object.keys(pro);
416
410
  pro['Exchange'] = Exchange; // now the same for rest and ts
417
411
  //-----------------------------------------------------------------------------
418
412
  const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
419
- 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, alpaca, apex, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitfinex, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, 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, };
413
+ 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, alpaca, apex, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitfinex, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitrue, bitso, bitstamp, bitteam, bitvavo, 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, 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, };
420
414
  export default ccxt;
421
415
  //-----------------------------------------------------------------------------
@@ -19,10 +19,14 @@ interface Exchange {
19
19
  privateGetAccountPositions(params?: {}): Promise<implicitReturnType>;
20
20
  privateGetAccountLeverageInfo(params?: {}): Promise<implicitReturnType>;
21
21
  privateGetAccountMarginMode(params?: {}): Promise<implicitReturnType>;
22
+ privateGetAccountPositionMode(params?: {}): Promise<implicitReturnType>;
22
23
  privateGetAccountBatchLeverageInfo(params?: {}): Promise<implicitReturnType>;
23
24
  privateGetTradeOrdersTpslPending(params?: {}): Promise<implicitReturnType>;
25
+ privateGetTradeOrdersAlgoPending(params?: {}): Promise<implicitReturnType>;
24
26
  privateGetTradeOrdersHistory(params?: {}): Promise<implicitReturnType>;
25
27
  privateGetTradeOrdersTpslHistory(params?: {}): Promise<implicitReturnType>;
28
+ privateGetTradeOrdersAlgoHistory(params?: {}): Promise<implicitReturnType>;
29
+ privateGetTradeOrderPriceRange(params?: {}): Promise<implicitReturnType>;
26
30
  privateGetUserQueryApikey(params?: {}): Promise<implicitReturnType>;
27
31
  privateGetAffiliateBasic(params?: {}): Promise<implicitReturnType>;
28
32
  privateGetCopytradingInstruments(params?: {}): Promise<implicitReturnType>;
@@ -37,8 +41,12 @@ interface Exchange {
37
41
  privateGetCopytradingTradePositionHistoryByOrder(params?: {}): Promise<implicitReturnType>;
38
42
  privateGetCopytradingTradeOrdersHistory(params?: {}): Promise<implicitReturnType>;
39
43
  privateGetCopytradingTradePendingTpslByOrder(params?: {}): Promise<implicitReturnType>;
44
+ privatePostAccountSetMarginMode(params?: {}): Promise<implicitReturnType>;
45
+ privatePostAccountSetPositionMode(params?: {}): Promise<implicitReturnType>;
40
46
  privatePostTradeOrder(params?: {}): Promise<implicitReturnType>;
47
+ privatePostTradeOrderAlgo(params?: {}): Promise<implicitReturnType>;
41
48
  privatePostTradeCancelOrder(params?: {}): Promise<implicitReturnType>;
49
+ privatePostTradeCancelAlgo(params?: {}): Promise<implicitReturnType>;
42
50
  privatePostAccountSetLeverage(params?: {}): Promise<implicitReturnType>;
43
51
  privatePostTradeBatchOrders(params?: {}): Promise<implicitReturnType>;
44
52
  privatePostTradeOrderTpsl(params?: {}): Promise<implicitReturnType>;
@@ -11,6 +11,7 @@ interface Exchange {
11
11
  privatePostTradeList(params?: {}): Promise<implicitReturnType>;
12
12
  privatePostTradeView(params?: {}): Promise<implicitReturnType>;
13
13
  privatePostWallet(params?: {}): Promise<implicitReturnType>;
14
+ webApiGetAjaxCoinCoinInfo(params?: {}): Promise<implicitReturnType>;
14
15
  }
15
16
  declare abstract class Exchange extends _Exchange {
16
17
  }
package/js/src/apex.js CHANGED
@@ -1085,9 +1085,10 @@ export default class apex extends Exchange {
1085
1085
  for (let i = 0; i < resultList.length; i++) {
1086
1086
  const entry = resultList[i];
1087
1087
  const timestamp = this.safeInteger(entry, 'fundingTimestamp');
1088
+ const marketId = this.safeString(entry, 'symbol');
1088
1089
  rates.push({
1089
1090
  'info': entry,
1090
- 'symbol': this.safeString(entry, 'symbol'),
1091
+ 'symbol': this.safeSymbol(marketId, market),
1091
1092
  'fundingRate': this.safeNumber(entry, 'rate'),
1092
1093
  'timestamp': timestamp,
1093
1094
  'datetime': this.iso8601(timestamp),
@@ -335,7 +335,21 @@ export default class Exchange {
335
335
  onRestResponse(statusCode: any, statusText: any, url: any, method: any, responseHeaders: any, responseBody: any, requestHeaders: any, requestBody: any): any;
336
336
  onJsonResponse(responseBody: any): any;
337
337
  loadMarketsHelper(reload?: boolean, params?: {}): Promise<Dictionary<any>>;
338
- loadMarkets(reload?: boolean, params?: {}): Promise<Dictionary<Market>>;
338
+ /**
339
+ * @method
340
+ * @name Exchange#loadMarkets
341
+ * @description Loads and prepares the markets for trading.
342
+ * @param {boolean} reload - If true, the markets will be reloaded from the exchange.
343
+ * @param {object} params - Additional exchange-specific parameters for the request.
344
+ * @returns A promise that resolves to a dictionary of markets.
345
+ * @throws An error if the markets cannot be loaded or prepared.
346
+ * @remarks This method is asynchronous and returns a promise.
347
+ * It ensures that the markets are only loaded once, even if the method is called multiple times.
348
+ * If the markets are already loaded and not reloading, the method returns the existing markets.
349
+ * If the markets are being reloaded, the method waits for the reload to complete before returning the markets.
350
+ * If an error occurs during the loading or preparation of the markets, the promise is rejected with the error.
351
+ */
352
+ loadMarkets(reload?: boolean, params?: object): Promise<Dictionary<Market>>;
339
353
  fetchCurrencies(params?: {}): Promise<Currencies>;
340
354
  fetchCurrenciesWs(params?: {}): Promise<unknown>;
341
355
  fetchMarkets(params?: {}): Promise<Market[]>;
@@ -729,8 +729,21 @@ export default class Exchange {
729
729
  const markets = await this.fetchMarkets(params);
730
730
  return this.setMarkets(markets, currencies);
731
731
  }
732
+ /**
733
+ * @method
734
+ * @name Exchange#loadMarkets
735
+ * @description Loads and prepares the markets for trading.
736
+ * @param {boolean} reload - If true, the markets will be reloaded from the exchange.
737
+ * @param {object} params - Additional exchange-specific parameters for the request.
738
+ * @returns A promise that resolves to a dictionary of markets.
739
+ * @throws An error if the markets cannot be loaded or prepared.
740
+ * @remarks This method is asynchronous and returns a promise.
741
+ * It ensures that the markets are only loaded once, even if the method is called multiple times.
742
+ * If the markets are already loaded and not reloading, the method returns the existing markets.
743
+ * If the markets are being reloaded, the method waits for the reload to complete before returning the markets.
744
+ * If an error occurs during the loading or preparation of the markets, the promise is rejected with the error.
745
+ */
732
746
  async loadMarkets(reload = false, params = {}) {
733
- // this method is async, it returns a promise
734
747
  if ((reload && !this.reloadingMarkets) || !this.marketsLoading) {
735
748
  this.reloadingMarkets = true;
736
749
  this.marketsLoading = this.loadMarketsHelper(reload, params).then((resolved) => {
@@ -2579,7 +2592,7 @@ export default class Exchange {
2579
2592
  currency['networks'][key]['active'] = false;
2580
2593
  }
2581
2594
  }
2582
- active = this.safeBool(network, 'active');
2595
+ active = this.safeBool(currency['networks'][key], 'active'); // dict might have been updated on above lines, so access directly instead of `network` variable
2583
2596
  const currencyActive = this.safeBool(currency, 'active');
2584
2597
  if (currencyActive === undefined || active) {
2585
2598
  currency['active'] = active;
@@ -446,6 +446,9 @@ export interface Greeks {
446
446
  theta: number;
447
447
  vega: number;
448
448
  rho: number;
449
+ vanna?: number;
450
+ volga?: number;
451
+ charm?: number;
449
452
  bidSize: number;
450
453
  askSize: number;
451
454
  bidImpliedVolatility: number;
package/js/src/bitget.js CHANGED
@@ -2080,9 +2080,7 @@ export default class bitget extends Exchange {
2080
2080
  const chain = chains[j];
2081
2081
  const networkId = this.safeString(chain, 'chain');
2082
2082
  let network = this.networkIdToCode(networkId, code);
2083
- if (network !== undefined) {
2084
- network = network.toUpperCase();
2085
- }
2083
+ network = network.toUpperCase();
2086
2084
  networks[network] = {
2087
2085
  'info': chain,
2088
2086
  'id': networkId,
package/js/src/bitrue.js CHANGED
@@ -767,70 +767,49 @@ export default class bitrue extends Exchange {
767
767
  const id = this.safeString(currency, 'coin');
768
768
  const name = this.safeString(currency, 'coinFulName');
769
769
  const code = this.safeCurrencyCode(id);
770
- let deposit = undefined;
771
- let withdraw = undefined;
772
- let minWithdrawString = undefined;
773
- let maxWithdrawString = undefined;
774
- let minWithdrawFeeString = undefined;
775
770
  const networkDetails = this.safeList(currency, 'chainDetail', []);
776
771
  const networks = {};
777
772
  for (let j = 0; j < networkDetails.length; j++) {
778
773
  const entry = networkDetails[j];
779
774
  const networkId = this.safeString(entry, 'chain');
780
775
  const network = this.networkIdToCode(networkId, code);
781
- const enableDeposit = this.safeBool(entry, 'enableDeposit');
782
- deposit = (enableDeposit) ? enableDeposit : deposit;
783
- const enableWithdraw = this.safeBool(entry, 'enableWithdraw');
784
- withdraw = (enableWithdraw) ? enableWithdraw : withdraw;
785
- const networkWithdrawFeeString = this.safeString(entry, 'withdrawFee');
786
- if (networkWithdrawFeeString !== undefined) {
787
- minWithdrawFeeString = (minWithdrawFeeString === undefined) ? networkWithdrawFeeString : Precise.stringMin(networkWithdrawFeeString, minWithdrawFeeString);
788
- }
789
- const networkMinWithdrawString = this.safeString(entry, 'minWithdraw');
790
- if (networkMinWithdrawString !== undefined) {
791
- minWithdrawString = (minWithdrawString === undefined) ? networkMinWithdrawString : Precise.stringMin(networkMinWithdrawString, minWithdrawString);
792
- }
793
- const networkMaxWithdrawString = this.safeString(entry, 'maxWithdraw');
794
- if (networkMaxWithdrawString !== undefined) {
795
- maxWithdrawString = (maxWithdrawString === undefined) ? networkMaxWithdrawString : Precise.stringMax(networkMaxWithdrawString, maxWithdrawString);
796
- }
797
776
  networks[network] = {
798
777
  'info': entry,
799
778
  'id': networkId,
800
779
  'network': network,
801
- 'deposit': enableDeposit,
802
- 'withdraw': enableWithdraw,
803
- 'active': enableDeposit && enableWithdraw,
804
- 'fee': this.parseNumber(networkWithdrawFeeString),
780
+ 'deposit': this.safeBool(entry, 'enableDeposit'),
781
+ 'withdraw': this.safeBool(entry, 'enableWithdraw'),
782
+ 'active': undefined,
783
+ 'fee': this.safeNumber(entry, 'withdrawFee'),
805
784
  'precision': undefined,
806
785
  'limits': {
807
786
  'withdraw': {
808
- 'min': this.parseNumber(networkMinWithdrawString),
809
- 'max': this.parseNumber(networkMaxWithdrawString),
787
+ 'min': this.safeNumber(entry, 'minWithdraw'),
788
+ 'max': this.safeNumber(entry, 'maxWithdraw'),
810
789
  },
811
790
  },
812
791
  };
813
792
  }
814
- result[code] = {
793
+ result[code] = this.safeCurrencyStructure({
815
794
  'id': id,
816
795
  'name': name,
817
796
  'code': code,
818
797
  'precision': undefined,
819
798
  'info': currency,
820
- 'active': deposit && withdraw,
821
- 'deposit': deposit,
822
- 'withdraw': withdraw,
799
+ 'active': undefined,
800
+ 'deposit': undefined,
801
+ 'withdraw': undefined,
823
802
  'networks': networks,
824
- 'fee': this.parseNumber(minWithdrawFeeString),
803
+ 'fee': undefined,
825
804
  'fees': undefined,
826
805
  'type': 'crypto',
827
806
  'limits': {
828
807
  'withdraw': {
829
- 'min': this.parseNumber(minWithdrawString),
830
- 'max': this.parseNumber(maxWithdrawString),
808
+ 'min': undefined,
809
+ 'max': undefined,
831
810
  },
832
811
  },
833
- };
812
+ });
834
813
  }
835
814
  return result;
836
815
  }
package/js/src/bitso.js CHANGED
@@ -31,6 +31,9 @@ export default class bitso extends Exchange {
31
31
  'future': false,
32
32
  'option': false,
33
33
  'addMargin': false,
34
+ 'borrowCrossMargin': false,
35
+ 'borrowIsolatedMargin': false,
36
+ 'borrowMargin': false,
34
37
  'cancelAllOrders': true,
35
38
  'cancelOrder': true,
36
39
  'cancelOrders': true,
@@ -38,11 +41,17 @@ export default class bitso extends Exchange {
38
41
  'closePosition': false,
39
42
  'createDepositAddress': false,
40
43
  'createOrder': true,
44
+ 'createOrderWithTakeProfitAndStopLoss': false,
45
+ 'createOrderWithTakeProfitAndStopLossWs': false,
41
46
  'createReduceOnlyOrder': false,
42
47
  'fetchAccounts': false,
43
48
  'fetchBalance': true,
49
+ 'fetchBorrowInterest': false,
50
+ 'fetchBorrowRate': false,
44
51
  'fetchBorrowRateHistories': false,
45
52
  'fetchBorrowRateHistory': false,
53
+ 'fetchBorrowRates': false,
54
+ 'fetchBorrowRatesPerSymbol': false,
46
55
  'fetchCrossBorrowRate': false,
47
56
  'fetchCrossBorrowRates': false,
48
57
  'fetchDeposit': true,
@@ -54,21 +63,40 @@ export default class bitso extends Exchange {
54
63
  'fetchDepositWithdrawFee': 'emulated',
55
64
  'fetchDepositWithdrawFees': true,
56
65
  'fetchFundingHistory': false,
66
+ 'fetchFundingInterval': false,
67
+ 'fetchFundingIntervals': false,
57
68
  'fetchFundingRate': false,
58
69
  'fetchFundingRateHistory': false,
59
70
  'fetchFundingRates': false,
71
+ 'fetchGreeks': false,
60
72
  'fetchIndexOHLCV': false,
61
73
  'fetchIsolatedBorrowRate': false,
62
74
  'fetchIsolatedBorrowRates': false,
75
+ 'fetchIsolatedPositions': false,
63
76
  'fetchLedger': true,
64
77
  'fetchLeverage': false,
78
+ 'fetchLeverages': false,
79
+ 'fetchLeverageTiers': false,
80
+ 'fetchLiquidations': false,
81
+ 'fetchLongShortRatio': false,
82
+ 'fetchLongShortRatioHistory': false,
83
+ 'fetchMarginAdjustmentHistory': false,
65
84
  'fetchMarginMode': false,
85
+ 'fetchMarginModes': false,
86
+ 'fetchMarketLeverageTiers': false,
66
87
  'fetchMarkets': true,
67
88
  'fetchMarkOHLCV': false,
89
+ 'fetchMarkPrices': false,
90
+ 'fetchMyLiquidations': false,
91
+ 'fetchMySettlementHistory': false,
68
92
  'fetchMyTrades': true,
69
93
  'fetchOHLCV': true,
94
+ 'fetchOpenInterest': false,
70
95
  'fetchOpenInterestHistory': false,
96
+ 'fetchOpenInterests': false,
71
97
  'fetchOpenOrders': true,
98
+ 'fetchOption': false,
99
+ 'fetchOptionChain': false,
72
100
  'fetchOrder': true,
73
101
  'fetchOrderBook': true,
74
102
  'fetchOrderTrades': true,
@@ -80,6 +108,7 @@ export default class bitso extends Exchange {
80
108
  'fetchPositionsHistory': false,
81
109
  'fetchPositionsRisk': false,
82
110
  'fetchPremiumIndexOHLCV': false,
111
+ 'fetchSettlementHistory': false,
83
112
  'fetchTicker': true,
84
113
  'fetchTickers': false,
85
114
  'fetchTime': false,
@@ -91,8 +120,12 @@ export default class bitso extends Exchange {
91
120
  'fetchTransactions': false,
92
121
  'fetchTransfer': false,
93
122
  'fetchTransfers': false,
123
+ 'fetchVolatilityHistory': false,
94
124
  'reduceMargin': false,
125
+ 'repayCrossMargin': false,
126
+ 'repayIsolatedMargin': false,
95
127
  'setLeverage': false,
128
+ 'setMargin': false,
96
129
  'setMarginMode': false,
97
130
  'setPositionMode': false,
98
131
  'transfer': false,
@@ -34,18 +34,27 @@ export default class bitstamp extends Exchange {
34
34
  'future': false,
35
35
  'option': false,
36
36
  'addMargin': false,
37
+ 'borrowCrossMargin': false,
38
+ 'borrowIsolatedMargin': false,
39
+ 'borrowMargin': false,
37
40
  'cancelAllOrders': true,
38
41
  'cancelOrder': true,
39
42
  'closeAllPositions': false,
40
43
  'closePosition': false,
41
44
  'createOrder': true,
45
+ 'createOrderWithTakeProfitAndStopLoss': false,
46
+ 'createOrderWithTakeProfitAndStopLossWs': false,
42
47
  'createReduceOnlyOrder': false,
43
48
  'createStopLimitOrder': false,
44
49
  'createStopMarketOrder': false,
45
50
  'createStopOrder': false,
46
51
  'fetchBalance': true,
52
+ 'fetchBorrowInterest': false,
53
+ 'fetchBorrowRate': false,
47
54
  'fetchBorrowRateHistories': false,
48
55
  'fetchBorrowRateHistory': false,
56
+ 'fetchBorrowRates': false,
57
+ 'fetchBorrowRatesPerSymbol': false,
49
58
  'fetchCrossBorrowRate': false,
50
59
  'fetchCrossBorrowRates': false,
51
60
  'fetchCurrencies': true,
@@ -56,21 +65,40 @@ export default class bitstamp extends Exchange {
56
65
  'fetchDepositWithdrawFee': 'emulated',
57
66
  'fetchDepositWithdrawFees': true,
58
67
  'fetchFundingHistory': false,
68
+ 'fetchFundingInterval': false,
69
+ 'fetchFundingIntervals': false,
59
70
  'fetchFundingRate': false,
60
71
  'fetchFundingRateHistory': false,
61
72
  'fetchFundingRates': false,
73
+ 'fetchGreeks': false,
62
74
  'fetchIndexOHLCV': false,
63
75
  'fetchIsolatedBorrowRate': false,
64
76
  'fetchIsolatedBorrowRates': false,
77
+ 'fetchIsolatedPositions': false,
65
78
  'fetchLedger': true,
66
79
  'fetchLeverage': false,
80
+ 'fetchLeverages': false,
81
+ 'fetchLeverageTiers': false,
82
+ 'fetchLiquidations': false,
83
+ 'fetchLongShortRatio': false,
84
+ 'fetchLongShortRatioHistory': false,
85
+ 'fetchMarginAdjustmentHistory': false,
67
86
  'fetchMarginMode': false,
87
+ 'fetchMarginModes': false,
88
+ 'fetchMarketLeverageTiers': false,
68
89
  'fetchMarkets': true,
69
90
  'fetchMarkOHLCV': false,
91
+ 'fetchMarkPrices': false,
92
+ 'fetchMyLiquidations': false,
93
+ 'fetchMySettlementHistory': false,
70
94
  'fetchMyTrades': true,
71
95
  'fetchOHLCV': true,
96
+ 'fetchOpenInterest': false,
72
97
  'fetchOpenInterestHistory': false,
98
+ 'fetchOpenInterests': false,
73
99
  'fetchOpenOrders': true,
100
+ 'fetchOption': false,
101
+ 'fetchOptionChain': false,
74
102
  'fetchOrder': true,
75
103
  'fetchOrderBook': true,
76
104
  'fetchPosition': false,
@@ -81,6 +109,7 @@ export default class bitstamp extends Exchange {
81
109
  'fetchPositionsHistory': false,
82
110
  'fetchPositionsRisk': false,
83
111
  'fetchPremiumIndexOHLCV': false,
112
+ 'fetchSettlementHistory': false,
84
113
  'fetchTicker': true,
85
114
  'fetchTickers': true,
86
115
  'fetchTrades': true,
@@ -88,9 +117,13 @@ export default class bitstamp extends Exchange {
88
117
  'fetchTradingFees': true,
89
118
  'fetchTransactionFees': true,
90
119
  'fetchTransactions': 'emulated',
120
+ 'fetchVolatilityHistory': false,
91
121
  'fetchWithdrawals': true,
92
122
  'reduceMargin': false,
123
+ 'repayCrossMargin': false,
124
+ 'repayIsolatedMargin': false,
93
125
  'setLeverage': false,
126
+ 'setMargin': false,
94
127
  'setMarginMode': false,
95
128
  'setPositionMode': false,
96
129
  'transfer': true,
@@ -143,12 +143,14 @@ export default class blofin extends Exchange {
143
143
  * @param {float} amount how much of currency you want to trade in units of base currency
144
144
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
145
145
  * @param {object} [params] extra parameters specific to the exchange API endpoint
146
+ * @param {string} [params.triggerPrice] the trigger price for a trigger order
146
147
  * @param {bool} [params.reduceOnly] a mark to reduce the position size for margin, swap and future orders
147
148
  * @param {bool} [params.postOnly] true to place a post only order
148
149
  * @param {string} [params.marginMode] 'cross' or 'isolated', default is 'cross'
149
150
  * @param {float} [params.stopLossPrice] stop loss trigger price (will use privatePostTradeOrderTpsl)
150
151
  * @param {float} [params.takeProfitPrice] take profit trigger price (will use privatePostTradeOrderTpsl)
151
152
  * @param {string} [params.positionSide] *stopLossPrice/takeProfitPrice orders only* 'long' or 'short' or 'net' default is 'net'
153
+ * @param {boolean} [params.hedged] if true, the positionSide will be set to long/short instead of net, default is false
152
154
  * @param {string} [params.clientOrderId] a unique id for the order
153
155
  * @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
154
156
  * @param {float} [params.takeProfit.triggerPrice] take profit trigger price
@@ -169,7 +171,8 @@ export default class blofin extends Exchange {
169
171
  * @param {string} id order id
170
172
  * @param {string} symbol unified symbol of the market the order was made in
171
173
  * @param {object} [params] extra parameters specific to the exchange API endpoint
172
- * @param {boolean} [params.trigger] True if cancelling a trigger/conditional order/tp sl orders
174
+ * @param {boolean} [params.trigger] True if cancelling a trigger/conditional
175
+ * @param {boolean} [params.tpsl] True if cancelling a tpsl order
173
176
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
174
177
  */
175
178
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
@@ -189,6 +192,7 @@ export default class blofin extends Exchange {
189
192
  * @description Fetch orders that are still open
190
193
  * @see https://blofin.com/docs#get-active-orders
191
194
  * @see https://blofin.com/docs#get-active-tpsl-orders
195
+ * @see https://docs.blofin.com/index.html#get-active-algo-orders
192
196
  * @param {string} symbol unified market symbol
193
197
  * @param {int} [since] the earliest time in ms to fetch open orders for
194
198
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -341,6 +345,7 @@ export default class blofin extends Exchange {
341
345
  * @param {string} symbol unified market symbol
342
346
  * @param {object} [params] extra parameters specific to the exchange API endpoint
343
347
  * @param {string} [params.marginMode] 'cross' or 'isolated'
348
+ * @param {string} [params.positionSide] 'long' or 'short' - required for hedged mode in isolated margin
344
349
  * @returns {object} response from the exchange
345
350
  */
346
351
  setLeverage(leverage: Int, symbol?: Str, params?: {}): Promise<any>;
@@ -387,7 +392,42 @@ export default class blofin extends Exchange {
387
392
  * @returns {object} a [margin mode structure]{@link https://docs.ccxt.com/#/?id=margin-mode-structure}
388
393
  */
389
394
  fetchMarginMode(symbol: string, params?: {}): Promise<MarginMode>;
390
- parseMarginMode(marginMode: Dict, market?: any): MarginMode;
395
+ parseMarginMode(marginMode: Dict, market?: Market): MarginMode;
396
+ /**
397
+ * @method
398
+ * @name blofin#setMarginMode
399
+ * @description set margin mode to 'cross' or 'isolated'
400
+ * @see https://docs.blofin.com/index.html#set-margin-mode
401
+ * @param {string} marginMode 'cross' or 'isolated'
402
+ * @param {string} [symbol] unified market symbol (not used in blofin setMarginMode)
403
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
404
+ * @returns {object} response from the exchange
405
+ */
406
+ setMarginMode(marginMode: string, symbol?: Str, params?: {}): Promise<MarginMode>;
407
+ /**
408
+ * @method
409
+ * @name blofin#fetchPositionMode
410
+ * @description fetchs the position mode, hedged or one way
411
+ * @see https://docs.blofin.com/index.html#get-position-mode
412
+ * @param {string} [symbol] unified symbol of the market to fetch the position mode for (not used in blofin fetchPositionMode)
413
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
414
+ * @returns {object} an object detailing whether the market is in hedged or one-way mode
415
+ */
416
+ fetchPositionMode(symbol?: Str, params?: {}): Promise<{
417
+ info: import("./base/types.js").Dictionary<any>;
418
+ hedged: boolean;
419
+ }>;
420
+ /**
421
+ * @method
422
+ * @name blofin#setPositionMode
423
+ * @description set hedged to true or false for a market
424
+ * @see https://docs.blofin.com/index.html#set-position-mode
425
+ * @param {bool} hedged set to true to use hedged mode, false for one-way mode
426
+ * @param {string} [symbol] not used by blofin setPositionMode ()
427
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
428
+ * @returns {object} response from the exchange
429
+ */
430
+ setPositionMode(hedged: boolean, symbol?: Str, params?: {}): Promise<any>;
391
431
  handleErrors(httpCode: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
392
432
  sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
393
433
  url: string;