ccxt 4.1.39 → 4.1.40

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.1.39';
183
+ const version = '4.1.40';
184
184
  Exchange["default"].ccxtVersion = version;
185
185
  const exchanges = {
186
186
  'ace': ace,
@@ -1405,13 +1405,13 @@ class huobi extends huobi$1 {
1405
1405
  // }
1406
1406
  //
1407
1407
  const channel = this.safeString(message, 'ch');
1408
- const timestamp = this.safeInteger(message, 'ts');
1408
+ const data = this.safeValue(message, 'data', []);
1409
+ const timestamp = this.safeInteger(data, 'changeTime', this.safeInteger(message, 'ts'));
1409
1410
  this.balance['timestamp'] = timestamp;
1410
1411
  this.balance['datetime'] = this.iso8601(timestamp);
1411
- this.balance['info'] = this.safeValue(message, 'data');
1412
+ this.balance['info'] = data;
1412
1413
  if (channel !== undefined) {
1413
1414
  // spot balance
1414
- const data = this.safeValue(message, 'data', {});
1415
1415
  const currencyId = this.safeString(data, 'currency');
1416
1416
  const code = this.safeCurrencyCode(currencyId);
1417
1417
  const account = this.account();
@@ -1423,7 +1423,6 @@ class huobi extends huobi$1 {
1423
1423
  }
1424
1424
  else {
1425
1425
  // contract balance
1426
- const data = this.safeValue(message, 'data', []);
1427
1426
  const dataLength = data.length;
1428
1427
  if (dataLength === 0) {
1429
1428
  return;
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, FundingRateHistory, Liquidation, FundingHistory } 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, NoChange } from './src/base/errors.js';
7
- declare const version = "4.1.38";
7
+ declare const version = "4.1.39";
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, NoChange } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.1.39';
41
+ const version = '4.1.40';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -1408,13 +1408,13 @@ export default class huobi extends huobiRest {
1408
1408
  // }
1409
1409
  //
1410
1410
  const channel = this.safeString(message, 'ch');
1411
- const timestamp = this.safeInteger(message, 'ts');
1411
+ const data = this.safeValue(message, 'data', []);
1412
+ const timestamp = this.safeInteger(data, 'changeTime', this.safeInteger(message, 'ts'));
1412
1413
  this.balance['timestamp'] = timestamp;
1413
1414
  this.balance['datetime'] = this.iso8601(timestamp);
1414
- this.balance['info'] = this.safeValue(message, 'data');
1415
+ this.balance['info'] = data;
1415
1416
  if (channel !== undefined) {
1416
1417
  // spot balance
1417
- const data = this.safeValue(message, 'data', {});
1418
1418
  const currencyId = this.safeString(data, 'currency');
1419
1419
  const code = this.safeCurrencyCode(currencyId);
1420
1420
  const account = this.account();
@@ -1426,7 +1426,6 @@ export default class huobi extends huobiRest {
1426
1426
  }
1427
1427
  else {
1428
1428
  // contract balance
1429
- const data = this.safeValue(message, 'data', []);
1430
1429
  const dataLength = data.length;
1431
1430
  if (dataLength === 0) {
1432
1431
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.1.39",
3
+ "version": "4.1.40",
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",
@@ -40,13 +40,13 @@
40
40
  "fast-test": "npm run commonjs-test && node run-tests --js",
41
41
  "commonjs-test": "node test-commonjs.cjs",
42
42
  "fast-test-ws": "node run-tests-ws --js",
43
- "test-js": "npm run commonjs-test && node js/src/test/static/test.ids && node run-tests --js",
43
+ "test-js": "npm run commonjs-test && node run-tests --js",
44
44
  "test-js-ws": "node run-tests-ws --js",
45
45
  "test-py": "node run-tests --python",
46
46
  "test-py-ws": "node run-tests-ws --python",
47
47
  "test-php": "node run-tests --php",
48
48
  "test-php-ws": "node run-tests-ws --php",
49
- "test-base": "npm run test-js-base && npm run test-python-base && npm run test-php-base",
49
+ "test-base": "npm run test-js-base && npm run test-python-base && npm run test-php-base && npm run id-tests && npm run static-tests",
50
50
  "test-base-ws": "npm run test-js-base-ws && npm run test-python-base-ws && npm run test-php-base-ws",
51
51
  "test-js-base": "node ./js/src/test/base/test.base.js",
52
52
  "test-js-base-ws": "npm run test-js-cache && npm run test-js-orderbook",
@@ -103,7 +103,11 @@
103
103
  "static-js": "node js/src/test/test.js --static",
104
104
  "static-py": "python python/ccxt/test/test_async.py --static",
105
105
  "static-php": "php php/test/test_async.php --static",
106
- "static-tests": "npm run static-js && npm run static-py && npm run static-php"
106
+ "static-tests": "npm run static-js && npm run static-py && npm run static-php",
107
+ "id-tests-js": "node js/src/test/test.js --idTests",
108
+ "id-tests-py": "python python/ccxt/test/test_async.py --idTests",
109
+ "id-tests-php": "php php/test/test_async.php --idTests",
110
+ "id-tests": "npm run id-tests-js && npm run id-tests-py && npm run id-tests-php"
107
111
  },
108
112
  "types": "./js/ccxt.d.ts",
109
113
  "devDependencies": {