ccxt 4.5.5 → 4.5.7

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 (151) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.min.js +15 -15
  3. package/dist/cjs/ccxt.js +6 -6
  4. package/dist/cjs/src/abstract/toobit.js +11 -0
  5. package/dist/cjs/src/abstract/tradeogre.js +1 -1
  6. package/dist/cjs/src/apex.js +2 -2
  7. package/dist/cjs/src/backpack.js +1 -1
  8. package/dist/cjs/src/base/Exchange.js +129 -2
  9. package/dist/cjs/src/bigone.js +4 -4
  10. package/dist/cjs/src/binance.js +82 -20
  11. package/dist/cjs/src/bingx.js +5 -2
  12. package/dist/cjs/src/bitbank.js +1 -0
  13. package/dist/cjs/src/bitbns.js +1 -0
  14. package/dist/cjs/src/bitflyer.js +1 -0
  15. package/dist/cjs/src/bitget.js +16 -9
  16. package/dist/cjs/src/bithumb.js +1 -0
  17. package/dist/cjs/src/bitso.js +1 -0
  18. package/dist/cjs/src/bitvavo.js +26 -40
  19. package/dist/cjs/src/blockchaincom.js +1 -0
  20. package/dist/cjs/src/btcalpha.js +1 -0
  21. package/dist/cjs/src/btcbox.js +1 -0
  22. package/dist/cjs/src/btcmarkets.js +1 -0
  23. package/dist/cjs/src/btcturk.js +1 -0
  24. package/dist/cjs/src/bybit.js +186 -127
  25. package/dist/cjs/src/coinsph.js +4 -1
  26. package/dist/cjs/src/cryptocom.js +6 -3
  27. package/dist/cjs/src/deribit.js +3 -2
  28. package/dist/cjs/src/digifinex.js +1 -1
  29. package/dist/cjs/src/gate.js +9 -13
  30. package/dist/cjs/src/gemini.js +5 -5
  31. package/dist/cjs/src/htx.js +11 -1
  32. package/dist/cjs/src/hyperliquid.js +3 -0
  33. package/dist/cjs/src/independentreserve.js +1 -0
  34. package/dist/cjs/src/indodax.js +17 -6
  35. package/dist/cjs/src/kraken.js +31 -8
  36. package/dist/cjs/src/krakenfutures.js +1 -0
  37. package/dist/cjs/src/kucoin.js +1 -2
  38. package/dist/cjs/src/luno.js +4 -1
  39. package/dist/cjs/src/mercado.js +1 -0
  40. package/dist/cjs/src/mexc.js +84 -37
  41. package/dist/cjs/src/novadax.js +1 -0
  42. package/dist/cjs/src/oceanex.js +1 -0
  43. package/dist/cjs/src/okcoin.js +4 -1
  44. package/dist/cjs/src/okx.js +52 -8
  45. package/dist/cjs/src/phemex.js +1 -1
  46. package/dist/cjs/src/pro/apex.js +8 -4
  47. package/dist/cjs/src/pro/backpack.js +7 -5
  48. package/dist/cjs/src/pro/binance.js +150 -19
  49. package/dist/cjs/src/pro/bingx.js +206 -220
  50. package/dist/cjs/src/pro/bitget.js +332 -76
  51. package/dist/cjs/src/pro/cex.js +1 -0
  52. package/dist/cjs/src/pro/htx.js +1 -1
  53. package/dist/cjs/src/pro/independentreserve.js +1 -0
  54. package/dist/cjs/src/pro/mexc.js +23 -23
  55. package/dist/cjs/src/pro/okx.js +46 -10
  56. package/dist/cjs/src/pro/toobit.js +1163 -0
  57. package/dist/cjs/src/pro/tradeogre.js +1 -1
  58. package/dist/cjs/src/toobit.js +2999 -0
  59. package/dist/cjs/src/tradeogre.js +1 -1
  60. package/dist/cjs/src/upbit.js +1 -0
  61. package/dist/cjs/src/wavesexchange.js +1 -0
  62. package/dist/cjs/src/yobit.js +1 -0
  63. package/dist/cjs/src/zaif.js +1 -0
  64. package/dist/cjs/src/zonda.js +1 -0
  65. package/js/ccxt.d.ts +8 -8
  66. package/js/ccxt.js +6 -6
  67. package/js/src/abstract/mexc.d.ts +1 -0
  68. package/js/src/abstract/myokx.d.ts +1 -0
  69. package/js/src/abstract/okx.d.ts +1 -0
  70. package/js/src/abstract/okxus.d.ts +1 -0
  71. package/js/src/abstract/toobit.d.ts +66 -0
  72. package/js/src/apex.js +2 -2
  73. package/js/src/backpack.js +1 -1
  74. package/js/src/base/Exchange.d.ts +9 -0
  75. package/js/src/base/Exchange.js +129 -2
  76. package/js/src/bigone.js +4 -4
  77. package/js/src/binance.d.ts +9 -0
  78. package/js/src/binance.js +82 -20
  79. package/js/src/bingx.js +5 -2
  80. package/js/src/bitbank.js +1 -0
  81. package/js/src/bitbns.js +1 -0
  82. package/js/src/bitflyer.js +1 -0
  83. package/js/src/bitget.js +16 -9
  84. package/js/src/bithumb.js +1 -0
  85. package/js/src/bitso.js +1 -0
  86. package/js/src/bitvavo.d.ts +0 -2
  87. package/js/src/bitvavo.js +27 -41
  88. package/js/src/blockchaincom.js +1 -0
  89. package/js/src/btcalpha.js +1 -0
  90. package/js/src/btcbox.js +1 -0
  91. package/js/src/btcmarkets.js +1 -0
  92. package/js/src/btcturk.js +1 -0
  93. package/js/src/bybit.d.ts +8 -0
  94. package/js/src/bybit.js +186 -127
  95. package/js/src/coinsph.js +4 -1
  96. package/js/src/cryptocom.js +6 -3
  97. package/js/src/deribit.js +3 -2
  98. package/js/src/digifinex.js +1 -1
  99. package/js/src/gate.d.ts +2 -2
  100. package/js/src/gate.js +9 -13
  101. package/js/src/gemini.js +5 -5
  102. package/js/src/htx.js +11 -1
  103. package/js/src/hyperliquid.js +3 -0
  104. package/js/src/independentreserve.js +1 -0
  105. package/js/src/indodax.js +17 -6
  106. package/js/src/kraken.d.ts +2 -2
  107. package/js/src/kraken.js +31 -8
  108. package/js/src/krakenfutures.js +1 -0
  109. package/js/src/kucoin.js +1 -2
  110. package/js/src/luno.js +4 -1
  111. package/js/src/mercado.js +1 -0
  112. package/js/src/mexc.d.ts +4 -1
  113. package/js/src/mexc.js +84 -37
  114. package/js/src/novadax.js +1 -0
  115. package/js/src/oceanex.js +1 -0
  116. package/js/src/okcoin.js +4 -1
  117. package/js/src/okx.js +52 -8
  118. package/js/src/phemex.js +1 -1
  119. package/js/src/pro/apex.js +8 -4
  120. package/js/src/pro/backpack.d.ts +1 -1
  121. package/js/src/pro/backpack.js +7 -5
  122. package/js/src/pro/binance.d.ts +24 -0
  123. package/js/src/pro/binance.js +150 -19
  124. package/js/src/pro/bingx.d.ts +53 -33
  125. package/js/src/pro/bingx.js +207 -221
  126. package/js/src/pro/bitget.d.ts +6 -0
  127. package/js/src/pro/bitget.js +332 -76
  128. package/js/src/pro/cex.js +1 -0
  129. package/js/src/pro/htx.js +1 -1
  130. package/js/src/pro/independentreserve.js +1 -0
  131. package/js/src/pro/mexc.js +23 -23
  132. package/js/src/pro/okx.d.ts +7 -1
  133. package/js/src/pro/okx.js +46 -10
  134. package/js/src/pro/toobit.d.ts +174 -0
  135. package/js/src/pro/toobit.js +1162 -0
  136. package/js/src/toobit.d.ts +456 -0
  137. package/js/src/toobit.js +2992 -0
  138. package/js/src/upbit.js +1 -0
  139. package/js/src/wavesexchange.js +1 -0
  140. package/js/src/yobit.js +1 -0
  141. package/js/src/zaif.js +1 -0
  142. package/js/src/zonda.js +1 -0
  143. package/package.json +1 -1
  144. package/dist/373.ccxt.browser.js +0 -7630
  145. package/dist/373.ccxt.browser.min.js +0 -1
  146. package/js/src/abstract/tradeogre.d.ts +0 -21
  147. package/js/src/pro/tradeogre.d.ts +0 -49
  148. package/js/src/pro/tradeogre.js +0 -278
  149. package/js/src/tradeogre.d.ts +0 -149
  150. package/js/src/tradeogre.js +0 -872
  151. /package/js/src/abstract/{tradeogre.js → toobit.js} +0 -0
@@ -6,7 +6,7 @@ var tradeogre$1 = require('./abstract/tradeogre.js');
6
6
  var errors = require('./base/errors.js');
7
7
  var number = require('./base/functions/number.js');
8
8
 
9
- // ---------------------------------------------------------------------------
9
+ // ----------------------------------------------------------------------------
10
10
  // ---------------------------------------------------------------------------
11
11
  /**
12
12
  * @class tradeogre
@@ -44,6 +44,7 @@ class upbit extends upbit$1["default"] {
44
44
  'fetchBalance': true,
45
45
  'fetchCanceledOrders': true,
46
46
  'fetchClosedOrders': true,
47
+ 'fetchCurrencies': false,
47
48
  'fetchDeposit': true,
48
49
  'fetchDepositAddress': true,
49
50
  'fetchDepositAddresses': true,
@@ -54,6 +54,7 @@ class wavesexchange extends wavesexchange$1["default"] {
54
54
  'fetchClosedOrders': true,
55
55
  'fetchCrossBorrowRate': false,
56
56
  'fetchCrossBorrowRates': false,
57
+ 'fetchCurrencies': false,
57
58
  'fetchDepositAddress': true,
58
59
  'fetchDepositAddresses': undefined,
59
60
  'fetchDepositAddressesByNetwork': undefined,
@@ -54,6 +54,7 @@ class yobit extends yobit$1["default"] {
54
54
  'fetchBorrowRatesPerSymbol': false,
55
55
  'fetchCrossBorrowRate': false,
56
56
  'fetchCrossBorrowRates': false,
57
+ 'fetchCurrencies': false,
57
58
  'fetchDepositAddress': true,
58
59
  'fetchDepositAddresses': false,
59
60
  'fetchDepositAddressesByNetwork': false,
@@ -35,6 +35,7 @@ class zaif extends zaif$1["default"] {
35
35
  'createOrder': true,
36
36
  'fetchBalance': true,
37
37
  'fetchClosedOrders': true,
38
+ 'fetchCurrencies': false,
38
39
  'fetchFundingHistory': false,
39
40
  'fetchFundingRate': false,
40
41
  'fetchFundingRateHistory': false,
@@ -50,6 +50,7 @@ class zonda extends zonda$1["default"] {
50
50
  'fetchBorrowRatesPerSymbol': false,
51
51
  'fetchCrossBorrowRate': false,
52
52
  'fetchCrossBorrowRates': false,
53
+ 'fetchCurrencies': false,
53
54
  'fetchDeposit': false,
54
55
  'fetchDepositAddress': true,
55
56
  'fetchDepositAddresses': true,
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, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarketMarginModes, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, LongShortRatio, OrderBooks, OpenInterests, ConstructorArgs } from './src/base/types.js';
6
6
  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';
7
- declare const version = "4.5.4";
7
+ declare const version = "4.5.6";
8
8
  import alpaca from './src/alpaca.js';
9
9
  import apex from './src/apex.js';
10
10
  import ascendex from './src/ascendex.js';
@@ -101,7 +101,7 @@ import poloniex from './src/poloniex.js';
101
101
  import probit from './src/probit.js';
102
102
  import timex from './src/timex.js';
103
103
  import tokocrypto from './src/tokocrypto.js';
104
- import tradeogre from './src/tradeogre.js';
104
+ import toobit from './src/toobit.js';
105
105
  import upbit from './src/upbit.js';
106
106
  import wavesexchange from './src/wavesexchange.js';
107
107
  import whitebit from './src/whitebit.js';
@@ -178,7 +178,7 @@ import paradexPro from './src/pro/paradex.js';
178
178
  import phemexPro from './src/pro/phemex.js';
179
179
  import poloniexPro from './src/pro/poloniex.js';
180
180
  import probitPro from './src/pro/probit.js';
181
- import tradeogrePro from './src/pro/tradeogre.js';
181
+ import toobitPro from './src/pro/toobit.js';
182
182
  import upbitPro from './src/pro/upbit.js';
183
183
  import whitebitPro from './src/pro/whitebit.js';
184
184
  import wooPro from './src/pro/woo.js';
@@ -281,7 +281,7 @@ declare const exchanges: {
281
281
  probit: typeof probit;
282
282
  timex: typeof timex;
283
283
  tokocrypto: typeof tokocrypto;
284
- tradeogre: typeof tradeogre;
284
+ toobit: typeof toobit;
285
285
  upbit: typeof upbit;
286
286
  wavesexchange: typeof wavesexchange;
287
287
  whitebit: typeof whitebit;
@@ -360,7 +360,7 @@ declare const pro: {
360
360
  phemex: typeof phemexPro;
361
361
  poloniex: typeof poloniexPro;
362
362
  probit: typeof probitPro;
363
- tradeogre: typeof tradeogrePro;
363
+ toobit: typeof toobitPro;
364
364
  upbit: typeof upbitPro;
365
365
  whitebit: typeof whitebitPro;
366
366
  woo: typeof wooPro;
@@ -440,7 +440,7 @@ declare const ccxt: {
440
440
  phemex: typeof phemexPro;
441
441
  poloniex: typeof poloniexPro;
442
442
  probit: typeof probitPro;
443
- tradeogre: typeof tradeogrePro;
443
+ toobit: typeof toobitPro;
444
444
  upbit: typeof upbitPro;
445
445
  whitebit: typeof whitebitPro;
446
446
  woo: typeof wooPro;
@@ -544,7 +544,7 @@ declare const ccxt: {
544
544
  probit: typeof probit;
545
545
  timex: typeof timex;
546
546
  tokocrypto: typeof tokocrypto;
547
- tradeogre: typeof tradeogre;
547
+ toobit: typeof toobit;
548
548
  upbit: typeof upbit;
549
549
  wavesexchange: typeof wavesexchange;
550
550
  whitebit: typeof whitebit;
@@ -555,5 +555,5 @@ declare const ccxt: {
555
555
  zaif: typeof zaif;
556
556
  zonda: typeof zonda;
557
557
  } & typeof functions & typeof errors;
558
- 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, Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, ConstructorArgs, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketMarginModes, MarketInterface, Trade, Order, OrderBook, OrderBooks, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, OpenInterests, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, LongShortRatio, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, alpaca, apex, ascendex, backpack, 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, };
558
+ 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, Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, ConstructorArgs, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketMarginModes, MarketInterface, Trade, Order, OrderBook, OrderBooks, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, OpenInterests, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, LongShortRatio, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, alpaca, apex, ascendex, backpack, 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, toobit, upbit, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
559
559
  export default ccxt;
package/js/ccxt.js CHANGED
@@ -32,7 +32,7 @@ import * as errors from './src/base/errors.js';
32
32
  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';
33
33
  //-----------------------------------------------------------------------------
34
34
  // this is updated by vss.js when building
35
- const version = '4.5.4';
35
+ const version = '4.5.6';
36
36
  Exchange.ccxtVersion = version;
37
37
  //-----------------------------------------------------------------------------
38
38
  import alpaca from './src/alpaca.js';
@@ -131,7 +131,7 @@ import poloniex from './src/poloniex.js';
131
131
  import probit from './src/probit.js';
132
132
  import timex from './src/timex.js';
133
133
  import tokocrypto from './src/tokocrypto.js';
134
- import tradeogre from './src/tradeogre.js';
134
+ import toobit from './src/toobit.js';
135
135
  import upbit from './src/upbit.js';
136
136
  import wavesexchange from './src/wavesexchange.js';
137
137
  import whitebit from './src/whitebit.js';
@@ -209,7 +209,7 @@ import paradexPro from './src/pro/paradex.js';
209
209
  import phemexPro from './src/pro/phemex.js';
210
210
  import poloniexPro from './src/pro/poloniex.js';
211
211
  import probitPro from './src/pro/probit.js';
212
- import tradeogrePro from './src/pro/tradeogre.js';
212
+ import toobitPro from './src/pro/toobit.js';
213
213
  import upbitPro from './src/pro/upbit.js';
214
214
  import whitebitPro from './src/pro/whitebit.js';
215
215
  import wooPro from './src/pro/woo.js';
@@ -312,7 +312,7 @@ const exchanges = {
312
312
  'probit': probit,
313
313
  'timex': timex,
314
314
  'tokocrypto': tokocrypto,
315
- 'tradeogre': tradeogre,
315
+ 'toobit': toobit,
316
316
  'upbit': upbit,
317
317
  'wavesexchange': wavesexchange,
318
318
  'whitebit': whitebit,
@@ -391,7 +391,7 @@ const pro = {
391
391
  'phemex': phemexPro,
392
392
  'poloniex': poloniexPro,
393
393
  'probit': probitPro,
394
- 'tradeogre': tradeogrePro,
394
+ 'toobit': toobitPro,
395
395
  'upbit': upbitPro,
396
396
  'whitebit': whitebitPro,
397
397
  'woo': wooPro,
@@ -410,6 +410,6 @@ pro.exchanges = Object.keys(pro);
410
410
  pro['Exchange'] = Exchange; // now the same for rest and ts
411
411
  //-----------------------------------------------------------------------------
412
412
  const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
413
- 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, backpack, 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, };
413
+ 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, backpack, 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, toobit, upbit, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
414
414
  export default ccxt;
415
415
  //-----------------------------------------------------------------------------
@@ -57,6 +57,7 @@ interface Exchange {
57
57
  spotPrivateGetMxDeductEnable(params?: {}): Promise<implicitReturnType>;
58
58
  spotPrivateGetUserDataStream(params?: {}): Promise<implicitReturnType>;
59
59
  spotPrivateGetSelfSymbols(params?: {}): Promise<implicitReturnType>;
60
+ spotPrivateGetAssetInternalTransferRecord(params?: {}): Promise<implicitReturnType>;
60
61
  spotPrivatePostOrder(params?: {}): Promise<implicitReturnType>;
61
62
  spotPrivatePostOrderTest(params?: {}): Promise<implicitReturnType>;
62
63
  spotPrivatePostSubAccountVirtualSubAccount(params?: {}): Promise<implicitReturnType>;
@@ -286,6 +286,7 @@ interface okx {
286
286
  privatePostAccountFixedLoanRepayBorrowingOrder(params?: {}): Promise<implicitReturnType>;
287
287
  privatePostAccountBillsHistoryArchive(params?: {}): Promise<implicitReturnType>;
288
288
  privatePostAccountMovePositions(params?: {}): Promise<implicitReturnType>;
289
+ privatePostAccountSetSettleCurrency(params?: {}): Promise<implicitReturnType>;
289
290
  privatePostUsersSubaccountModifyApikey(params?: {}): Promise<implicitReturnType>;
290
291
  privatePostAssetSubaccountTransfer(params?: {}): Promise<implicitReturnType>;
291
292
  privatePostUsersSubaccountSetTransferOut(params?: {}): Promise<implicitReturnType>;
@@ -286,6 +286,7 @@ interface Exchange {
286
286
  privatePostAccountFixedLoanRepayBorrowingOrder(params?: {}): Promise<implicitReturnType>;
287
287
  privatePostAccountBillsHistoryArchive(params?: {}): Promise<implicitReturnType>;
288
288
  privatePostAccountMovePositions(params?: {}): Promise<implicitReturnType>;
289
+ privatePostAccountSetSettleCurrency(params?: {}): Promise<implicitReturnType>;
289
290
  privatePostUsersSubaccountModifyApikey(params?: {}): Promise<implicitReturnType>;
290
291
  privatePostAssetSubaccountTransfer(params?: {}): Promise<implicitReturnType>;
291
292
  privatePostUsersSubaccountSetTransferOut(params?: {}): Promise<implicitReturnType>;
@@ -286,6 +286,7 @@ interface okx {
286
286
  privatePostAccountFixedLoanRepayBorrowingOrder(params?: {}): Promise<implicitReturnType>;
287
287
  privatePostAccountBillsHistoryArchive(params?: {}): Promise<implicitReturnType>;
288
288
  privatePostAccountMovePositions(params?: {}): Promise<implicitReturnType>;
289
+ privatePostAccountSetSettleCurrency(params?: {}): Promise<implicitReturnType>;
289
290
  privatePostUsersSubaccountModifyApikey(params?: {}): Promise<implicitReturnType>;
290
291
  privatePostAssetSubaccountTransfer(params?: {}): Promise<implicitReturnType>;
291
292
  privatePostUsersSubaccountSetTransferOut(params?: {}): Promise<implicitReturnType>;
@@ -0,0 +1,66 @@
1
+ import { implicitReturnType } from '../base/types.js';
2
+ import { Exchange as _Exchange } from '../base/Exchange.js';
3
+ interface Exchange {
4
+ commonGetApiV1Time(params?: {}): Promise<implicitReturnType>;
5
+ commonGetApiV1Ping(params?: {}): Promise<implicitReturnType>;
6
+ commonGetApiV1ExchangeInfo(params?: {}): Promise<implicitReturnType>;
7
+ commonGetQuoteV1Depth(params?: {}): Promise<implicitReturnType>;
8
+ commonGetQuoteV1DepthMerged(params?: {}): Promise<implicitReturnType>;
9
+ commonGetQuoteV1Trades(params?: {}): Promise<implicitReturnType>;
10
+ commonGetQuoteV1Klines(params?: {}): Promise<implicitReturnType>;
11
+ commonGetQuoteV1IndexKlines(params?: {}): Promise<implicitReturnType>;
12
+ commonGetQuoteV1MarkPriceKlines(params?: {}): Promise<implicitReturnType>;
13
+ commonGetQuoteV1MarkPrice(params?: {}): Promise<implicitReturnType>;
14
+ commonGetQuoteV1Index(params?: {}): Promise<implicitReturnType>;
15
+ commonGetQuoteV1Ticker24hr(params?: {}): Promise<implicitReturnType>;
16
+ commonGetQuoteV1ContractTicker24hr(params?: {}): Promise<implicitReturnType>;
17
+ commonGetQuoteV1TickerPrice(params?: {}): Promise<implicitReturnType>;
18
+ commonGetQuoteV1TickerBookTicker(params?: {}): Promise<implicitReturnType>;
19
+ commonGetApiV1FuturesFundingRate(params?: {}): Promise<implicitReturnType>;
20
+ commonGetApiV1FuturesHistoryFundingRate(params?: {}): Promise<implicitReturnType>;
21
+ privateGetApiV1Account(params?: {}): Promise<implicitReturnType>;
22
+ privateGetApiV1AccountCheckApiKey(params?: {}): Promise<implicitReturnType>;
23
+ privateGetApiV1SpotOrder(params?: {}): Promise<implicitReturnType>;
24
+ privateGetApiV1SpotOpenOrders(params?: {}): Promise<implicitReturnType>;
25
+ privateGetApiV1FuturesOpenOrders(params?: {}): Promise<implicitReturnType>;
26
+ privateGetApiV1SpotTradeOrders(params?: {}): Promise<implicitReturnType>;
27
+ privateGetApiV1FuturesHistoryOrders(params?: {}): Promise<implicitReturnType>;
28
+ privateGetApiV1AccountTrades(params?: {}): Promise<implicitReturnType>;
29
+ privateGetApiV1AccountBalanceFlow(params?: {}): Promise<implicitReturnType>;
30
+ privateGetApiV1AccountDepositOrders(params?: {}): Promise<implicitReturnType>;
31
+ privateGetApiV1AccountWithdrawOrders(params?: {}): Promise<implicitReturnType>;
32
+ privateGetApiV1AccountDepositAddress(params?: {}): Promise<implicitReturnType>;
33
+ privateGetApiV1SubAccount(params?: {}): Promise<implicitReturnType>;
34
+ privateGetApiV1FuturesAccountLeverage(params?: {}): Promise<implicitReturnType>;
35
+ privateGetApiV1FuturesOrder(params?: {}): Promise<implicitReturnType>;
36
+ privateGetApiV1FuturesPositions(params?: {}): Promise<implicitReturnType>;
37
+ privateGetApiV1FuturesBalance(params?: {}): Promise<implicitReturnType>;
38
+ privateGetApiV1FuturesUserTrades(params?: {}): Promise<implicitReturnType>;
39
+ privateGetApiV1FuturesBalanceFlow(params?: {}): Promise<implicitReturnType>;
40
+ privateGetApiV1FuturesCommissionRate(params?: {}): Promise<implicitReturnType>;
41
+ privateGetApiV1FuturesTodayPnl(params?: {}): Promise<implicitReturnType>;
42
+ privatePostApiV1SpotOrderTest(params?: {}): Promise<implicitReturnType>;
43
+ privatePostApiV1SpotOrder(params?: {}): Promise<implicitReturnType>;
44
+ privatePostApiV1FuturesOrder(params?: {}): Promise<implicitReturnType>;
45
+ privatePostApiV1SpotBatchOrders(params?: {}): Promise<implicitReturnType>;
46
+ privatePostApiV1SubAccountTransfer(params?: {}): Promise<implicitReturnType>;
47
+ privatePostApiV1AccountWithdraw(params?: {}): Promise<implicitReturnType>;
48
+ privatePostApiV1FuturesMarginType(params?: {}): Promise<implicitReturnType>;
49
+ privatePostApiV1FuturesLeverage(params?: {}): Promise<implicitReturnType>;
50
+ privatePostApiV1FuturesBatchOrders(params?: {}): Promise<implicitReturnType>;
51
+ privatePostApiV1FuturesPositionTradingStop(params?: {}): Promise<implicitReturnType>;
52
+ privatePostApiV1FuturesPositionMargin(params?: {}): Promise<implicitReturnType>;
53
+ privatePostApiV1UserDataStream(params?: {}): Promise<implicitReturnType>;
54
+ privatePostApiV1ListenKey(params?: {}): Promise<implicitReturnType>;
55
+ privateDeleteApiV1SpotOrder(params?: {}): Promise<implicitReturnType>;
56
+ privateDeleteApiV1FuturesOrder(params?: {}): Promise<implicitReturnType>;
57
+ privateDeleteApiV1SpotOpenOrders(params?: {}): Promise<implicitReturnType>;
58
+ privateDeleteApiV1FuturesBatchOrders(params?: {}): Promise<implicitReturnType>;
59
+ privateDeleteApiV1SpotCancelOrderByIds(params?: {}): Promise<implicitReturnType>;
60
+ privateDeleteApiV1FuturesCancelOrderByIds(params?: {}): Promise<implicitReturnType>;
61
+ privateDeleteApiV1ListenKey(params?: {}): Promise<implicitReturnType>;
62
+ privatePutApiV1ListenKey(params?: {}): Promise<implicitReturnType>;
63
+ }
64
+ declare abstract class Exchange extends _Exchange {
65
+ }
66
+ export default Exchange;
package/js/src/apex.js CHANGED
@@ -801,9 +801,9 @@ export default class apex extends Exchange {
801
801
  limit = 200; // default is 200 when requested with `since`
802
802
  }
803
803
  request['limit'] = limit; // max 200, default 200
804
- [request, params] = this.handleUntilOption('end', request, params);
804
+ [request, params] = this.handleUntilOption('end', request, params, 0.001);
805
805
  if (since !== undefined) {
806
- request['start'] = since;
806
+ request['start'] = Math.floor(since / 1000);
807
807
  }
808
808
  const response = await this.publicGetV3Klines(this.extend(request, params));
809
809
  const data = this.safeDict(response, 'data', {});
@@ -1908,7 +1908,7 @@ export default class backpack extends Exchange {
1908
1908
  // "createdAt": 1753626206762,
1909
1909
  // "executedQuantity": "0",
1910
1910
  // "executedQuoteQuantity": "0",
1911
- // "id": "4228978330",
1911
+ // "id": "4228978331",
1912
1912
  // "orderType": "Limit",
1913
1913
  // "postOnly": true,
1914
1914
  // "price": "3000",
@@ -439,6 +439,13 @@ export default class Exchange {
439
439
  * @param {boolean} enabled true to enable sandbox mode, false to disable it
440
440
  */
441
441
  setSandboxMode(enabled: boolean): void;
442
+ /**
443
+ * @method
444
+ * @name Exchange#enableDemoTrading
445
+ * @description enables or disables demo trading mode
446
+ * @param {boolean} [enable] true if demo trading should be enabled, false otherwise
447
+ */
448
+ enableDemoTrading(enable: boolean): void;
442
449
  sign(path: any, api?: any, method?: string, params?: {}, headers?: any, body?: any): {};
443
450
  fetchAccounts(params?: {}): Promise<Account[]>;
444
451
  fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
@@ -528,6 +535,8 @@ export default class Exchange {
528
535
  initRestRateLimiter(): void;
529
536
  featuresGenerator(): void;
530
537
  featuresMapper(initialFeatures: any, marketType: Str, subType?: Str): any;
538
+ featureValue(symbol: string, methodName?: Str, paramName?: Str, subParamName?: Str, defaultValue?: any): any;
539
+ featureValueByType(marketType: string, subType: Str, methodName?: Str, paramName?: Str, subParamName?: Str, defaultValue?: any): any;
531
540
  orderbookChecksumMessage(symbol: Str): string;
532
541
  createNetworksByIdObject(): void;
533
542
  getDefaultOptions(): {
@@ -1403,7 +1403,7 @@ export default class Exchange {
1403
1403
  // ########################################################################
1404
1404
  // ########################################################################
1405
1405
  // ------------------------------------------------------------------------
1406
- // METHODS BELOW THIS LINE ARE TRANSPILED FROM JAVASCRIPT TO PYTHON AND PHP
1406
+ // METHODS BELOW THIS LINE ARE TRANSPILED FROM TYPESCRIPT
1407
1407
  describe() {
1408
1408
  return {
1409
1409
  'id': undefined,
@@ -2151,6 +2151,27 @@ export default class Exchange {
2151
2151
  this.isSandboxModeEnabled = false;
2152
2152
  }
2153
2153
  }
2154
+ /**
2155
+ * @method
2156
+ * @name Exchange#enableDemoTrading
2157
+ * @description enables or disables demo trading mode
2158
+ * @param {boolean} [enable] true if demo trading should be enabled, false otherwise
2159
+ */
2160
+ enableDemoTrading(enable) {
2161
+ if (this.isSandboxModeEnabled) {
2162
+ throw new NotSupported(this.id + ' demo trading does not support in sandbox environment. Please check https://www.binance.com/en/support/faq/detail/9be58f73e5e14338809e3b705b9687dd to see the differences');
2163
+ }
2164
+ if (enable) {
2165
+ this.urls['apiBackupDemoTrading'] = this.urls['api'];
2166
+ this.urls['api'] = this.urls['demo'];
2167
+ }
2168
+ else if ('apiBackupDemoTrading' in this.urls) {
2169
+ this.urls['api'] = this.urls['apiBackupDemoTrading'];
2170
+ const newUrls = this.omit(this.urls, 'apiBackupDemoTrading');
2171
+ this.urls = newUrls;
2172
+ }
2173
+ this.options['enableDemoTrading'] = enable;
2174
+ }
2154
2175
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
2155
2176
  return {};
2156
2177
  }
@@ -2605,6 +2626,97 @@ export default class Exchange {
2605
2626
  }
2606
2627
  return featuresObj;
2607
2628
  }
2629
+ featureValue(symbol, methodName = undefined, paramName = undefined, subParamName = undefined, defaultValue = undefined) {
2630
+ /**
2631
+ * @method
2632
+ * @name exchange#featureValue
2633
+ * @description this method is a very deterministic to help users to know what feature is supported by the exchange
2634
+ * @param {string} [symbol] unified symbol
2635
+ * @param {string} [methodName] view currently supported methods: https://docs.ccxt.com/#/README?id=features
2636
+ * @param {string} [paramName] unified param value (check docs for supported param names)
2637
+ * @param {string} [subParamName] unified sub-param value (eg. stopLoss->triggerPriceType)
2638
+ * @param {object} [defaultValue] return default value if no result found
2639
+ * @returns {object} returns feature value
2640
+ */
2641
+ const market = this.market(symbol);
2642
+ return this.featureValueByType(market['type'], market['subType'], methodName, paramName, subParamName, defaultValue);
2643
+ }
2644
+ featureValueByType(marketType, subType, methodName = undefined, paramName = undefined, subParamName = undefined, defaultValue = undefined) {
2645
+ /**
2646
+ * @method
2647
+ * @name exchange#featureValueByType
2648
+ * @description this method is a very deterministic to help users to know what feature is supported by the exchange
2649
+ * @param {string} [marketType] supported only: "spot", "swap", "future"
2650
+ * @param {string} [subType] supported only: "linear", "inverse"
2651
+ * @param {string} [methodName] view currently supported methods: https://docs.ccxt.com/#/README?id=features
2652
+ * @param {string} [paramName] unified param value (check docs for supported param names)
2653
+ * @param {string} [subParamName] unified sub-param value (eg. stopLoss->triggerPriceType)
2654
+ * @param {object} [defaultValue] return default value if no result found
2655
+ * @returns {object} returns feature value
2656
+ */
2657
+ // if exchange does not yet have features manually implemented
2658
+ if (this.features === undefined) {
2659
+ return defaultValue;
2660
+ }
2661
+ // if marketType (e.g. 'option') does not exist in features
2662
+ if (!(marketType in this.features)) {
2663
+ return defaultValue; // unsupported marketType, check "exchange.features" for details
2664
+ }
2665
+ // if marketType dict undefined
2666
+ if (this.features[marketType] === undefined) {
2667
+ return defaultValue;
2668
+ }
2669
+ let methodsContainer = this.features[marketType];
2670
+ if (subType === undefined) {
2671
+ if (marketType !== 'spot') {
2672
+ return defaultValue; // subType is required for non-spot markets
2673
+ }
2674
+ }
2675
+ else {
2676
+ if (!(subType in this.features[marketType])) {
2677
+ return defaultValue; // unsupported subType, check "exchange.features" for details
2678
+ }
2679
+ // if subType dict undefined
2680
+ if (this.features[marketType][subType] === undefined) {
2681
+ return defaultValue;
2682
+ }
2683
+ methodsContainer = this.features[marketType][subType];
2684
+ }
2685
+ // if user wanted only marketType and didn't provide methodName, eg: featureIsSupported('spot')
2686
+ if (methodName === undefined) {
2687
+ return methodsContainer;
2688
+ }
2689
+ if (!(methodName in methodsContainer)) {
2690
+ return defaultValue; // unsupported method, check "exchange.features" for details');
2691
+ }
2692
+ const methodDict = methodsContainer[methodName];
2693
+ if (methodDict === undefined) {
2694
+ return defaultValue;
2695
+ }
2696
+ // if user wanted only method and didn't provide `paramName`, eg: featureIsSupported('swap', 'linear', 'createOrder')
2697
+ if (paramName === undefined) {
2698
+ return methodDict;
2699
+ }
2700
+ if (!(paramName in methodDict)) {
2701
+ return defaultValue; // unsupported paramName, check "exchange.features" for details');
2702
+ }
2703
+ const dictionary = this.safeDict(methodDict, paramName);
2704
+ if (dictionary === undefined) {
2705
+ // if the value is not dictionary but a scalar value (or undefined), return as is
2706
+ return methodDict[paramName];
2707
+ }
2708
+ else {
2709
+ // return as is, when calling without `subParamName` eg: featureValueByType('spot', undefined, 'createOrder', 'stopLoss')
2710
+ if (subParamName === undefined) {
2711
+ return methodDict[paramName];
2712
+ }
2713
+ // throw an exception for unsupported subParamName
2714
+ if (!(subParamName in methodDict[paramName])) {
2715
+ return defaultValue; // unsupported subParamName, check "exchange.features" for details
2716
+ }
2717
+ return methodDict[paramName][subParamName];
2718
+ }
2719
+ }
2608
2720
  orderbookChecksumMessage(symbol) {
2609
2721
  return symbol + ' : ' + 'orderbook data checksum validation failed. You can reconnect by calling watchOrderBook again or you can mute the error by setting exchange.options["watchOrderBook"]["checksum"] = false';
2610
2722
  }
@@ -2909,7 +3021,12 @@ export default class Exchange {
2909
3021
  const marketsSortedById = this.keysort(this.markets_by_id);
2910
3022
  this.symbols = Object.keys(marketsSortedBySymbol);
2911
3023
  this.ids = Object.keys(marketsSortedById);
3024
+ let numCurrencies = 0;
2912
3025
  if (currencies !== undefined) {
3026
+ const keys = Object.keys(currencies);
3027
+ numCurrencies = keys.length;
3028
+ }
3029
+ if (numCurrencies > 0) {
2913
3030
  // currencies is always undefined when called in constructor but not when called from loadMarkets
2914
3031
  this.currencies = this.mapToSafeMap(this.deepExtend(this.currencies, currencies));
2915
3032
  }
@@ -2988,6 +3105,14 @@ export default class Exchange {
2988
3105
  this.baseCurrencies = sourceExchange.baseCurrencies;
2989
3106
  this.quoteCurrencies = sourceExchange.quoteCurrencies;
2990
3107
  this.codes = sourceExchange.codes;
3108
+ // check marketHelperProps
3109
+ const sourceExchangeHelpers = this.safeList(sourceExchange.options, 'marketHelperProps', []);
3110
+ for (let i = 0; i < sourceExchangeHelpers.length; i++) {
3111
+ const helper = sourceExchangeHelpers[i];
3112
+ if (sourceExchange.options[helper] !== undefined) {
3113
+ this.options[helper] = sourceExchange.options[helper];
3114
+ }
3115
+ }
2991
3116
  return this;
2992
3117
  }
2993
3118
  getDescribeForExtendedWsExchange(currentRestInstance, parentRestInstance, wsBaseDescribe) {
@@ -5729,7 +5854,9 @@ export default class Exchange {
5729
5854
  return this.safeString(this.commonCurrencies, code, code);
5730
5855
  }
5731
5856
  currency(code) {
5732
- if (this.currencies === undefined) {
5857
+ const keys = Object.keys(this.currencies);
5858
+ const numCurrencies = keys.length;
5859
+ if (numCurrencies === 0) {
5733
5860
  throw new ExchangeError(this.id + ' currencies not loaded');
5734
5861
  }
5735
5862
  if (typeof code === 'string') {
package/js/src/bigone.js CHANGED
@@ -22,7 +22,7 @@ export default class bigone extends Exchange {
22
22
  'CORS': undefined,
23
23
  'spot': true,
24
24
  'margin': false,
25
- 'swap': undefined,
25
+ 'swap': true,
26
26
  'future': undefined,
27
27
  'option': false,
28
28
  'cancelAllOrders': true,
@@ -446,7 +446,7 @@ export default class bigone extends Exchange {
446
446
  // we use undocumented link (possible, less informative alternative is : https://big.one/api/uc/v3/assets/accounts)
447
447
  const data = await this.fetchWebEndpoint('fetchCurrencies', 'webExchangeGetV3Assets', true);
448
448
  if (data === undefined) {
449
- return undefined;
449
+ return {};
450
450
  }
451
451
  //
452
452
  // {
@@ -1251,7 +1251,7 @@ export default class bigone extends Exchange {
1251
1251
  await this.loadMarkets();
1252
1252
  const market = this.market(symbol);
1253
1253
  if (market['contract']) {
1254
- throw new BadRequest(this.id + ' fetchTrades () can only fetch trades for spot markets');
1254
+ throw new NotSupported(this.id + ' fetchTrades () can only fetch trades for spot markets');
1255
1255
  }
1256
1256
  const request = {
1257
1257
  'asset_pair_name': market['id'],
@@ -1318,7 +1318,7 @@ export default class bigone extends Exchange {
1318
1318
  await this.loadMarkets();
1319
1319
  const market = this.market(symbol);
1320
1320
  if (market['contract']) {
1321
- throw new BadRequest(this.id + ' fetchOHLCV () can only fetch ohlcvs for spot markets');
1321
+ throw new NotSupported(this.id + ' fetchOHLCV () can only fetch ohlcvs for spot markets');
1322
1322
  }
1323
1323
  const until = this.safeInteger(params, 'until');
1324
1324
  const untilIsDefined = (until !== undefined);
@@ -14,6 +14,15 @@ export default class binance extends Exchange {
14
14
  safeMarket(marketId?: Str, market?: Market, delimiter?: Str, marketType?: Str): MarketInterface;
15
15
  costToPrecision(symbol: any, cost: any): string;
16
16
  nonce(): number;
17
+ /**
18
+ * @method
19
+ * @name binance#enableDemoTrading
20
+ * @description enables or disables demo trading mode
21
+ * @see https://www.binance.com/en/support/faq/detail/9be58f73e5e14338809e3b705b9687dd
22
+ * @see https://demo.binance.com/en/my/settings/api-management
23
+ * @param {boolean} [enable] true if demo trading should be enabled, false otherwise
24
+ */
25
+ enableDemoTrading(enable: boolean): void;
17
26
  /**
18
27
  * @method
19
28
  * @name binance#fetchTime