ccxt 4.3.48 → 4.3.49

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
@@ -188,7 +188,7 @@ var woofipro$1 = require('./src/pro/woofipro.js');
188
188
 
189
189
  //-----------------------------------------------------------------------------
190
190
  // this is updated by vss.js when building
191
- const version = '4.3.48';
191
+ const version = '4.3.49';
192
192
  Exchange["default"].ccxtVersion = version;
193
193
  const exchanges = {
194
194
  'ace': ace,
@@ -1017,14 +1017,11 @@ class ace extends ace$1 {
1017
1017
  let auth = 'ACE_SIGN' + this.secret;
1018
1018
  const data = this.extend({
1019
1019
  'apiKey': this.apiKey,
1020
- 'timeStamp': nonce,
1020
+ 'timeStamp': this.numberToString(nonce),
1021
1021
  }, params);
1022
- const dataKeys = Object.keys(data);
1023
- const sortedDataKeys = this.sortBy(dataKeys, 0, false, '');
1024
- for (let i = 0; i < sortedDataKeys.length; i++) {
1025
- const key = sortedDataKeys[i];
1026
- auth += this.safeString(data, key);
1027
- }
1022
+ const sortedData = this.keysort(data);
1023
+ const values = Object.values(sortedData);
1024
+ auth += values.join('');
1028
1025
  const signature = this.hash(this.encode(auth), sha256.sha256, 'hex');
1029
1026
  data['signKey'] = signature;
1030
1027
  headers = {
@@ -1180,7 +1180,7 @@ class binance extends binance$1 {
1180
1180
  'BCC': 'BCC',
1181
1181
  'YOYO': 'YOYOW',
1182
1182
  },
1183
- 'precisionMode': number.DECIMAL_PLACES,
1183
+ 'precisionMode': number.TICK_SIZE,
1184
1184
  // exchange-specific options
1185
1185
  'options': {
1186
1186
  'sandboxMode': false,
@@ -2783,7 +2783,7 @@ class binance extends binance$1 {
2783
2783
  'deposit': depositEnable,
2784
2784
  'withdraw': withdrawEnable,
2785
2785
  'fee': this.parseNumber(fee),
2786
- 'precision': minPrecision,
2786
+ 'precision': this.parseNumber(precisionTick),
2787
2787
  'limits': {
2788
2788
  'withdraw': {
2789
2789
  'min': this.safeNumber(networkItem, 'withdrawMin'),
@@ -2798,15 +2798,11 @@ class binance extends binance$1 {
2798
2798
  }
2799
2799
  const trading = this.safeBool(entry, 'trading');
2800
2800
  const active = (isWithdrawEnabled && isDepositEnabled && trading);
2801
- let maxDecimalPlaces = undefined;
2802
- if (minPrecision !== undefined) {
2803
- maxDecimalPlaces = parseInt(this.numberToString(this.precisionFromString(minPrecision)));
2804
- }
2805
2801
  result[code] = {
2806
2802
  'id': id,
2807
2803
  'name': name,
2808
2804
  'code': code,
2809
- 'precision': maxDecimalPlaces,
2805
+ 'precision': this.parseNumber(minPrecision),
2810
2806
  'info': entry,
2811
2807
  'active': active,
2812
2808
  'deposit': isDepositEnabled,
@@ -3191,10 +3187,10 @@ class binance extends binance$1 {
3191
3187
  'strike': parsedStrike,
3192
3188
  'optionType': this.safeStringLower(market, 'side'),
3193
3189
  'precision': {
3194
- 'amount': this.safeInteger2(market, 'quantityPrecision', 'quantityScale'),
3195
- 'price': this.safeInteger2(market, 'pricePrecision', 'priceScale'),
3196
- 'base': this.safeInteger(market, 'baseAssetPrecision'),
3197
- 'quote': this.safeInteger(market, 'quotePrecision'),
3190
+ 'amount': this.parseNumber(this.parsePrecision(this.safeString2(market, 'quantityPrecision', 'quantityScale'))),
3191
+ 'price': this.parseNumber(this.parsePrecision(this.safeString2(market, 'pricePrecision', 'priceScale'))),
3192
+ 'base': this.parseNumber(this.parsePrecision(this.safeString(market, 'baseAssetPrecision'))),
3193
+ 'quote': this.parseNumber(this.parsePrecision(this.safeString(market, 'quotePrecision'))),
3198
3194
  },
3199
3195
  'limits': {
3200
3196
  'leverage': {
@@ -3227,12 +3223,11 @@ class binance extends binance$1 {
3227
3223
  'min': this.safeNumber(filter, 'minPrice'),
3228
3224
  'max': this.safeNumber(filter, 'maxPrice'),
3229
3225
  };
3230
- entry['precision']['price'] = this.precisionFromString(filter['tickSize']);
3226
+ entry['precision']['price'] = this.safeNumber(filter, 'tickSize');
3231
3227
  }
3232
3228
  if ('LOT_SIZE' in filtersByType) {
3233
3229
  const filter = this.safeDict(filtersByType, 'LOT_SIZE', {});
3234
- const stepSize = this.safeString(filter, 'stepSize');
3235
- entry['precision']['amount'] = this.precisionFromString(stepSize);
3230
+ entry['precision']['amount'] = this.safeNumber(filter, 'stepSize');
3236
3231
  entry['limits']['amount'] = {
3237
3232
  'min': this.safeNumber(filter, 'minQty'),
3238
3233
  'max': this.safeNumber(filter, 'maxQty'),
@@ -9578,7 +9573,7 @@ class binance extends binance$1 {
9578
9573
  const rightSide = Precise["default"].stringSub(Precise["default"].stringMul(Precise["default"].stringDiv('1', entryPriceSignString), size), walletBalance);
9579
9574
  liquidationPriceStringRaw = Precise["default"].stringDiv(leftSide, rightSide);
9580
9575
  }
9581
- const pricePrecision = market['precision']['price'];
9576
+ const pricePrecision = this.precisionFromString(this.safeString(market['precision'], 'price'));
9582
9577
  const pricePrecisionPlusOne = pricePrecision + 1;
9583
9578
  const pricePrecisionPlusOneString = pricePrecisionPlusOne.toString();
9584
9579
  // round half up
@@ -9751,8 +9746,7 @@ class binance extends binance$1 {
9751
9746
  }
9752
9747
  const inner = Precise["default"].stringMul(liquidationPriceString, onePlusMaintenanceMarginPercentageString);
9753
9748
  const leftSide = Precise["default"].stringAdd(inner, entryPriceSignString);
9754
- const pricePrecision = this.safeInteger(precision, 'price');
9755
- const quotePrecision = this.safeInteger(precision, 'quote', pricePrecision);
9749
+ const quotePrecision = this.precisionFromString(this.safeString2(precision, 'quote', 'price'));
9756
9750
  if (quotePrecision !== undefined) {
9757
9751
  collateralString = Precise["default"].stringDiv(Precise["default"].stringMul(leftSide, contractsAbs), '1', quotePrecision);
9758
9752
  }
@@ -9770,7 +9764,7 @@ class binance extends binance$1 {
9770
9764
  }
9771
9765
  const leftSide = Precise["default"].stringMul(contractsAbs, contractSizeString);
9772
9766
  const rightSide = Precise["default"].stringSub(Precise["default"].stringDiv('1', entryPriceSignString), Precise["default"].stringDiv(onePlusMaintenanceMarginPercentageString, liquidationPriceString));
9773
- const basePrecision = this.safeInteger(precision, 'base');
9767
+ const basePrecision = this.precisionFromString(this.safeString(precision, 'base'));
9774
9768
  if (basePrecision !== undefined) {
9775
9769
  collateralString = Precise["default"].stringDiv(Precise["default"].stringMul(leftSide, rightSide), '1', basePrecision);
9776
9770
  }
@@ -12921,7 +12915,7 @@ class binance extends binance$1 {
12921
12915
  'deposit': undefined,
12922
12916
  'withdraw': undefined,
12923
12917
  'fee': undefined,
12924
- 'precision': this.safeInteger(entry, 'fraction'),
12918
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(entry, 'fraction'))),
12925
12919
  'limits': {
12926
12920
  'amount': {
12927
12921
  'min': undefined,
@@ -1002,7 +1002,19 @@ class bitso extends bitso$1 {
1002
1002
  const request = {
1003
1003
  'oid': id,
1004
1004
  };
1005
- return await this.privateDeleteOrdersOid(this.extend(request, params));
1005
+ const response = await this.privateDeleteOrdersOid(this.extend(request, params));
1006
+ //
1007
+ // {
1008
+ // "success": true,
1009
+ // "payload": ["yWTQGxDMZ0VimZgZ"]
1010
+ // }
1011
+ //
1012
+ const payload = this.safeList(response, 'payload', []);
1013
+ const orderId = this.safeString(payload, 0);
1014
+ return this.safeOrder({
1015
+ 'info': response,
1016
+ 'id': orderId,
1017
+ });
1006
1018
  }
1007
1019
  async cancelOrders(ids, symbol = undefined, params = {}) {
1008
1020
  /**
@@ -1213,7 +1213,8 @@ class hyperliquid extends hyperliquid$1 {
1213
1213
  * @param {string} [params.vaultAddress] the vault address for order
1214
1214
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1215
1215
  */
1216
- return await this.cancelOrders([id], symbol, params);
1216
+ const orders = await this.cancelOrders([id], symbol, params);
1217
+ return this.safeDict(orders, 0);
1217
1218
  }
1218
1219
  async cancelOrders(ids, symbol = undefined, params = {}) {
1219
1220
  /**
@@ -1292,7 +1293,18 @@ class hyperliquid extends hyperliquid$1 {
1292
1293
  // }
1293
1294
  // }
1294
1295
  //
1295
- return response;
1296
+ const innerResponse = this.safeDict(response, 'response');
1297
+ const data = this.safeDict(innerResponse, 'data');
1298
+ const statuses = this.safeList(data, 'statuses');
1299
+ const orders = [];
1300
+ for (let i = 0; i < statuses.length; i++) {
1301
+ const status = statuses[i];
1302
+ orders.push(this.safeOrder({
1303
+ 'info': status,
1304
+ 'status': status,
1305
+ }));
1306
+ }
1307
+ return orders;
1296
1308
  }
1297
1309
  async cancelOrdersForSymbols(orders, params = {}) {
1298
1310
  /**
@@ -1713,6 +1713,7 @@ class kraken extends kraken$1 {
1713
1713
  'filled': filled,
1714
1714
  'average': average,
1715
1715
  'remaining': undefined,
1716
+ 'reduceOnly': this.safeBool2(order, 'reduceOnly', 'reduce_only'),
1716
1717
  'fee': fee,
1717
1718
  'trades': trades,
1718
1719
  }, market);
@@ -2122,7 +2123,7 @@ class kraken extends kraken$1 {
2122
2123
  * @method
2123
2124
  * @name kraken#cancelOrder
2124
2125
  * @description cancels an open order
2125
- * @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelOrder
2126
+ * @see https://docs.kraken.com/rest/#tag/Spot-Trading/operation/cancelOrder
2126
2127
  * @param {string} id order id
2127
2128
  * @param {string} symbol unified symbol of the market the order was made in
2128
2129
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -2163,7 +2164,7 @@ class kraken extends kraken$1 {
2163
2164
  * @method
2164
2165
  * @name kraken#cancelOrders
2165
2166
  * @description cancel multiple orders
2166
- * @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelOrderBatch
2167
+ * @see https://docs.kraken.com/rest/#tag/Spot-Trading/operation/cancelOrderBatch
2167
2168
  * @param {string[]} ids open orders transaction ID (txid) or user reference (userref)
2168
2169
  * @param {string} symbol unified market symbol
2169
2170
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -2192,7 +2193,7 @@ class kraken extends kraken$1 {
2192
2193
  * @method
2193
2194
  * @name kraken#cancelAllOrders
2194
2195
  * @description cancel all open orders
2195
- * @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelAllOrders
2196
+ * @see https://docs.kraken.com/rest/#tag/Spot-Trading/operation/cancelAllOrders
2196
2197
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
2197
2198
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2198
2199
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -1875,7 +1875,7 @@ class krakenfutures extends krakenfutures$1 {
1875
1875
  'type': this.parseOrderType(type),
1876
1876
  'timeInForce': timeInForce,
1877
1877
  'postOnly': type === 'post',
1878
- 'reduceOnly': this.safeValue(details, 'reduceOnly'),
1878
+ 'reduceOnly': this.safeBool2(details, 'reduceOnly', 'reduce_only'),
1879
1879
  'side': this.safeString(details, 'side'),
1880
1880
  'price': price,
1881
1881
  'stopPrice': this.safeString(details, 'triggerPrice'),
@@ -69,6 +69,7 @@ class coinbaseinternational extends coinbaseinternational$1 {
69
69
  * @param {object} [params] extra parameters specific to the exchange API endpoint
70
70
  * @returns {object} subscription to a websocket channel
71
71
  */
72
+ await this.loadMarkets();
72
73
  this.checkRequiredCredentials();
73
74
  let market = undefined;
74
75
  let messageHash = name;
@@ -117,6 +118,7 @@ class coinbaseinternational extends coinbaseinternational$1 {
117
118
  * @param {object} [params] extra parameters specific to the exchange API endpoint
118
119
  * @returns {object} subscription to a websocket channel
119
120
  */
121
+ await this.loadMarkets();
120
122
  this.checkRequiredCredentials();
121
123
  if (this.isEmpty(symbols)) {
122
124
  symbols = this.symbols;
@@ -160,6 +162,7 @@ class coinbaseinternational extends coinbaseinternational$1 {
160
162
  * @param {object} [params] extra parameters specific to the exchange API endpoint
161
163
  * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
162
164
  */
165
+ await this.loadMarkets();
163
166
  return await this.subscribe('RISK', [symbol], params);
164
167
  }
165
168
  async watchFundingRates(symbols, params = {}) {
@@ -172,6 +175,7 @@ class coinbaseinternational extends coinbaseinternational$1 {
172
175
  * @param {object} [params] extra parameters specific to the exchange API endpoint
173
176
  * @returns {object} a dictionary of [funding rates structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexe by market symbols
174
177
  */
178
+ await this.loadMarkets();
175
179
  const fundingRate = await this.subscribeMultiple('RISK', symbols, params);
176
180
  const symbol = this.safeString(fundingRate, 'symbol');
177
181
  if (this.newUpdates) {
@@ -191,6 +195,7 @@ class coinbaseinternational extends coinbaseinternational$1 {
191
195
  * @param {object} [params] extra parameters specific to the exchange API endpoint
192
196
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
193
197
  */
198
+ await this.loadMarkets();
194
199
  let channel = undefined;
195
200
  [channel, params] = this.handleOptionAndParams(params, 'watchTicker', 'channel', 'LEVEL1');
196
201
  return await this.subscribe(channel, [symbol], params);
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, TransferEntries, LeverageTiers } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
7
- declare const version = "4.3.47";
7
+ declare const version = "4.3.48";
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, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.3.48';
41
+ const version = '4.3.49';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
package/js/src/ace.js CHANGED
@@ -1020,14 +1020,11 @@ export default class ace extends Exchange {
1020
1020
  let auth = 'ACE_SIGN' + this.secret;
1021
1021
  const data = this.extend({
1022
1022
  'apiKey': this.apiKey,
1023
- 'timeStamp': nonce,
1023
+ 'timeStamp': this.numberToString(nonce),
1024
1024
  }, params);
1025
- const dataKeys = Object.keys(data);
1026
- const sortedDataKeys = this.sortBy(dataKeys, 0, false, '');
1027
- for (let i = 0; i < sortedDataKeys.length; i++) {
1028
- const key = sortedDataKeys[i];
1029
- auth += this.safeString(data, key);
1030
- }
1025
+ const sortedData = this.keysort(data);
1026
+ const values = Object.values(sortedData);
1027
+ auth += values.join('');
1031
1028
  const signature = this.hash(this.encode(auth), sha256, 'hex');
1032
1029
  data['signKey'] = signature;
1033
1030
  headers = {
package/js/src/binance.js CHANGED
@@ -8,7 +8,7 @@
8
8
  import Exchange from './abstract/binance.js';
9
9
  import { ExchangeError, ArgumentsRequired, OperationFailed, OperationRejected, InsufficientFunds, OrderNotFound, InvalidOrder, DDoSProtection, InvalidNonce, AuthenticationError, RateLimitExceeded, PermissionDenied, NotSupported, BadRequest, BadSymbol, AccountSuspended, OrderImmediatelyFillable, OnMaintenance, BadResponse, RequestTimeout, OrderNotFillable, MarginModeAlreadySet, MarketClosed } from './base/errors.js';
10
10
  import { Precise } from './base/Precise.js';
11
- import { TRUNCATE, DECIMAL_PLACES } from './base/functions/number.js';
11
+ import { TRUNCATE, TICK_SIZE } from './base/functions/number.js';
12
12
  import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
13
13
  import { rsa } from './base/functions/rsa.js';
14
14
  import { eddsa } from './base/functions/crypto.js';
@@ -1183,7 +1183,7 @@ export default class binance extends Exchange {
1183
1183
  'BCC': 'BCC',
1184
1184
  'YOYO': 'YOYOW',
1185
1185
  },
1186
- 'precisionMode': DECIMAL_PLACES,
1186
+ 'precisionMode': TICK_SIZE,
1187
1187
  // exchange-specific options
1188
1188
  'options': {
1189
1189
  'sandboxMode': false,
@@ -2786,7 +2786,7 @@ export default class binance extends Exchange {
2786
2786
  'deposit': depositEnable,
2787
2787
  'withdraw': withdrawEnable,
2788
2788
  'fee': this.parseNumber(fee),
2789
- 'precision': minPrecision,
2789
+ 'precision': this.parseNumber(precisionTick),
2790
2790
  'limits': {
2791
2791
  'withdraw': {
2792
2792
  'min': this.safeNumber(networkItem, 'withdrawMin'),
@@ -2801,15 +2801,11 @@ export default class binance extends Exchange {
2801
2801
  }
2802
2802
  const trading = this.safeBool(entry, 'trading');
2803
2803
  const active = (isWithdrawEnabled && isDepositEnabled && trading);
2804
- let maxDecimalPlaces = undefined;
2805
- if (minPrecision !== undefined) {
2806
- maxDecimalPlaces = parseInt(this.numberToString(this.precisionFromString(minPrecision)));
2807
- }
2808
2804
  result[code] = {
2809
2805
  'id': id,
2810
2806
  'name': name,
2811
2807
  'code': code,
2812
- 'precision': maxDecimalPlaces,
2808
+ 'precision': this.parseNumber(minPrecision),
2813
2809
  'info': entry,
2814
2810
  'active': active,
2815
2811
  'deposit': isDepositEnabled,
@@ -3194,10 +3190,10 @@ export default class binance extends Exchange {
3194
3190
  'strike': parsedStrike,
3195
3191
  'optionType': this.safeStringLower(market, 'side'),
3196
3192
  'precision': {
3197
- 'amount': this.safeInteger2(market, 'quantityPrecision', 'quantityScale'),
3198
- 'price': this.safeInteger2(market, 'pricePrecision', 'priceScale'),
3199
- 'base': this.safeInteger(market, 'baseAssetPrecision'),
3200
- 'quote': this.safeInteger(market, 'quotePrecision'),
3193
+ 'amount': this.parseNumber(this.parsePrecision(this.safeString2(market, 'quantityPrecision', 'quantityScale'))),
3194
+ 'price': this.parseNumber(this.parsePrecision(this.safeString2(market, 'pricePrecision', 'priceScale'))),
3195
+ 'base': this.parseNumber(this.parsePrecision(this.safeString(market, 'baseAssetPrecision'))),
3196
+ 'quote': this.parseNumber(this.parsePrecision(this.safeString(market, 'quotePrecision'))),
3201
3197
  },
3202
3198
  'limits': {
3203
3199
  'leverage': {
@@ -3230,12 +3226,11 @@ export default class binance extends Exchange {
3230
3226
  'min': this.safeNumber(filter, 'minPrice'),
3231
3227
  'max': this.safeNumber(filter, 'maxPrice'),
3232
3228
  };
3233
- entry['precision']['price'] = this.precisionFromString(filter['tickSize']);
3229
+ entry['precision']['price'] = this.safeNumber(filter, 'tickSize');
3234
3230
  }
3235
3231
  if ('LOT_SIZE' in filtersByType) {
3236
3232
  const filter = this.safeDict(filtersByType, 'LOT_SIZE', {});
3237
- const stepSize = this.safeString(filter, 'stepSize');
3238
- entry['precision']['amount'] = this.precisionFromString(stepSize);
3233
+ entry['precision']['amount'] = this.safeNumber(filter, 'stepSize');
3239
3234
  entry['limits']['amount'] = {
3240
3235
  'min': this.safeNumber(filter, 'minQty'),
3241
3236
  'max': this.safeNumber(filter, 'maxQty'),
@@ -9581,7 +9576,7 @@ export default class binance extends Exchange {
9581
9576
  const rightSide = Precise.stringSub(Precise.stringMul(Precise.stringDiv('1', entryPriceSignString), size), walletBalance);
9582
9577
  liquidationPriceStringRaw = Precise.stringDiv(leftSide, rightSide);
9583
9578
  }
9584
- const pricePrecision = market['precision']['price'];
9579
+ const pricePrecision = this.precisionFromString(this.safeString(market['precision'], 'price'));
9585
9580
  const pricePrecisionPlusOne = pricePrecision + 1;
9586
9581
  const pricePrecisionPlusOneString = pricePrecisionPlusOne.toString();
9587
9582
  // round half up
@@ -9754,8 +9749,7 @@ export default class binance extends Exchange {
9754
9749
  }
9755
9750
  const inner = Precise.stringMul(liquidationPriceString, onePlusMaintenanceMarginPercentageString);
9756
9751
  const leftSide = Precise.stringAdd(inner, entryPriceSignString);
9757
- const pricePrecision = this.safeInteger(precision, 'price');
9758
- const quotePrecision = this.safeInteger(precision, 'quote', pricePrecision);
9752
+ const quotePrecision = this.precisionFromString(this.safeString2(precision, 'quote', 'price'));
9759
9753
  if (quotePrecision !== undefined) {
9760
9754
  collateralString = Precise.stringDiv(Precise.stringMul(leftSide, contractsAbs), '1', quotePrecision);
9761
9755
  }
@@ -9773,7 +9767,7 @@ export default class binance extends Exchange {
9773
9767
  }
9774
9768
  const leftSide = Precise.stringMul(contractsAbs, contractSizeString);
9775
9769
  const rightSide = Precise.stringSub(Precise.stringDiv('1', entryPriceSignString), Precise.stringDiv(onePlusMaintenanceMarginPercentageString, liquidationPriceString));
9776
- const basePrecision = this.safeInteger(precision, 'base');
9770
+ const basePrecision = this.precisionFromString(this.safeString(precision, 'base'));
9777
9771
  if (basePrecision !== undefined) {
9778
9772
  collateralString = Precise.stringDiv(Precise.stringMul(leftSide, rightSide), '1', basePrecision);
9779
9773
  }
@@ -12924,7 +12918,7 @@ export default class binance extends Exchange {
12924
12918
  'deposit': undefined,
12925
12919
  'withdraw': undefined,
12926
12920
  'fee': undefined,
12927
- 'precision': this.safeInteger(entry, 'fraction'),
12921
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(entry, 'fraction'))),
12928
12922
  'limits': {
12929
12923
  'amount': {
12930
12924
  'min': undefined,
package/js/src/bitso.d.ts CHANGED
@@ -38,7 +38,7 @@ export default class bitso extends Exchange {
38
38
  fetchTradingFees(params?: {}): Promise<TradingFees>;
39
39
  fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
40
40
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
41
- cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
41
+ cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
42
42
  cancelOrders(ids: any, symbol?: Str, params?: {}): Promise<any[]>;
43
43
  cancelAllOrders(symbol?: Str, params?: {}): Promise<any[]>;
44
44
  parseOrderStatus(status: Str): string;
package/js/src/bitso.js CHANGED
@@ -1005,7 +1005,19 @@ export default class bitso extends Exchange {
1005
1005
  const request = {
1006
1006
  'oid': id,
1007
1007
  };
1008
- return await this.privateDeleteOrdersOid(this.extend(request, params));
1008
+ const response = await this.privateDeleteOrdersOid(this.extend(request, params));
1009
+ //
1010
+ // {
1011
+ // "success": true,
1012
+ // "payload": ["yWTQGxDMZ0VimZgZ"]
1013
+ // }
1014
+ //
1015
+ const payload = this.safeList(response, 'payload', []);
1016
+ const orderId = this.safeString(payload, 0);
1017
+ return this.safeOrder({
1018
+ 'info': response,
1019
+ 'id': orderId,
1020
+ });
1009
1021
  }
1010
1022
  async cancelOrders(ids, symbol = undefined, params = {}) {
1011
1023
  /**
@@ -76,7 +76,7 @@ export default class coinbase extends Exchange {
76
76
  parseOrderStatus(status: Str): string;
77
77
  parseOrderType(type: Str): string;
78
78
  parseTimeInForce(timeInForce: Str): string;
79
- cancelOrder(id: string, symbol?: Str, params?: {}): Promise<import("./base/types.js").Dictionary<any>>;
79
+ cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
80
80
  cancelOrders(ids: any, symbol?: Str, params?: {}): Promise<Order[]>;
81
81
  editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
82
82
  fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
@@ -53,8 +53,8 @@ export default class hyperliquid extends Exchange {
53
53
  };
54
54
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
55
55
  createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
56
- cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
57
- cancelOrders(ids: string[], symbol?: Str, params?: {}): Promise<any>;
56
+ cancelOrder(id: string, symbol?: Str, params?: {}): Promise<import("./base/types.js").Dictionary<any>>;
57
+ cancelOrders(ids: string[], symbol?: Str, params?: {}): Promise<any[]>;
58
58
  cancelOrdersForSymbols(orders: CancellationRequest[], params?: {}): Promise<any>;
59
59
  cancelAllOrdersAfter(timeout: Int, params?: {}): Promise<any>;
60
60
  editOrder(id: string, symbol: string, type: string, side: string, amount?: Num, price?: Num, params?: {}): Promise<Order>;
@@ -1216,7 +1216,8 @@ export default class hyperliquid extends Exchange {
1216
1216
  * @param {string} [params.vaultAddress] the vault address for order
1217
1217
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1218
1218
  */
1219
- return await this.cancelOrders([id], symbol, params);
1219
+ const orders = await this.cancelOrders([id], symbol, params);
1220
+ return this.safeDict(orders, 0);
1220
1221
  }
1221
1222
  async cancelOrders(ids, symbol = undefined, params = {}) {
1222
1223
  /**
@@ -1295,7 +1296,18 @@ export default class hyperliquid extends Exchange {
1295
1296
  // }
1296
1297
  // }
1297
1298
  //
1298
- return response;
1299
+ const innerResponse = this.safeDict(response, 'response');
1300
+ const data = this.safeDict(innerResponse, 'data');
1301
+ const statuses = this.safeList(data, 'statuses');
1302
+ const orders = [];
1303
+ for (let i = 0; i < statuses.length; i++) {
1304
+ const status = statuses[i];
1305
+ orders.push(this.safeOrder({
1306
+ 'info': status,
1307
+ 'status': status,
1308
+ }));
1309
+ }
1310
+ return orders;
1299
1311
  }
1300
1312
  async cancelOrdersForSymbols(orders, params = {}) {
1301
1313
  /**
package/js/src/kraken.js CHANGED
@@ -1716,6 +1716,7 @@ export default class kraken extends Exchange {
1716
1716
  'filled': filled,
1717
1717
  'average': average,
1718
1718
  'remaining': undefined,
1719
+ 'reduceOnly': this.safeBool2(order, 'reduceOnly', 'reduce_only'),
1719
1720
  'fee': fee,
1720
1721
  'trades': trades,
1721
1722
  }, market);
@@ -2125,7 +2126,7 @@ export default class kraken extends Exchange {
2125
2126
  * @method
2126
2127
  * @name kraken#cancelOrder
2127
2128
  * @description cancels an open order
2128
- * @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelOrder
2129
+ * @see https://docs.kraken.com/rest/#tag/Spot-Trading/operation/cancelOrder
2129
2130
  * @param {string} id order id
2130
2131
  * @param {string} symbol unified symbol of the market the order was made in
2131
2132
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -2166,7 +2167,7 @@ export default class kraken extends Exchange {
2166
2167
  * @method
2167
2168
  * @name kraken#cancelOrders
2168
2169
  * @description cancel multiple orders
2169
- * @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelOrderBatch
2170
+ * @see https://docs.kraken.com/rest/#tag/Spot-Trading/operation/cancelOrderBatch
2170
2171
  * @param {string[]} ids open orders transaction ID (txid) or user reference (userref)
2171
2172
  * @param {string} symbol unified market symbol
2172
2173
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -2195,7 +2196,7 @@ export default class kraken extends Exchange {
2195
2196
  * @method
2196
2197
  * @name kraken#cancelAllOrders
2197
2198
  * @description cancel all open orders
2198
- * @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelAllOrders
2199
+ * @see https://docs.kraken.com/rest/#tag/Spot-Trading/operation/cancelAllOrders
2199
2200
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
2200
2201
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2201
2202
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -1878,7 +1878,7 @@ export default class krakenfutures extends Exchange {
1878
1878
  'type': this.parseOrderType(type),
1879
1879
  'timeInForce': timeInForce,
1880
1880
  'postOnly': type === 'post',
1881
- 'reduceOnly': this.safeValue(details, 'reduceOnly'),
1881
+ 'reduceOnly': this.safeBool2(details, 'reduceOnly', 'reduce_only'),
1882
1882
  'side': this.safeString(details, 'side'),
1883
1883
  'price': price,
1884
1884
  'stopPrice': this.safeString(details, 'triggerPrice'),
@@ -72,6 +72,7 @@ export default class coinbaseinternational extends coinbaseinternationalRest {
72
72
  * @param {object} [params] extra parameters specific to the exchange API endpoint
73
73
  * @returns {object} subscription to a websocket channel
74
74
  */
75
+ await this.loadMarkets();
75
76
  this.checkRequiredCredentials();
76
77
  let market = undefined;
77
78
  let messageHash = name;
@@ -120,6 +121,7 @@ export default class coinbaseinternational extends coinbaseinternationalRest {
120
121
  * @param {object} [params] extra parameters specific to the exchange API endpoint
121
122
  * @returns {object} subscription to a websocket channel
122
123
  */
124
+ await this.loadMarkets();
123
125
  this.checkRequiredCredentials();
124
126
  if (this.isEmpty(symbols)) {
125
127
  symbols = this.symbols;
@@ -163,6 +165,7 @@ export default class coinbaseinternational extends coinbaseinternationalRest {
163
165
  * @param {object} [params] extra parameters specific to the exchange API endpoint
164
166
  * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
165
167
  */
168
+ await this.loadMarkets();
166
169
  return await this.subscribe('RISK', [symbol], params);
167
170
  }
168
171
  async watchFundingRates(symbols, params = {}) {
@@ -175,6 +178,7 @@ export default class coinbaseinternational extends coinbaseinternationalRest {
175
178
  * @param {object} [params] extra parameters specific to the exchange API endpoint
176
179
  * @returns {object} a dictionary of [funding rates structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexe by market symbols
177
180
  */
181
+ await this.loadMarkets();
178
182
  const fundingRate = await this.subscribeMultiple('RISK', symbols, params);
179
183
  const symbol = this.safeString(fundingRate, 'symbol');
180
184
  if (this.newUpdates) {
@@ -194,6 +198,7 @@ export default class coinbaseinternational extends coinbaseinternationalRest {
194
198
  * @param {object} [params] extra parameters specific to the exchange API endpoint
195
199
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
196
200
  */
201
+ await this.loadMarkets();
197
202
  let channel = undefined;
198
203
  [channel, params] = this.handleOptionAndParams(params, 'watchTicker', 'channel', 'LEVEL1');
199
204
  return await this.subscribe(channel, [symbol], params);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.3.48",
3
+ "version": "4.3.49",
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",