ccxt 4.4.14 → 4.4.15

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.
package/dist/cjs/ccxt.js CHANGED
@@ -194,7 +194,7 @@ var xt$1 = require('./src/pro/xt.js');
194
194
 
195
195
  //-----------------------------------------------------------------------------
196
196
  // this is updated by vss.js when building
197
- const version = '4.4.14';
197
+ const version = '4.4.15';
198
198
  Exchange["default"].ccxtVersion = version;
199
199
  const exchanges = {
200
200
  'ace': ace,
@@ -1230,7 +1230,7 @@ class htx extends htx$1 {
1230
1230
  'SBTC': 'SUPERBITCOIN',
1231
1231
  'SOUL': 'SOULSAVER',
1232
1232
  'BIFI': 'BITCOINFILE',
1233
- 'FUD': 'FTX Users\' Debt',
1233
+ 'FUD': 'FTX Users Debt',
1234
1234
  },
1235
1235
  });
1236
1236
  }
@@ -116,8 +116,8 @@ class onetrading extends onetrading$1 {
116
116
  'urls': {
117
117
  'logo': 'https://github.com/ccxt/ccxt/assets/43336371/bdbc26fd-02f2-4ca7-9f1e-17333690bb1c',
118
118
  'api': {
119
- 'public': 'https://api.onetrading.com/public',
120
- 'private': 'https://api.onetrading.com/public',
119
+ 'public': 'https://api.onetrading.com/fast',
120
+ 'private': 'https://api.onetrading.com/fast',
121
121
  },
122
122
  'www': 'https://onetrading.com/',
123
123
  'doc': [
@@ -246,7 +246,7 @@ class binance extends binance$1 {
246
246
  let type = undefined;
247
247
  [type, params] = this.handleMarketTypeAndParams('watchLiquidationsForSymbols', firstMarket, params);
248
248
  if (type === 'spot') {
249
- throw new errors.BadRequest(this.id + 'watchLiquidationsForSymbols is not supported for swap symbols');
249
+ throw new errors.BadRequest(this.id + 'watchLiquidationsForSymbols is not supported for spot symbols');
250
250
  }
251
251
  let subType = undefined;
252
252
  [subType, params] = this.handleSubTypeAndParams('watchLiquidationsForSymbols', firstMarket, params);
@@ -14,6 +14,7 @@ class upbit extends upbit$1 {
14
14
  'ws': true,
15
15
  'watchOrderBook': true,
16
16
  'watchTicker': true,
17
+ 'watchTickers': true,
17
18
  'watchTrades': true,
18
19
  'watchTradesForSymbols': true,
19
20
  'watchOrders': true,
@@ -56,6 +57,33 @@ class upbit extends upbit$1 {
56
57
  const messageHash = channel + ':' + marketId;
57
58
  return await this.watch(url, messageHash, request, messageHash);
58
59
  }
60
+ async watchPublicMultiple(symbols, channel, params = {}) {
61
+ await this.loadMarkets();
62
+ if (symbols === undefined) {
63
+ symbols = this.symbols;
64
+ }
65
+ symbols = this.marketSymbols(symbols);
66
+ const marketIds = this.marketIds(symbols);
67
+ const url = this.implodeParams(this.urls['api']['ws'], {
68
+ 'hostname': this.hostname,
69
+ });
70
+ const messageHashes = [];
71
+ for (let i = 0; i < marketIds.length; i++) {
72
+ messageHashes.push(channel + ':' + marketIds[i]);
73
+ }
74
+ const request = [
75
+ {
76
+ 'ticket': this.uuid(),
77
+ },
78
+ {
79
+ 'type': channel,
80
+ 'codes': marketIds,
81
+ // 'isOnlySnapshot': false,
82
+ // 'isOnlyRealtime': false,
83
+ },
84
+ ];
85
+ return await this.watchMultiple(url, messageHashes, request, messageHashes);
86
+ }
59
87
  async watchTicker(symbol, params = {}) {
60
88
  /**
61
89
  * @method
@@ -68,6 +96,24 @@ class upbit extends upbit$1 {
68
96
  */
69
97
  return await this.watchPublic(symbol, 'ticker');
70
98
  }
99
+ async watchTickers(symbols = undefined, params = {}) {
100
+ /**
101
+ * @method
102
+ * @name upbit#watchTicker
103
+ * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
104
+ * @see https://global-docs.upbit.com/reference/websocket-ticker
105
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
106
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
107
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
108
+ */
109
+ const newTickers = await this.watchPublicMultiple(symbols, 'ticker');
110
+ if (this.newUpdates) {
111
+ const tickers = {};
112
+ tickers[newTickers['symbol']] = newTickers;
113
+ return tickers;
114
+ }
115
+ return this.filterByArray(this.tickers, 'symbol', symbols);
116
+ }
71
117
  async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
72
118
  /**
73
119
  * @method
@@ -45,6 +45,9 @@ class vertex extends vertex$1 {
45
45
  'fetchPositionsSnapshot': true,
46
46
  'awaitPositionsSnapshot': true, // whether to wait for the positions snapshot before providing updates
47
47
  },
48
+ 'ws': {
49
+ 'inflate': true,
50
+ },
48
51
  },
49
52
  'streaming': {
50
53
  // 'ping': this.ping,
@@ -73,6 +76,14 @@ class vertex extends vertex$1 {
73
76
  'id': requestId,
74
77
  };
75
78
  const request = this.extend(subscribe, message);
79
+ const wsOptions = {
80
+ 'headers': {
81
+ 'Sec-WebSocket-Extensions': 'permessage-deflate',
82
+ },
83
+ };
84
+ this.options['ws'] = {
85
+ 'options': wsOptions,
86
+ };
76
87
  return await this.watch(url, messageHash, request, messageHash, subscribe);
77
88
  }
78
89
  async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
@@ -2948,6 +2948,17 @@ class vertex extends vertex$1 {
2948
2948
  url += '?' + this.urlencode(params);
2949
2949
  }
2950
2950
  }
2951
+ if (path !== 'execute') {
2952
+ // required encoding for public methods
2953
+ if (headers !== undefined) {
2954
+ headers['Accept-Encoding'] = 'gzip';
2955
+ }
2956
+ else {
2957
+ headers = {
2958
+ 'Accept-Encoding': 'gzip',
2959
+ };
2960
+ }
2961
+ }
2951
2962
  return { 'url': url, 'method': method, 'body': body, 'headers': headers };
2952
2963
  }
2953
2964
  }
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, MarketMarginModes, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
7
- declare const version = "4.4.13";
7
+ declare const version = "4.4.14";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.4.14';
41
+ const version = '4.4.15';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
package/js/src/htx.js CHANGED
@@ -1233,7 +1233,7 @@ export default class htx extends Exchange {
1233
1233
  'SBTC': 'SUPERBITCOIN',
1234
1234
  'SOUL': 'SOULSAVER',
1235
1235
  'BIFI': 'BITCOINFILE',
1236
- 'FUD': 'FTX Users\' Debt',
1236
+ 'FUD': 'FTX Users Debt',
1237
1237
  },
1238
1238
  });
1239
1239
  }
@@ -119,8 +119,8 @@ export default class onetrading extends Exchange {
119
119
  'urls': {
120
120
  'logo': 'https://github.com/ccxt/ccxt/assets/43336371/bdbc26fd-02f2-4ca7-9f1e-17333690bb1c',
121
121
  'api': {
122
- 'public': 'https://api.onetrading.com/public',
123
- 'private': 'https://api.onetrading.com/public',
122
+ 'public': 'https://api.onetrading.com/fast',
123
+ 'private': 'https://api.onetrading.com/fast',
124
124
  },
125
125
  'www': 'https://onetrading.com/',
126
126
  'doc': [
@@ -249,7 +249,7 @@ export default class binance extends binanceRest {
249
249
  let type = undefined;
250
250
  [type, params] = this.handleMarketTypeAndParams('watchLiquidationsForSymbols', firstMarket, params);
251
251
  if (type === 'spot') {
252
- throw new BadRequest(this.id + 'watchLiquidationsForSymbols is not supported for swap symbols');
252
+ throw new BadRequest(this.id + 'watchLiquidationsForSymbols is not supported for spot symbols');
253
253
  }
254
254
  let subType = undefined;
255
255
  [subType, params] = this.handleSubTypeAndParams('watchLiquidationsForSymbols', firstMarket, params);
@@ -1,10 +1,12 @@
1
1
  import upbitRest from '../upbit.js';
2
- import type { Int, Str, Order, OrderBook, Trade, Ticker, Balances } from '../base/types.js';
2
+ import type { Int, Str, Order, OrderBook, Trade, Ticker, Balances, Tickers, Strings } from '../base/types.js';
3
3
  import Client from '../base/ws/Client.js';
4
4
  export default class upbit extends upbitRest {
5
5
  describe(): any;
6
6
  watchPublic(symbol: string, channel: any, params?: {}): Promise<any>;
7
+ watchPublicMultiple(symbols: Strings, channel: any, params?: {}): Promise<any>;
7
8
  watchTicker(symbol: string, params?: {}): Promise<Ticker>;
9
+ watchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
8
10
  watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
9
11
  watchTradesForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
10
12
  watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
@@ -17,6 +17,7 @@ export default class upbit extends upbitRest {
17
17
  'ws': true,
18
18
  'watchOrderBook': true,
19
19
  'watchTicker': true,
20
+ 'watchTickers': true,
20
21
  'watchTrades': true,
21
22
  'watchTradesForSymbols': true,
22
23
  'watchOrders': true,
@@ -59,6 +60,33 @@ export default class upbit extends upbitRest {
59
60
  const messageHash = channel + ':' + marketId;
60
61
  return await this.watch(url, messageHash, request, messageHash);
61
62
  }
63
+ async watchPublicMultiple(symbols, channel, params = {}) {
64
+ await this.loadMarkets();
65
+ if (symbols === undefined) {
66
+ symbols = this.symbols;
67
+ }
68
+ symbols = this.marketSymbols(symbols);
69
+ const marketIds = this.marketIds(symbols);
70
+ const url = this.implodeParams(this.urls['api']['ws'], {
71
+ 'hostname': this.hostname,
72
+ });
73
+ const messageHashes = [];
74
+ for (let i = 0; i < marketIds.length; i++) {
75
+ messageHashes.push(channel + ':' + marketIds[i]);
76
+ }
77
+ const request = [
78
+ {
79
+ 'ticket': this.uuid(),
80
+ },
81
+ {
82
+ 'type': channel,
83
+ 'codes': marketIds,
84
+ // 'isOnlySnapshot': false,
85
+ // 'isOnlyRealtime': false,
86
+ },
87
+ ];
88
+ return await this.watchMultiple(url, messageHashes, request, messageHashes);
89
+ }
62
90
  async watchTicker(symbol, params = {}) {
63
91
  /**
64
92
  * @method
@@ -71,6 +99,24 @@ export default class upbit extends upbitRest {
71
99
  */
72
100
  return await this.watchPublic(symbol, 'ticker');
73
101
  }
102
+ async watchTickers(symbols = undefined, params = {}) {
103
+ /**
104
+ * @method
105
+ * @name upbit#watchTicker
106
+ * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
107
+ * @see https://global-docs.upbit.com/reference/websocket-ticker
108
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
109
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
110
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
111
+ */
112
+ const newTickers = await this.watchPublicMultiple(symbols, 'ticker');
113
+ if (this.newUpdates) {
114
+ const tickers = {};
115
+ tickers[newTickers['symbol']] = newTickers;
116
+ return tickers;
117
+ }
118
+ return this.filterByArray(this.tickers, 'symbol', symbols);
119
+ }
74
120
  async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
75
121
  /**
76
122
  * @method
@@ -48,6 +48,9 @@ export default class vertex extends vertexRest {
48
48
  'fetchPositionsSnapshot': true,
49
49
  'awaitPositionsSnapshot': true, // whether to wait for the positions snapshot before providing updates
50
50
  },
51
+ 'ws': {
52
+ 'inflate': true,
53
+ },
51
54
  },
52
55
  'streaming': {
53
56
  // 'ping': this.ping,
@@ -76,6 +79,14 @@ export default class vertex extends vertexRest {
76
79
  'id': requestId,
77
80
  };
78
81
  const request = this.extend(subscribe, message);
82
+ const wsOptions = {
83
+ 'headers': {
84
+ 'Sec-WebSocket-Extensions': 'permessage-deflate',
85
+ },
86
+ };
87
+ this.options['ws'] = {
88
+ 'options': wsOptions,
89
+ };
79
90
  return await this.watch(url, messageHash, request, messageHash, subscribe);
80
91
  }
81
92
  async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
@@ -15,7 +15,7 @@ export declare class BigInteger {
15
15
  protected intValue(): number;
16
16
  protected byteValue(): number;
17
17
  protected shortValue(): number;
18
- protected signum(): 0 | 1 | -1;
18
+ protected signum(): 1 | 0 | -1;
19
19
  toByteArray(): number[];
20
20
  protected equals(a: BigInteger): boolean;
21
21
  protected min(a: BigInteger): BigInteger;
@@ -1,5 +1,5 @@
1
1
  import { Abi, FunctionAbi, RawArgs } from '../../../types/index.js';
2
2
  import { AbiParserInterface } from './interface.js';
3
3
  export declare function createAbiParser(abi: Abi): AbiParserInterface;
4
- export declare function getAbiVersion(abi: Abi): 0 | 1 | 2;
4
+ export declare function getAbiVersion(abi: Abi): 1 | 0 | 2;
5
5
  export declare function isNoConstructorValid(method: string, argsCalldata: RawArgs, abiMethod?: FunctionAbi): boolean;
package/js/src/vertex.js CHANGED
@@ -2951,6 +2951,17 @@ export default class vertex extends Exchange {
2951
2951
  url += '?' + this.urlencode(params);
2952
2952
  }
2953
2953
  }
2954
+ if (path !== 'execute') {
2955
+ // required encoding for public methods
2956
+ if (headers !== undefined) {
2957
+ headers['Accept-Encoding'] = 'gzip';
2958
+ }
2959
+ else {
2960
+ headers = {
2961
+ 'Accept-Encoding': 'gzip',
2962
+ };
2963
+ }
2964
+ }
2954
2965
  return { 'url': url, 'method': method, 'body': body, 'headers': headers };
2955
2966
  }
2956
2967
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.4.14",
3
+ "version": "4.4.15",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.min.js",
6
6
  "type": "module",