ccxt 4.3.6 → 4.3.8

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 (196) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/ccxt.js +1 -1
  3. package/dist/cjs/src/ace.js +5 -0
  4. package/dist/cjs/src/alpaca.js +6 -0
  5. package/dist/cjs/src/base/Exchange.js +47 -3
  6. package/dist/cjs/src/binance.js +3 -1
  7. package/dist/cjs/src/bingx.js +3 -1
  8. package/dist/cjs/src/bitbank.js +3 -0
  9. package/dist/cjs/src/bitget.js +75 -2
  10. package/dist/cjs/src/bithumb.js +4 -0
  11. package/dist/cjs/src/bitmex.js +2 -0
  12. package/dist/cjs/src/bitopro.js +5 -0
  13. package/dist/cjs/src/bitso.js +3 -0
  14. package/dist/cjs/src/bitstamp.js +3 -0
  15. package/dist/cjs/src/bitteam.js +4 -0
  16. package/dist/cjs/src/bitvavo.js +3 -0
  17. package/dist/cjs/src/bl3p.js +3 -0
  18. package/dist/cjs/src/btcalpha.js +3 -0
  19. package/dist/cjs/src/btcbox.js +3 -0
  20. package/dist/cjs/src/btcmarkets.js +3 -0
  21. package/dist/cjs/src/btcturk.js +3 -0
  22. package/dist/cjs/src/bybit.js +123 -12
  23. package/dist/cjs/src/cex.js +6 -0
  24. package/dist/cjs/src/coinbase.js +95 -17
  25. package/dist/cjs/src/coinbaseinternational.js +2 -0
  26. package/dist/cjs/src/coinbasepro.js +6 -0
  27. package/dist/cjs/src/coincheck.js +3 -0
  28. package/dist/cjs/src/coinex.js +257 -190
  29. package/dist/cjs/src/coinlist.js +4 -0
  30. package/dist/cjs/src/coinmate.js +3 -0
  31. package/dist/cjs/src/coinone.js +3 -0
  32. package/dist/cjs/src/coinsph.js +4 -0
  33. package/dist/cjs/src/coinspot.js +3 -0
  34. package/dist/cjs/src/cryptocom.js +2 -0
  35. package/dist/cjs/src/exmo.js +5 -0
  36. package/dist/cjs/src/gate.js +124 -22
  37. package/dist/cjs/src/hitbtc.js +4 -3
  38. package/dist/cjs/src/htx.js +2 -0
  39. package/dist/cjs/src/idex.js +3 -0
  40. package/dist/cjs/src/independentreserve.js +3 -0
  41. package/dist/cjs/src/indodax.js +3 -0
  42. package/dist/cjs/src/kucoin.js +2 -0
  43. package/dist/cjs/src/kucoinfutures.js +2 -0
  44. package/dist/cjs/src/latoken.js +6 -0
  45. package/dist/cjs/src/luno.js +3 -0
  46. package/dist/cjs/src/lykke.js +5 -0
  47. package/dist/cjs/src/mercado.js +3 -0
  48. package/dist/cjs/src/mexc.js +111 -0
  49. package/dist/cjs/src/ndax.js +4 -0
  50. package/dist/cjs/src/novadax.js +4 -0
  51. package/dist/cjs/src/okx.js +84 -1
  52. package/dist/cjs/src/onetrading.js +3 -0
  53. package/dist/cjs/src/p2b.js +3 -0
  54. package/dist/cjs/src/pro/bybit.js +1 -1
  55. package/dist/cjs/src/pro/coinbase.js +30 -29
  56. package/dist/cjs/src/probit.js +3 -0
  57. package/dist/cjs/src/timex.js +3 -0
  58. package/dist/cjs/src/tradeogre.js +3 -0
  59. package/dist/cjs/src/wavesexchange.js +3 -0
  60. package/dist/cjs/src/wazirx.js +3 -0
  61. package/dist/cjs/src/woo.js +3 -1
  62. package/dist/cjs/src/yobit.js +3 -0
  63. package/js/ccxt.d.ts +1 -1
  64. package/js/ccxt.js +1 -1
  65. package/js/src/abstract/coinbase.d.ts +5 -0
  66. package/js/src/ace.js +5 -0
  67. package/js/src/alpaca.js +6 -0
  68. package/js/src/ascendex.d.ts +2 -2
  69. package/js/src/base/Exchange.d.ts +23 -19
  70. package/js/src/base/Exchange.js +47 -3
  71. package/js/src/base/functions/generic.d.ts +20 -19
  72. package/js/src/bigone.d.ts +1 -1
  73. package/js/src/binance.d.ts +3 -3
  74. package/js/src/binance.js +3 -1
  75. package/js/src/bingx.d.ts +3 -3
  76. package/js/src/bingx.js +3 -1
  77. package/js/src/bitbank.d.ts +1 -1
  78. package/js/src/bitbank.js +3 -0
  79. package/js/src/bitfinex.d.ts +1 -1
  80. package/js/src/bitfinex2.d.ts +1 -1
  81. package/js/src/bitflyer.d.ts +1 -1
  82. package/js/src/bitget.d.ts +4 -3
  83. package/js/src/bitget.js +75 -2
  84. package/js/src/bithumb.d.ts +1 -1
  85. package/js/src/bithumb.js +4 -0
  86. package/js/src/bitmart.d.ts +1 -1
  87. package/js/src/bitmex.d.ts +1 -1
  88. package/js/src/bitmex.js +2 -0
  89. package/js/src/bitopro.d.ts +1 -1
  90. package/js/src/bitopro.js +5 -0
  91. package/js/src/bitrue.d.ts +1 -1
  92. package/js/src/bitso.d.ts +1 -1
  93. package/js/src/bitso.js +3 -0
  94. package/js/src/bitstamp.d.ts +1 -1
  95. package/js/src/bitstamp.js +3 -0
  96. package/js/src/bitteam.js +4 -0
  97. package/js/src/bitvavo.d.ts +1 -1
  98. package/js/src/bitvavo.js +3 -0
  99. package/js/src/bl3p.js +3 -0
  100. package/js/src/blockchaincom.d.ts +1 -1
  101. package/js/src/btcalpha.js +3 -0
  102. package/js/src/btcbox.js +3 -0
  103. package/js/src/btcmarkets.d.ts +1 -1
  104. package/js/src/btcmarkets.js +3 -0
  105. package/js/src/btcturk.js +3 -0
  106. package/js/src/bybit.d.ts +8 -7
  107. package/js/src/bybit.js +123 -12
  108. package/js/src/cex.js +6 -0
  109. package/js/src/coinbase.d.ts +2 -2
  110. package/js/src/coinbase.js +95 -17
  111. package/js/src/coinbaseinternational.d.ts +2 -2
  112. package/js/src/coinbaseinternational.js +2 -0
  113. package/js/src/coinbasepro.d.ts +1 -1
  114. package/js/src/coinbasepro.js +6 -0
  115. package/js/src/coincheck.js +3 -0
  116. package/js/src/coinex.d.ts +8 -7
  117. package/js/src/coinex.js +257 -190
  118. package/js/src/coinlist.d.ts +1 -1
  119. package/js/src/coinlist.js +4 -0
  120. package/js/src/coinmate.d.ts +1 -1
  121. package/js/src/coinmate.js +3 -0
  122. package/js/src/coinone.js +3 -0
  123. package/js/src/coinsph.d.ts +1 -1
  124. package/js/src/coinsph.js +4 -0
  125. package/js/src/coinspot.js +3 -0
  126. package/js/src/cryptocom.d.ts +1 -1
  127. package/js/src/cryptocom.js +2 -0
  128. package/js/src/delta.d.ts +2 -2
  129. package/js/src/deribit.d.ts +1 -1
  130. package/js/src/digifinex.d.ts +3 -3
  131. package/js/src/exmo.d.ts +3 -3
  132. package/js/src/exmo.js +5 -0
  133. package/js/src/gate.d.ts +8 -7
  134. package/js/src/gate.js +124 -22
  135. package/js/src/gemini.d.ts +2 -2
  136. package/js/src/hitbtc.d.ts +3 -3
  137. package/js/src/hitbtc.js +4 -3
  138. package/js/src/hollaex.d.ts +2 -2
  139. package/js/src/htx.d.ts +3 -3
  140. package/js/src/htx.js +2 -0
  141. package/js/src/huobijp.d.ts +1 -1
  142. package/js/src/hyperliquid.d.ts +2 -2
  143. package/js/src/idex.d.ts +2 -2
  144. package/js/src/idex.js +3 -0
  145. package/js/src/independentreserve.js +3 -0
  146. package/js/src/indodax.d.ts +1 -1
  147. package/js/src/indodax.js +3 -0
  148. package/js/src/kraken.d.ts +1 -1
  149. package/js/src/kucoin.d.ts +2 -2
  150. package/js/src/kucoin.js +2 -0
  151. package/js/src/kucoinfutures.d.ts +1 -1
  152. package/js/src/kucoinfutures.js +2 -0
  153. package/js/src/kuna.d.ts +1 -1
  154. package/js/src/latoken.js +6 -0
  155. package/js/src/lbank.d.ts +1 -1
  156. package/js/src/luno.js +3 -0
  157. package/js/src/lykke.d.ts +1 -1
  158. package/js/src/lykke.js +5 -0
  159. package/js/src/mercado.d.ts +1 -1
  160. package/js/src/mercado.js +3 -0
  161. package/js/src/mexc.d.ts +5 -4
  162. package/js/src/mexc.js +111 -0
  163. package/js/src/ndax.d.ts +1 -1
  164. package/js/src/ndax.js +4 -0
  165. package/js/src/novadax.d.ts +1 -1
  166. package/js/src/novadax.js +4 -0
  167. package/js/src/okcoin.d.ts +2 -2
  168. package/js/src/okx.d.ts +10 -9
  169. package/js/src/okx.js +84 -1
  170. package/js/src/onetrading.d.ts +1 -1
  171. package/js/src/onetrading.js +3 -0
  172. package/js/src/p2b.js +3 -0
  173. package/js/src/paymium.d.ts +1 -1
  174. package/js/src/phemex.d.ts +1 -1
  175. package/js/src/poloniex.d.ts +1 -1
  176. package/js/src/pro/bybit.js +1 -1
  177. package/js/src/pro/coinbase.d.ts +2 -2
  178. package/js/src/pro/coinbase.js +30 -29
  179. package/js/src/pro/luno.d.ts +2 -2
  180. package/js/src/probit.d.ts +2 -2
  181. package/js/src/probit.js +3 -0
  182. package/js/src/timex.js +3 -0
  183. package/js/src/tokocrypto.d.ts +1 -1
  184. package/js/src/tradeogre.js +3 -0
  185. package/js/src/upbit.d.ts +2 -2
  186. package/js/src/wavesexchange.d.ts +1 -1
  187. package/js/src/wavesexchange.js +3 -0
  188. package/js/src/wazirx.js +3 -0
  189. package/js/src/whitebit.d.ts +2 -2
  190. package/js/src/woo.d.ts +1 -1
  191. package/js/src/woo.js +3 -1
  192. package/js/src/yobit.d.ts +1 -1
  193. package/js/src/yobit.js +3 -0
  194. package/js/src/zaif.d.ts +1 -1
  195. package/js/src/zonda.d.ts +2 -2
  196. package/package.json +1 -1
@@ -111,8 +111,10 @@ class okx extends okx$1 {
111
111
  'fetchOrderTrades': true,
112
112
  'fetchPermissions': undefined,
113
113
  'fetchPosition': true,
114
+ 'fetchPositionHistory': 'emulated',
114
115
  'fetchPositions': true,
115
116
  'fetchPositionsForSymbol': true,
117
+ 'fetchPositionsHistory': true,
116
118
  'fetchPositionsRisk': false,
117
119
  'fetchPremiumIndexOHLCV': false,
118
120
  'fetchSettlementHistory': true,
@@ -7923,7 +7925,7 @@ class okx extends okx$1 {
7923
7925
  // }
7924
7926
  //
7925
7927
  const rows = this.safeList(response, 'data', []);
7926
- return this.parseConversions(rows, 'baseCcy', 'quoteCcy', since, limit);
7928
+ return this.parseConversions(rows, code, 'baseCcy', 'quoteCcy', since, limit);
7927
7929
  }
7928
7930
  parseConversion(conversion, fromCurrency = undefined, toCurrency = undefined) {
7929
7931
  //
@@ -8199,6 +8201,87 @@ class okx extends okx$1 {
8199
8201
  const modifications = this.parseMarginModifications(data);
8200
8202
  return this.filterBySymbolSinceLimit(modifications, symbol, since, limit);
8201
8203
  }
8204
+ async fetchPositionsHistory(symbols = undefined, since = undefined, limit = undefined, params = {}) {
8205
+ /**
8206
+ * @method
8207
+ * @name okx#fetchPositionsHistory
8208
+ * @description fetches historical positions
8209
+ * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-positions-history
8210
+ * @param {string} [symbols] unified market symbols
8211
+ * @param {int} [since] timestamp in ms of the earliest position to fetch
8212
+ * @param {int} [limit] the maximum amount of records to fetch, default=100, max=100
8213
+ * @param {object} params extra parameters specific to the exchange api endpoint
8214
+ * @param {string} [params.marginMode] "cross" or "isolated"
8215
+ *
8216
+ * EXCHANGE SPECIFIC PARAMETERS
8217
+ * @param {string} [params.instType] margin, swap, futures or option
8218
+ * @param {string} [params.type] the type of latest close position 1: close position partially, 2:close all, 3:liquidation, 4:partial liquidation; 5:adl, is it is the latest type if there are several types for the same position
8219
+ * @param {string} [params.posId] position id, there is attribute expiration, the posid will be expired if it is more than 30 days after the last full close position, then position will use new posid
8220
+ * @param {string} [params.before] timestamp in ms of the earliest position to fetch based on the last update time of the position
8221
+ * @param {string} [params.after] timestamp in ms of the latest position to fetch based on the last update time of the position
8222
+ * @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
8223
+ */
8224
+ await this.loadMarkets();
8225
+ const marginMode = this.safeString(params, 'marginMode');
8226
+ const instType = this.safeStringUpper(params, 'instType');
8227
+ params = this.omit(params, ['until', 'marginMode', 'instType']);
8228
+ if (limit === undefined) {
8229
+ limit = 100;
8230
+ }
8231
+ const request = {
8232
+ 'limit': limit,
8233
+ };
8234
+ if (symbols !== undefined) {
8235
+ const symbolsLength = symbols.length;
8236
+ if (symbolsLength === 1) {
8237
+ const market = this.market(symbols[0]);
8238
+ request['instId'] = market['id'];
8239
+ }
8240
+ }
8241
+ if (marginMode !== undefined) {
8242
+ request['mgnMode'] = marginMode;
8243
+ }
8244
+ if (instType !== undefined) {
8245
+ request['instType'] = instType;
8246
+ }
8247
+ const response = await this.privateGetAccountPositionsHistory(this.extend(request, params));
8248
+ //
8249
+ // {
8250
+ // code: '0',
8251
+ // data: [
8252
+ // {
8253
+ // cTime: '1708735940395',
8254
+ // ccy: 'USDT',
8255
+ // closeAvgPx: '0.6330444444444444',
8256
+ // closeTotalPos: '27',
8257
+ // direction: 'long',
8258
+ // fee: '-1.69566',
8259
+ // fundingFee: '-11.870404179341788',
8260
+ // instId: 'XRP-USDT-SWAP',
8261
+ // instType: 'SWAP',
8262
+ // lever: '3.0',
8263
+ // liqPenalty: '0',
8264
+ // mgnMode: 'cross',
8265
+ // openAvgPx: '0.623',
8266
+ // openMaxPos: '15',
8267
+ // pnl: '27.11999999999988',
8268
+ // pnlRatio: '0.0241732402722634',
8269
+ // posId: '681423155054862336',
8270
+ // realizedPnl: '13.553935820658092',
8271
+ // triggerPx: '',
8272
+ // type: '2',
8273
+ // uTime: '1711088748170',
8274
+ // uly: 'XRP-USDT'
8275
+ // },
8276
+ // ...
8277
+ // ],
8278
+ // msg: ''
8279
+ // }
8280
+ //
8281
+ const data = this.safeList(response, 'data');
8282
+ const positions = this.parsePositions(data, symbols, params);
8283
+ return this.filterBySinceLimit(positions, since, limit);
8284
+ }
8202
8285
  }
8203
8286
 
8204
8287
  module.exports = okx;
@@ -74,8 +74,11 @@ class onetrading extends onetrading$1 {
74
74
  'fetchOrders': false,
75
75
  'fetchOrderTrades': true,
76
76
  'fetchPosition': false,
77
+ 'fetchPositionHistory': false,
77
78
  'fetchPositionMode': false,
78
79
  'fetchPositions': false,
80
+ 'fetchPositionsForSymbol': false,
81
+ 'fetchPositionsHistory': false,
79
82
  'fetchPositionsRisk': false,
80
83
  'fetchPremiumIndexOHLCV': false,
81
84
  'fetchTicker': true,
@@ -79,8 +79,11 @@ class p2b extends p2b$1 {
79
79
  'fetchOrderTrades': true,
80
80
  'fetchPermissions': false,
81
81
  'fetchPosition': false,
82
+ 'fetchPositionHistory': false,
83
+ 'fetchPositionMode': false,
82
84
  'fetchPositions': false,
83
85
  'fetchPositionsForSymbol': false,
86
+ 'fetchPositionsHistory': false,
84
87
  'fetchPositionsRisk': false,
85
88
  'fetchPremiumIndexOHLCV': false,
86
89
  'fetchTicker': true,
@@ -117,7 +117,7 @@ class bybit extends bybit$1 {
117
117
  },
118
118
  'streaming': {
119
119
  'ping': this.ping,
120
- 'keepAlive': 20000,
120
+ 'keepAlive': 19000,
121
121
  },
122
122
  });
123
123
  }
@@ -46,7 +46,7 @@ class coinbase extends coinbase$1 {
46
46
  },
47
47
  });
48
48
  }
49
- async subscribe(name, symbol = undefined, params = {}) {
49
+ async subscribe(name, isPrivate, symbol = undefined, params = {}) {
50
50
  /**
51
51
  * @ignore
52
52
  * @method
@@ -58,7 +58,6 @@ class coinbase extends coinbase$1 {
58
58
  * @returns {object} subscription to a websocket channel
59
59
  */
60
60
  await this.loadMarkets();
61
- this.checkRequiredCredentials();
62
61
  let market = undefined;
63
62
  let messageHash = name;
64
63
  let productIds = [];
@@ -75,8 +74,6 @@ class coinbase extends coinbase$1 {
75
74
  }
76
75
  const url = this.urls['api']['ws'];
77
76
  const timestamp = this.numberToString(this.seconds());
78
- const isCloudAPiKey = (this.apiKey.indexOf('organizations/') >= 0) || (this.secret.startsWith('-----BEGIN'));
79
- const auth = timestamp + name + productIds.join(',');
80
77
  const subscribe = {
81
78
  'type': 'subscribe',
82
79
  'product_ids': productIds,
@@ -85,25 +82,30 @@ class coinbase extends coinbase$1 {
85
82
  // 'timestamp': timestamp,
86
83
  // 'signature': this.hmac (this.encode (auth), this.encode (this.secret), sha256),
87
84
  };
88
- if (!isCloudAPiKey) {
89
- subscribe['api_key'] = this.apiKey;
90
- subscribe['timestamp'] = timestamp;
91
- subscribe['signature'] = this.hmac(this.encode(auth), this.encode(this.secret), sha256.sha256);
92
- }
93
- else {
94
- if (this.apiKey.startsWith('-----BEGIN')) {
95
- throw new errors.ArgumentsRequired(this.id + ' apiKey should contain the name (eg: organizations/3b910e93....) and not the public key');
85
+ if (isPrivate) {
86
+ this.checkRequiredCredentials();
87
+ const isCloudAPiKey = (this.apiKey.indexOf('organizations/') >= 0) || (this.secret.startsWith('-----BEGIN'));
88
+ const auth = timestamp + name + productIds.join(',');
89
+ if (!isCloudAPiKey) {
90
+ subscribe['api_key'] = this.apiKey;
91
+ subscribe['timestamp'] = timestamp;
92
+ subscribe['signature'] = this.hmac(this.encode(auth), this.encode(this.secret), sha256.sha256);
96
93
  }
97
- const currentToken = this.safeString(this.options, 'wsToken');
98
- const tokenTimestamp = this.safeInteger(this.options, 'wsTokenTimestamp', 0);
99
- const seconds = this.seconds();
100
- if (currentToken === undefined || tokenTimestamp + 120 < seconds) {
101
- // we should generate new token
102
- const token = this.createAuthToken(seconds);
103
- this.options['wsToken'] = token;
104
- this.options['wsTokenTimestamp'] = seconds;
94
+ else {
95
+ if (this.apiKey.startsWith('-----BEGIN')) {
96
+ throw new errors.ArgumentsRequired(this.id + ' apiKey should contain the name (eg: organizations/3b910e93....) and not the public key');
97
+ }
98
+ const currentToken = this.safeString(this.options, 'wsToken');
99
+ const tokenTimestamp = this.safeInteger(this.options, 'wsTokenTimestamp', 0);
100
+ const seconds = this.seconds();
101
+ if (currentToken === undefined || tokenTimestamp + 120 < seconds) {
102
+ // we should generate new token
103
+ const token = this.createAuthToken(seconds);
104
+ this.options['wsToken'] = token;
105
+ this.options['wsTokenTimestamp'] = seconds;
106
+ }
107
+ subscribe['jwt'] = this.safeString(this.options, 'wsToken');
105
108
  }
106
- subscribe['jwt'] = this.safeString(this.options, 'wsToken');
107
109
  }
108
110
  return await this.watch(url, messageHash, subscribe, messageHash);
109
111
  }
@@ -118,7 +120,7 @@ class coinbase extends coinbase$1 {
118
120
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
119
121
  */
120
122
  const name = 'ticker';
121
- return await this.subscribe(name, symbol, params);
123
+ return await this.subscribe(name, false, symbol, params);
122
124
  }
123
125
  async watchTickers(symbols = undefined, params = {}) {
124
126
  /**
@@ -134,7 +136,7 @@ class coinbase extends coinbase$1 {
134
136
  symbols = this.symbols;
135
137
  }
136
138
  const name = 'ticker_batch';
137
- const tickers = await this.subscribe(name, symbols, params);
139
+ const tickers = await this.subscribe(name, false, symbols, params);
138
140
  if (this.newUpdates) {
139
141
  return tickers;
140
142
  }
@@ -298,7 +300,7 @@ class coinbase extends coinbase$1 {
298
300
  await this.loadMarkets();
299
301
  symbol = this.symbol(symbol);
300
302
  const name = 'market_trades';
301
- const trades = await this.subscribe(name, symbol, params);
303
+ const trades = await this.subscribe(name, false, symbol, params);
302
304
  if (this.newUpdates) {
303
305
  limit = trades.getLimit(symbol, limit);
304
306
  }
@@ -318,7 +320,7 @@ class coinbase extends coinbase$1 {
318
320
  */
319
321
  await this.loadMarkets();
320
322
  const name = 'user';
321
- const orders = await this.subscribe(name, symbol, params);
323
+ const orders = await this.subscribe(name, true, symbol, params);
322
324
  if (this.newUpdates) {
323
325
  limit = orders.getLimit(symbol, limit);
324
326
  }
@@ -339,7 +341,7 @@ class coinbase extends coinbase$1 {
339
341
  const name = 'level2';
340
342
  const market = this.market(symbol);
341
343
  symbol = market['symbol'];
342
- const orderbook = await this.subscribe(name, symbol, params);
344
+ const orderbook = await this.subscribe(name, false, symbol, params);
343
345
  return orderbook.limit();
344
346
  }
345
347
  handleTrade(client, message) {
@@ -557,8 +559,8 @@ class coinbase extends coinbase$1 {
557
559
  this.orderbooks[symbol] = this.orderBook({}, limit);
558
560
  const orderbook = this.orderbooks[symbol];
559
561
  this.handleOrderBookHelper(orderbook, updates);
560
- orderbook['timestamp'] = undefined;
561
- orderbook['datetime'] = undefined;
562
+ orderbook['timestamp'] = this.parse8601(datetime);
563
+ orderbook['datetime'] = datetime;
562
564
  orderbook['symbol'] = symbol;
563
565
  client.resolve(orderbook, messageHash);
564
566
  if (messageHash.endsWith('USD')) {
@@ -577,7 +579,6 @@ class coinbase extends coinbase$1 {
577
579
  }
578
580
  }
579
581
  }
580
- return message;
581
582
  }
582
583
  handleSubscriptionStatus(client, message) {
583
584
  //
@@ -67,8 +67,11 @@ class probit extends probit$1 {
67
67
  'fetchOrder': true,
68
68
  'fetchOrderBook': true,
69
69
  'fetchPosition': false,
70
+ 'fetchPositionHistory': false,
70
71
  'fetchPositionMode': false,
71
72
  'fetchPositions': false,
73
+ 'fetchPositionsForSymbol': false,
74
+ 'fetchPositionsHistory': false,
72
75
  'fetchPositionsRisk': false,
73
76
  'fetchPremiumIndexOHLCV': false,
74
77
  'fetchTicker': true,
@@ -64,8 +64,11 @@ class timex extends timex$1 {
64
64
  'fetchOrder': true,
65
65
  'fetchOrderBook': true,
66
66
  'fetchPosition': false,
67
+ 'fetchPositionHistory': false,
67
68
  'fetchPositionMode': false,
68
69
  'fetchPositions': false,
70
+ 'fetchPositionsForSymbol': false,
71
+ 'fetchPositionsHistory': false,
69
72
  'fetchPositionsRisk': false,
70
73
  'fetchPremiumIndexOHLCV': false,
71
74
  'fetchTicker': true,
@@ -79,8 +79,11 @@ class tradeogre extends tradeogre$1 {
79
79
  'fetchOrderTrades': false,
80
80
  'fetchPermissions': false,
81
81
  'fetchPosition': false,
82
+ 'fetchPositionHistory': false,
83
+ 'fetchPositionMode': false,
82
84
  'fetchPositions': false,
83
85
  'fetchPositionsForSymbol': false,
86
+ 'fetchPositionsHistory': false,
84
87
  'fetchPositionsRisk': false,
85
88
  'fetchPremiumIndexOHLCV': false,
86
89
  'fetchTicker': true,
@@ -66,8 +66,11 @@ class wavesexchange extends wavesexchange$1 {
66
66
  'fetchOrderBook': true,
67
67
  'fetchOrders': true,
68
68
  'fetchPosition': false,
69
+ 'fetchPositionHistory': false,
69
70
  'fetchPositionMode': false,
70
71
  'fetchPositions': false,
72
+ 'fetchPositionsForSymbol': false,
73
+ 'fetchPositionsHistory': false,
71
74
  'fetchPositionsRisk': false,
72
75
  'fetchPremiumIndexOHLCV': false,
73
76
  'fetchTicker': true,
@@ -71,8 +71,11 @@ class wazirx extends wazirx$1 {
71
71
  'fetchOrderBook': true,
72
72
  'fetchOrders': true,
73
73
  'fetchPosition': false,
74
+ 'fetchPositionHistory': false,
74
75
  'fetchPositionMode': false,
75
76
  'fetchPositions': false,
77
+ 'fetchPositionsForSymbol': false,
78
+ 'fetchPositionsHistory': false,
76
79
  'fetchPositionsRisk': false,
77
80
  'fetchPremiumIndexOHLCV': false,
78
81
  'fetchStatus': true,
@@ -88,8 +88,10 @@ class woo extends woo$1 {
88
88
  'fetchOrders': true,
89
89
  'fetchOrderTrades': true,
90
90
  'fetchPosition': true,
91
+ 'fetchPositionHistory': false,
91
92
  'fetchPositionMode': false,
92
93
  'fetchPositions': true,
94
+ 'fetchPositionsHistory': false,
93
95
  'fetchPremiumIndexOHLCV': false,
94
96
  'fetchStatus': true,
95
97
  'fetchTicker': false,
@@ -3180,7 +3182,7 @@ class woo extends woo$1 {
3180
3182
  //
3181
3183
  const data = this.safeDict(response, 'data', {});
3182
3184
  const rows = this.safeList(data, 'tradeVos', []);
3183
- return this.parseConversions(rows, 'sellAsset', 'buyAsset', since, limit);
3185
+ return this.parseConversions(rows, code, 'sellAsset', 'buyAsset', since, limit);
3184
3186
  }
3185
3187
  parseConversion(conversion, fromCurrency = undefined, toCurrency = undefined) {
3186
3188
  //
@@ -65,8 +65,11 @@ class yobit extends yobit$1 {
65
65
  'fetchOrderBook': true,
66
66
  'fetchOrderBooks': true,
67
67
  'fetchPosition': false,
68
+ 'fetchPositionHistory': false,
68
69
  'fetchPositionMode': false,
69
70
  'fetchPositions': false,
71
+ 'fetchPositionsForSymbol': false,
72
+ 'fetchPositionsHistory': false,
70
73
  'fetchPositionsRisk': false,
71
74
  'fetchPremiumIndexOHLCV': false,
72
75
  'fetchTicker': true,
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 { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages, Option, OptionChain, Conversion } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
7
- declare const version = "4.3.5";
7
+ declare const version = "4.3.7";
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, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.3.6';
41
+ const version = '4.3.8';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -47,6 +47,11 @@ interface Exchange {
47
47
  v2PrivateDeleteAccountsId(params?: {}): Promise<implicitReturnType>;
48
48
  v2PrivateDeleteAccountsAccountIdTransactionsTransactionId(params?: {}): Promise<implicitReturnType>;
49
49
  v3PublicGetBrokerageTime(params?: {}): Promise<implicitReturnType>;
50
+ v3PublicGetBrokerageMarketProductBook(params?: {}): Promise<implicitReturnType>;
51
+ v3PublicGetBrokerageMarketProducts(params?: {}): Promise<implicitReturnType>;
52
+ v3PublicGetBrokerageMarketProductsProductId(params?: {}): Promise<implicitReturnType>;
53
+ v3PublicGetBrokerageMarketProductsProductIdCandles(params?: {}): Promise<implicitReturnType>;
54
+ v3PublicGetBrokerageMarketProductsProductIdTicker(params?: {}): Promise<implicitReturnType>;
50
55
  v3PrivateGetBrokerageAccounts(params?: {}): Promise<implicitReturnType>;
51
56
  v3PrivateGetBrokerageAccountsAccountUuid(params?: {}): Promise<implicitReturnType>;
52
57
  v3PrivateGetBrokerageOrdersHistoricalBatch(params?: {}): Promise<implicitReturnType>;
package/js/src/ace.js CHANGED
@@ -65,8 +65,13 @@ export default class ace extends Exchange {
65
65
  'fetchOrderBook': true,
66
66
  'fetchOrders': false,
67
67
  'fetchOrderTrades': true,
68
+ 'fetchPosition': false,
69
+ 'fetchPositionHistory': false,
68
70
  'fetchPositionMode': false,
69
71
  'fetchPositions': false,
72
+ 'fetchPositionsForSymbol': false,
73
+ 'fetchPositionsHistory': false,
74
+ 'fetchPositionsRisk': false,
70
75
  'fetchPremiumIndexOHLCV': false,
71
76
  'fetchTicker': true,
72
77
  'fetchTickers': true,
package/js/src/alpaca.js CHANGED
@@ -74,7 +74,13 @@ export default class alpaca extends Exchange {
74
74
  'fetchOrder': true,
75
75
  'fetchOrderBook': true,
76
76
  'fetchOrders': true,
77
+ 'fetchPosition': false,
78
+ 'fetchPositionHistory': false,
79
+ 'fetchPositionMode': false,
77
80
  'fetchPositions': false,
81
+ 'fetchPositionsForSymbol': false,
82
+ 'fetchPositionsHistory': false,
83
+ 'fetchPositionsRisk': false,
78
84
  'fetchStatus': false,
79
85
  'fetchTicker': false,
80
86
  'fetchTickers': false,
@@ -72,8 +72,8 @@ export default class ascendex extends Exchange {
72
72
  fetchFundingRates(symbols?: Strings, params?: {}): Promise<any>;
73
73
  modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<MarginModification>;
74
74
  parseMarginModification(data: any, market?: Market): MarginModification;
75
- reduceMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
76
- addMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
75
+ reduceMargin(symbol: string, amount: number, params?: {}): Promise<MarginModification>;
76
+ addMargin(symbol: string, amount: number, params?: {}): Promise<MarginModification>;
77
77
  setLeverage(leverage: Int, symbol?: Str, params?: {}): Promise<any>;
78
78
  setMarginMode(marginMode: string, symbol?: Str, params?: {}): Promise<any>;
79
79
  fetchLeverageTiers(symbols?: Strings, params?: {}): Promise<{}>;
@@ -166,21 +166,21 @@ export default class Exchange {
166
166
  newUpdates: boolean;
167
167
  streaming: {};
168
168
  alias: boolean;
169
- deepExtend: (...xs: any[]) => any;
169
+ deepExtend: (...xs: any) => any;
170
170
  isNode: boolean;
171
171
  keys: {
172
172
  (o: object): string[];
173
173
  (o: {}): string[];
174
174
  };
175
- values: (x: any) => any[];
175
+ values: (x: any[] | Dictionary<any>) => any[];
176
176
  extend: (...args: any[]) => any;
177
177
  clone: (x: any) => any;
178
- flatten: (x: any, out?: any[]) => any[];
179
- unique: (x: any) => any[];
180
- indexBy: (x: any, k: any, out?: {}) => {};
181
- sortBy: (array: any, key: any, descending?: boolean, defaultValue?: any, direction?: number) => any;
182
- sortBy2: (array: any, key1: any, key2: any, descending?: boolean, direction?: number) => any;
183
- groupBy: (x: any, k: any, out?: {}) => {};
178
+ flatten: (x: any[], out?: any[]) => any[];
179
+ unique: (x: any[]) => any[];
180
+ indexBy: (x: Dictionary<any>, k: IndexType, out?: Dictionary<any>) => Dictionary<any>;
181
+ sortBy: (array: any[], key: IndexType, descending?: boolean, defaultValue?: any, direction?: number) => any[];
182
+ sortBy2: (array: any[], key1: IndexType, key2: IndexType, descending?: boolean, direction?: number) => any[];
183
+ groupBy: (x: Dictionary<any>, k: string, out?: Dictionary<any>) => Dictionary<any>;
184
184
  aggregate: typeof functions.aggregate;
185
185
  uuid: (a?: any) => string;
186
186
  unCamelCase: (s: string) => string;
@@ -200,7 +200,7 @@ export default class Exchange {
200
200
  numberToBE: (n: number, padding: number) => Uint8Array;
201
201
  base16ToBinary: (str: string) => Uint8Array;
202
202
  iso8601: (timestamp: any) => string;
203
- omit: (x: any, ...args: any[]) => any;
203
+ omit: (x: Dictionary<any>, ...args: any[]) => any;
204
204
  isJsonEncodedObject: (object: any) => boolean;
205
205
  safeInteger: (o: any, k: IndexType, $default?: number) => number;
206
206
  sum: (...xs: any[]) => any;
@@ -209,7 +209,7 @@ export default class Exchange {
209
209
  extractParams: (string: any) => any[];
210
210
  json: (data: any, params?: any) => string;
211
211
  vwap: typeof functions.vwap;
212
- merge: (target: any, ...args: any[]) => any;
212
+ merge: (target: Dictionary<any>, ...args: any) => Dictionary<any>;
213
213
  binaryConcat: typeof import("../static_dependencies/noble-curves/abstract/utils.js").concatBytes;
214
214
  hash: (request: import("../static_dependencies/noble-hashes/utils.js").Input, hash: {
215
215
  (message: import("../static_dependencies/noble-hashes/utils.js").Input): Uint8Array;
@@ -217,7 +217,7 @@ export default class Exchange {
217
217
  blockLen: number;
218
218
  create(): import("../static_dependencies/noble-hashes/utils.js").Hash<import("../static_dependencies/noble-hashes/utils.js").Hash<any>>;
219
219
  }, digest?: "binary" | "hex" | "base64") => any;
220
- arrayConcat: (a: any, b: any) => any;
220
+ arrayConcat: (a: any[], b: any[]) => any[];
221
221
  encode: (str: string) => Uint8Array;
222
222
  urlencode: (object: object) => string;
223
223
  hmac: (request: import("../static_dependencies/noble-hashes/utils.js").Input, secret: import("../static_dependencies/noble-hashes/utils.js").Input, hash: {
@@ -249,19 +249,19 @@ export default class Exchange {
249
249
  base64ToBinary: (str: string) => Uint8Array;
250
250
  safeTimestamp2: (o: any, k1: IndexType, k2: IndexType, $default?: any) => number;
251
251
  rawencode: (object: object) => string;
252
- keysort: (x: any, out?: {}) => {};
253
- inArray: (needle: any, haystack: any) => any;
252
+ keysort: (x: Dictionary<any>, out?: Dictionary<any>) => Dictionary<any>;
253
+ inArray: (needle: any, haystack: any[]) => boolean;
254
254
  safeStringLower2: (o: any, k1: IndexType, k2: IndexType, $default?: string) => string;
255
255
  safeStringUpper2: (o: any, k1: IndexType, k2: IndexType, $default?: string) => string;
256
- isEmpty: (object: any) => boolean;
257
- ordered: (x: any) => any;
258
- filterBy: (x: any, k: any, value?: any, out?: any[]) => any[];
256
+ isEmpty: (object: any[] | Dictionary<any>) => boolean;
257
+ ordered: (x: any[] | Dictionary<any>) => any[] | Dictionary<any>;
258
+ filterBy: (x: Dictionary<any>, k: string, value?: any, out?: Dictionary<any>[]) => Dictionary<any>[];
259
259
  uuid16: (a?: any) => string;
260
260
  urlencodeWithArrayRepeat: (object: object) => string;
261
261
  microseconds: () => number;
262
262
  binaryToBase64: (data: Uint8Array) => string;
263
263
  strip: (s: string) => string;
264
- toArray: (object: any) => unknown[];
264
+ toArray: (object: any[] | Dictionary<any>) => any[];
265
265
  safeFloatN: (o: any, k: IndexType[], $default?: number) => number;
266
266
  safeIntegerN: (o: any, k: IndexType[], $default?: number) => number;
267
267
  safeIntegerProductN: (o: any, k: IndexType[], $factor: number, $default?: number) => number;
@@ -432,6 +432,8 @@ export default class Exchange {
432
432
  fetchOrderWs: any;
433
433
  fetchPermissions: any;
434
434
  fetchPosition: any;
435
+ fetchPositionHistory: any;
436
+ fetchPositionsHistory: any;
435
437
  fetchPositionWs: any;
436
438
  fetchPositionMode: any;
437
439
  fetchPositions: any;
@@ -1015,7 +1017,7 @@ export default class Exchange {
1015
1017
  filterBySymbolsSinceLimit(array: any, symbols?: string[], since?: Int, limit?: Int, tail?: boolean): any;
1016
1018
  parseLastPrices(pricesData: any, symbols?: string[], params?: {}): LastPrices;
1017
1019
  parseTickers(tickers: any, symbols?: string[], params?: {}): Dictionary<Ticker>;
1018
- parseDepositAddresses(addresses: any, codes?: string[], indexed?: boolean, params?: {}): {};
1020
+ parseDepositAddresses(addresses: any, codes?: string[], indexed?: boolean, params?: {}): Dictionary<any>;
1019
1021
  parseBorrowInterests(response: any, market?: Market): any[];
1020
1022
  parseFundingRateHistories(response: any, market?: any, since?: Int, limit?: Int): FundingRateHistory[];
1021
1023
  safeSymbol(marketId: Str, market?: Market, delimiter?: Str, marketType?: Str): string;
@@ -1070,11 +1072,13 @@ export default class Exchange {
1070
1072
  parseMarginMode(marginMode: any, market?: Market): MarginMode;
1071
1073
  parseLeverages(response: object[], symbols?: string[], symbolKey?: Str, marketType?: MarketType): Leverages;
1072
1074
  parseLeverage(leverage: any, market?: Market): Leverage;
1073
- parseConversions(conversions: any[], fromCurrencyKey?: Str, toCurrencyKey?: Str, since?: Int, limit?: Int, params?: {}): Conversion[];
1075
+ parseConversions(conversions: any[], code?: Str, fromCurrencyKey?: Str, toCurrencyKey?: Str, since?: Int, limit?: Int, params?: {}): Conversion[];
1074
1076
  parseConversion(conversion: any, fromCurrency?: Currency, toCurrency?: Currency): Conversion;
1075
1077
  convertExpireDate(date: string): string;
1076
1078
  convertExpireDateToMarketIdDate(date: string): string;
1077
1079
  convertMarketIdExpireDate(date: string): string;
1080
+ fetchPositionHistory(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Position>;
1081
+ fetchPositionsHistory(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
1078
1082
  parseMarginModification(data: any, market?: Market): MarginModification;
1079
1083
  parseMarginModifications(response: object[], symbols?: string[], symbolKey?: Str, marketType?: MarketType): MarginModification[];
1080
1084
  }