ccxt 4.3.74 → 4.3.76

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.
@@ -6293,6 +6293,7 @@ class htx extends htx$1 {
6293
6293
  async fetchDepositAddressesByNetwork(code, params = {}) {
6294
6294
  /**
6295
6295
  * @method
6296
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec50029-7773-11ed-9966-0242ac110003
6296
6297
  * @name huobi#fetchDepositAddressesByNetwork
6297
6298
  * @description fetch a dictionary of addresses for a currency, indexed by network
6298
6299
  * @param {string} code unified currency code of the currency for the deposit address
@@ -6326,6 +6327,7 @@ class htx extends htx$1 {
6326
6327
  /**
6327
6328
  * @method
6328
6329
  * @name huobi#fetchDepositAddress
6330
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec50029-7773-11ed-9966-0242ac110003
6329
6331
  * @description fetch the deposit address for a currency associated with this account
6330
6332
  * @param {string} code unified currency code
6331
6333
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -6376,6 +6378,7 @@ class htx extends htx$1 {
6376
6378
  /**
6377
6379
  * @method
6378
6380
  * @name huobi#fetchDeposits
6381
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4f050-7773-11ed-9966-0242ac110003
6379
6382
  * @description fetch all deposits made to an account
6380
6383
  * @param {string} code unified currency code
6381
6384
  * @param {int} [since] the earliest time in ms to fetch deposits for
@@ -6610,6 +6613,7 @@ class htx extends htx$1 {
6610
6613
  /**
6611
6614
  * @method
6612
6615
  * @name huobi#withdraw
6616
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4cc41-7773-11ed-9966-0242ac110003
6613
6617
  * @description make a withdrawal
6614
6618
  * @param {string} code unified currency code
6615
6619
  * @param {float} amount the amount to withdraw
@@ -5235,7 +5235,7 @@ class mexc extends mexc$1 {
5235
5235
  const networks = this.safeDict(this.options, 'networks', {});
5236
5236
  let network = this.safeString2(params, 'network', 'netWork'); // this line allows the user to specify either ERC20 or ETH
5237
5237
  network = this.safeString(networks, network, network); // handle ETH > ERC-20 alias
5238
- network = this.networkCodeToId(network);
5238
+ network = this.networkIdToCode(network);
5239
5239
  this.checkAddress(address);
5240
5240
  await this.loadMarkets();
5241
5241
  const currency = this.currency(code);
@@ -535,6 +535,12 @@ class binance extends binance$1 {
535
535
  /**
536
536
  * @method
537
537
  * @name binance#watchOrderBook
538
+ * @see https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams
539
+ * @see https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream
540
+ * @see https://binance-docs.github.io/apidocs/futures/en/#partial-book-depth-streams
541
+ * @see https://binance-docs.github.io/apidocs/futures/en/#diff-book-depth-streams
542
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#partial-book-depth-streams
543
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#diff-book-depth-streams
538
544
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
539
545
  * @param {string} symbol unified symbol of the market to fetch the order book for
540
546
  * @param {int} [limit] the maximum amount of order book entries to return
@@ -584,6 +590,12 @@ class binance extends binance$1 {
584
590
  /**
585
591
  * @method
586
592
  * @name binance#watchOrderBookForSymbols
593
+ * @see https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams
594
+ * @see https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream
595
+ * @see https://binance-docs.github.io/apidocs/futures/en/#partial-book-depth-streams
596
+ * @see https://binance-docs.github.io/apidocs/futures/en/#diff-book-depth-streams
597
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#partial-book-depth-streams
598
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#diff-book-depth-streams
587
599
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
588
600
  * @param {string[]} symbols unified array of symbols
589
601
  * @param {int} [limit] the maximum amount of order book entries to return
@@ -1476,6 +1488,12 @@ class binance extends binance$1 {
1476
1488
  /**
1477
1489
  * @method
1478
1490
  * @name binance#watchTicker
1491
+ * @see https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream
1492
+ * @see https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams
1493
+ * @see https://binance-docs.github.io/apidocs/futures/en/#all-market-mini-tickers-stream
1494
+ * @see https://binance-docs.github.io/apidocs/futures/en/#individual-symbol-ticker-streams
1495
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#all-market-mini-tickers-stream
1496
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#individual-symbol-ticker-streams
1479
1497
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
1480
1498
  * @param {string} symbol unified symbol of the market to fetch the ticker for
1481
1499
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1491,6 +1509,12 @@ class binance extends binance$1 {
1491
1509
  /**
1492
1510
  * @method
1493
1511
  * @name binance#watchTickers
1512
+ * @see https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream
1513
+ * @see https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams
1514
+ * @see https://binance-docs.github.io/apidocs/futures/en/#all-market-mini-tickers-stream
1515
+ * @see https://binance-docs.github.io/apidocs/futures/en/#individual-symbol-ticker-streams
1516
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#all-market-mini-tickers-stream
1517
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#individual-symbol-ticker-streams
1494
1518
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
1495
1519
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
1496
1520
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -40,8 +40,8 @@ class bitmart extends bitmart$1 {
40
40
  'private': 'wss://ws-manager-compress.{hostname}/user?protocol=1.1',
41
41
  },
42
42
  'swap': {
43
- 'public': 'wss://openapi-ws.{hostname}/api?protocol=1.1',
44
- 'private': 'wss://openapi-ws.{hostname}/user?protocol=1.1',
43
+ 'public': 'wss://openapi-ws-v2.{hostname}/api?protocol=1.1',
44
+ 'private': 'wss://openapi-ws-v2.{hostname}/user?protocol=1.1',
45
45
  },
46
46
  },
47
47
  },
@@ -135,7 +135,7 @@ class bitmart extends bitmart$1 {
135
135
  * @method
136
136
  * @name bitmart#watchBalance
137
137
  * @see https://developer-pro.bitmart.com/en/spot/#private-balance-change
138
- * @see https://developer-pro.bitmart.com/en/futures/#private-assets-channel
138
+ * @see https://developer-pro.bitmart.com/en/futuresv2/#private-assets-channel
139
139
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
140
140
  * @param {object} [params] extra parameters specific to the exchange API endpoint
141
141
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
@@ -269,7 +269,7 @@ class bitmart extends bitmart$1 {
269
269
  * @method
270
270
  * @name bitmart#watchTrades
271
271
  * @see https://developer-pro.bitmart.com/en/spot/#public-trade-channel
272
- * @see https://developer-pro.bitmart.com/en/futures/#public-trade-channel
272
+ * @see https://developer-pro.bitmart.com/en/futuresv2/#public-trade-channel
273
273
  * @description get the list of most recent trades for a particular symbol
274
274
  * @param {string} symbol unified symbol of the market to fetch trades for
275
275
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
@@ -319,6 +319,7 @@ class bitmart extends bitmart$1 {
319
319
  * @method
320
320
  * @name bitmart#watchTicker
321
321
  * @see https://developer-pro.bitmart.com/en/spot/#public-ticker-channel
322
+ * @see https://developer-pro.bitmart.com/en/futuresv2/#public-ticker-channel
322
323
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
323
324
  * @param {string} symbol unified symbol of the market to fetch the ticker for
324
325
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -333,7 +334,7 @@ class bitmart extends bitmart$1 {
333
334
  /**
334
335
  * @method
335
336
  * @name bitmart#watchTickers
336
- * @see https://developer-pro.bitmart.com/en/futures/#overview
337
+ * @see https://developer-pro.bitmart.com/en/futuresv2/#public-ticker-channel
337
338
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
338
339
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
339
340
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -357,7 +358,7 @@ class bitmart extends bitmart$1 {
357
358
  * @name bitmart#watchOrders
358
359
  * @description watches information on multiple orders made by the user
359
360
  * @see https://developer-pro.bitmart.com/en/spot/#private-order-progress
360
- * @see https://developer-pro.bitmart.com/en/futures/#private-order-channel
361
+ * @see https://developer-pro.bitmart.com/en/futuresv2/#private-order-channel
361
362
  * @param {string} symbol unified market symbol of the market orders were made in
362
363
  * @param {int} [since] the earliest time in ms to fetch orders for
363
364
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -992,7 +993,7 @@ class bitmart extends bitmart$1 {
992
993
  * @method
993
994
  * @name bitmart#watchOHLCV
994
995
  * @see https://developer-pro.bitmart.com/en/spot/#public-kline-channel
995
- * @see https://developer-pro.bitmart.com/en/futures/#public-klinebin-channel
996
+ * @see https://developer-pro.bitmart.com/en/futuresv2/#public-klinebin-channel
996
997
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
997
998
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
998
999
  * @param {string} timeframe the length of time each candle represents
@@ -1120,7 +1121,7 @@ class bitmart extends bitmart$1 {
1120
1121
  * @name bitmart#watchOrderBook
1121
1122
  * @see https://developer-pro.bitmart.com/en/spot/#public-depth-all-channel
1122
1123
  * @see https://developer-pro.bitmart.com/en/spot/#public-depth-increase-channel
1123
- * @see https://developer-pro.bitmart.com/en/futures/#public-depth-channel
1124
+ * @see https://developer-pro.bitmart.com/en/futuresv2/#public-depth-channel
1124
1125
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
1125
1126
  * @param {string} symbol unified symbol of the market to fetch the order book for
1126
1127
  * @param {int} [limit] the maximum amount of order book entries to return
@@ -166,7 +166,7 @@ class bybit extends bybit$1 {
166
166
  if (isSpot) {
167
167
  url = url[accessibility]['spot'];
168
168
  }
169
- else if (type === 'swap') {
169
+ else if ((type === 'swap') || (type === 'future')) {
170
170
  let subType = undefined;
171
171
  [subType, params] = this.handleSubTypeAndParams(method, market, params, 'linear');
172
172
  url = url[accessibility][subType];
@@ -2061,7 +2061,7 @@ class bybit extends bybit$1 {
2061
2061
  this.handleSubscriptionStatus(client, message);
2062
2062
  return;
2063
2063
  }
2064
- const topic = this.safeString2(message, 'topic', 'op');
2064
+ const topic = this.safeString2(message, 'topic', 'op', '');
2065
2065
  const methods = {
2066
2066
  'orderbook': this.handleOrderBook,
2067
2067
  'kline': this.handleOHLCV,
@@ -804,8 +804,23 @@ class whitebit extends whitebit$1 {
804
804
  // "change": "2.12" // in percent
805
805
  // }
806
806
  //
807
+ // WS market_update
808
+ //
809
+ // {
810
+ // "open": "52853.04",
811
+ // "close": "55913.88",
812
+ // "high": "56272",
813
+ // "low": "49549.67",
814
+ // "volume": "57331.067185",
815
+ // "deal": "3063860382.42985338",
816
+ // "last": "55913.88",
817
+ // "period": 86400
818
+ // }
807
819
  market = this.safeMarket(undefined, market);
808
- const last = this.safeString(ticker, 'last_price');
820
+ // last price is provided as "last" or "last_price"
821
+ const last = this.safeString2(ticker, 'last', 'last_price');
822
+ // if "close" is provided, use it, otherwise use <last>
823
+ const close = this.safeString(ticker, 'close', last);
809
824
  return this.safeTicker({
810
825
  'symbol': market['symbol'],
811
826
  'timestamp': undefined,
@@ -818,7 +833,7 @@ class whitebit extends whitebit$1 {
818
833
  'askVolume': undefined,
819
834
  'vwap': undefined,
820
835
  'open': this.safeString(ticker, 'open'),
821
- 'close': last,
836
+ 'close': close,
822
837
  'last': last,
823
838
  'previousClose': undefined,
824
839
  'change': undefined,
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.73";
7
+ declare const version = "4.3.75";
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.74';
41
+ const version = '4.3.76';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -61,6 +61,8 @@ interface Exchange {
61
61
  privateGetContractPrivateCurrentPlanOrder(params?: {}): Promise<implicitReturnType>;
62
62
  privateGetContractPrivateTrades(params?: {}): Promise<implicitReturnType>;
63
63
  privateGetContractPrivatePositionRisk(params?: {}): Promise<implicitReturnType>;
64
+ privateGetContractPrivateAffilateRebateList(params?: {}): Promise<implicitReturnType>;
65
+ privateGetContractPrivateAffilateTradeList(params?: {}): Promise<implicitReturnType>;
64
66
  privatePostAccountSubAccountMainV1SubToMain(params?: {}): Promise<implicitReturnType>;
65
67
  privatePostAccountSubAccountSubV1SubToMain(params?: {}): Promise<implicitReturnType>;
66
68
  privatePostAccountSubAccountMainV1MainToSub(params?: {}): Promise<implicitReturnType>;
@@ -52,6 +52,7 @@ interface Exchange {
52
52
  publicGetV5SpotCrossMarginTradeBorrowToken(params?: {}): Promise<implicitReturnType>;
53
53
  publicGetV5InsLoanProductInfos(params?: {}): Promise<implicitReturnType>;
54
54
  publicGetV5InsLoanEnsureTokensConvert(params?: {}): Promise<implicitReturnType>;
55
+ privateGetV5MarketInstrumentsInfo(params?: {}): Promise<implicitReturnType>;
55
56
  privateGetV2PrivateWalletFundRecords(params?: {}): Promise<implicitReturnType>;
56
57
  privateGetSpotV3PrivateOrder(params?: {}): Promise<implicitReturnType>;
57
58
  privateGetSpotV3PrivateOpenOrders(params?: {}): Promise<implicitReturnType>;
@@ -55,6 +55,7 @@ interface Exchange {
55
55
  privatePostV1AccountCreate(params?: {}): Promise<implicitReturnType>;
56
56
  privatePostV1AccountList(params?: {}): Promise<implicitReturnType>;
57
57
  privatePostV1Heartbeat(params?: {}): Promise<implicitReturnType>;
58
+ privatePostV1Roles(params?: {}): Promise<implicitReturnType>;
58
59
  }
59
60
  declare abstract class Exchange extends _Exchange {
60
61
  }
@@ -1985,7 +1985,7 @@ export default class Exchange {
1985
1985
  }
1986
1986
  async watchLiquidations(symbol, since = undefined, limit = undefined, params = {}) {
1987
1987
  if (this.has['watchLiquidationsForSymbols']) {
1988
- return this.watchLiquidationsForSymbols([symbol], since, limit, params);
1988
+ return await this.watchLiquidationsForSymbols([symbol], since, limit, params);
1989
1989
  }
1990
1990
  throw new NotSupported(this.id + ' watchLiquidations() is not supported yet');
1991
1991
  }
package/js/src/binance.js CHANGED
@@ -9806,7 +9806,7 @@ export default class binance extends Exchange {
9806
9806
  const liquidationPrice = this.parseNumber(liquidationPriceString);
9807
9807
  let collateralString = undefined;
9808
9808
  let marginMode = this.safeString(position, 'marginType');
9809
- if (marginMode === undefined && isolatedMarginString) {
9809
+ if (marginMode === undefined && isolatedMarginString !== undefined) {
9810
9810
  marginMode = Precise.stringEq(isolatedMarginString, '0') ? 'cross' : 'isolated';
9811
9811
  }
9812
9812
  let side = undefined;