ccxt 4.3.83 → 4.3.84

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.3.83';
197
+ const version = '4.3.84';
198
198
  Exchange["default"].ccxtVersion = version;
199
199
  const exchanges = {
200
200
  'ace': ace,
@@ -11406,7 +11406,7 @@ class binance extends binance$1 {
11406
11406
  if ((api === 'sapi') && (path === 'asset/dust')) {
11407
11407
  query = this.urlencodeWithArrayRepeat(extendedParams);
11408
11408
  }
11409
- else if ((path === 'batchOrders') || (path.indexOf('sub-account') >= 0) || (path === 'capital/withdraw/apply') || (path.indexOf('staking') >= 0)) {
11409
+ else if ((path === 'batchOrders') || (path.indexOf('sub-account') >= 0) || (path === 'capital/withdraw/apply') || (path.indexOf('staking') >= 0) || (path.indexOf('simple-earn') >= 0)) {
11410
11410
  if ((method === 'DELETE') && (path === 'batchOrders')) {
11411
11411
  const orderidlist = this.safeList(extendedParams, 'orderidlist', []);
11412
11412
  const origclientorderidlist = this.safeList(extendedParams, 'origclientorderidlist', []);
@@ -335,9 +335,9 @@ class bitfinex2 extends bitfinex2$1 {
335
335
  // convert 'EXCHANGE LIMIT' to lowercase 'limit'
336
336
  // everything else remains uppercase
337
337
  'exchangeTypes': {
338
- // 'MARKET': undefined,
338
+ 'MARKET': 'market',
339
339
  'EXCHANGE MARKET': 'market',
340
- // 'LIMIT': undefined,
340
+ 'LIMIT': 'limit',
341
341
  'EXCHANGE LIMIT': 'limit',
342
342
  // 'STOP': undefined,
343
343
  'EXCHANGE STOP': 'market',
@@ -2525,14 +2525,12 @@ class kraken extends kraken$1 {
2525
2525
  * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
2526
2526
  */
2527
2527
  // https://www.kraken.com/en-us/help/api#deposit-status
2528
- if (code === undefined) {
2529
- throw new errors.ArgumentsRequired(this.id + ' fetchDeposits() requires a currency code argument');
2530
- }
2531
2528
  await this.loadMarkets();
2532
- const currency = this.currency(code);
2533
- const request = {
2534
- 'asset': currency['id'],
2535
- };
2529
+ const request = {};
2530
+ if (code !== undefined) {
2531
+ const currency = this.currency(code);
2532
+ request['asset'] = currency['id'];
2533
+ }
2536
2534
  if (since !== undefined) {
2537
2535
  request['start'] = since;
2538
2536
  }
@@ -1217,6 +1217,9 @@ class binance extends binance$1 {
1217
1217
  * @param {object} [params.timezone] if provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00'
1218
1218
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
1219
1219
  */
1220
+ await this.loadMarkets();
1221
+ const market = this.market(symbol);
1222
+ symbol = market['symbol'];
1220
1223
  params['callerMethodName'] = 'watchOHLCV';
1221
1224
  const result = await this.watchOHLCVForSymbols([[symbol, timeframe]], since, limit, params);
1222
1225
  return result[symbol][timeframe];
@@ -1267,7 +1270,7 @@ class binance extends binance$1 {
1267
1270
  const suffix = '@+08:00';
1268
1271
  const utcSuffix = shouldUseUTC8 ? suffix : '';
1269
1272
  rawHashes.push(marketId + '@' + klineType + '_' + interval + utcSuffix);
1270
- messageHashes.push('ohlcv::' + symbolString + '::' + timeframeString);
1273
+ messageHashes.push('ohlcv::' + market['symbol'] + '::' + timeframeString);
1271
1274
  }
1272
1275
  const url = this.urls['api']['ws'][type] + '/' + this.stream(type, 'multipleOHLCV');
1273
1276
  const requestId = this.requestId(url);
@@ -1543,6 +1546,8 @@ class binance extends binance$1 {
1543
1546
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1544
1547
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1545
1548
  */
1549
+ await this.loadMarkets();
1550
+ symbols = this.marketSymbols(symbols, undefined, true, false, true);
1546
1551
  const result = await this.watchMultiTickerHelper('watchBidsAsks', 'bookTicker', symbols, params);
1547
1552
  if (this.newUpdates) {
1548
1553
  return result;
@@ -411,15 +411,7 @@ class bitrue extends bitrue$1 {
411
411
  async authenticate(params = {}) {
412
412
  const listenKey = this.safeValue(this.options, 'listenKey');
413
413
  if (listenKey === undefined) {
414
- let response = undefined;
415
- try {
416
- response = await this.openPrivatePostPoseidonApiV1ListenKey(params);
417
- }
418
- catch (error) {
419
- this.options['listenKey'] = undefined;
420
- this.options['listenKeyUrl'] = undefined;
421
- return undefined;
422
- }
414
+ const response = await this.openPrivatePostPoseidonApiV1ListenKey(params);
423
415
  //
424
416
  // {
425
417
  // "msg": "succ",
@@ -1514,7 +1514,7 @@ class gate extends gate$1 {
1514
1514
  const errs = this.safeDict(data, 'errs');
1515
1515
  const error = this.safeDict(message, 'error', errs);
1516
1516
  const code = this.safeString2(error, 'code', 'label');
1517
- const id = this.safeString2(message, 'id', 'requestId');
1517
+ const id = this.safeStringN(message, ['id', 'requestId', 'request_id']);
1518
1518
  if (error !== undefined) {
1519
1519
  const messageHash = this.safeString(client.subscriptions, id);
1520
1520
  try {
@@ -1530,7 +1530,7 @@ class gate extends gate$1 {
1530
1530
  delete client.subscriptions[messageHash];
1531
1531
  }
1532
1532
  }
1533
- if (id !== undefined) {
1533
+ if ((id !== undefined) && (id in client.subscriptions)) {
1534
1534
  delete client.subscriptions[id];
1535
1535
  }
1536
1536
  return true;
@@ -1818,7 +1818,7 @@ class gate extends gate$1 {
1818
1818
  'event': event,
1819
1819
  'payload': payload,
1820
1820
  };
1821
- return await this.watch(url, messageHash, request, messageHash);
1821
+ return await this.watch(url, messageHash, request, messageHash, requestId);
1822
1822
  }
1823
1823
  async subscribePrivate(url, messageHash, payload, channel, params, requiresUid = false) {
1824
1824
  this.checkRequiredCredentials();
@@ -1862,7 +1862,7 @@ class gate extends gate$1 {
1862
1862
  client.subscriptions[tempSubscriptionHash] = messageHash;
1863
1863
  }
1864
1864
  const message = this.extend(request, params);
1865
- return await this.watch(url, messageHash, message, messageHash);
1865
+ return await this.watch(url, messageHash, message, messageHash, messageHash);
1866
1866
  }
1867
1867
  }
1868
1868
 
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, LeverageTiers } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, 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 } from './src/base/errors.js';
7
- declare const version = "4.3.82";
7
+ declare const version = "4.3.83";
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, 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 } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.3.83';
41
+ const version = '4.3.84';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
package/js/src/binance.js CHANGED
@@ -11409,7 +11409,7 @@ export default class binance extends Exchange {
11409
11409
  if ((api === 'sapi') && (path === 'asset/dust')) {
11410
11410
  query = this.urlencodeWithArrayRepeat(extendedParams);
11411
11411
  }
11412
- else if ((path === 'batchOrders') || (path.indexOf('sub-account') >= 0) || (path === 'capital/withdraw/apply') || (path.indexOf('staking') >= 0)) {
11412
+ else if ((path === 'batchOrders') || (path.indexOf('sub-account') >= 0) || (path === 'capital/withdraw/apply') || (path.indexOf('staking') >= 0) || (path.indexOf('simple-earn') >= 0)) {
11413
11413
  if ((method === 'DELETE') && (path === 'batchOrders')) {
11414
11414
  const orderidlist = this.safeList(extendedParams, 'orderidlist', []);
11415
11415
  const origclientorderidlist = this.safeList(extendedParams, 'origclientorderidlist', []);
@@ -338,9 +338,9 @@ export default class bitfinex2 extends Exchange {
338
338
  // convert 'EXCHANGE LIMIT' to lowercase 'limit'
339
339
  // everything else remains uppercase
340
340
  'exchangeTypes': {
341
- // 'MARKET': undefined,
341
+ 'MARKET': 'market',
342
342
  'EXCHANGE MARKET': 'market',
343
- // 'LIMIT': undefined,
343
+ 'LIMIT': 'limit',
344
344
  'EXCHANGE LIMIT': 'limit',
345
345
  // 'STOP': undefined,
346
346
  'EXCHANGE STOP': 'market',
package/js/src/kraken.js CHANGED
@@ -2528,14 +2528,12 @@ export default class kraken extends Exchange {
2528
2528
  * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
2529
2529
  */
2530
2530
  // https://www.kraken.com/en-us/help/api#deposit-status
2531
- if (code === undefined) {
2532
- throw new ArgumentsRequired(this.id + ' fetchDeposits() requires a currency code argument');
2533
- }
2534
2531
  await this.loadMarkets();
2535
- const currency = this.currency(code);
2536
- const request = {
2537
- 'asset': currency['id'],
2538
- };
2532
+ const request = {};
2533
+ if (code !== undefined) {
2534
+ const currency = this.currency(code);
2535
+ request['asset'] = currency['id'];
2536
+ }
2539
2537
  if (since !== undefined) {
2540
2538
  request['start'] = since;
2541
2539
  }
@@ -1220,6 +1220,9 @@ export default class binance extends binanceRest {
1220
1220
  * @param {object} [params.timezone] if provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00'
1221
1221
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
1222
1222
  */
1223
+ await this.loadMarkets();
1224
+ const market = this.market(symbol);
1225
+ symbol = market['symbol'];
1223
1226
  params['callerMethodName'] = 'watchOHLCV';
1224
1227
  const result = await this.watchOHLCVForSymbols([[symbol, timeframe]], since, limit, params);
1225
1228
  return result[symbol][timeframe];
@@ -1270,7 +1273,7 @@ export default class binance extends binanceRest {
1270
1273
  const suffix = '@+08:00';
1271
1274
  const utcSuffix = shouldUseUTC8 ? suffix : '';
1272
1275
  rawHashes.push(marketId + '@' + klineType + '_' + interval + utcSuffix);
1273
- messageHashes.push('ohlcv::' + symbolString + '::' + timeframeString);
1276
+ messageHashes.push('ohlcv::' + market['symbol'] + '::' + timeframeString);
1274
1277
  }
1275
1278
  const url = this.urls['api']['ws'][type] + '/' + this.stream(type, 'multipleOHLCV');
1276
1279
  const requestId = this.requestId(url);
@@ -1546,6 +1549,8 @@ export default class binance extends binanceRest {
1546
1549
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1547
1550
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1548
1551
  */
1552
+ await this.loadMarkets();
1553
+ symbols = this.marketSymbols(symbols, undefined, true, false, true);
1549
1554
  const result = await this.watchMultiTickerHelper('watchBidsAsks', 'bookTicker', symbols, params);
1550
1555
  if (this.newUpdates) {
1551
1556
  return result;
@@ -414,15 +414,7 @@ export default class bitrue extends bitrueRest {
414
414
  async authenticate(params = {}) {
415
415
  const listenKey = this.safeValue(this.options, 'listenKey');
416
416
  if (listenKey === undefined) {
417
- let response = undefined;
418
- try {
419
- response = await this.openPrivatePostPoseidonApiV1ListenKey(params);
420
- }
421
- catch (error) {
422
- this.options['listenKey'] = undefined;
423
- this.options['listenKeyUrl'] = undefined;
424
- return undefined;
425
- }
417
+ const response = await this.openPrivatePostPoseidonApiV1ListenKey(params);
426
418
  //
427
419
  // {
428
420
  // "msg": "succ",
@@ -1517,7 +1517,7 @@ export default class gate extends gateRest {
1517
1517
  const errs = this.safeDict(data, 'errs');
1518
1518
  const error = this.safeDict(message, 'error', errs);
1519
1519
  const code = this.safeString2(error, 'code', 'label');
1520
- const id = this.safeString2(message, 'id', 'requestId');
1520
+ const id = this.safeStringN(message, ['id', 'requestId', 'request_id']);
1521
1521
  if (error !== undefined) {
1522
1522
  const messageHash = this.safeString(client.subscriptions, id);
1523
1523
  try {
@@ -1533,7 +1533,7 @@ export default class gate extends gateRest {
1533
1533
  delete client.subscriptions[messageHash];
1534
1534
  }
1535
1535
  }
1536
- if (id !== undefined) {
1536
+ if ((id !== undefined) && (id in client.subscriptions)) {
1537
1537
  delete client.subscriptions[id];
1538
1538
  }
1539
1539
  return true;
@@ -1821,7 +1821,7 @@ export default class gate extends gateRest {
1821
1821
  'event': event,
1822
1822
  'payload': payload,
1823
1823
  };
1824
- return await this.watch(url, messageHash, request, messageHash);
1824
+ return await this.watch(url, messageHash, request, messageHash, requestId);
1825
1825
  }
1826
1826
  async subscribePrivate(url, messageHash, payload, channel, params, requiresUid = false) {
1827
1827
  this.checkRequiredCredentials();
@@ -1865,6 +1865,6 @@ export default class gate extends gateRest {
1865
1865
  client.subscriptions[tempSubscriptionHash] = messageHash;
1866
1866
  }
1867
1867
  const message = this.extend(request, params);
1868
- return await this.watch(url, messageHash, message, messageHash);
1868
+ return await this.watch(url, messageHash, message, messageHash, messageHash);
1869
1869
  }
1870
1870
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.3.83",
3
+ "version": "4.3.84",
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",