ccxt 4.3.51 → 4.3.53

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 (45) hide show
  1. package/README.md +6 -5
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +6 -1
  4. package/dist/cjs/src/abstract/vertex.js +9 -0
  5. package/dist/cjs/src/base/Precise.js +10 -0
  6. package/dist/cjs/src/base/functions/type.js +43 -10
  7. package/dist/cjs/src/binance.js +2 -2
  8. package/dist/cjs/src/bybit.js +6 -0
  9. package/dist/cjs/src/hyperliquid.js +27 -26
  10. package/dist/cjs/src/krakenfutures.js +1 -0
  11. package/dist/cjs/src/okx.js +1 -0
  12. package/dist/cjs/src/pro/okx.js +1 -1
  13. package/dist/cjs/src/pro/probit.js +8 -3
  14. package/dist/cjs/src/pro/vertex.js +978 -0
  15. package/dist/cjs/src/probit.js +10 -5
  16. package/dist/cjs/src/static_dependencies/ethers/hash/typed-data.js +1 -1
  17. package/dist/cjs/src/vertex.js +2941 -0
  18. package/js/ccxt.d.ts +8 -2
  19. package/js/ccxt.js +6 -2
  20. package/js/src/abstract/okx.d.ts +1 -0
  21. package/js/src/abstract/vertex.d.ts +22 -0
  22. package/js/src/abstract/vertex.js +11 -0
  23. package/js/src/base/Exchange.d.ts +1 -1
  24. package/js/src/base/Precise.d.ts +2 -0
  25. package/js/src/base/Precise.js +10 -0
  26. package/js/src/base/functions/type.js +43 -10
  27. package/js/src/binance.d.ts +1 -11
  28. package/js/src/binance.js +2 -2
  29. package/js/src/bitget.d.ts +1 -1
  30. package/js/src/bitmart.d.ts +1 -1
  31. package/js/src/bybit.js +6 -0
  32. package/js/src/coinex.d.ts +1 -1
  33. package/js/src/htx.d.ts +1 -1
  34. package/js/src/hyperliquid.js +27 -26
  35. package/js/src/krakenfutures.js +1 -0
  36. package/js/src/okx.js +1 -0
  37. package/js/src/pro/okx.js +1 -1
  38. package/js/src/pro/probit.js +8 -3
  39. package/js/src/pro/vertex.d.ts +39 -0
  40. package/js/src/pro/vertex.js +979 -0
  41. package/js/src/probit.js +11 -6
  42. package/js/src/static_dependencies/ethers/hash/typed-data.js +1 -1
  43. package/js/src/vertex.d.ts +112 -0
  44. package/js/src/vertex.js +2942 -0
  45. package/package.json +1 -1
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, TransferEntries, LeverageTiers } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
7
- declare const version = "4.3.50";
7
+ declare const version = "4.3.52";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
@@ -103,6 +103,7 @@ import timex from './src/timex.js';
103
103
  import tokocrypto from './src/tokocrypto.js';
104
104
  import tradeogre from './src/tradeogre.js';
105
105
  import upbit from './src/upbit.js';
106
+ import vertex from './src/vertex.js';
106
107
  import wavesexchange from './src/wavesexchange.js';
107
108
  import wazirx from './src/wazirx.js';
108
109
  import whitebit from './src/whitebit.js';
@@ -174,6 +175,7 @@ import poloniexPro from './src/pro/poloniex.js';
174
175
  import poloniexfuturesPro from './src/pro/poloniexfutures.js';
175
176
  import probitPro from './src/pro/probit.js';
176
177
  import upbitPro from './src/pro/upbit.js';
178
+ import vertexPro from './src/pro/vertex.js';
177
179
  import wazirxPro from './src/pro/wazirx.js';
178
180
  import whitebitPro from './src/pro/whitebit.js';
179
181
  import wooPro from './src/pro/woo.js';
@@ -277,6 +279,7 @@ declare const exchanges: {
277
279
  tokocrypto: typeof tokocrypto;
278
280
  tradeogre: typeof tradeogre;
279
281
  upbit: typeof upbit;
282
+ vertex: typeof vertex;
280
283
  wavesexchange: typeof wavesexchange;
281
284
  wazirx: typeof wazirx;
282
285
  whitebit: typeof whitebit;
@@ -350,6 +353,7 @@ declare const pro: {
350
353
  poloniexfutures: typeof poloniexfuturesPro;
351
354
  probit: typeof probitPro;
352
355
  upbit: typeof upbitPro;
356
+ vertex: typeof vertexPro;
353
357
  wazirx: typeof wazirxPro;
354
358
  whitebit: typeof whitebitPro;
355
359
  woo: typeof wooPro;
@@ -423,6 +427,7 @@ declare const ccxt: {
423
427
  poloniexfutures: typeof poloniexfuturesPro;
424
428
  probit: typeof probitPro;
425
429
  upbit: typeof upbitPro;
430
+ vertex: typeof vertexPro;
426
431
  wazirx: typeof wazirxPro;
427
432
  whitebit: typeof whitebitPro;
428
433
  woo: typeof wooPro;
@@ -527,6 +532,7 @@ declare const ccxt: {
527
532
  tokocrypto: typeof tokocrypto;
528
533
  tradeogre: typeof tradeogre;
529
534
  upbit: typeof upbit;
535
+ vertex: typeof vertex;
530
536
  wavesexchange: typeof wavesexchange;
531
537
  wazirx: typeof wazirx;
532
538
  whitebit: typeof whitebit;
@@ -537,5 +543,5 @@ declare const ccxt: {
537
543
  zaif: typeof zaif;
538
544
  zonda: typeof zonda;
539
545
  } & typeof functions & typeof errors;
540
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, TransferEntries, LeverageTiers, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
546
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, TransferEntries, LeverageTiers, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
541
547
  export default ccxt;
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, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.3.51';
41
+ const version = '4.3.53';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -139,6 +139,7 @@ import timex from './src/timex.js';
139
139
  import tokocrypto from './src/tokocrypto.js';
140
140
  import tradeogre from './src/tradeogre.js';
141
141
  import upbit from './src/upbit.js';
142
+ import vertex from './src/vertex.js';
142
143
  import wavesexchange from './src/wavesexchange.js';
143
144
  import wazirx from './src/wazirx.js';
144
145
  import whitebit from './src/whitebit.js';
@@ -211,6 +212,7 @@ import poloniexPro from './src/pro/poloniex.js';
211
212
  import poloniexfuturesPro from './src/pro/poloniexfutures.js';
212
213
  import probitPro from './src/pro/probit.js';
213
214
  import upbitPro from './src/pro/upbit.js';
215
+ import vertexPro from './src/pro/vertex.js';
214
216
  import wazirxPro from './src/pro/wazirx.js';
215
217
  import whitebitPro from './src/pro/whitebit.js';
216
218
  import wooPro from './src/pro/woo.js';
@@ -314,6 +316,7 @@ const exchanges = {
314
316
  'tokocrypto': tokocrypto,
315
317
  'tradeogre': tradeogre,
316
318
  'upbit': upbit,
319
+ 'vertex': vertex,
317
320
  'wavesexchange': wavesexchange,
318
321
  'wazirx': wazirx,
319
322
  'whitebit': whitebit,
@@ -387,6 +390,7 @@ const pro = {
387
390
  'poloniexfutures': poloniexfuturesPro,
388
391
  'probit': probitPro,
389
392
  'upbit': upbitPro,
393
+ 'vertex': vertexPro,
390
394
  'wazirx': wazirxPro,
391
395
  'whitebit': whitebitPro,
392
396
  'woo': wooPro,
@@ -404,6 +408,6 @@ pro.exchanges = Object.keys(pro);
404
408
  pro['Exchange'] = Exchange; // now the same for rest and ts
405
409
  //-----------------------------------------------------------------------------
406
410
  const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
407
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
411
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
408
412
  export default ccxt;
409
413
  //-----------------------------------------------------------------------------
@@ -222,6 +222,7 @@ interface Exchange {
222
222
  privatePostSprdCancelOrder(params?: {}): Promise<implicitReturnType>;
223
223
  privatePostSprdMassCancel(params?: {}): Promise<implicitReturnType>;
224
224
  privatePostSprdAmendOrder(params?: {}): Promise<implicitReturnType>;
225
+ privatePostSprdCancelAllAfter(params?: {}): Promise<implicitReturnType>;
225
226
  privatePostTradeOrder(params?: {}): Promise<implicitReturnType>;
226
227
  privatePostTradeBatchOrders(params?: {}): Promise<implicitReturnType>;
227
228
  privatePostTradeCancelOrder(params?: {}): Promise<implicitReturnType>;
@@ -0,0 +1,22 @@
1
+ import { implicitReturnType } from '../base/types.js';
2
+ import { Exchange as _Exchange } from '../base/Exchange.js';
3
+ interface Exchange {
4
+ v1ArchivePost(params?: {}): Promise<implicitReturnType>;
5
+ v1GatewayGetQuery(params?: {}): Promise<implicitReturnType>;
6
+ v1GatewayGetSymbols(params?: {}): Promise<implicitReturnType>;
7
+ v1GatewayGetTime(params?: {}): Promise<implicitReturnType>;
8
+ v1GatewayPostQuery(params?: {}): Promise<implicitReturnType>;
9
+ v1GatewayPostExecute(params?: {}): Promise<implicitReturnType>;
10
+ v1TriggerPostExecute(params?: {}): Promise<implicitReturnType>;
11
+ v1TriggerPostQuery(params?: {}): Promise<implicitReturnType>;
12
+ v2ArchiveGetTickers(params?: {}): Promise<implicitReturnType>;
13
+ v2ArchiveGetContracts(params?: {}): Promise<implicitReturnType>;
14
+ v2ArchiveGetTrades(params?: {}): Promise<implicitReturnType>;
15
+ v2ArchiveGetVrtx(params?: {}): Promise<implicitReturnType>;
16
+ v2GatewayGetAssets(params?: {}): Promise<implicitReturnType>;
17
+ v2GatewayGetPairs(params?: {}): Promise<implicitReturnType>;
18
+ v2GatewayGetOrderbook(params?: {}): Promise<implicitReturnType>;
19
+ }
20
+ declare abstract class Exchange extends _Exchange {
21
+ }
22
+ export default Exchange;
@@ -0,0 +1,11 @@
1
+ // ----------------------------------------------------------------------------
2
+
3
+ // PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
4
+ // https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
+ // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
+
7
+ // -------------------------------------------------------------------------------
8
+ import { Exchange as _Exchange } from '../base/Exchange.js';
9
+ class Exchange extends _Exchange {
10
+ }
11
+ export default Exchange;
@@ -731,7 +731,7 @@ export default class Exchange {
731
731
  parsePosition(position: Dict, market?: Market): Position;
732
732
  parseFundingRateHistory(info: any, market?: Market): FundingRateHistory;
733
733
  parseBorrowInterest(info: Dict, market?: Market): BorrowInterest;
734
- parseIsolatedBorrowRate(info: any, market?: Market): IsolatedBorrowRate;
734
+ parseIsolatedBorrowRate(info: Dict, market?: Market): IsolatedBorrowRate;
735
735
  parseWsTrade(trade: any, market?: Market): Trade;
736
736
  parseWsOrder(order: any, market?: Market): Order;
737
737
  parseWsOrderTrade(trade: any, market?: Market): Trade;
@@ -11,6 +11,7 @@ declare class Precise {
11
11
  sub(other: Precise): Precise;
12
12
  abs(): Precise;
13
13
  neg(): Precise;
14
+ or(other: Precise): Precise;
14
15
  min(other: Precise): Precise;
15
16
  max(other: Precise): Precise;
16
17
  gt(other: Precise): boolean;
@@ -27,6 +28,7 @@ declare class Precise {
27
28
  static stringAbs(string: Str): string;
28
29
  static stringNeg(string: Str): string;
29
30
  static stringMod(string1: Str, string2: Str): string;
31
+ static stringOr(string1: Str, string2: Str): string;
30
32
  static stringEquals(string1: Str, string2: Str): boolean;
31
33
  static stringEq(string1: Str, string2: Str): boolean;
32
34
  static stringMin(string1: Str, string2: Str): string;
@@ -82,6 +82,10 @@ class Precise {
82
82
  neg() {
83
83
  return new Precise(-this.integer, this.decimals);
84
84
  }
85
+ or(other) {
86
+ const integerResult = this.integer | other.integer;
87
+ return new Precise(integerResult, this.decimals);
88
+ }
85
89
  min(other) {
86
90
  return this.lt(other) ? this : other;
87
91
  }
@@ -212,6 +216,12 @@ class Precise {
212
216
  }
213
217
  return (new Precise(string1)).mod(new Precise(string2)).toString();
214
218
  }
219
+ static stringOr(string1, string2) {
220
+ if ((string1 === undefined) || (string2 === undefined)) {
221
+ return undefined;
222
+ }
223
+ return (new Precise(string1)).or(new Precise(string2)).toString();
224
+ }
215
225
  static stringEquals(string1, string2) {
216
226
  if ((string1 === undefined) || (string2 === undefined)) {
217
227
  return undefined;
@@ -23,7 +23,7 @@ const prop2 = (o, k1, k2) => (!isObject(o)
23
23
  : (o[k2] !== '' && o[k2] !== null
24
24
  ? o[k2]
25
25
  : undefined)));
26
- const getValueFromKeysInArray = (object, array) => object[array.find((k) => prop(object, k) !== undefined)];
26
+ const getValueFromKeysInArray = (object, array) => isObject(object) ? object[array.find((k) => prop(object, k) !== undefined)] : undefined;
27
27
  /* ............................................. */
28
28
  const asFloat = (x) => ((isNumber(x) || (isString(x) && x.length !== 0)) ? parseFloat(x) : NaN);
29
29
  const asInteger = (x) => ((isNumber(x) || (isString(x) && x.length !== 0)) ? Math.trunc(Number(x)) : NaN);
@@ -54,11 +54,23 @@ const safeString = (o, k, $default) => {
54
54
  };
55
55
  const safeStringLower = (o, k, $default) => {
56
56
  const x = prop(o, k);
57
- return isStringCoercible(x) ? String(x).toLowerCase() : $default;
57
+ if (isStringCoercible(x)) {
58
+ return String(x).toLowerCase();
59
+ }
60
+ else if (isStringCoercible($default)) {
61
+ return String($default).toLowerCase();
62
+ }
63
+ return $default;
58
64
  };
59
65
  const safeStringUpper = (o, k, $default) => {
60
66
  const x = prop(o, k);
61
- return isStringCoercible(x) ? String(x).toUpperCase() : $default;
67
+ if (isStringCoercible(x)) {
68
+ return String(x).toUpperCase();
69
+ }
70
+ else if (isStringCoercible($default)) {
71
+ return String($default).toUpperCase();
72
+ }
73
+ return $default;
62
74
  };
63
75
  /* ............................................. */
64
76
  const safeFloat2 = (o, k1, k2, $default) => {
@@ -87,11 +99,23 @@ const safeString2 = (o, k1, k2, $default) => {
87
99
  };
88
100
  const safeStringLower2 = (o, k1, k2, $default) => {
89
101
  const x = prop2(o, k1, k2);
90
- return isStringCoercible(x) ? String(x).toLowerCase() : $default;
102
+ if (isStringCoercible(x)) {
103
+ return String(x).toLowerCase();
104
+ }
105
+ else if (isStringCoercible($default)) {
106
+ return String($default).toLowerCase();
107
+ }
108
+ return $default;
91
109
  };
92
110
  const safeStringUpper2 = (o, k1, k2, $default) => {
93
111
  const x = prop2(o, k1, k2);
94
- return isStringCoercible(x) ? String(x).toUpperCase() : $default;
112
+ if (isStringCoercible(x)) {
113
+ return String(x).toUpperCase();
114
+ }
115
+ else if (isStringCoercible($default)) {
116
+ return String($default).toUpperCase();
117
+ }
118
+ return $default;
95
119
  };
96
120
  const safeFloatN = (o, k, $default) => {
97
121
  const n = asFloat(getValueFromKeysInArray(o, k));
@@ -127,15 +151,24 @@ const safeStringN = (o, k, $default) => {
127
151
  return isStringCoercible(x) ? String(x) : $default;
128
152
  };
129
153
  const safeStringLowerN = (o, k, $default) => {
130
- if (o === undefined) {
131
- return $default;
132
- }
133
154
  const x = getValueFromKeysInArray(o, k);
134
- return isStringCoercible(x) ? String(x).toLowerCase() : $default;
155
+ if (isStringCoercible(x)) {
156
+ return String(x).toLowerCase();
157
+ }
158
+ else if (isStringCoercible($default)) {
159
+ return String($default).toLowerCase();
160
+ }
161
+ return $default;
135
162
  };
136
163
  const safeStringUpperN = (o, k, $default) => {
137
164
  const x = getValueFromKeysInArray(o, k);
138
- return isStringCoercible(x) ? String(x).toUpperCase() : $default;
165
+ if (isStringCoercible(x)) {
166
+ return String(x).toUpperCase();
167
+ }
168
+ else if (isStringCoercible($default)) {
169
+ return String($default).toUpperCase();
170
+ }
171
+ return $default;
139
172
  };
140
173
  export { isNumber, isInteger, isArray, isObject, isString, isStringCoercible, isDictionary, hasProps, prop, asFloat, asInteger, safeFloat, safeInteger, safeIntegerProduct, safeTimestamp, safeValue, safeString, safeStringLower, safeStringUpper
141
174
  // not using safeFloats with an array argument as we're trying to save some cycles here
@@ -293,17 +293,7 @@ export default class binance extends Exchange {
293
293
  datetime: string;
294
294
  info: any;
295
295
  };
296
- parseIsolatedBorrowRate(info: any, market?: Market): {
297
- info: any;
298
- symbol: string;
299
- base: string;
300
- baseRate: number;
301
- quote: string;
302
- quoteRate: number;
303
- period: number;
304
- timestamp: any;
305
- datetime: any;
306
- };
296
+ parseIsolatedBorrowRate(info: Dict, market?: Market): IsolatedBorrowRate;
307
297
  createGiftCode(code: string, amount: any, params?: {}): Promise<{
308
298
  info: any;
309
299
  id: string;
package/js/src/binance.js CHANGED
@@ -11148,10 +11148,10 @@ export default class binance extends Exchange {
11148
11148
  const orderidlistLength = orderidlist.length;
11149
11149
  const origclientorderidlistLength = origclientorderidlist.length;
11150
11150
  if (orderidlistLength > 0) {
11151
- query = query + '&' + 'orderidlist=[' + orderidlist.join(',') + ']';
11151
+ query = query + '&' + 'orderidlist=%5B' + orderidlist.join('%2C') + '%5D';
11152
11152
  }
11153
11153
  if (origclientorderidlistLength > 0) {
11154
- query = query + '&' + 'origclientorderidlist=[' + origclientorderidlist.join(',') + ']';
11154
+ query = query + '&' + 'origclientorderidlist=%5B' + origclientorderidlist.join('%2C') + '%5D';
11155
11155
  }
11156
11156
  }
11157
11157
  else {
@@ -208,7 +208,7 @@ export default class bitget extends Exchange {
208
208
  fetchMyLiquidations(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
209
209
  parseLiquidation(liquidation: any, market?: Market): Liquidation;
210
210
  fetchIsolatedBorrowRate(symbol: string, params?: {}): Promise<IsolatedBorrowRate>;
211
- parseIsolatedBorrowRate(info: any, market?: Market): IsolatedBorrowRate;
211
+ parseIsolatedBorrowRate(info: Dict, market?: Market): IsolatedBorrowRate;
212
212
  fetchCrossBorrowRate(code: string, params?: {}): Promise<CrossBorrowRate>;
213
213
  parseBorrowRate(info: any, currency?: Currency): {
214
214
  currency: string;
@@ -102,7 +102,7 @@ export default class bitmart extends Exchange {
102
102
  info: any;
103
103
  };
104
104
  fetchIsolatedBorrowRate(symbol: string, params?: {}): Promise<IsolatedBorrowRate>;
105
- parseIsolatedBorrowRate(info: any, market?: Market): IsolatedBorrowRate;
105
+ parseIsolatedBorrowRate(info: Dict, market?: Market): IsolatedBorrowRate;
106
106
  fetchIsolatedBorrowRates(params?: {}): Promise<IsolatedBorrowRates>;
107
107
  transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
108
108
  parseTransferStatus(status: Str): Str;
package/js/src/bybit.js CHANGED
@@ -5209,9 +5209,15 @@ export default class bybit extends Exchange {
5209
5209
  * @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
5210
5210
  * @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
5211
5211
  * @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
5212
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
5212
5213
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5213
5214
  */
5214
5215
  await this.loadMarkets();
5216
+ let paginate = false;
5217
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'paginate');
5218
+ if (paginate) {
5219
+ return await this.fetchPaginatedCallCursor('fetchOpenOrders', symbol, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
5220
+ }
5215
5221
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
5216
5222
  const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
5217
5223
  const request = {};
@@ -126,7 +126,7 @@ export default class coinex extends Exchange {
126
126
  fetchTransfers(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<TransferEntries>;
127
127
  fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
128
128
  fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
129
- parseIsolatedBorrowRate(info: any, market?: Market): IsolatedBorrowRate;
129
+ parseIsolatedBorrowRate(info: Dict, market?: Market): IsolatedBorrowRate;
130
130
  fetchIsolatedBorrowRate(symbol: string, params?: {}): Promise<IsolatedBorrowRate>;
131
131
  fetchBorrowInterest(code?: Str, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
132
132
  parseBorrowInterest(info: Dict, market?: Market): {
package/js/src/htx.d.ts CHANGED
@@ -112,7 +112,7 @@ export default class htx extends Exchange {
112
112
  parseTransfer(transfer: Dict, currency?: Currency): TransferEntry;
113
113
  transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
114
114
  fetchIsolatedBorrowRates(params?: {}): Promise<IsolatedBorrowRates>;
115
- parseIsolatedBorrowRate(info: any, market?: Market): IsolatedBorrowRate;
115
+ parseIsolatedBorrowRate(info: Dict, market?: Market): IsolatedBorrowRate;
116
116
  fetchFundingRateHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
117
117
  parseFundingRate(contract: any, market?: Market): {
118
118
  info: any;
@@ -445,24 +445,26 @@ export default class hyperliquid extends Exchange {
445
445
  for (let i = 0; i < meta.length; i++) {
446
446
  const market = this.safeDict(meta, i, {});
447
447
  const marketName = this.safeString(market, 'name');
448
- if (marketName.indexOf('/') < 0) {
449
- // there are some weird spot markets in testnet, eg @2
450
- continue;
451
- }
452
- const marketParts = marketName.split('/');
453
- const baseName = this.safeString(marketParts, 0);
454
- const quoteId = this.safeString(marketParts, 1);
455
- const base = this.safeCurrencyCode(baseName);
456
- const quote = this.safeCurrencyCode(quoteId);
457
- const symbol = base + '/' + quote;
448
+ // if (marketName.indexOf ('/') < 0) {
449
+ // // there are some weird spot markets in testnet, eg @2
450
+ // continue;
451
+ // }
452
+ // const marketParts = marketName.split ('/');
453
+ // const baseName = this.safeString (marketParts, 0);
454
+ // const quoteId = this.safeString (marketParts, 1);
458
455
  const fees = this.safeDict(this.fees, 'spot', {});
459
456
  const taker = this.safeNumber(fees, 'taker');
460
457
  const maker = this.safeNumber(fees, 'maker');
461
458
  const tokensPos = this.safeList(market, 'tokens', []);
462
459
  const baseTokenPos = this.safeInteger(tokensPos, 0);
463
- // const quoteTokenPos = this.safeInteger (tokensPos, 1);
460
+ const quoteTokenPos = this.safeInteger(tokensPos, 1);
464
461
  const baseTokenInfo = this.safeDict(tokens, baseTokenPos, {});
465
- // const quoteTokenInfo = this.safeDict (tokens, quoteTokenPos, {});
462
+ const quoteTokenInfo = this.safeDict(tokens, quoteTokenPos, {});
463
+ const baseName = this.safeString(baseTokenInfo, 'name');
464
+ const quoteId = this.safeString(quoteTokenInfo, 'name');
465
+ const base = this.safeCurrencyCode(baseName);
466
+ const quote = this.safeCurrencyCode(quoteId);
467
+ const symbol = base + '/' + quote;
466
468
  const innerBaseTokenInfo = this.safeDict(baseTokenInfo, 'spec', baseTokenInfo);
467
469
  // const innerQuoteTokenInfo = this.safeDict (quoteTokenInfo, 'spec', quoteTokenInfo);
468
470
  const amountPrecision = this.parseNumber(this.parsePrecision(this.safeString(innerBaseTokenInfo, 'szDecimals')));
@@ -1156,7 +1158,7 @@ export default class hyperliquid extends Exchange {
1156
1158
  if (clientOrderId !== undefined) {
1157
1159
  orderObj['c'] = clientOrderId;
1158
1160
  }
1159
- orderReq.push(this.extend(orderObj, orderParams));
1161
+ orderReq.push(orderObj);
1160
1162
  }
1161
1163
  const vaultAddress = this.formatVaultAddress(this.safeString(params, 'vaultAddress'));
1162
1164
  const orderAction = {
@@ -1179,7 +1181,7 @@ export default class hyperliquid extends Exchange {
1179
1181
  params = this.omit(params, 'vaultAddress');
1180
1182
  request['vaultAddress'] = vaultAddress;
1181
1183
  }
1182
- const response = await this.privatePostExchange(this.extend(request, params));
1184
+ const response = await this.privatePostExchange(request);
1183
1185
  //
1184
1186
  // {
1185
1187
  // "status": "ok",
@@ -1282,7 +1284,7 @@ export default class hyperliquid extends Exchange {
1282
1284
  params = this.omit(params, 'vaultAddress');
1283
1285
  request['vaultAddress'] = vaultAddress;
1284
1286
  }
1285
- const response = await this.privatePostExchange(this.extend(request, params));
1287
+ const response = await this.privatePostExchange(request);
1286
1288
  //
1287
1289
  // {
1288
1290
  // "status":"ok",
@@ -1366,7 +1368,7 @@ export default class hyperliquid extends Exchange {
1366
1368
  params = this.omit(params, 'vaultAddress');
1367
1369
  request['vaultAddress'] = vaultAddress;
1368
1370
  }
1369
- const response = await this.privatePostExchange(this.extend(request, params));
1371
+ const response = await this.privatePostExchange(request);
1370
1372
  //
1371
1373
  // {
1372
1374
  // "status":"ok",
@@ -1412,7 +1414,7 @@ export default class hyperliquid extends Exchange {
1412
1414
  params = this.omit(params, 'vaultAddress');
1413
1415
  request['vaultAddress'] = vaultAddress;
1414
1416
  }
1415
- const response = await this.privatePostExchange(this.extend(request, params));
1417
+ const response = await this.privatePostExchange(request);
1416
1418
  //
1417
1419
  // {
1418
1420
  // "status":"err",
@@ -1534,7 +1536,7 @@ export default class hyperliquid extends Exchange {
1534
1536
  params = this.omit(params, 'vaultAddress');
1535
1537
  request['vaultAddress'] = vaultAddress;
1536
1538
  }
1537
- const response = await this.privatePostExchange(this.extend(request, params));
1539
+ const response = await this.privatePostExchange(request);
1538
1540
  //
1539
1541
  // {
1540
1542
  // "status": "ok",
@@ -2213,10 +2215,9 @@ export default class hyperliquid extends Exchange {
2213
2215
  vaultAddress = vaultAddress.replace('0x', '');
2214
2216
  }
2215
2217
  }
2216
- const extendedAction = this.extend(updateAction, params);
2217
- const signature = this.signL1Action(extendedAction, nonce, vaultAddress);
2218
+ const signature = this.signL1Action(updateAction, nonce, vaultAddress);
2218
2219
  const request = {
2219
- 'action': extendedAction,
2220
+ 'action': updateAction,
2220
2221
  'nonce': nonce,
2221
2222
  'signature': signature,
2222
2223
  // 'vaultAddress': vaultAddress,
@@ -2274,7 +2275,7 @@ export default class hyperliquid extends Exchange {
2274
2275
  params = this.omit(params, 'vaultAddress');
2275
2276
  request['vaultAddress'] = vaultAddress;
2276
2277
  }
2277
- const response = await this.privatePostExchange(this.extend(request, params));
2278
+ const response = await this.privatePostExchange(request);
2278
2279
  //
2279
2280
  // {
2280
2281
  // 'response': {
@@ -2338,7 +2339,7 @@ export default class hyperliquid extends Exchange {
2338
2339
  params = this.omit(params, 'vaultAddress');
2339
2340
  request['vaultAddress'] = vaultAddress;
2340
2341
  }
2341
- const response = await this.privatePostExchange(this.extend(request, params));
2342
+ const response = await this.privatePostExchange(request);
2342
2343
  //
2343
2344
  // {
2344
2345
  // 'response': {
@@ -2405,7 +2406,7 @@ export default class hyperliquid extends Exchange {
2405
2406
  };
2406
2407
  const signature = this.signL1Action(action, nonce, vaultAddress);
2407
2408
  const innerRequest = {
2408
- 'action': this.extend(action, params),
2409
+ 'action': action,
2409
2410
  'nonce': nonce,
2410
2411
  'signature': signature,
2411
2412
  };
@@ -2442,7 +2443,7 @@ export default class hyperliquid extends Exchange {
2442
2443
  'nonce': nonce,
2443
2444
  'signature': sig,
2444
2445
  };
2445
- const response = await this.privatePostExchange(this.extend(request, params));
2446
+ const response = await this.privatePostExchange(request);
2446
2447
  return response;
2447
2448
  }
2448
2449
  async withdraw(code, amount, address, tag = undefined, params = {}) {
@@ -2488,7 +2489,7 @@ export default class hyperliquid extends Exchange {
2488
2489
  'nonce': nonce,
2489
2490
  'signature': sig,
2490
2491
  };
2491
- const response = await this.privatePostExchange(this.extend(request, params));
2492
+ const response = await this.privatePostExchange(request);
2492
2493
  return this.parseTransaction(response);
2493
2494
  }
2494
2495
  parseTransaction(transaction, currency = undefined) {
@@ -84,6 +84,7 @@ export default class krakenfutures extends Exchange {
84
84
  'public': 'https://demo-futures.kraken.com/derivatives/api/',
85
85
  'private': 'https://demo-futures.kraken.com/derivatives/api/',
86
86
  'charts': 'https://demo-futures.kraken.com/api/charts/',
87
+ 'history': 'https://demo-futures.kraken.com/api/history/',
87
88
  'www': 'https://demo-futures.kraken.com',
88
89
  },
89
90
  'logo': 'https://user-images.githubusercontent.com/24300605/81436764-b22fd580-9172-11ea-9703-742783e6376d.jpg',
package/js/src/okx.js CHANGED
@@ -434,6 +434,7 @@ export default class okx extends Exchange {
434
434
  'sprd/cancel-order': 1,
435
435
  'sprd/mass-cancel': 1,
436
436
  'sprd/amend-order': 1,
437
+ 'sprd/cancel-all-after': 10,
437
438
  // trade
438
439
  'trade/order': 1 / 3,
439
440
  'trade/batch-orders': 1 / 15,
package/js/src/pro/okx.js CHANGED
@@ -102,7 +102,7 @@ export default class okx extends okxRest {
102
102
  // okex does not support built-in ws protocol-level ping-pong
103
103
  // instead it requires a custom text-based ping-pong
104
104
  'ping': this.ping,
105
- 'keepAlive': 20000,
105
+ 'keepAlive': 18000,
106
106
  },
107
107
  });
108
108
  }
@@ -47,7 +47,6 @@ export default class probit extends probitRest {
47
47
  },
48
48
  },
49
49
  'streaming': {},
50
- 'exceptions': {},
51
50
  });
52
51
  }
53
52
  async watchBalance(params = {}) {
@@ -496,8 +495,14 @@ export default class probit extends probitRest {
496
495
  const code = this.safeString(message, 'errorCode');
497
496
  const errMessage = this.safeString(message, 'message', '');
498
497
  const details = this.safeValue(message, 'details');
499
- // todo - throw properly here
500
- throw new ExchangeError(this.id + ' ' + code + ' ' + errMessage + ' ' + this.json(details));
498
+ const feedback = this.id + ' ' + code + ' ' + errMessage + ' ' + this.json(details);
499
+ if ('exact' in this.exceptions) {
500
+ this.throwExactlyMatchedException(this.exceptions['exact'], code, feedback);
501
+ }
502
+ if ('broad' in this.exceptions) {
503
+ this.throwBroadlyMatchedException(this.exceptions['broad'], errMessage, feedback);
504
+ }
505
+ throw new ExchangeError(feedback);
501
506
  }
502
507
  handleAuthenticate(client, message) {
503
508
  //