ccxt 4.0.91 → 4.0.94

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/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 { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending } from './src/base/errors.js';
7
- declare const version = "4.0.90";
7
+ declare const version = "4.0.93";
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, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.0.91';
41
+ const version = '4.0.94';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -90,6 +90,7 @@ interface Exchange {
90
90
  privatePortfolioGetInterestRecords(params?: {}): Promise<implicitReturnType>;
91
91
  privatePortfolioGetSpotOrders(params?: {}): Promise<implicitReturnType>;
92
92
  privatePortfolioGetSpotOrdersOrderId(params?: {}): Promise<implicitReturnType>;
93
+ privatePortfolioPostAccountMode(params?: {}): Promise<implicitReturnType>;
93
94
  privatePortfolioPostLoans(params?: {}): Promise<implicitReturnType>;
94
95
  privatePortfolioPostSpotOrders(params?: {}): Promise<implicitReturnType>;
95
96
  privatePortfolioDeleteSpotOrdersOrderId(params?: {}): Promise<implicitReturnType>;
@@ -90,6 +90,7 @@ interface gate {
90
90
  privatePortfolioGetInterestRecords(params?: {}): Promise<implicitReturnType>;
91
91
  privatePortfolioGetSpotOrders(params?: {}): Promise<implicitReturnType>;
92
92
  privatePortfolioGetSpotOrdersOrderId(params?: {}): Promise<implicitReturnType>;
93
+ privatePortfolioPostAccountMode(params?: {}): Promise<implicitReturnType>;
93
94
  privatePortfolioPostLoans(params?: {}): Promise<implicitReturnType>;
94
95
  privatePortfolioPostSpotOrders(params?: {}): Promise<implicitReturnType>;
95
96
  privatePortfolioDeleteSpotOrdersOrderId(params?: {}): Promise<implicitReturnType>;
package/js/src/bigone.js CHANGED
@@ -137,6 +137,7 @@ export default class bigone extends Exchange {
137
137
  'options': {
138
138
  'accountsByType': {
139
139
  'spot': 'SPOT',
140
+ 'fund': 'FUND',
140
141
  'funding': 'FUND',
141
142
  'future': 'CONTRACT',
142
143
  'swap': 'CONTRACT',
@@ -1596,7 +1597,7 @@ export default class bigone extends Exchange {
1596
1597
  const txid = this.safeString(transaction, 'txid');
1597
1598
  const address = this.safeString(transaction, 'target_address');
1598
1599
  const tag = this.safeString(transaction, 'memo');
1599
- const type = ('customer_id' in transaction) ? 'deposit' : 'withdrawal';
1600
+ const type = ('customer_id' in transaction) ? 'withdrawal' : 'deposit';
1600
1601
  return {
1601
1602
  'info': transaction,
1602
1603
  'id': id,
@@ -1725,10 +1726,11 @@ export default class bigone extends Exchange {
1725
1726
  * @method
1726
1727
  * @name bigone#transfer
1727
1728
  * @description transfer currency internally between wallets on the same account
1729
+ * @see https://open.big.one/docs/spot_transfer.html#transfer-of-user
1728
1730
  * @param {string} code unified currency code
1729
1731
  * @param {float} amount amount to transfer
1730
- * @param {string} fromAccount account to transfer from
1731
- * @param {string} toAccount account to transfer to
1732
+ * @param {string} fromAccount 'SPOT', 'FUND', or 'CONTRACT'
1733
+ * @param {string} toAccount 'SPOT', 'FUND', or 'CONTRACT'
1732
1734
  * @param {object} [params] extra parameters specific to the bigone api endpoint
1733
1735
  * @returns {object} a [transfer structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
1734
1736
  */
package/js/src/binance.js CHANGED
@@ -7758,7 +7758,7 @@ export default class binance extends Exchange {
7758
7758
  * @param {int} [since] timestamp in ms
7759
7759
  * @param {int} [limit] number of records, default 100, max 100
7760
7760
  * @param {object} [params] exchange specific params
7761
- * @returns {object[]} a list of [settlement history objects]
7761
+ * @returns {object[]} a list of [settlement history objects]{@link https://github.com/ccxt/ccxt/wiki/Manual#settlement-history-structure}
7762
7762
  */
7763
7763
  await this.loadMarkets();
7764
7764
  const market = (symbol === undefined) ? undefined : this.market(symbol);
package/js/src/bitopro.js CHANGED
@@ -114,42 +114,42 @@ export default class bitopro extends Exchange {
114
114
  },
115
115
  'api': {
116
116
  'public': {
117
- 'get': [
118
- 'order-book/{pair}',
119
- 'tickers',
120
- 'tickers/{pair}',
121
- 'trades/{pair}',
122
- 'provisioning/currencies',
123
- 'provisioning/trading-pairs',
124
- 'provisioning/limitations-and-fees',
125
- 'trading-history/{pair}',
126
- ],
117
+ 'get': {
118
+ 'order-book/{pair}': 1,
119
+ 'tickers': 1,
120
+ 'tickers/{pair}': 1,
121
+ 'trades/{pair}': 1,
122
+ 'provisioning/currencies': 1,
123
+ 'provisioning/trading-pairs': 1,
124
+ 'provisioning/limitations-and-fees': 1,
125
+ 'trading-history/{pair}': 1,
126
+ },
127
127
  },
128
128
  'private': {
129
- 'get': [
130
- 'accounts/balance',
131
- 'orders/history',
132
- 'orders/all/{pair}',
133
- 'orders/trades/{pair}',
134
- 'orders/{pair}/{orderId}',
135
- 'wallet/withdraw/{currency}/{serial}',
136
- 'wallet/withdraw/{currency}/id/{id}',
137
- 'wallet/depositHistory/{currency}',
138
- 'wallet/withdrawHistory/{currency}',
139
- ],
140
- 'post': [
141
- 'orders/{pair}',
142
- 'orders/batch',
143
- 'wallet/withdraw/{currency}',
144
- ],
145
- 'put': [
146
- 'orders',
147
- ],
148
- 'delete': [
149
- 'orders/{pair}/{id}',
150
- 'orders/all',
151
- 'orders/{pair}',
152
- ],
129
+ 'get': {
130
+ 'accounts/balance': 1,
131
+ 'orders/history': 1,
132
+ 'orders/all/{pair}': 1,
133
+ 'orders/trades/{pair}': 1,
134
+ 'orders/{pair}/{orderId}': 1,
135
+ 'wallet/withdraw/{currency}/{serial}': 1,
136
+ 'wallet/withdraw/{currency}/id/{id}': 1,
137
+ 'wallet/depositHistory/{currency}': 1,
138
+ 'wallet/withdrawHistory/{currency}': 1,
139
+ },
140
+ 'post': {
141
+ 'orders/{pair}': 1 / 2,
142
+ 'orders/batch': 20 / 3,
143
+ 'wallet/withdraw/{currency}': 10, // 60/m => 1/s => 10/1 = 10
144
+ },
145
+ 'put': {
146
+ 'orders': 5, // 2/s => 10/2 = 5
147
+ },
148
+ 'delete': {
149
+ 'orders/{pair}/{id}': 2 / 3,
150
+ 'orders/all': 5,
151
+ 'orders/{pair}': 5, // 2/s => 10/2 = 5
152
+ },
153
153
  },
154
154
  },
155
155
  'fees': {
package/js/src/bybit.js CHANGED
@@ -8967,7 +8967,7 @@ export default class bybit extends Exchange {
8967
8967
  * @param {int} [since] timestamp in ms
8968
8968
  * @param {int} [limit] number of records
8969
8969
  * @param {object} [params] exchange specific params
8970
- * @returns {object[]} a list of [settlement history objects]
8970
+ * @returns {object[]} a list of [settlement history objects]{@link https://github.com/ccxt/ccxt/wiki/Manual#settlement-history-structure}
8971
8971
  */
8972
8972
  await this.loadMarkets();
8973
8973
  const request = {};
@@ -2678,7 +2678,7 @@ export default class cryptocom extends Exchange {
2678
2678
  * @param {int} [limit] number of records
2679
2679
  * @param {object} [params] exchange specific params
2680
2680
  * @param {int} [params.type] 'future', 'option'
2681
- * @returns {object[]} a list of [settlement history objects]
2681
+ * @returns {object[]} a list of [settlement history objects]{@link https://github.com/ccxt/ccxt/wiki/Manual#settlement-history-structure}
2682
2682
  */
2683
2683
  await this.loadMarkets();
2684
2684
  let market = undefined;
package/js/src/delta.js CHANGED
@@ -2874,7 +2874,7 @@ export default class delta extends Exchange {
2874
2874
  * @param {int} [since] timestamp in ms
2875
2875
  * @param {int} [limit] number of records
2876
2876
  * @param {object} [params] exchange specific params
2877
- * @returns {object[]} a list of [settlement history objects]
2877
+ * @returns {object[]} a list of [settlement history objects]{@link https://github.com/ccxt/ccxt/wiki/Manual#settlement-history-structure}
2878
2878
  */
2879
2879
  await this.loadMarkets();
2880
2880
  let market = undefined;
package/js/src/gate.js CHANGED
@@ -296,6 +296,7 @@ export default class gate extends Exchange {
296
296
  'spot/orders/{order_id}': 1.5,
297
297
  },
298
298
  'post': {
299
+ 'account_mode': 1.5,
299
300
  'loans': 1.5,
300
301
  'spot/orders': 1.5,
301
302
  },
@@ -5806,7 +5807,7 @@ export default class gate extends Exchange {
5806
5807
  * @param {int} [since] timestamp in ms
5807
5808
  * @param {int} [limit] number of records
5808
5809
  * @param {object} [params] exchange specific params
5809
- * @returns {object[]} a list of [settlement history objects]
5810
+ * @returns {object[]} a list of [settlement history objects]{@link https://github.com/ccxt/ccxt/wiki/Manual#settlement-history-structure}
5810
5811
  */
5811
5812
  this.checkRequiredSymbol('fetchSettlementHistory', symbol);
5812
5813
  await this.loadMarkets();
package/js/src/hollaex.js CHANGED
@@ -40,6 +40,7 @@ export default class hollaex extends Exchange {
40
40
  'createMarketBuyOrder': true,
41
41
  'createMarketSellOrder': true,
42
42
  'createOrder': true,
43
+ 'createPostOnlyOrder': true,
43
44
  'createReduceOnlyOrder': false,
44
45
  'createStopLimitOrder': true,
45
46
  'createStopMarketOrder': true,
@@ -1128,6 +1129,8 @@ export default class hollaex extends Exchange {
1128
1129
  * @param {float} amount how much of currency you want to trade in units of base currency
1129
1130
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1130
1131
  * @param {object} [params] extra parameters specific to the hollaex api endpoint
1132
+ * @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
1133
+ * @param {bool} [params.postOnly] if true, the order will only be posted to the order book and not executed immediately
1131
1134
  * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1132
1135
  */
1133
1136
  await this.loadMarkets();
package/js/src/huobi.js CHANGED
@@ -4808,10 +4808,10 @@ export default class huobi extends Exchange {
4808
4808
  }
4809
4809
  }
4810
4810
  else {
4811
- const clientOrderId = this.safeString2(params, 'client_order_id', 'clientOrderId');
4811
+ const clientOrderId = this.safeInteger2(params, 'client_order_id', 'clientOrderId');
4812
4812
  if (clientOrderId !== undefined) {
4813
4813
  request['client_order_id'] = clientOrderId;
4814
- params = this.omit(params, ['client_order_id', 'clientOrderId']);
4814
+ params = this.omit(params, ['clientOrderId']);
4815
4815
  }
4816
4816
  if (type === 'limit' || type === 'ioc' || type === 'fok' || type === 'post_only') {
4817
4817
  request['price'] = this.priceToPrecision(symbol, price);
@@ -7859,7 +7859,7 @@ export default class huobi extends Exchange {
7859
7859
  * @param {int} [params.until] timestamp in ms, value range = start_time -> current time,default = current time
7860
7860
  * @param {int} [params.page_index] page index, default page 1 if not filled
7861
7861
  * @param {int} [params.code] unified currency code, can be used when symbol is undefined
7862
- * @returns A list of settlement history objects
7862
+ * @returns {object[]} a list of [settlement history objects]{@link https://github.com/ccxt/ccxt/wiki/Manual#settlement-history-structure}
7863
7863
  */
7864
7864
  const code = this.safeString(params, 'code');
7865
7865
  const until = this.safeInteger2(params, 'until', 'till');
package/js/src/okx.js CHANGED
@@ -2580,7 +2580,7 @@ export default class okx extends Exchange {
2580
2580
  else {
2581
2581
  request['slOrdPx'] = '-1'; // market sl order
2582
2582
  }
2583
- const stopLossTriggerPriceType = this.safeString2(stopLoss, 'triggerPriceType', 'slTriggerPxType');
2583
+ const stopLossTriggerPriceType = this.safeString2(stopLoss, 'triggerPriceType', 'slTriggerPxType', 'last');
2584
2584
  if (stopLossTriggerPriceType !== undefined) {
2585
2585
  if ((stopLossTriggerPriceType !== 'last') && (stopLossTriggerPriceType !== 'index') && (stopLossTriggerPriceType !== 'mark')) {
2586
2586
  throw new InvalidOrder(this.id + ' createOrder() stop loss trigger price type must be one of "last", "index" or "mark"');
@@ -2620,7 +2620,7 @@ export default class okx extends Exchange {
2620
2620
  else {
2621
2621
  request['tpOrdPx'] = '-1'; // market tp order
2622
2622
  }
2623
- const takeProfitTriggerPriceType = this.safeString2(stopLoss, 'triggerPriceType', 'tpTriggerPxType');
2623
+ const takeProfitTriggerPriceType = this.safeString2(takeProfit, 'triggerPriceType', 'tpTriggerPxType', 'last');
2624
2624
  if (takeProfitTriggerPriceType !== undefined) {
2625
2625
  if ((takeProfitTriggerPriceType !== 'last') && (takeProfitTriggerPriceType !== 'index') && (takeProfitTriggerPriceType !== 'mark')) {
2626
2626
  throw new InvalidOrder(this.id + ' createOrder() take profit trigger price type must be one of "last", "index" or "mark"');
@@ -6615,7 +6615,7 @@ export default class okx extends Exchange {
6615
6615
  * @param {int} [since] timestamp in ms
6616
6616
  * @param {int} [limit] number of records
6617
6617
  * @param {object} [params] exchange specific params
6618
- * @returns {object[]} a list of [settlement history objects]
6618
+ * @returns {object[]} a list of [settlement history objects]{@link https://github.com/ccxt/ccxt/wiki/Manual#settlement-history-structure}
6619
6619
  */
6620
6620
  this.checkRequiredSymbol('fetchSettlementHistory', symbol);
6621
6621
  await this.loadMarkets();
@@ -245,8 +245,8 @@ export default class binance extends binanceRest {
245
245
  for (let i = 0; i < symbols.length; i++) {
246
246
  const symbol = symbols[i];
247
247
  const market = this.market(symbol);
248
- const messageHash = market['lowercaseId'] + '@' + name + '@' + watchOrderBookRate + 'ms';
249
- subParams.push(messageHash);
248
+ const symbolHash = market['lowercaseId'] + '@' + name + '@' + watchOrderBookRate + 'ms';
249
+ subParams.push(symbolHash);
250
250
  }
251
251
  const request = {
252
252
  'method': 'SUBSCRIBE',
@@ -460,7 +460,7 @@ export default class binance extends binanceRest {
460
460
  delete this.orderbooks[symbol];
461
461
  }
462
462
  this.orderbooks[symbol] = this.orderBook({}, limit);
463
- subscription['symbol'] = symbol;
463
+ subscription = this.extend(subscription, { 'symbol': symbol });
464
464
  // fetch the snapshot in a separate async call
465
465
  this.spawn(this.fetchOrderBookSnapshot, client, message, subscription);
466
466
  }
@@ -1,20 +1,35 @@
1
1
  import hitbtcRest from '../hitbtc.js';
2
2
  import { Int } from '../base/types.js';
3
3
  import Client from '../base/ws/Client.js';
4
+ import { Trade } from '../base/types';
4
5
  export default class hitbtc extends hitbtcRest {
5
6
  describe(): any;
6
- watchPublic(symbol: string, channel: any, timeframe?: any, params?: {}): Promise<any>;
7
+ authenticate(): Promise<any>;
8
+ subscribePublic(name: string, symbols?: string[], params?: {}): Promise<any>;
9
+ subscribePrivate(name: string, symbol?: string, params?: {}): Promise<any>;
7
10
  watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<any>;
8
- handleOrderBookSnapshot(client: Client, message: any): void;
9
- handleOrderBookUpdate(client: Client, message: any): void;
11
+ handleOrderBook(client: Client, message: any): void;
10
12
  handleDelta(bookside: any, delta: any): void;
11
13
  handleDeltas(bookside: any, deltas: any): void;
12
14
  watchTicker(symbol: string, params?: {}): Promise<any>;
13
- handleTicker(client: Client, message: any): void;
15
+ watchTickers(symbols?: any, params?: {}): Promise<any>;
16
+ handleTicker(client: Client, message: any): any;
17
+ parseWsTicker(ticker: any, market?: any): import("../base/types.js").Ticker;
14
18
  watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<any>;
15
19
  handleTrades(client: Client, message: any): any;
20
+ parseWsTrades(trades: any, market?: object, since?: Int, limit?: Int, params?: {}): Trade[];
21
+ parseWsTrade(trade: any, market?: any): Trade;
16
22
  watchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<any>;
17
23
  handleOHLCV(client: Client, message: any): any;
24
+ parseWsOHLCV(ohlcv: any, market?: any): number[];
25
+ watchOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<any>;
26
+ handleOrder(client: Client, message: any): any;
27
+ handleOrderHelper(client: Client, message: any, order: any): void;
28
+ parseWsOrderTrade(trade: any, market?: any): Trade;
29
+ parseWsOrder(order: any, market?: any): import("../base/types.js").Order;
30
+ watchBalance(params?: {}): Promise<any>;
31
+ handleBalance(client: Client, message: any): void;
18
32
  handleNotification(client: Client, message: any): any;
19
33
  handleMessage(client: Client, message: any): void;
34
+ handleAuthenticate(client: Client, message: any): any;
20
35
  }