ccxt 4.0.93 → 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/dist/cjs/ccxt.js CHANGED
@@ -180,7 +180,7 @@ var woo$1 = require('./src/pro/woo.js');
180
180
 
181
181
  //-----------------------------------------------------------------------------
182
182
  // this is updated by vss.js when building
183
- const version = '4.0.93';
183
+ const version = '4.0.94';
184
184
  Exchange["default"].ccxtVersion = version;
185
185
  const exchanges = {
186
186
  'ace': ace,
@@ -134,6 +134,7 @@ class bigone extends bigone$1 {
134
134
  'options': {
135
135
  'accountsByType': {
136
136
  'spot': 'SPOT',
137
+ 'fund': 'FUND',
137
138
  'funding': 'FUND',
138
139
  'future': 'CONTRACT',
139
140
  'swap': 'CONTRACT',
@@ -1593,7 +1594,7 @@ class bigone extends bigone$1 {
1593
1594
  const txid = this.safeString(transaction, 'txid');
1594
1595
  const address = this.safeString(transaction, 'target_address');
1595
1596
  const tag = this.safeString(transaction, 'memo');
1596
- const type = ('customer_id' in transaction) ? 'deposit' : 'withdrawal';
1597
+ const type = ('customer_id' in transaction) ? 'withdrawal' : 'deposit';
1597
1598
  return {
1598
1599
  'info': transaction,
1599
1600
  'id': id,
@@ -1722,10 +1723,11 @@ class bigone extends bigone$1 {
1722
1723
  * @method
1723
1724
  * @name bigone#transfer
1724
1725
  * @description transfer currency internally between wallets on the same account
1726
+ * @see https://open.big.one/docs/spot_transfer.html#transfer-of-user
1725
1727
  * @param {string} code unified currency code
1726
1728
  * @param {float} amount amount to transfer
1727
- * @param {string} fromAccount account to transfer from
1728
- * @param {string} toAccount account to transfer to
1729
+ * @param {string} fromAccount 'SPOT', 'FUND', or 'CONTRACT'
1730
+ * @param {string} toAccount 'SPOT', 'FUND', or 'CONTRACT'
1729
1731
  * @param {object} [params] extra parameters specific to the bigone api endpoint
1730
1732
  * @returns {object} a [transfer structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
1731
1733
  */
@@ -111,42 +111,42 @@ class bitopro extends bitopro$1 {
111
111
  },
112
112
  'api': {
113
113
  'public': {
114
- 'get': [
115
- 'order-book/{pair}',
116
- 'tickers',
117
- 'tickers/{pair}',
118
- 'trades/{pair}',
119
- 'provisioning/currencies',
120
- 'provisioning/trading-pairs',
121
- 'provisioning/limitations-and-fees',
122
- 'trading-history/{pair}',
123
- ],
114
+ 'get': {
115
+ 'order-book/{pair}': 1,
116
+ 'tickers': 1,
117
+ 'tickers/{pair}': 1,
118
+ 'trades/{pair}': 1,
119
+ 'provisioning/currencies': 1,
120
+ 'provisioning/trading-pairs': 1,
121
+ 'provisioning/limitations-and-fees': 1,
122
+ 'trading-history/{pair}': 1,
123
+ },
124
124
  },
125
125
  'private': {
126
- 'get': [
127
- 'accounts/balance',
128
- 'orders/history',
129
- 'orders/all/{pair}',
130
- 'orders/trades/{pair}',
131
- 'orders/{pair}/{orderId}',
132
- 'wallet/withdraw/{currency}/{serial}',
133
- 'wallet/withdraw/{currency}/id/{id}',
134
- 'wallet/depositHistory/{currency}',
135
- 'wallet/withdrawHistory/{currency}',
136
- ],
137
- 'post': [
138
- 'orders/{pair}',
139
- 'orders/batch',
140
- 'wallet/withdraw/{currency}',
141
- ],
142
- 'put': [
143
- 'orders',
144
- ],
145
- 'delete': [
146
- 'orders/{pair}/{id}',
147
- 'orders/all',
148
- 'orders/{pair}',
149
- ],
126
+ 'get': {
127
+ 'accounts/balance': 1,
128
+ 'orders/history': 1,
129
+ 'orders/all/{pair}': 1,
130
+ 'orders/trades/{pair}': 1,
131
+ 'orders/{pair}/{orderId}': 1,
132
+ 'wallet/withdraw/{currency}/{serial}': 1,
133
+ 'wallet/withdraw/{currency}/id/{id}': 1,
134
+ 'wallet/depositHistory/{currency}': 1,
135
+ 'wallet/withdrawHistory/{currency}': 1,
136
+ },
137
+ 'post': {
138
+ 'orders/{pair}': 1 / 2,
139
+ 'orders/batch': 20 / 3,
140
+ 'wallet/withdraw/{currency}': 10, // 60/m => 1/s => 10/1 = 10
141
+ },
142
+ 'put': {
143
+ 'orders': 5, // 2/s => 10/2 = 5
144
+ },
145
+ 'delete': {
146
+ 'orders/{pair}/{id}': 2 / 3,
147
+ 'orders/all': 5,
148
+ 'orders/{pair}': 5, // 2/s => 10/2 = 5
149
+ },
150
150
  },
151
151
  },
152
152
  'fees': {
@@ -37,6 +37,7 @@ class hollaex extends hollaex$1 {
37
37
  'createMarketBuyOrder': true,
38
38
  'createMarketSellOrder': true,
39
39
  'createOrder': true,
40
+ 'createPostOnlyOrder': true,
40
41
  'createReduceOnlyOrder': false,
41
42
  'createStopLimitOrder': true,
42
43
  'createStopMarketOrder': true,
@@ -1125,6 +1126,8 @@ class hollaex extends hollaex$1 {
1125
1126
  * @param {float} amount how much of currency you want to trade in units of base currency
1126
1127
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1127
1128
  * @param {object} [params] extra parameters specific to the hollaex api endpoint
1129
+ * @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
1130
+ * @param {bool} [params.postOnly] if true, the order will only be posted to the order book and not executed immediately
1128
1131
  * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1129
1132
  */
1130
1133
  await this.loadMarkets();
@@ -4805,10 +4805,10 @@ class huobi extends huobi$1 {
4805
4805
  }
4806
4806
  }
4807
4807
  else {
4808
- const clientOrderId = this.safeString2(params, 'client_order_id', 'clientOrderId');
4808
+ const clientOrderId = this.safeInteger2(params, 'client_order_id', 'clientOrderId');
4809
4809
  if (clientOrderId !== undefined) {
4810
4810
  request['client_order_id'] = clientOrderId;
4811
- params = this.omit(params, ['client_order_id', 'clientOrderId']);
4811
+ params = this.omit(params, ['clientOrderId']);
4812
4812
  }
4813
4813
  if (type === 'limit' || type === 'ioc' || type === 'fok' || type === 'post_only') {
4814
4814
  request['price'] = this.priceToPrecision(symbol, price);
@@ -2577,7 +2577,7 @@ class okx extends okx$1 {
2577
2577
  else {
2578
2578
  request['slOrdPx'] = '-1'; // market sl order
2579
2579
  }
2580
- const stopLossTriggerPriceType = this.safeString2(stopLoss, 'triggerPriceType', 'slTriggerPxType');
2580
+ const stopLossTriggerPriceType = this.safeString2(stopLoss, 'triggerPriceType', 'slTriggerPxType', 'last');
2581
2581
  if (stopLossTriggerPriceType !== undefined) {
2582
2582
  if ((stopLossTriggerPriceType !== 'last') && (stopLossTriggerPriceType !== 'index') && (stopLossTriggerPriceType !== 'mark')) {
2583
2583
  throw new errors.InvalidOrder(this.id + ' createOrder() stop loss trigger price type must be one of "last", "index" or "mark"');
@@ -2617,7 +2617,7 @@ class okx extends okx$1 {
2617
2617
  else {
2618
2618
  request['tpOrdPx'] = '-1'; // market tp order
2619
2619
  }
2620
- const takeProfitTriggerPriceType = this.safeString2(stopLoss, 'triggerPriceType', 'tpTriggerPxType');
2620
+ const takeProfitTriggerPriceType = this.safeString2(takeProfit, 'triggerPriceType', 'tpTriggerPxType', 'last');
2621
2621
  if (takeProfitTriggerPriceType !== undefined) {
2622
2622
  if ((takeProfitTriggerPriceType !== 'last') && (takeProfitTriggerPriceType !== 'index') && (takeProfitTriggerPriceType !== 'mark')) {
2623
2623
  throw new errors.InvalidOrder(this.id + ' createOrder() take profit trigger price type must be one of "last", "index" or "mark"');
@@ -242,8 +242,8 @@ class binance extends binance$1 {
242
242
  for (let i = 0; i < symbols.length; i++) {
243
243
  const symbol = symbols[i];
244
244
  const market = this.market(symbol);
245
- const messageHash = market['lowercaseId'] + '@' + name + '@' + watchOrderBookRate + 'ms';
246
- subParams.push(messageHash);
245
+ const symbolHash = market['lowercaseId'] + '@' + name + '@' + watchOrderBookRate + 'ms';
246
+ subParams.push(symbolHash);
247
247
  }
248
248
  const request = {
249
249
  'method': 'SUBSCRIBE',
@@ -457,7 +457,7 @@ class binance extends binance$1 {
457
457
  delete this.orderbooks[symbol];
458
458
  }
459
459
  this.orderbooks[symbol] = this.orderBook({}, limit);
460
- subscription['symbol'] = symbol;
460
+ subscription = this.extend(subscription, { 'symbol': symbol });
461
461
  // fetch the snapshot in a separate async call
462
462
  this.spawn(this.fetchOrderBookSnapshot, client, message, subscription);
463
463
  }
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.92";
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.93';
41
+ const version = '4.0.94';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
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/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/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);
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"');
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.0.93",
3
+ "version": "4.0.94",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 130+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.js",
6
6
  "type": "module",