ccxt 4.3.77 → 4.3.78

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/js/src/kraken.js CHANGED
@@ -1385,7 +1385,7 @@ export default class kraken extends Exchange {
1385
1385
  * @method
1386
1386
  * @name kraken#createMarketOrderWithCost
1387
1387
  * @description create a market order by providing the symbol, side and cost
1388
- * @see https://docs.kraken.com/rest/#tag/Trading/operation/addOrder
1388
+ * @see https://docs.kraken.com/rest/#tag/Spot-Trading/operation/addOrder
1389
1389
  * @param {string} symbol unified symbol of the market to create an order in (only USD markets are supported)
1390
1390
  * @param {string} side 'buy' or 'sell'
1391
1391
  * @param {float} cost how much you want to trade in units of the quote currency
@@ -1402,7 +1402,7 @@ export default class kraken extends Exchange {
1402
1402
  * @method
1403
1403
  * @name kraken#createMarketBuyOrderWithCost
1404
1404
  * @description create a market buy order by providing the symbol, side and cost
1405
- * @see https://docs.kraken.com/rest/#tag/Trading/operation/addOrder
1405
+ * @see https://docs.kraken.com/rest/#tag/Spot-Trading/operation/addOrder
1406
1406
  * @param {string} symbol unified symbol of the market to create an order in
1407
1407
  * @param {float} cost how much you want to trade in units of the quote currency
1408
1408
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1415,7 +1415,7 @@ export default class kraken extends Exchange {
1415
1415
  /**
1416
1416
  * @method
1417
1417
  * @name kraken#createOrder
1418
- * @see https://docs.kraken.com/rest/#tag/Trading/operation/addOrder
1418
+ * @see https://docs.kraken.com/rest/#tag/Spot-Trading/operation/addOrder
1419
1419
  * @description create a trade order
1420
1420
  * @param {string} symbol unified symbol of the market to create an order in
1421
1421
  * @param {string} type 'market' or 'limit'
@@ -1554,6 +1554,8 @@ export default class kraken extends Exchange {
1554
1554
  // "status": "ok",
1555
1555
  // "txid": "OAW2BO-7RWEK-PZY5UO",
1556
1556
  // "originaltxid": "OXL6SS-UPNMC-26WBE7",
1557
+ // "newuserref": 1234,
1558
+ // "olduserref": 123,
1557
1559
  // "volume": "0.00075000",
1558
1560
  // "price": "13500.0",
1559
1561
  // "orders_cancelled": 1,
@@ -1697,7 +1699,7 @@ export default class kraken extends Exchange {
1697
1699
  const txid = this.safeList(order, 'txid');
1698
1700
  id = this.safeString(txid, 0);
1699
1701
  }
1700
- const clientOrderId = this.safeString(order, 'userref');
1702
+ const clientOrderId = this.safeString2(order, 'userref', 'newuserref');
1701
1703
  const rawTrades = this.safeValue(order, 'trades', []);
1702
1704
  const trades = [];
1703
1705
  for (let i = 0; i < rawTrades.length; i++) {
@@ -1853,7 +1855,7 @@ export default class kraken extends Exchange {
1853
1855
  const extendedPostFlags = (flags !== undefined) ? flags + ',post' : 'post';
1854
1856
  request['oflags'] = extendedPostFlags;
1855
1857
  }
1856
- if ((flags !== undefined) && (request['oflags'] === undefined)) {
1858
+ if ((flags !== undefined) && !('oflags' in request)) {
1857
1859
  request['oflags'] = flags;
1858
1860
  }
1859
1861
  params = this.omit(params, ['timeInForce', 'reduceOnly', 'stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingLimitAmount', 'offset']);
@@ -1864,7 +1866,7 @@ export default class kraken extends Exchange {
1864
1866
  * @method
1865
1867
  * @name kraken#editOrder
1866
1868
  * @description edit a trade order
1867
- * @see https://docs.kraken.com/rest/#tag/Trading/operation/editOrder
1869
+ * @see https://docs.kraken.com/rest/#tag/Spot-Trading/operation/editOrder
1868
1870
  * @param {string} id order id
1869
1871
  * @param {string} symbol unified symbol of the market to create an order in
1870
1872
  * @param {string} type 'market' or 'limit'
@@ -1926,8 +1928,8 @@ export default class kraken extends Exchange {
1926
1928
  await this.loadMarkets();
1927
1929
  const clientOrderId = this.safeValue2(params, 'userref', 'clientOrderId');
1928
1930
  const request = {
1929
- 'trades': true, // whether or not to include trades in output (optional, default false)
1930
- // 'txid': id, // do not comma separate a list of ids - use fetchOrdersByIds instead
1931
+ 'trades': true,
1932
+ 'txid': id, // do not comma separate a list of ids - use fetchOrdersByIds instead
1931
1933
  // 'userref': 'optional', // restrict results to given user reference id (optional)
1932
1934
  };
1933
1935
  let query = params;
@@ -1935,9 +1937,6 @@ export default class kraken extends Exchange {
1935
1937
  request['userref'] = clientOrderId;
1936
1938
  query = this.omit(params, ['userref', 'clientOrderId']);
1937
1939
  }
1938
- else {
1939
- request['txid'] = id;
1940
- }
1941
1940
  const response = await this.privatePostQueryOrders(this.extend(request, query));
1942
1941
  //
1943
1942
  // {
package/js/src/kuna.js CHANGED
@@ -888,7 +888,6 @@ export default class kuna extends Exchange {
888
888
  'fee': {
889
889
  'cost': this.safeString(trade, 'fee'),
890
890
  'currency': this.safeCurrencyCode(this.safeString(trade, 'feeCurrency')),
891
- 'rate': undefined,
892
891
  },
893
892
  }, market);
894
893
  }
@@ -206,7 +206,7 @@ export default class binance extends binanceRest {
206
206
  * @param {object} [params] exchange specific parameters for the bitmex api endpoint
207
207
  * @returns {object} an array of [liquidation structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#liquidation-structure}
208
208
  */
209
- return this.watchLiquidationsForSymbols([symbol], since, limit, params);
209
+ return await this.watchLiquidationsForSymbols([symbol], since, limit, params);
210
210
  }
211
211
  async watchLiquidationsForSymbols(symbols = undefined, since = undefined, limit = undefined, params = {}) {
212
212
  /**
@@ -117,6 +117,7 @@ export default class paradex extends paradexRest {
117
117
  * @param {object} [params] extra parameters specific to the exchange API endpoint
118
118
  * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
119
119
  */
120
+ await this.loadMarkets();
120
121
  const market = this.market(symbol);
121
122
  const messageHash = 'order_book.' + market['id'] + '.snapshot@15@100ms';
122
123
  const url = this.urls['api']['ws'];
@@ -226,6 +227,7 @@ export default class paradex extends paradexRest {
226
227
  * @param {object} [params] extra parameters specific to the exchange API endpoint
227
228
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
228
229
  */
230
+ await this.loadMarkets();
229
231
  symbols = this.marketSymbols(symbols);
230
232
  const channel = 'markets_summary';
231
233
  const url = this.urls['api']['ws'];
package/js/src/vertex.js CHANGED
@@ -668,6 +668,13 @@ export default class vertex extends Exchange {
668
668
  let amount = undefined;
669
669
  let side = undefined;
670
670
  let fee = undefined;
671
+ const feeCost = this.convertFromX18(this.safeString(trade, 'fee'));
672
+ if (feeCost !== undefined) {
673
+ fee = {
674
+ 'cost': feeCost,
675
+ 'currency': undefined,
676
+ };
677
+ }
671
678
  const id = this.safeString2(trade, 'trade_id', 'submission_idx');
672
679
  const order = this.safeString(trade, 'digest');
673
680
  const timestamp = this.safeTimestamp(trade, 'timestamp');
@@ -685,10 +692,6 @@ export default class vertex extends Exchange {
685
692
  const subOrder = this.safeDict(trade, 'order', {});
686
693
  price = this.convertFromX18(this.safeString(subOrder, 'priceX18'));
687
694
  amount = this.convertFromX18(this.safeString(trade, 'base_filled'));
688
- fee = {
689
- 'cost': this.convertFromX18(this.safeString(trade, 'fee')),
690
- 'currency': undefined,
691
- };
692
695
  if (Precise.stringLt(amount, '0')) {
693
696
  side = 'sell';
694
697
  }
package/js/src/woo.js CHANGED
@@ -610,6 +610,10 @@ export default class woo extends Exchange {
610
610
  const amount = this.safeString(trade, 'executed_quantity');
611
611
  const order_id = this.safeString(trade, 'order_id');
612
612
  const fee = this.parseTokenAndFeeTemp(trade, 'fee_asset', 'fee');
613
+ const feeCost = this.safeString(fee, 'cost');
614
+ if (feeCost !== undefined) {
615
+ fee['cost'] = feeCost;
616
+ }
613
617
  const cost = Precise.stringMul(price, amount);
614
618
  const side = this.safeStringLower(trade, 'side');
615
619
  const id = this.safeString(trade, 'id');
@@ -683,6 +683,10 @@ export default class woofipro extends Exchange {
683
683
  const amount = this.safeString(trade, 'executed_quantity');
684
684
  const order_id = this.safeString(trade, 'order_id');
685
685
  const fee = this.parseTokenAndFeeTemp(trade, 'fee_asset', 'fee');
686
+ const feeCost = this.safeString(fee, 'cost');
687
+ if (feeCost !== undefined) {
688
+ fee['cost'] = feeCost;
689
+ }
686
690
  const cost = Precise.stringMul(price, amount);
687
691
  const side = this.safeStringLower(trade, 'side');
688
692
  const id = this.safeString(trade, 'id');
package/js/src/xt.js CHANGED
@@ -2109,7 +2109,6 @@ export default class xt extends Exchange {
2109
2109
  'fee': {
2110
2110
  'currency': this.safeCurrencyCode(this.safeString2(trade, 'feeCurrency', 'feeCoin')),
2111
2111
  'cost': this.safeString(trade, 'fee'),
2112
- 'rate': undefined,
2113
2112
  },
2114
2113
  }, market);
2115
2114
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.3.77",
3
+ "version": "4.3.78",
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",