ccxt 4.2.48 → 4.2.50

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.
Files changed (67) hide show
  1. package/README.md +3 -3
  2. package/build.sh +7 -0
  3. package/dist/ccxt.browser.js +598 -48
  4. package/dist/ccxt.browser.min.js +3 -3
  5. package/dist/cjs/ccxt.js +1 -1
  6. package/dist/cjs/src/base/Exchange.js +5 -0
  7. package/dist/cjs/src/binance.js +9 -4
  8. package/dist/cjs/src/bitmart.js +30 -4
  9. package/dist/cjs/src/bitstamp.js +8 -0
  10. package/dist/cjs/src/bl3p.js +47 -0
  11. package/dist/cjs/src/btcalpha.js +4 -0
  12. package/dist/cjs/src/btcmarkets.js +4 -0
  13. package/dist/cjs/src/btcturk.js +4 -0
  14. package/dist/cjs/src/bybit.js +138 -6
  15. package/dist/cjs/src/independentreserve.js +48 -0
  16. package/dist/cjs/src/latoken.js +16 -0
  17. package/dist/cjs/src/luno.js +18 -0
  18. package/dist/cjs/src/lykke.js +19 -0
  19. package/dist/cjs/src/ndax.js +18 -0
  20. package/dist/cjs/src/pro/ascendex.js +22 -7
  21. package/dist/cjs/src/pro/bequant.js +3 -4
  22. package/dist/cjs/src/pro/binance.js +29 -2
  23. package/dist/cjs/src/pro/bitget.js +28 -7
  24. package/dist/cjs/src/pro/bitstamp.js +1 -1
  25. package/dist/cjs/src/pro/gemini.js +89 -1
  26. package/dist/cjs/src/pro/mexc.js +2 -1
  27. package/dist/cjs/src/pro/whitebit.js +9 -8
  28. package/dist/cjs/src/timex.js +35 -1
  29. package/dist/cjs/src/upbit.js +11 -2
  30. package/js/ccxt.d.ts +1 -1
  31. package/js/ccxt.js +1 -1
  32. package/js/src/abstract/bitstamp.d.ts +8 -0
  33. package/js/src/base/Exchange.d.ts +1 -0
  34. package/js/src/base/Exchange.js +5 -0
  35. package/js/src/binance.js +9 -4
  36. package/js/src/bitmart.js +30 -4
  37. package/js/src/bitstamp.js +8 -0
  38. package/js/src/bl3p.d.ts +15 -1
  39. package/js/src/bl3p.js +47 -0
  40. package/js/src/btcalpha.js +4 -0
  41. package/js/src/btcmarkets.js +4 -0
  42. package/js/src/btcturk.js +4 -0
  43. package/js/src/bybit.d.ts +3 -1
  44. package/js/src/bybit.js +138 -6
  45. package/js/src/independentreserve.d.ts +15 -1
  46. package/js/src/independentreserve.js +48 -0
  47. package/js/src/latoken.js +16 -0
  48. package/js/src/luno.js +18 -0
  49. package/js/src/lykke.js +19 -0
  50. package/js/src/ndax.js +18 -0
  51. package/js/src/pro/ascendex.d.ts +1 -0
  52. package/js/src/pro/ascendex.js +22 -7
  53. package/js/src/pro/bequant.js +3 -4
  54. package/js/src/pro/binance.d.ts +1 -0
  55. package/js/src/pro/binance.js +29 -2
  56. package/js/src/pro/bitget.js +28 -7
  57. package/js/src/pro/bitstamp.js +1 -1
  58. package/js/src/pro/gemini.d.ts +3 -1
  59. package/js/src/pro/gemini.js +89 -1
  60. package/js/src/pro/mexc.js +2 -1
  61. package/js/src/pro/whitebit.js +9 -8
  62. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
  63. package/js/src/timex.d.ts +1 -0
  64. package/js/src/timex.js +35 -1
  65. package/js/src/upbit.js +11 -2
  66. package/package.json +3 -1
  67. package/skip-tests.json +4 -3
@@ -1,5 +1,5 @@
1
1
  import geminiRest from '../gemini.js';
2
- import type { Int, Str, OrderBook, Order, Trade, OHLCV } from '../base/types.js';
2
+ import type { Int, Str, OrderBook, Order, Trade, OHLCV, Tickers } from '../base/types.js';
3
3
  import Client from '../base/ws/Client.js';
4
4
  export default class gemini extends geminiRest {
5
5
  describe(): any;
@@ -14,6 +14,8 @@ export default class gemini extends geminiRest {
14
14
  watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
15
15
  handleOrderBook(client: Client, message: any): void;
16
16
  watchOrderBookForSymbols(symbols: string[], limit?: Int, params?: {}): Promise<OrderBook>;
17
+ watchBidsAsks(symbols: string[], limit?: Int, params?: {}): Promise<Tickers>;
18
+ handleBidsAsksForMultidata(client: Client, rawBidAskChanges: any, timestamp: Int, nonce: Int): void;
17
19
  helperForWatchMultipleConstruct(itemHashName: string, symbols: string[], params?: {}): Promise<any>;
18
20
  handleOrderBookForMultidata(client: Client, rawOrderBookChanges: any, timestamp: Int, nonce: Int): void;
19
21
  handleL2Updates(client: Client, message: any): void;
@@ -18,6 +18,7 @@ export default class gemini extends geminiRest {
18
18
  'watchBalance': false,
19
19
  'watchTicker': false,
20
20
  'watchTickers': false,
21
+ 'watchBidsAsks': true,
21
22
  'watchTrades': true,
22
23
  'watchTradesForSymbols': true,
23
24
  'watchMyTrades': false,
@@ -417,6 +418,79 @@ export default class gemini extends geminiRest {
417
418
  const orderbook = await this.helperForWatchMultipleConstruct('orderbook', symbols, params);
418
419
  return orderbook.limit();
419
420
  }
421
+ async watchBidsAsks(symbols, limit = undefined, params = {}) {
422
+ /**
423
+ * @method
424
+ * @name gemini#watchBidsAsks
425
+ * @description watches best bid & ask for symbols
426
+ * @see https://docs.gemini.com/websocket-api/#multi-market-data
427
+ * @param {string[]} symbols unified symbol of the market to fetch the ticker for
428
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
429
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
430
+ */
431
+ return await this.helperForWatchMultipleConstruct('bidsasks', symbols, params);
432
+ }
433
+ handleBidsAsksForMultidata(client, rawBidAskChanges, timestamp, nonce) {
434
+ //
435
+ // {
436
+ // eventId: '1683002916916153',
437
+ // events: [
438
+ // {
439
+ // price: '50945.37',
440
+ // reason: 'top-of-book',
441
+ // remaining: '0.0',
442
+ // side: 'bid',
443
+ // symbol: 'BTCUSDT',
444
+ // type: 'change'
445
+ // },
446
+ // {
447
+ // price: '50947.75',
448
+ // reason: 'top-of-book',
449
+ // remaining: '0.11725',
450
+ // side: 'bid',
451
+ // symbol: 'BTCUSDT',
452
+ // type: 'change'
453
+ // }
454
+ // ],
455
+ // socket_sequence: 322,
456
+ // timestamp: 1708674495,
457
+ // timestampms: 1708674495174,
458
+ // type: 'update'
459
+ // }
460
+ //
461
+ const marketId = rawBidAskChanges[0]['symbol'];
462
+ const market = this.safeMarket(marketId.toLowerCase());
463
+ const symbol = market['symbol'];
464
+ if (!(symbol in this.bidsasks)) {
465
+ this.bidsasks[symbol] = this.parseTicker({});
466
+ this.bidsasks[symbol]['symbol'] = symbol;
467
+ }
468
+ const currentBidAsk = this.bidsasks[symbol];
469
+ const messageHash = 'bidsasks:' + symbol;
470
+ // last update always overwrites the previous state and is the latest state
471
+ for (let i = 0; i < rawBidAskChanges.length; i++) {
472
+ const entry = rawBidAskChanges[i];
473
+ const rawSide = this.safeString(entry, 'side');
474
+ const price = this.safeNumber(entry, 'price');
475
+ const size = this.safeNumber(entry, 'remaining');
476
+ if (size === 0) {
477
+ continue;
478
+ }
479
+ if (rawSide === 'bid') {
480
+ currentBidAsk['bid'] = price;
481
+ currentBidAsk['bidVolume'] = size;
482
+ }
483
+ else {
484
+ currentBidAsk['ask'] = price;
485
+ currentBidAsk['askVolume'] = size;
486
+ }
487
+ }
488
+ currentBidAsk['timestamp'] = timestamp;
489
+ currentBidAsk['datetime'] = this.iso8601(timestamp);
490
+ currentBidAsk['info'] = rawBidAskChanges;
491
+ this.bidsasks[symbol] = currentBidAsk;
492
+ client.resolve(currentBidAsk, messageHash);
493
+ }
420
494
  async helperForWatchMultipleConstruct(itemHashName, symbols, params = {}) {
421
495
  await this.loadMarkets();
422
496
  symbols = this.marketSymbols(symbols, undefined, false, true, true);
@@ -438,6 +512,9 @@ export default class gemini extends geminiRest {
438
512
  if (itemHashName === 'orderbook') {
439
513
  url += 'trades=false&bids=true&offers=true';
440
514
  }
515
+ else if (itemHashName === 'bidsasks') {
516
+ url += 'trades=false&bids=true&offers=true&top_of_book=true';
517
+ }
441
518
  else if (itemHashName === 'trades') {
442
519
  url += 'trades=true&bids=false&offers=false';
443
520
  }
@@ -780,18 +857,29 @@ export default class gemini extends geminiRest {
780
857
  const eventId = this.safeInteger(message, 'eventId');
781
858
  const events = this.safeList(message, 'events');
782
859
  const orderBookItems = [];
860
+ const bidaskItems = [];
783
861
  const collectedEventsOfTrades = [];
862
+ const eventsLength = events.length;
784
863
  for (let i = 0; i < events.length; i++) {
785
864
  const event = events[i];
786
865
  const eventType = this.safeString(event, 'type');
787
866
  const isOrderBook = (eventType === 'change') && ('side' in event) && this.inArray(event['side'], ['ask', 'bid']);
788
- if (isOrderBook) {
867
+ const eventReason = this.safeString(event, 'reason');
868
+ const isBidAsk = (eventReason === 'top-of-book') || (isOrderBook && (eventReason === 'initial') && eventsLength === 2);
869
+ if (isBidAsk) {
870
+ bidaskItems.push(event);
871
+ }
872
+ else if (isOrderBook) {
789
873
  orderBookItems.push(event);
790
874
  }
791
875
  else if (eventType === 'trade') {
792
876
  collectedEventsOfTrades.push(events[i]);
793
877
  }
794
878
  }
879
+ const lengthBa = bidaskItems.length;
880
+ if (lengthBa > 0) {
881
+ this.handleBidsAsksForMultidata(client, bidaskItems, ts, eventId);
882
+ }
795
883
  const lengthOb = orderBookItems.length;
796
884
  if (lengthOb > 0) {
797
885
  this.handleOrderBookForMultidata(client, orderBookItems, ts, eventId);
@@ -453,6 +453,7 @@ export default class mexc extends mexcRest {
453
453
  const symbol = this.safeSymbol(marketId);
454
454
  const messageHash = 'orderbook:' + symbol;
455
455
  const subscription = this.safeValue(client.subscriptions, messageHash);
456
+ const limit = this.safeInteger(subscription, 'limit');
456
457
  if (subscription === true) {
457
458
  // we set client.subscriptions[messageHash] to 1
458
459
  // once we have received the first delta and initialized the orderbook
@@ -465,7 +466,7 @@ export default class mexc extends mexcRest {
465
466
  const cacheLength = storedOrderBook.cache.length;
466
467
  const snapshotDelay = this.handleOption('watchOrderBook', 'snapshotDelay', 25);
467
468
  if (cacheLength === snapshotDelay) {
468
- this.spawn(this.loadOrderBook, client, messageHash, symbol);
469
+ this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {});
469
470
  }
470
471
  storedOrderBook.cache.push(data);
471
472
  return;
@@ -166,6 +166,7 @@ export default class whitebit extends whitebitRest {
166
166
  // "params":[
167
167
  // true,
168
168
  // {
169
+ // "timestamp": 1708679568.940867,
169
170
  // "asks":[
170
171
  // [ "21252.45","0.01957"],
171
172
  // ["21252.55","0.126205"],
@@ -202,14 +203,14 @@ export default class whitebit extends whitebitRest {
202
203
  const market = this.safeMarket(marketId);
203
204
  const symbol = market['symbol'];
204
205
  const data = this.safeValue(params, 1);
205
- let orderbook = undefined;
206
- if (symbol in this.orderbooks) {
207
- orderbook = this.orderbooks[symbol];
208
- }
209
- else {
210
- orderbook = this.orderBook();
211
- this.orderbooks[symbol] = orderbook;
212
- }
206
+ const timestamp = this.safeTimestamp(data, 'timestamp');
207
+ if (!(symbol in this.orderbooks)) {
208
+ const ob = this.orderBook();
209
+ this.orderbooks[symbol] = ob;
210
+ }
211
+ const orderbook = this.orderbooks[symbol];
212
+ orderbook['timestamp'] = timestamp;
213
+ orderbook['datetime'] = this.iso8601(timestamp);
213
214
  if (isSnapshot) {
214
215
  const snapshot = this.parseOrderBook(data, symbol);
215
216
  orderbook.reset(snapshot);
@@ -15,7 +15,7 @@ export declare class BigInteger {
15
15
  protected intValue(): number;
16
16
  protected byteValue(): number;
17
17
  protected shortValue(): number;
18
- protected signum(): 1 | 0 | -1;
18
+ protected signum(): 0 | 1 | -1;
19
19
  toByteArray(): number[];
20
20
  protected equals(a: BigInteger): boolean;
21
21
  protected min(a: BigInteger): BigInteger;
package/js/src/timex.d.ts CHANGED
@@ -6,6 +6,7 @@ import type { Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSid
6
6
  */
7
7
  export default class timex extends Exchange {
8
8
  describe(): any;
9
+ fetchTime(params?: {}): Promise<number>;
9
10
  fetchMarkets(params?: {}): Promise<import("./base/types.js").MarketInterface[]>;
10
11
  fetchCurrencies(params?: {}): Promise<{}>;
11
12
  fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
package/js/src/timex.js CHANGED
@@ -73,6 +73,7 @@ export default class timex extends Exchange {
73
73
  'fetchPremiumIndexOHLCV': false,
74
74
  'fetchTicker': true,
75
75
  'fetchTickers': true,
76
+ 'fetchTime': true,
76
77
  'fetchTrades': true,
77
78
  'fetchTradingFee': true,
78
79
  'fetchWithdrawal': false,
@@ -268,11 +269,26 @@ export default class timex extends Exchange {
268
269
  },
269
270
  });
270
271
  }
272
+ async fetchTime(params = {}) {
273
+ /**
274
+ * @method
275
+ * @name timex#fetchTime
276
+ * @description fetches the current integer timestamp in milliseconds from the exchange server
277
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
278
+ * @returns {int} the current integer timestamp in milliseconds from the exchange server
279
+ */
280
+ const response = await this.tradingviewGetTime(params);
281
+ //
282
+ // 1708682617
283
+ //
284
+ return this.parseToInt(response) * 1000;
285
+ }
271
286
  async fetchMarkets(params = {}) {
272
287
  /**
273
288
  * @method
274
289
  * @name timex#fetchMarkets
275
290
  * @description retrieves data on all markets for timex
291
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listMarkets
276
292
  * @param {object} [params] extra parameters specific to the exchange API endpoint
277
293
  * @returns {object[]} an array of objects representing market data
278
294
  */
@@ -305,6 +321,7 @@ export default class timex extends Exchange {
305
321
  * @method
306
322
  * @name timex#fetchCurrencies
307
323
  * @description fetches all available currencies on an exchange
324
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listCurrencies
308
325
  * @param {object} [params] extra parameters specific to the exchange API endpoint
309
326
  * @returns {object} an associative dictionary of currencies
310
327
  */
@@ -346,6 +363,7 @@ export default class timex extends Exchange {
346
363
  * @method
347
364
  * @name timex#fetchDeposits
348
365
  * @description fetch all deposits made to an account
366
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Manager/getDeposits
349
367
  * @param {string} code unified currency code
350
368
  * @param {int} [since] the earliest time in ms to fetch deposits for
351
369
  * @param {int} [limit] the maximum number of deposits structures to retrieve
@@ -381,6 +399,7 @@ export default class timex extends Exchange {
381
399
  * @method
382
400
  * @name timex#fetchWithdrawals
383
401
  * @description fetch all withdrawals made to an account
402
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Manager/getWithdraws
384
403
  * @param {string} code unified currency code
385
404
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
386
405
  * @param {int} [limit] the maximum number of transaction structures to retrieve
@@ -465,6 +484,7 @@ export default class timex extends Exchange {
465
484
  * @method
466
485
  * @name timex#fetchTickers
467
486
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
487
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listTickers
468
488
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
469
489
  * @param {object} [params] extra parameters specific to the exchange API endpoint
470
490
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -499,6 +519,7 @@ export default class timex extends Exchange {
499
519
  * @method
500
520
  * @name timex#fetchTicker
501
521
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
522
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listTickers
502
523
  * @param {string} symbol unified symbol of the market to fetch the ticker for
503
524
  * @param {object} [params] extra parameters specific to the exchange API endpoint
504
525
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -536,6 +557,7 @@ export default class timex extends Exchange {
536
557
  * @method
537
558
  * @name timex#fetchOrderBook
538
559
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
560
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/orderbookV2
539
561
  * @param {string} symbol unified symbol of the market to fetch the order book for
540
562
  * @param {int} [limit] the maximum amount of order book entries to return
541
563
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -582,6 +604,7 @@ export default class timex extends Exchange {
582
604
  * @method
583
605
  * @name timex#fetchTrades
584
606
  * @description get the list of most recent trades for a particular symbol
607
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listTrades
585
608
  * @param {string} symbol unified symbol of the market to fetch trades for
586
609
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
587
610
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -629,6 +652,7 @@ export default class timex extends Exchange {
629
652
  * @method
630
653
  * @name timex#fetchOHLCV
631
654
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
655
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listCandles
632
656
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
633
657
  * @param {string} timeframe the length of time each candle represents
634
658
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -694,6 +718,7 @@ export default class timex extends Exchange {
694
718
  * @method
695
719
  * @name timex#fetchBalance
696
720
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
721
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/getBalances
697
722
  * @param {object} [params] extra parameters specific to the exchange API endpoint
698
723
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
699
724
  */
@@ -715,6 +740,7 @@ export default class timex extends Exchange {
715
740
  * @method
716
741
  * @name timex#createOrder
717
742
  * @description create a trade order
743
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/createOrder
718
744
  * @param {string} symbol unified symbol of the market to create an order in
719
745
  * @param {string} type 'market' or 'limit'
720
746
  * @param {string} side 'buy' or 'sell'
@@ -843,6 +869,7 @@ export default class timex extends Exchange {
843
869
  * @method
844
870
  * @name timex#cancelOrder
845
871
  * @description cancels an open order
872
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/deleteOrders
846
873
  * @param {string} id order id
847
874
  * @param {string} symbol not used by timex cancelOrder ()
848
875
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -856,6 +883,7 @@ export default class timex extends Exchange {
856
883
  * @method
857
884
  * @name timex#cancelOrders
858
885
  * @description cancel multiple orders
886
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/deleteOrders
859
887
  * @param {string[]} ids order ids
860
888
  * @param {string} symbol unified market symbol, default is undefined
861
889
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -897,6 +925,7 @@ export default class timex extends Exchange {
897
925
  * @method
898
926
  * @name timex#fetchOrder
899
927
  * @description fetches information on an order made by the user
928
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/History/getOrderDetails
900
929
  * @param {string} symbol not used by timex fetchOrder
901
930
  * @param {object} [params] extra parameters specific to the exchange API endpoint
902
931
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -948,6 +977,7 @@ export default class timex extends Exchange {
948
977
  * @method
949
978
  * @name timex#fetchOpenOrders
950
979
  * @description fetch all unfilled currently open orders
980
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/getOpenOrders
951
981
  * @param {string} symbol unified market symbol
952
982
  * @param {int} [since] the earliest time in ms to fetch open orders for
953
983
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -1002,6 +1032,7 @@ export default class timex extends Exchange {
1002
1032
  * @method
1003
1033
  * @name timex#fetchClosedOrders
1004
1034
  * @description fetches information on multiple closed orders made by the user
1035
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/History/getOrders
1005
1036
  * @param {string} symbol unified market symbol of the market orders were made in
1006
1037
  * @param {int} [since] the earliest time in ms to fetch orders for
1007
1038
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -1061,6 +1092,7 @@ export default class timex extends Exchange {
1061
1092
  * @method
1062
1093
  * @name timex#fetchMyTrades
1063
1094
  * @description fetch all trades made by the user
1095
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/History/getTrades_1
1064
1096
  * @param {string} symbol unified market symbol
1065
1097
  * @param {int} [since] the earliest time in ms to fetch trades for
1066
1098
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -1139,6 +1171,7 @@ export default class timex extends Exchange {
1139
1171
  * @method
1140
1172
  * @name timex#fetchTradingFee
1141
1173
  * @description fetch the trading fees for a market
1174
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/getFees
1142
1175
  * @param {string} symbol unified market symbol
1143
1176
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1144
1177
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -1532,6 +1565,7 @@ export default class timex extends Exchange {
1532
1565
  * @method
1533
1566
  * @name timex#fetchDepositAddress
1534
1567
  * @description fetch the deposit address for a currency associated with this account, does not accept params["network"]
1568
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Currency/selectCurrencyBySymbol
1535
1569
  * @param {string} code unified currency code
1536
1570
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1537
1571
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -1594,7 +1628,7 @@ export default class timex extends Exchange {
1594
1628
  if (Object.keys(params).length) {
1595
1629
  url += '?' + this.urlencodeWithArrayRepeat(params);
1596
1630
  }
1597
- if (api !== 'public') {
1631
+ if (api !== 'public' && api !== 'tradingview') {
1598
1632
  this.checkRequiredCredentials();
1599
1633
  const auth = this.stringToBase64(this.apiKey + ':' + this.secret);
1600
1634
  const secret = 'Basic ' + auth;
package/js/src/upbit.js CHANGED
@@ -44,9 +44,9 @@ export default class upbit extends Exchange {
44
44
  'fetchBalance': true,
45
45
  'fetchCanceledOrders': true,
46
46
  'fetchClosedOrders': true,
47
+ 'fetchDeposit': true,
47
48
  'fetchDepositAddress': true,
48
49
  'fetchDepositAddresses': true,
49
- 'fetchDeposit': true,
50
50
  'fetchDeposits': true,
51
51
  'fetchFundingHistory': false,
52
52
  'fetchFundingRate': false,
@@ -1030,6 +1030,7 @@ export default class upbit extends Exchange {
1030
1030
  * @name upbit#createOrder
1031
1031
  * @description create a trade order
1032
1032
  * @see https://docs.upbit.com/reference/%EC%A3%BC%EB%AC%B8%ED%95%98%EA%B8%B0
1033
+ * @see https://global-docs.upbit.com/reference/order
1033
1034
  * @param {string} symbol unified symbol of the market to create an order in
1034
1035
  * @param {string} type 'market' or 'limit'
1035
1036
  * @param {string} side 'buy' or 'sell'
@@ -1037,6 +1038,7 @@ export default class upbit extends Exchange {
1037
1038
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1038
1039
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1039
1040
  * @param {float} [params.cost] for market buy orders, the quote quantity that can be used as an alternative for the amount
1041
+ * @param {string} [params.timeInForce] 'IOC' or 'FOK'
1040
1042
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1041
1043
  */
1042
1044
  await this.loadMarkets();
@@ -1093,6 +1095,13 @@ export default class upbit extends Exchange {
1093
1095
  if (clientOrderId !== undefined) {
1094
1096
  request['identifier'] = clientOrderId;
1095
1097
  }
1098
+ if (type !== 'market') {
1099
+ const timeInForce = this.safeStringLower2(params, 'timeInForce', 'time_in_force');
1100
+ params = this.omit(params, 'timeInForce');
1101
+ if (timeInForce !== undefined) {
1102
+ request['time_in_force'] = timeInForce;
1103
+ }
1104
+ }
1096
1105
  params = this.omit(params, ['clientOrderId', 'identifier']);
1097
1106
  const response = await this.privatePostOrders(this.extend(request, params));
1098
1107
  //
@@ -1876,7 +1885,7 @@ export default class upbit extends Exchange {
1876
1885
  }
1877
1886
  if (api === 'private') {
1878
1887
  this.checkRequiredCredentials();
1879
- const nonce = this.nonce();
1888
+ const nonce = this.uuid();
1880
1889
  const request = {
1881
1890
  'access_key': this.apiKey,
1882
1891
  'nonce': nonce,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.2.48",
3
+ "version": "4.2.50",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.js",
6
6
  "type": "module",
@@ -56,6 +56,8 @@
56
56
  "test-py-ws": "node run-tests --ws --python --useProxy",
57
57
  "test-php": "node run-tests --php --useProxy",
58
58
  "test-php-ws": "node run-tests --ws --php --useProxy",
59
+ "test-csharp": "npm run commonjs-test && node run-tests --csharp --useProxy",
60
+ "test-csharp-ws": "node run-tests --ws --csharp --useProxy",
59
61
  "test-js-base": "node ./js/src/test/base/test.base.js",
60
62
  "test-js-base-ws": "npm run test-js-cache && npm run test-js-orderbook",
61
63
  "test-python-base": "python3 python/ccxt/test/base/test_number.py && python3 python/ccxt/test/base/test_crypto.py",
package/skip-tests.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "ace": {
3
3
  "skip": "temp",
4
- "skipWs": true,
5
4
  "skipMethods": {
6
5
  "loadMarkets": {
7
6
  "currencyIdAndCode": "temporary skip, because ids are numeric and we are in wip for numeric id tests",
@@ -22,7 +21,6 @@
22
21
  "skipWs": "private endpoints"
23
22
  },
24
23
  "ascendex": {
25
- "skipWs": "unknown https://app.travis-ci.com/github/ccxt/ccxt/builds/267900037#L2416",
26
24
  "skipMethods": {
27
25
  "loadMarkets": {
28
26
  "currencyIdAndCode": "broken currencies"
@@ -35,11 +33,14 @@
35
33
  "low":"16 Aug - happened weird negative 24hr low",
36
34
  "bid":"messed bid-ask",
37
35
  "ask":"messed bid-ask"
36
+ },
37
+ "watchOrderBook": {
38
+ "bid":"messed bid-ask",
39
+ "ask":"messed bid-ask"
38
40
  }
39
41
  }
40
42
  },
41
43
  "bequant": {
42
- "skipWs": "timeouts",
43
44
  "skipMethods": {
44
45
  "loadMarkets": {
45
46
  "currencyIdAndCode": "https://app.travis-ci.com/github/ccxt/ccxt/builds/264802937#L2194"