ccxt 4.2.45 → 4.2.46

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 (71) hide show
  1. package/CHANGELOG.md +3099 -8415
  2. package/README.md +4 -4
  3. package/change.sh +4 -2
  4. package/dist/ccxt.browser.js +381 -58
  5. package/dist/ccxt.browser.min.js +7 -7
  6. package/dist/cjs/ccxt.js +1 -1
  7. package/dist/cjs/src/base/ws/Cache.js +13 -5
  8. package/dist/cjs/src/base/ws/OrderBook.js +2 -2
  9. package/dist/cjs/src/binance.js +34 -12
  10. package/dist/cjs/src/bitfinex2.js +1 -0
  11. package/dist/cjs/src/bithumb.js +5 -0
  12. package/dist/cjs/src/btcturk.js +11 -0
  13. package/dist/cjs/src/coinbase.js +9 -5
  14. package/dist/cjs/src/coincheck.js +11 -0
  15. package/dist/cjs/src/coinmate.js +114 -1
  16. package/dist/cjs/src/coinspot.js +7 -0
  17. package/dist/cjs/src/cryptocom.js +2 -2
  18. package/dist/cjs/src/hitbtc.js +2 -0
  19. package/dist/cjs/src/idex.js +60 -1
  20. package/dist/cjs/src/latoken.js +3 -0
  21. package/dist/cjs/src/mercado.js +3 -0
  22. package/dist/cjs/src/oceanex.js +3 -0
  23. package/dist/cjs/src/okx.js +1 -0
  24. package/dist/cjs/src/pro/bitget.js +12 -8
  25. package/dist/cjs/src/pro/bitmart.js +11 -11
  26. package/dist/cjs/src/pro/bitmex.js +4 -4
  27. package/dist/cjs/src/pro/cex.js +2 -2
  28. package/dist/cjs/src/pro/gemini.js +4 -3
  29. package/dist/cjs/src/timex.js +65 -0
  30. package/js/ccxt.d.ts +1 -1
  31. package/js/ccxt.js +1 -1
  32. package/js/src/abstract/bequant.d.ts +2 -0
  33. package/js/src/abstract/bitcoincom.d.ts +2 -0
  34. package/js/src/abstract/bithumb.d.ts +5 -0
  35. package/js/src/abstract/coinmate.d.ts +12 -0
  36. package/js/src/abstract/fmfwio.d.ts +2 -0
  37. package/js/src/abstract/hitbtc.d.ts +2 -0
  38. package/js/src/abstract/hitbtc3.d.ts +2 -0
  39. package/js/src/abstract/okx.d.ts +1 -0
  40. package/js/src/base/Exchange.d.ts +9 -7
  41. package/js/src/base/ws/Cache.d.ts +5 -1
  42. package/js/src/base/ws/Cache.js +13 -5
  43. package/js/src/base/ws/OrderBook.d.ts +5 -1
  44. package/js/src/base/ws/OrderBook.js +3 -3
  45. package/js/src/binance.d.ts +1 -1
  46. package/js/src/binance.js +34 -12
  47. package/js/src/bitfinex2.js +1 -0
  48. package/js/src/bithumb.js +5 -0
  49. package/js/src/btcturk.js +11 -0
  50. package/js/src/coinbase.js +9 -5
  51. package/js/src/coincheck.js +11 -0
  52. package/js/src/coinmate.d.ts +3 -1
  53. package/js/src/coinmate.js +114 -1
  54. package/js/src/coinspot.js +7 -0
  55. package/js/src/cryptocom.js +2 -2
  56. package/js/src/hitbtc.js +2 -0
  57. package/js/src/idex.d.ts +14 -0
  58. package/js/src/idex.js +60 -1
  59. package/js/src/latoken.js +3 -0
  60. package/js/src/mercado.js +3 -0
  61. package/js/src/oceanex.js +3 -0
  62. package/js/src/okx.js +1 -0
  63. package/js/src/pro/bitget.js +12 -8
  64. package/js/src/pro/bitmart.js +11 -11
  65. package/js/src/pro/bitmex.js +4 -4
  66. package/js/src/pro/cex.js +2 -2
  67. package/js/src/pro/gemini.js +4 -3
  68. package/js/src/timex.d.ts +14 -0
  69. package/js/src/timex.js +65 -0
  70. package/package.json +1 -1
  71. package/skip-tests.json +4 -0
package/dist/cjs/ccxt.js CHANGED
@@ -177,7 +177,7 @@ var woo$1 = require('./src/pro/woo.js');
177
177
 
178
178
  //-----------------------------------------------------------------------------
179
179
  // this is updated by vss.js when building
180
- const version = '4.2.45';
180
+ const version = '4.2.46';
181
181
  Exchange["default"].ccxtVersion = version;
182
182
  const exchanges = {
183
183
  'ace': ace,
@@ -20,6 +20,7 @@ class BaseCache extends Array {
20
20
  class ArrayCache extends BaseCache {
21
21
  constructor(maxSize = undefined) {
22
22
  super(maxSize);
23
+ this.hashmap = {};
23
24
  Object.defineProperty(this, 'nestedNewUpdatesBySymbol', {
24
25
  __proto__: null,
25
26
  value: false,
@@ -45,6 +46,12 @@ class ArrayCache extends BaseCache {
45
46
  value: false,
46
47
  writable: true,
47
48
  });
49
+ Object.defineProperty(this, 'hashmap', {
50
+ __proto__: null,
51
+ value: {},
52
+ writable: true,
53
+ enumerable: false,
54
+ });
48
55
  }
49
56
  getLimit(symbol, limit) {
50
57
  let newUpdatesValue = undefined;
@@ -124,6 +131,7 @@ class ArrayCacheByTimestamp extends BaseCache {
124
131
  if (item[0] in this.hashmap) {
125
132
  const reference = this.hashmap[item[0]];
126
133
  if (reference !== item) {
134
+ // eslint-disable-next-line
127
135
  for (const prop in item) {
128
136
  reference[prop] = item[prop];
129
137
  }
@@ -149,11 +157,11 @@ class ArrayCacheBySymbolById extends ArrayCache {
149
157
  constructor(maxSize = undefined) {
150
158
  super(maxSize);
151
159
  this.nestedNewUpdatesBySymbol = true;
152
- Object.defineProperty(this, 'hashmap', {
153
- __proto__: null,
154
- value: {},
155
- writable: true,
156
- });
160
+ // Object.defineProperty (this, 'hashmap', {
161
+ // __proto__: null, // make it invisible
162
+ // value: {},
163
+ // writable: true,
164
+ // })
157
165
  }
158
166
  append(item) {
159
167
  const byId = this.hashmap[item.symbol] = this.hashmap[item.symbol] || {};
@@ -7,14 +7,14 @@ var generic = require('../functions/generic.js');
7
7
  var OrderBookSide = require('./OrderBookSide.js');
8
8
 
9
9
  /* eslint-disable max-classes-per-file */
10
- // ----------------------------------------------------------------------------
11
- // overwrites absolute volumes at price levels
12
10
  class OrderBook {
13
11
  constructor(snapshot = {}, depth = undefined) {
12
+ this.cache = []; // make prop visible so we use typed OrderBooks
14
13
  Object.defineProperty(this, 'cache', {
15
14
  __proto__: null,
16
15
  value: [],
17
16
  writable: true,
17
+ enumerable: false,
18
18
  });
19
19
  depth = depth || Number.MAX_SAFE_INTEGER;
20
20
  const defaults = {
@@ -3158,25 +3158,38 @@ class binance extends binance$1 {
3158
3158
  account['debt'] = Precise["default"].stringAdd(debt, interest);
3159
3159
  return account;
3160
3160
  }
3161
- parseBalanceCustom(response, type = undefined, marginMode = undefined) {
3161
+ parseBalanceCustom(response, type = undefined, marginMode = undefined, isPortfolioMargin = false) {
3162
3162
  const result = {
3163
3163
  'info': response,
3164
3164
  };
3165
3165
  let timestamp = undefined;
3166
3166
  const isolated = marginMode === 'isolated';
3167
3167
  const cross = (type === 'margin') || (marginMode === 'cross');
3168
- if (type === 'papi') {
3168
+ if (isPortfolioMargin) {
3169
3169
  for (let i = 0; i < response.length; i++) {
3170
3170
  const entry = response[i];
3171
3171
  const account = this.account();
3172
3172
  const currencyId = this.safeString(entry, 'asset');
3173
3173
  const code = this.safeCurrencyCode(currencyId);
3174
- const borrowed = this.safeString(entry, 'crossMarginBorrowed');
3175
- const interest = this.safeString(entry, 'crossMarginInterest');
3176
- account['free'] = this.safeString(entry, 'crossMarginFree');
3177
- account['used'] = this.safeString(entry, 'crossMarginLocked');
3178
- account['total'] = this.safeString(entry, 'crossMarginAsset');
3179
- account['debt'] = Precise["default"].stringAdd(borrowed, interest);
3174
+ if (type === 'linear') {
3175
+ account['free'] = this.safeString(entry, 'umWalletBalance');
3176
+ account['used'] = this.safeString(entry, 'umUnrealizedPNL');
3177
+ }
3178
+ else if (type === 'inverse') {
3179
+ account['free'] = this.safeString(entry, 'cmWalletBalance');
3180
+ account['used'] = this.safeString(entry, 'cmUnrealizedPNL');
3181
+ }
3182
+ else if (cross) {
3183
+ const borrowed = this.safeString(entry, 'crossMarginBorrowed');
3184
+ const interest = this.safeString(entry, 'crossMarginInterest');
3185
+ account['debt'] = Precise["default"].stringAdd(borrowed, interest);
3186
+ account['free'] = this.safeString(entry, 'crossMarginFree');
3187
+ account['used'] = this.safeString(entry, 'crossMarginLocked');
3188
+ account['total'] = this.safeString(entry, 'crossMarginAsset');
3189
+ }
3190
+ else {
3191
+ account['total'] = this.safeString(entry, 'totalWalletBalance');
3192
+ }
3180
3193
  result[code] = account;
3181
3194
  }
3182
3195
  }
@@ -3296,7 +3309,13 @@ class binance extends binance$1 {
3296
3309
  let response = undefined;
3297
3310
  const request = {};
3298
3311
  if (isPortfolioMargin || (type === 'papi')) {
3299
- type = 'papi';
3312
+ if (this.isLinear(type, subType)) {
3313
+ type = 'linear';
3314
+ }
3315
+ else if (this.isInverse(type, subType)) {
3316
+ type = 'inverse';
3317
+ }
3318
+ isPortfolioMargin = true;
3300
3319
  response = await this.papiGetBalance(this.extend(request, query));
3301
3320
  }
3302
3321
  else if (this.isLinear(type, subType)) {
@@ -3544,7 +3563,7 @@ class binance extends binance$1 {
3544
3563
  // },
3545
3564
  // ]
3546
3565
  //
3547
- return this.parseBalanceCustom(response, type, marginMode);
3566
+ return this.parseBalanceCustom(response, type, marginMode, isPortfolioMargin);
3548
3567
  }
3549
3568
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
3550
3569
  /**
@@ -9827,12 +9846,12 @@ class binance extends binance$1 {
9827
9846
  /**
9828
9847
  * @method
9829
9848
  * @name binance#fetchPositions
9849
+ * @description fetch all open positions
9830
9850
  * @see https://binance-docs.github.io/apidocs/futures/en/#position-information-v2-user_data
9831
9851
  * @see https://binance-docs.github.io/apidocs/delivery/en/#position-information-user_data
9832
9852
  * @see https://binance-docs.github.io/apidocs/futures/en/#account-information-v2-user_data
9833
9853
  * @see https://binance-docs.github.io/apidocs/delivery/en/#account-information-user_data
9834
9854
  * @see https://binance-docs.github.io/apidocs/voptions/en/#option-position-information-user_data
9835
- * @description fetch all open positions
9836
9855
  * @param {string[]} [symbols] list of unified market symbols
9837
9856
  * @param {object} [params] extra parameters specific to the exchange API endpoint
9838
9857
  * @param {string} [method] method name to call, "positionRisk", "account" or "option", default is "positionRisk"
@@ -10056,7 +10075,10 @@ class binance extends binance$1 {
10056
10075
  const result = [];
10057
10076
  for (let i = 0; i < response.length; i++) {
10058
10077
  const parsed = this.parsePositionRisk(response[i]);
10059
- result.push(parsed);
10078
+ const entryPrice = this.safeString(parsed, 'entryPrice');
10079
+ if ((entryPrice !== '0') && (entryPrice !== '0.0') && (entryPrice !== '0.00000000')) {
10080
+ result.push(parsed);
10081
+ }
10060
10082
  }
10061
10083
  symbols = this.marketSymbols(symbols);
10062
10084
  return this.filterByArrayPositions(result, 'symbol', symbols, false);
@@ -406,6 +406,7 @@ class bitfinex2 extends bitfinex2$1 {
406
406
  'EDO': 'PNT',
407
407
  'EUS': 'EURS',
408
408
  'EUT': 'EURT',
409
+ 'HTX': 'HT',
409
410
  'IDX': 'ID',
410
411
  'IOT': 'IOTA',
411
412
  'IQX': 'IQ',
@@ -88,6 +88,11 @@ class bithumb extends bithumb$1 {
88
88
  'orderbook/ALL_{quoteId}',
89
89
  'orderbook/{baseId}_{quoteId}',
90
90
  'transaction_history/{baseId}_{quoteId}',
91
+ 'network-info',
92
+ 'assetsstatus/multichain/ALL',
93
+ 'assetsstatus/multichain/{currency}',
94
+ 'withdraw/minimum/ALL',
95
+ 'withdraw/minimum/{currency}',
91
96
  'assetsstatus/ALL',
92
97
  'assetsstatus/{baseId}',
93
98
  'candlestick/{baseId}_{quoteId}/{interval}',
@@ -144,6 +144,7 @@ class btcturk extends btcturk$1 {
144
144
  * @method
145
145
  * @name btcturk#fetchMarkets
146
146
  * @description retrieves data on all markets for btcturk
147
+ * @see https://docs.btcturk.com/public-endpoints/exchange-info
147
148
  * @param {object} [params] extra parameters specific to the exchange API endpoint
148
149
  * @returns {object[]} an array of objects representing market data
149
150
  */
@@ -293,6 +294,7 @@ class btcturk extends btcturk$1 {
293
294
  * @method
294
295
  * @name btcturk#fetchBalance
295
296
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
297
+ * @see https://docs.btcturk.com/private-endpoints/account-balance
296
298
  * @param {object} [params] extra parameters specific to the exchange API endpoint
297
299
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
298
300
  */
@@ -321,6 +323,7 @@ class btcturk extends btcturk$1 {
321
323
  * @method
322
324
  * @name btcturk#fetchOrderBook
323
325
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
326
+ * @see https://docs.btcturk.com/public-endpoints/orderbook
324
327
  * @param {string} symbol unified symbol of the market to fetch the order book for
325
328
  * @param {int} [limit] the maximum amount of order book entries to return
326
329
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -401,6 +404,7 @@ class btcturk extends btcturk$1 {
401
404
  * @method
402
405
  * @name btcturk#fetchTickers
403
406
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
407
+ * @see https://docs.btcturk.com/public-endpoints/ticker
404
408
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
405
409
  * @param {object} [params] extra parameters specific to the exchange API endpoint
406
410
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -415,6 +419,7 @@ class btcturk extends btcturk$1 {
415
419
  * @method
416
420
  * @name btcturk#fetchTicker
417
421
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
422
+ * @see https://docs.btcturk.com/public-endpoints/ticker
418
423
  * @param {string} symbol unified symbol of the market to fetch the ticker for
419
424
  * @param {object} [params] extra parameters specific to the exchange API endpoint
420
425
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -490,6 +495,7 @@ class btcturk extends btcturk$1 {
490
495
  * @method
491
496
  * @name btcturk#fetchTrades
492
497
  * @description get the list of most recent trades for a particular symbol
498
+ * @see https://docs.btcturk.com/public-endpoints/trades
493
499
  * @param {string} symbol unified symbol of the market to fetch trades for
494
500
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
495
501
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -653,6 +659,7 @@ class btcturk extends btcturk$1 {
653
659
  * @method
654
660
  * @name btcturk#createOrder
655
661
  * @description create a trade order
662
+ * @see https://docs.btcturk.com/private-endpoints/submit-order
656
663
  * @param {string} symbol unified symbol of the market to create an order in
657
664
  * @param {string} type 'market' or 'limit'
658
665
  * @param {string} side 'buy' or 'sell'
@@ -687,6 +694,7 @@ class btcturk extends btcturk$1 {
687
694
  * @method
688
695
  * @name btcturk#cancelOrder
689
696
  * @description cancels an open order
697
+ * @see https://docs.btcturk.com/private-endpoints/cancel-order
690
698
  * @param {string} id order id
691
699
  * @param {string} symbol not used by btcturk cancelOrder ()
692
700
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -702,6 +710,7 @@ class btcturk extends btcturk$1 {
702
710
  * @method
703
711
  * @name btcturk#fetchOpenOrders
704
712
  * @description fetch all unfilled currently open orders
713
+ * @see https://docs.btcturk.com/private-endpoints/open-orders
705
714
  * @param {string} symbol unified market symbol
706
715
  * @param {int} [since] the earliest time in ms to fetch open orders for
707
716
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -726,6 +735,7 @@ class btcturk extends btcturk$1 {
726
735
  * @method
727
736
  * @name btcturk#fetchOrders
728
737
  * @description fetches information on multiple orders made by the user
738
+ * @see https://docs.btcturk.com/private-endpoints/all-orders
729
739
  * @param {string} symbol unified market symbol of the market orders were made in
730
740
  * @param {int} [since] the earliest time in ms to fetch orders for
731
741
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -848,6 +858,7 @@ class btcturk extends btcturk$1 {
848
858
  * @method
849
859
  * @name btcturk#fetchMyTrades
850
860
  * @description fetch all trades made by the user
861
+ * @see https://docs.btcturk.com/private-endpoints/user-transactions
851
862
  * @param {string} symbol unified market symbol
852
863
  * @param {int} [since] the earliest time in ms to fetch trades for
853
864
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -62,6 +62,8 @@ class coinbase extends coinbase$1 {
62
62
  'fetchCrossBorrowRate': false,
63
63
  'fetchCrossBorrowRates': false,
64
64
  'fetchCurrencies': true,
65
+ 'fetchDepositAddress': 'emulated',
66
+ 'fetchDepositAddresses': false,
65
67
  'fetchDepositAddressesByNetwork': true,
66
68
  'fetchDeposits': true,
67
69
  'fetchFundingHistory': false,
@@ -1740,17 +1742,18 @@ class coinbase extends coinbase$1 {
1740
1742
  * @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-accounts#list-accounts
1741
1743
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1742
1744
  * @param {boolean} [params.v3] default false, set true to use v3 api endpoint
1745
+ * @param {object} [params.type] "spot" (default) or "swap"
1743
1746
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
1744
1747
  */
1745
1748
  await this.loadMarkets();
1746
- const request = {
1747
- 'limit': 250,
1748
- };
1749
+ const request = {};
1749
1750
  let response = undefined;
1750
1751
  const isV3 = this.safeBool(params, 'v3', false);
1751
- params = this.omit(params, 'v3');
1752
+ const type = this.safeString(params, 'type');
1753
+ params = this.omit(params, ['v3', 'type']);
1752
1754
  const method = this.safeString(this.options, 'fetchBalance', 'v3PrivateGetBrokerageAccounts');
1753
1755
  if ((isV3) || (method === 'v3PrivateGetBrokerageAccounts')) {
1756
+ request['limit'] = 250;
1754
1757
  response = await this.v3PrivateGetBrokerageAccounts(this.extend(request, params));
1755
1758
  }
1756
1759
  else {
@@ -1827,6 +1830,7 @@ class coinbase extends coinbase$1 {
1827
1830
  // "size": 9
1828
1831
  // }
1829
1832
  //
1833
+ params['type'] = type;
1830
1834
  return this.parseCustomBalance(response, params);
1831
1835
  }
1832
1836
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
@@ -3401,7 +3405,7 @@ class coinbase extends coinbase$1 {
3401
3405
  async fetchDepositAddressesByNetwork(code, params = {}) {
3402
3406
  /**
3403
3407
  * @method
3404
- * @name ascendex#fetchDepositAddress
3408
+ * @name coinbase#fetchDepositAddress
3405
3409
  * @description fetch the deposit address for a currency associated with this account
3406
3410
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postcoinbaseaccountaddresses
3407
3411
  * @param {string} code unified currency code
@@ -189,6 +189,7 @@ class coincheck extends coincheck$1 {
189
189
  * @method
190
190
  * @name coincheck#fetchBalance
191
191
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
192
+ * @see https://coincheck.com/documents/exchange/api#order-transactions-pagination
192
193
  * @param {object} [params] extra parameters specific to the exchange API endpoint
193
194
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
194
195
  */
@@ -201,6 +202,7 @@ class coincheck extends coincheck$1 {
201
202
  * @method
202
203
  * @name coincheck#fetchOpenOrders
203
204
  * @description fetch all unfilled currently open orders
205
+ * @see https://coincheck.com/documents/exchange/api#order-opens
204
206
  * @param {string} symbol unified market symbol
205
207
  * @param {int} [since] the earliest time in ms to fetch open orders for
206
208
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -276,6 +278,7 @@ class coincheck extends coincheck$1 {
276
278
  * @method
277
279
  * @name coincheck#fetchOrderBook
278
280
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
281
+ * @see https://coincheck.com/documents/exchange/api#order-book
279
282
  * @param {string} symbol unified symbol of the market to fetch the order book for
280
283
  * @param {int} [limit] the maximum amount of order book entries to return
281
284
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -332,6 +335,7 @@ class coincheck extends coincheck$1 {
332
335
  * @method
333
336
  * @name coincheck#fetchTicker
334
337
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
338
+ * @see https://coincheck.com/documents/exchange/api#ticker
335
339
  * @param {string} symbol unified symbol of the market to fetch the ticker for
336
340
  * @param {object} [params] extra parameters specific to the exchange API endpoint
337
341
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -445,6 +449,7 @@ class coincheck extends coincheck$1 {
445
449
  * @method
446
450
  * @name coincheck#fetchMyTrades
447
451
  * @description fetch all trades made by the user
452
+ * @see https://coincheck.com/documents/exchange/api#order-transactions-pagination
448
453
  * @param {string} symbol unified market symbol
449
454
  * @param {int} [since] the earliest time in ms to fetch trades for
450
455
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -488,6 +493,7 @@ class coincheck extends coincheck$1 {
488
493
  * @method
489
494
  * @name coincheck#fetchTrades
490
495
  * @description get the list of most recent trades for a particular symbol
496
+ * @see https://coincheck.com/documents/exchange/api#public-trades
491
497
  * @param {string} symbol unified symbol of the market to fetch trades for
492
498
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
493
499
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -521,6 +527,7 @@ class coincheck extends coincheck$1 {
521
527
  * @method
522
528
  * @name coincheck#fetchTradingFees
523
529
  * @description fetch the trading fees for multiple markets
530
+ * @see https://coincheck.com/documents/exchange/api#account-info
524
531
  * @param {object} [params] extra parameters specific to the exchange API endpoint
525
532
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
526
533
  */
@@ -567,6 +574,7 @@ class coincheck extends coincheck$1 {
567
574
  * @method
568
575
  * @name coincheck#createOrder
569
576
  * @description create a trade order
577
+ * @see https://coincheck.com/documents/exchange/api#order-new
570
578
  * @param {string} symbol unified symbol of the market to create an order in
571
579
  * @param {string} type 'market' or 'limit'
572
580
  * @param {string} side 'buy' or 'sell'
@@ -603,6 +611,7 @@ class coincheck extends coincheck$1 {
603
611
  * @method
604
612
  * @name coincheck#cancelOrder
605
613
  * @description cancels an open order
614
+ * @see https://coincheck.com/documents/exchange/api#order-cancel
606
615
  * @param {string} id order id
607
616
  * @param {string} symbol not used by coincheck cancelOrder ()
608
617
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -618,6 +627,7 @@ class coincheck extends coincheck$1 {
618
627
  * @method
619
628
  * @name coincheck#fetchDeposits
620
629
  * @description fetch all deposits made to an account
630
+ * @see https://coincheck.com/documents/exchange/api#account-deposits
621
631
  * @param {string} code unified currency code
622
632
  * @param {int} [since] the earliest time in ms to fetch deposits for
623
633
  * @param {int} [limit] the maximum number of deposits structures to retrieve
@@ -666,6 +676,7 @@ class coincheck extends coincheck$1 {
666
676
  * @method
667
677
  * @name coincheck#fetchWithdrawals
668
678
  * @description fetch all withdrawals made from an account
679
+ * @see https://coincheck.com/documents/exchange/api#withdraws
669
680
  * @param {string} code unified currency code
670
681
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
671
682
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
@@ -62,6 +62,7 @@ class coinmate extends coinmate$1 {
62
62
  'fetchPositionsRisk': false,
63
63
  'fetchPremiumIndexOHLCV': false,
64
64
  'fetchTicker': true,
65
+ 'fetchTickers': true,
65
66
  'fetchTrades': true,
66
67
  'fetchTradingFee': true,
67
68
  'fetchTradingFees': false,
@@ -96,6 +97,8 @@ class coinmate extends coinmate$1 {
96
97
  'get': [
97
98
  'orderBook',
98
99
  'ticker',
100
+ 'tickerAll',
101
+ 'products',
99
102
  'transactions',
100
103
  'tradingPairs',
101
104
  ],
@@ -144,6 +147,16 @@ class coinmate extends coinmate$1 {
144
147
  'unconfirmedEthereumDeposits',
145
148
  'unconfirmedLitecoinDeposits',
146
149
  'unconfirmedRippleDeposits',
150
+ 'cancelAllOpenOrders',
151
+ 'withdrawVirtualCurrency',
152
+ 'virtualCurrencyDepositAddresses',
153
+ 'unconfirmedVirtualCurrencyDeposits',
154
+ 'adaWithdrawal',
155
+ 'adaDepositAddresses',
156
+ 'unconfirmedAdaDeposits',
157
+ 'solWithdrawal',
158
+ 'solDepositAddresses',
159
+ 'unconfirmedSolDeposits',
147
160
  ],
148
161
  },
149
162
  },
@@ -188,6 +201,8 @@ class coinmate extends coinmate$1 {
188
201
  'XRP': 'privatePostRippleWithdrawal',
189
202
  'DASH': 'privatePostDashWithdrawal',
190
203
  'DAI': 'privatePostDaiWithdrawal',
204
+ 'ADA': 'privatePostAdaWithdrawal',
205
+ 'SOL': 'privatePostSolWithdrawal',
191
206
  },
192
207
  },
193
208
  },
@@ -212,6 +227,7 @@ class coinmate extends coinmate$1 {
212
227
  * @method
213
228
  * @name coinmate#fetchMarkets
214
229
  * @description retrieves data on all markets for coinmate
230
+ * @see https://coinmate.docs.apiary.io/#reference/trading-pairs/get-trading-pairs/get
215
231
  * @param {object} [params] extra parameters specific to the exchange API endpoint
216
232
  * @returns {object[]} an array of objects representing market data
217
233
  */
@@ -318,6 +334,7 @@ class coinmate extends coinmate$1 {
318
334
  * @method
319
335
  * @name coinmate#fetchBalance
320
336
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
337
+ * @see https://coinmate.docs.apiary.io/#reference/balance/get-balances/post
321
338
  * @param {object} [params] extra parameters specific to the exchange API endpoint
322
339
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
323
340
  */
@@ -330,6 +347,7 @@ class coinmate extends coinmate$1 {
330
347
  * @method
331
348
  * @name coinmate#fetchOrderBook
332
349
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
350
+ * @see https://coinmate.docs.apiary.io/#reference/order-book/get-order-book/get
333
351
  * @param {string} symbol unified symbol of the market to fetch the order book for
334
352
  * @param {int} [limit] the maximum amount of order book entries to return
335
353
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -351,6 +369,7 @@ class coinmate extends coinmate$1 {
351
369
  * @method
352
370
  * @name coinmate#fetchTicker
353
371
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
372
+ * @see https://coinmate.docs.apiary.io/#reference/ticker/get-ticker/get
354
373
  * @param {string} symbol unified symbol of the market to fetch the ticker for
355
374
  * @param {object} [params] extra parameters specific to the exchange API endpoint
356
375
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -361,7 +380,82 @@ class coinmate extends coinmate$1 {
361
380
  'currencyPair': market['id'],
362
381
  };
363
382
  const response = await this.publicGetTicker(this.extend(request, params));
364
- const ticker = this.safeValue(response, 'data');
383
+ //
384
+ // {
385
+ // "error": false,
386
+ // "errorMessage": null,
387
+ // "data": {
388
+ // "last": 0.55105,
389
+ // "high": 0.56439,
390
+ // "low": 0.54358,
391
+ // "amount": 37038.993381,
392
+ // "bid": 0.54595,
393
+ // "ask": 0.55324,
394
+ // "change": 3.03659243,
395
+ // "open": 0.53481,
396
+ // "timestamp": 1708074779
397
+ // }
398
+ // }
399
+ //
400
+ const data = this.safeValue(response, 'data');
401
+ return this.parseTicker(data, market);
402
+ }
403
+ async fetchTickers(symbols = undefined, params = {}) {
404
+ /**
405
+ * @method
406
+ * @name coinmate#fetchTickers
407
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
408
+ * @see https://coinmate.docs.apiary.io/#reference/ticker/get-ticker-all/get
409
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
410
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
411
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
412
+ */
413
+ await this.loadMarkets();
414
+ symbols = this.marketSymbols(symbols);
415
+ const response = await this.publicGetTickerAll(params);
416
+ //
417
+ // {
418
+ // "error": false,
419
+ // "errorMessage": null,
420
+ // "data": {
421
+ // "LTC_BTC": {
422
+ // "last": "0.001337",
423
+ // "high": "0.001348",
424
+ // "low": "0.001332",
425
+ // "amount": "34.75472959",
426
+ // "bid": "0.001348",
427
+ // "ask": "0.001356",
428
+ // "change": "-0.74239050",
429
+ // "open": "0.001347",
430
+ // "timestamp": "1708074485"
431
+ // }
432
+ // }
433
+ // }
434
+ //
435
+ const data = this.safeValue(response, 'data', {});
436
+ const keys = Object.keys(data);
437
+ const result = {};
438
+ for (let i = 0; i < keys.length; i++) {
439
+ const market = this.market(keys[i]);
440
+ const ticker = this.parseTicker(this.safeValue(data, keys[i]), market);
441
+ result[market['symbol']] = ticker;
442
+ }
443
+ return this.filterByArrayTickers(result, 'symbol', symbols);
444
+ }
445
+ parseTicker(ticker, market = undefined) {
446
+ //
447
+ // {
448
+ // "last": "0.001337",
449
+ // "high": "0.001348",
450
+ // "low": "0.001332",
451
+ // "amount": "34.75472959",
452
+ // "bid": "0.001348",
453
+ // "ask": "0.001356",
454
+ // "change": "-0.74239050",
455
+ // "open": "0.001347",
456
+ // "timestamp": "1708074485"
457
+ // }
458
+ //
365
459
  const timestamp = this.safeTimestamp(ticker, 'timestamp');
366
460
  const last = this.safeNumber(ticker, 'last');
367
461
  return this.safeTicker({
@@ -392,6 +486,7 @@ class coinmate extends coinmate$1 {
392
486
  * @method
393
487
  * @name coinmate#fetchDepositsWithdrawals
394
488
  * @description fetch history of deposits and withdrawals
489
+ * @see https://coinmate.docs.apiary.io/#reference/transfers/get-transfer-history/post
395
490
  * @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
396
491
  * @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
397
492
  * @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
@@ -504,6 +599,12 @@ class coinmate extends coinmate$1 {
504
599
  * @method
505
600
  * @name coinmate#withdraw
506
601
  * @description make a withdrawal
602
+ * @see https://coinmate.docs.apiary.io/#reference/bitcoin-withdrawal-and-deposit/withdraw-bitcoins/post
603
+ * @see https://coinmate.docs.apiary.io/#reference/litecoin-withdrawal-and-deposit/withdraw-litecoins/post
604
+ * @see https://coinmate.docs.apiary.io/#reference/ethereum-withdrawal-and-deposit/withdraw-ethereum/post
605
+ * @see https://coinmate.docs.apiary.io/#reference/ripple-withdrawal-and-deposit/withdraw-ripple/post
606
+ * @see https://coinmate.docs.apiary.io/#reference/cardano-withdrawal-and-deposit/withdraw-cardano/post
607
+ * @see https://coinmate.docs.apiary.io/#reference/solana-withdrawal-and-deposit/withdraw-solana/post
507
608
  * @param {string} code unified currency code
508
609
  * @param {float} amount the amount to withdraw
509
610
  * @param {string} address the address to withdraw to
@@ -557,6 +658,7 @@ class coinmate extends coinmate$1 {
557
658
  * @method
558
659
  * @name coinmate#fetchMyTrades
559
660
  * @description fetch all trades made by the user
661
+ * @see https://coinmate.docs.apiary.io/#reference/trade-history/get-trade-history/post
560
662
  * @param {string} symbol unified market symbol
561
663
  * @param {int} [since] the earliest time in ms to fetch trades for
562
664
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -649,6 +751,7 @@ class coinmate extends coinmate$1 {
649
751
  * @method
650
752
  * @name coinmate#fetchTrades
651
753
  * @description get the list of most recent trades for a particular symbol
754
+ * @see https://coinmate.docs.apiary.io/#reference/transactions/transactions/get
652
755
  * @param {string} symbol unified symbol of the market to fetch trades for
653
756
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
654
757
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -686,6 +789,7 @@ class coinmate extends coinmate$1 {
686
789
  * @method
687
790
  * @name coinmate#fetchTradingFee
688
791
  * @description fetch the trading fees for a market
792
+ * @see https://coinmate.docs.apiary.io/#reference/trader-fees/get-trading-fees/post
689
793
  * @param {string} symbol unified market symbol
690
794
  * @param {object} [params] extra parameters specific to the exchange API endpoint
691
795
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -722,6 +826,7 @@ class coinmate extends coinmate$1 {
722
826
  * @method
723
827
  * @name coinmate#fetchOpenOrders
724
828
  * @description fetch all unfilled currently open orders
829
+ * @see https://coinmate.docs.apiary.io/#reference/order/get-open-orders/post
725
830
  * @param {string} symbol unified market symbol
726
831
  * @param {int} [since] the earliest time in ms to fetch open orders for
727
832
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -737,6 +842,7 @@ class coinmate extends coinmate$1 {
737
842
  * @method
738
843
  * @name coinmate#fetchOrders
739
844
  * @description fetches information on multiple orders made by the user
845
+ * @see https://coinmate.docs.apiary.io/#reference/order/order-history/post
740
846
  * @param {string} symbol unified market symbol of the market orders were made in
741
847
  * @param {int} [since] the earliest time in ms to fetch orders for
742
848
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -860,6 +966,10 @@ class coinmate extends coinmate$1 {
860
966
  * @method
861
967
  * @name coinmate#createOrder
862
968
  * @description create a trade order
969
+ * @see https://coinmate.docs.apiary.io/#reference/order/buy-limit-order/post
970
+ * @see https://coinmate.docs.apiary.io/#reference/order/sell-limit-order/post
971
+ * @see https://coinmate.docs.apiary.io/#reference/order/buy-instant-order/post
972
+ * @see https://coinmate.docs.apiary.io/#reference/order/sell-instant-order/post
863
973
  * @param {string} symbol unified symbol of the market to create an order in
864
974
  * @param {string} type 'market' or 'limit'
865
975
  * @param {string} side 'buy' or 'sell'
@@ -900,6 +1010,8 @@ class coinmate extends coinmate$1 {
900
1010
  * @method
901
1011
  * @name coinmate#fetchOrder
902
1012
  * @description fetches information on an order made by the user
1013
+ * @see https://coinmate.docs.apiary.io/#reference/order/get-order-by-orderid/post
1014
+ * @see https://coinmate.docs.apiary.io/#reference/order/get-order-by-clientorderid/post
903
1015
  * @param {string} symbol unified symbol of the market the order was made in
904
1016
  * @param {object} [params] extra parameters specific to the exchange API endpoint
905
1017
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -921,6 +1033,7 @@ class coinmate extends coinmate$1 {
921
1033
  * @method
922
1034
  * @name coinmate#cancelOrder
923
1035
  * @description cancels an open order
1036
+ * @see https://coinmate.docs.apiary.io/#reference/order/cancel-order/post
924
1037
  * @param {string} id order id
925
1038
  * @param {string} symbol not used by coinmate cancelOrder ()
926
1039
  * @param {object} [params] extra parameters specific to the exchange API endpoint