ccxt 4.2.94 → 4.2.96

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 (43) hide show
  1. package/README.md +3 -3
  2. package/build.sh +1 -1
  3. package/dist/ccxt.browser.js +964 -406
  4. package/dist/ccxt.browser.min.js +2 -2
  5. package/dist/cjs/ccxt.js +1 -1
  6. package/dist/cjs/src/base/errors.js +25 -64
  7. package/dist/cjs/src/base/functions/crypto.js +15 -2
  8. package/dist/cjs/src/base/functions/rsa.js +2 -2
  9. package/dist/cjs/src/base/ws/OrderBookSide.js +5 -0
  10. package/dist/cjs/src/bitstamp.js +6 -0
  11. package/dist/cjs/src/coinbase.js +615 -102
  12. package/dist/cjs/src/coinex.js +61 -55
  13. package/dist/cjs/src/gemini.js +29 -10
  14. package/dist/cjs/src/htx.js +127 -125
  15. package/dist/cjs/src/okx.js +40 -40
  16. package/dist/cjs/src/pro/coinbase.js +37 -4
  17. package/js/ccxt.d.ts +3 -3
  18. package/js/ccxt.js +3 -3
  19. package/js/src/abstract/bitstamp.d.ts +6 -0
  20. package/js/src/abstract/coinbase.d.ts +1 -0
  21. package/js/src/base/errorHierarchy.d.ts +1 -1
  22. package/js/src/base/errorHierarchy.js +1 -1
  23. package/js/src/base/errors.d.ts +26 -26
  24. package/js/src/base/errors.js +26 -66
  25. package/js/src/base/functions/crypto.d.ts +1 -1
  26. package/js/src/base/functions/crypto.js +15 -2
  27. package/js/src/base/functions/rsa.js +2 -2
  28. package/js/src/base/types.d.ts +1 -0
  29. package/js/src/base/ws/OrderBook.d.ts +8 -0
  30. package/js/src/base/ws/OrderBook.js +1 -6
  31. package/js/src/base/ws/OrderBookSide.d.ts +9 -3
  32. package/js/src/base/ws/OrderBookSide.js +6 -1
  33. package/js/src/bitstamp.js +6 -0
  34. package/js/src/coinbase.d.ts +8 -1
  35. package/js/src/coinbase.js +616 -103
  36. package/js/src/coinex.js +61 -55
  37. package/js/src/gemini.js +29 -10
  38. package/js/src/htx.d.ts +1 -0
  39. package/js/src/htx.js +128 -126
  40. package/js/src/okx.js +40 -40
  41. package/js/src/pro/coinbase.js +37 -4
  42. package/package.json +1 -1
  43. package/skip-tests.json +2 -0
@@ -1117,7 +1117,7 @@ class okx extends okx$1 {
1117
1117
  return super.handleMarketTypeAndParams(methodName, market, params);
1118
1118
  }
1119
1119
  convertToInstrumentType(type) {
1120
- const exchangeTypes = this.safeValue(this.options, 'exchangeType', {});
1120
+ const exchangeTypes = this.safeDict(this.options, 'exchangeType', {});
1121
1121
  return this.safeString(exchangeTypes, type, type);
1122
1122
  }
1123
1123
  createExpiredOptionMarket(symbol) {
@@ -2921,7 +2921,7 @@ class okx extends okx$1 {
2921
2921
  const side = this.safeString(rawOrder, 'side');
2922
2922
  const amount = this.safeValue(rawOrder, 'amount');
2923
2923
  const price = this.safeValue(rawOrder, 'price');
2924
- const orderParams = this.safeValue(rawOrder, 'params', {});
2924
+ const orderParams = this.safeDict(rawOrder, 'params', {});
2925
2925
  const extendedParams = this.extend(orderParams, params); // the request does not accept extra params since it's a list, so we're extending each order with the common params
2926
2926
  const orderRequest = this.createOrderRequest(marketId, type, side, amount, price, extendedParams);
2927
2927
  ordersRequests.push(orderRequest);
@@ -3110,8 +3110,8 @@ class okx extends okx$1 {
3110
3110
  // "msg": ""
3111
3111
  // }
3112
3112
  //
3113
- const data = this.safeValue(response, 'data', []);
3114
- const first = this.safeValue(data, 0);
3113
+ const data = this.safeList(response, 'data', []);
3114
+ const first = this.safeDict(data, 0, {});
3115
3115
  const order = this.parseOrder(first, market);
3116
3116
  order['type'] = type;
3117
3117
  order['side'] = side;
@@ -4310,7 +4310,7 @@ class okx extends okx$1 {
4310
4310
  if (paginate) {
4311
4311
  return await this.fetchPaginatedCallDynamic('fetchLedger', code, since, limit, params);
4312
4312
  }
4313
- const options = this.safeValue(this.options, 'fetchLedger', {});
4313
+ const options = this.safeDict(this.options, 'fetchLedger', {});
4314
4314
  let method = this.safeString(options, 'method');
4315
4315
  method = this.safeString(params, 'method', method);
4316
4316
  params = this.omit(params, 'method');
@@ -4639,7 +4639,7 @@ class okx extends okx$1 {
4639
4639
  // ]
4640
4640
  // }
4641
4641
  //
4642
- const data = this.safeValue(response, 'data', []);
4642
+ const data = this.safeList(response, 'data', []);
4643
4643
  const filtered = this.filterBy(data, 'selected', true);
4644
4644
  const parsed = this.parseDepositAddresses(filtered, [currency['code']], false);
4645
4645
  return this.indexBy(parsed, 'network');
@@ -4713,7 +4713,7 @@ class okx extends okx$1 {
4713
4713
  };
4714
4714
  let network = this.safeString(params, 'network'); // this line allows the user to specify either ERC20 or ETH
4715
4715
  if (network !== undefined) {
4716
- const networks = this.safeValue(this.options, 'networks', {});
4716
+ const networks = this.safeDict(this.options, 'networks', {});
4717
4717
  network = this.safeString(networks, network.toUpperCase(), network); // handle ETH>ERC20 alias
4718
4718
  request['chain'] = currency['id'] + '-' + network;
4719
4719
  params = this.omit(params, 'network');
@@ -4722,7 +4722,7 @@ class okx extends okx$1 {
4722
4722
  if (fee === undefined) {
4723
4723
  const currencies = await this.fetchCurrencies();
4724
4724
  this.currencies = this.deepExtend(this.currencies, currencies);
4725
- const targetNetwork = this.safeValue(currency['networks'], this.networkIdToCode(network), {});
4725
+ const targetNetwork = this.safeDict(currency['networks'], this.networkIdToCode(network), {});
4726
4726
  fee = this.safeString(targetNetwork, 'fee');
4727
4727
  if (fee === undefined) {
4728
4728
  throw new errors.ArgumentsRequired(this.id + ' withdraw() requires a "fee" string parameter, network transaction fee must be ≥ 0. Withdrawals to OKCoin or OKX are fee-free, please set "0". Withdrawing to external digital asset address requires network transaction fee.');
@@ -4744,7 +4744,7 @@ class okx extends okx$1 {
4744
4744
  // ]
4745
4745
  // }
4746
4746
  //
4747
- const data = this.safeValue(response, 'data', []);
4747
+ const data = this.safeList(response, 'data', []);
4748
4748
  const transaction = this.safeDict(data, 0);
4749
4749
  return this.parseTransaction(transaction, currency);
4750
4750
  }
@@ -4969,7 +4969,7 @@ class okx extends okx$1 {
4969
4969
  // "msg": ''
4970
4970
  // }
4971
4971
  //
4972
- const data = this.safeValue(response, 'data');
4972
+ const data = this.safeList(response, 'data', []);
4973
4973
  const withdrawal = this.safeDict(data, 0, {});
4974
4974
  return this.parseTransaction(withdrawal);
4975
4975
  }
@@ -5256,8 +5256,8 @@ class okx extends okx$1 {
5256
5256
  // ]
5257
5257
  // }
5258
5258
  //
5259
- const data = this.safeValue(response, 'data', []);
5260
- const position = this.safeValue(data, 0);
5259
+ const data = this.safeList(response, 'data', []);
5260
+ const position = this.safeDict(data, 0);
5261
5261
  if (position === undefined) {
5262
5262
  return undefined;
5263
5263
  }
@@ -5293,7 +5293,7 @@ class okx extends okx$1 {
5293
5293
  request['instId'] = marketIds.join(',');
5294
5294
  }
5295
5295
  }
5296
- const fetchPositionsOptions = this.safeValue(this.options, 'fetchPositions', {});
5296
+ const fetchPositionsOptions = this.safeDict(this.options, 'fetchPositions', {});
5297
5297
  const method = this.safeString(fetchPositionsOptions, 'method', 'privateGetAccountPositions');
5298
5298
  let response = undefined;
5299
5299
  if (method === 'privateGetAccountPositionsHistory') {
@@ -5348,7 +5348,7 @@ class okx extends okx$1 {
5348
5348
  // ]
5349
5349
  // }
5350
5350
  //
5351
- const positions = this.safeValue(response, 'data', []);
5351
+ const positions = this.safeList(response, 'data', []);
5352
5352
  const result = [];
5353
5353
  for (let i = 0; i < positions.length; i++) {
5354
5354
  result.push(this.parsePosition(positions[i]));
@@ -5556,7 +5556,7 @@ class okx extends okx$1 {
5556
5556
  */
5557
5557
  await this.loadMarkets();
5558
5558
  const currency = this.currency(code);
5559
- const accountsByType = this.safeValue(this.options, 'accountsByType', {});
5559
+ const accountsByType = this.safeDict(this.options, 'accountsByType', {});
5560
5560
  const fromId = this.safeString(accountsByType, fromAccount, fromAccount);
5561
5561
  const toId = this.safeString(accountsByType, toAccount, toAccount);
5562
5562
  const request = {
@@ -5598,7 +5598,7 @@ class okx extends okx$1 {
5598
5598
  // ]
5599
5599
  // }
5600
5600
  //
5601
- const data = this.safeValue(response, 'data', []);
5601
+ const data = this.safeList(response, 'data', []);
5602
5602
  const rawTransfer = this.safeDict(data, 0, {});
5603
5603
  return this.parseTransfer(rawTransfer, currency);
5604
5604
  }
@@ -5661,7 +5661,7 @@ class okx extends okx$1 {
5661
5661
  let amount = this.safeNumber(transfer, 'amt');
5662
5662
  const fromAccountId = this.safeString(transfer, 'from');
5663
5663
  const toAccountId = this.safeString(transfer, 'to');
5664
- const accountsById = this.safeValue(this.options, 'accountsById', {});
5664
+ const accountsById = this.safeDict(this.options, 'accountsById', {});
5665
5665
  const timestamp = this.safeInteger(transfer, 'ts');
5666
5666
  const balanceChange = this.safeString(transfer, 'sz');
5667
5667
  if (balanceChange !== undefined) {
@@ -5712,7 +5712,7 @@ class okx extends okx$1 {
5712
5712
  // "msg": ""
5713
5713
  // }
5714
5714
  //
5715
- const data = this.safeValue(response, 'data', []);
5715
+ const data = this.safeList(response, 'data', []);
5716
5716
  const transfer = this.safeDict(data, 0);
5717
5717
  return this.parseTransfer(transfer);
5718
5718
  }
@@ -5918,8 +5918,8 @@ class okx extends okx$1 {
5918
5918
  // "msg": ""
5919
5919
  // }
5920
5920
  //
5921
- const data = this.safeValue(response, 'data', []);
5922
- const entry = this.safeValue(data, 0, {});
5921
+ const data = this.safeList(response, 'data', []);
5922
+ const entry = this.safeDict(data, 0, {});
5923
5923
  return this.parseFundingRate(entry, market);
5924
5924
  }
5925
5925
  async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -6059,7 +6059,7 @@ class okx extends okx$1 {
6059
6059
  // "type": "8"
6060
6060
  // }
6061
6061
  //
6062
- const data = this.safeValue(response, 'data', []);
6062
+ const data = this.safeList(response, 'data', []);
6063
6063
  const result = [];
6064
6064
  for (let i = 0; i < data.length; i++) {
6065
6065
  const entry = data[i];
@@ -6251,7 +6251,7 @@ class okx extends okx$1 {
6251
6251
  // ],
6252
6252
  // }
6253
6253
  //
6254
- const data = this.safeValue(response, 'data', []);
6254
+ const data = this.safeList(response, 'data', []);
6255
6255
  const rates = [];
6256
6256
  for (let i = 0; i < data.length; i++) {
6257
6257
  rates.push(this.parseBorrowRate(data[i]));
@@ -6287,8 +6287,8 @@ class okx extends okx$1 {
6287
6287
  // "msg": ""
6288
6288
  // }
6289
6289
  //
6290
- const data = this.safeValue(response, 'data');
6291
- const rate = this.safeValue(data, 0);
6290
+ const data = this.safeList(response, 'data', []);
6291
+ const rate = this.safeDict(data, 0, {});
6292
6292
  return this.parseBorrowRate(rate);
6293
6293
  }
6294
6294
  parseBorrowRate(info, currency = undefined) {
@@ -6392,7 +6392,7 @@ class okx extends okx$1 {
6392
6392
  // "msg": ""
6393
6393
  // }
6394
6394
  //
6395
- const data = this.safeValue(response, 'data');
6395
+ const data = this.safeList(response, 'data', []);
6396
6396
  return this.parseBorrowRateHistories(data, codes, since, limit);
6397
6397
  }
6398
6398
  async fetchBorrowRateHistory(code, since = undefined, limit = undefined, params = {}) {
@@ -6436,7 +6436,7 @@ class okx extends okx$1 {
6436
6436
  // "msg": ""
6437
6437
  // }
6438
6438
  //
6439
- const data = this.safeValue(response, 'data');
6439
+ const data = this.safeList(response, 'data', []);
6440
6440
  return this.parseBorrowRateHistory(data, code, since, limit);
6441
6441
  }
6442
6442
  async modifyMarginHelper(symbol, amount, type, params = {}) {
@@ -6628,7 +6628,7 @@ class okx extends okx$1 {
6628
6628
  // ]
6629
6629
  // }
6630
6630
  //
6631
- const data = this.safeValue(response, 'data');
6631
+ const data = this.safeList(response, 'data', []);
6632
6632
  return this.parseMarketLeverageTiers(data, market);
6633
6633
  }
6634
6634
  parseMarketLeverageTiers(info, market = undefined) {
@@ -6730,7 +6730,7 @@ class okx extends okx$1 {
6730
6730
  // "msg": ""
6731
6731
  // }
6732
6732
  //
6733
- const data = this.safeValue(response, 'data');
6733
+ const data = this.safeList(response, 'data', []);
6734
6734
  const interest = this.parseBorrowInterests(data);
6735
6735
  return this.filterByCurrencySinceLimit(interest, code, since, limit);
6736
6736
  }
@@ -6786,8 +6786,8 @@ class okx extends okx$1 {
6786
6786
  // "msg": ""
6787
6787
  // }
6788
6788
  //
6789
- const data = this.safeValue(response, 'data', []);
6790
- const loan = this.safeValue(data, 0);
6789
+ const data = this.safeList(response, 'data', []);
6790
+ const loan = this.safeDict(data, 0, {});
6791
6791
  return this.parseMarginLoan(loan, currency);
6792
6792
  }
6793
6793
  async repayCrossMargin(code, amount, params = {}) {
@@ -6831,8 +6831,8 @@ class okx extends okx$1 {
6831
6831
  // "msg": ""
6832
6832
  // }
6833
6833
  //
6834
- const data = this.safeValue(response, 'data', []);
6835
- const loan = this.safeValue(data, 0);
6834
+ const data = this.safeList(response, 'data', []);
6835
+ const loan = this.safeDict(data, 0, {});
6836
6836
  return this.parseMarginLoan(loan, currency);
6837
6837
  }
6838
6838
  parseMarginLoan(info, currency = undefined) {
@@ -6914,8 +6914,8 @@ class okx extends okx$1 {
6914
6914
  * @param {int} [params.until] The time in ms of the latest record to retrieve as a unix timestamp
6915
6915
  * @returns An array of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
6916
6916
  */
6917
- const options = this.safeValue(this.options, 'fetchOpenInterestHistory', {});
6918
- const timeframes = this.safeValue(options, 'timeframes', {});
6917
+ const options = this.safeDict(this.options, 'fetchOpenInterestHistory', {});
6918
+ const timeframes = this.safeDict(options, 'timeframes', {});
6919
6919
  timeframe = this.safeString(timeframes, timeframe, timeframe);
6920
6920
  if (timeframe !== '5m' && timeframe !== '1H' && timeframe !== '1D') {
6921
6921
  throw new errors.BadRequest(this.id + ' fetchOpenInterestHistory cannot only use the 5m, 1h, and 1d timeframe');
@@ -7205,7 +7205,7 @@ class okx extends okx$1 {
7205
7205
  // "msg": ""
7206
7206
  // }
7207
7207
  //
7208
- const data = this.safeValue(response, 'data', []);
7208
+ const data = this.safeList(response, 'data', []);
7209
7209
  const settlements = this.parseSettlements(data, market);
7210
7210
  const sorted = this.sortBy(settlements, 'timestamp');
7211
7211
  return this.filterBySymbolSinceLimit(sorted, market['symbol'], since, limit);
@@ -7244,7 +7244,7 @@ class okx extends okx$1 {
7244
7244
  for (let i = 0; i < settlements.length; i++) {
7245
7245
  const entry = settlements[i];
7246
7246
  const timestamp = this.safeInteger(entry, 'ts');
7247
- const details = this.safeValue(entry, 'details', []);
7247
+ const details = this.safeList(entry, 'details', []);
7248
7248
  for (let j = 0; j < details.length; j++) {
7249
7249
  const settlement = this.parseSettlement(details[j], market);
7250
7250
  result.push(this.extend(settlement, {
@@ -7290,7 +7290,7 @@ class okx extends okx$1 {
7290
7290
  // "msg": ""
7291
7291
  // }
7292
7292
  //
7293
- const underlyings = this.safeValue(response, 'data', []);
7293
+ const underlyings = this.safeList(response, 'data', []);
7294
7294
  return underlyings[0];
7295
7295
  }
7296
7296
  async fetchGreeks(symbol, params = {}) {
@@ -7342,7 +7342,7 @@ class okx extends okx$1 {
7342
7342
  // "msg": ""
7343
7343
  // }
7344
7344
  //
7345
- const data = this.safeValue(response, 'data', []);
7345
+ const data = this.safeList(response, 'data', []);
7346
7346
  for (let i = 0; i < data.length; i++) {
7347
7347
  const entry = data[i];
7348
7348
  const entryMarketId = this.safeString(entry, 'instId');
@@ -7465,7 +7465,7 @@ class okx extends okx$1 {
7465
7465
  // "outTime": "1701877077102579"
7466
7466
  // }
7467
7467
  //
7468
- const data = this.safeValue(response, 'data');
7468
+ const data = this.safeList(response, 'data', []);
7469
7469
  const order = this.safeDict(data, 0);
7470
7470
  return this.parseOrder(order, market);
7471
7471
  }
@@ -7784,7 +7784,7 @@ class okx extends okx$1 {
7784
7784
  const code = this.safeString(response, 'code');
7785
7785
  if ((code !== '0') && (code !== '2')) { // 2 means that bulk operation partially succeeded
7786
7786
  const feedback = this.id + ' ' + body;
7787
- const data = this.safeValue(response, 'data', []);
7787
+ const data = this.safeList(response, 'data', []);
7788
7788
  for (let i = 0; i < data.length; i++) {
7789
7789
  const error = data[i];
7790
7790
  const errorCode = this.safeString(error, 'sCode');
@@ -140,6 +140,11 @@ class coinbase extends coinbase$1 {
140
140
  // "low_52_w": "15460",
141
141
  // "high_52_w": "48240",
142
142
  // "price_percent_chg_24_h": "-4.15775596190603"
143
+ // new as of 2024-04-12
144
+ // "best_bid":"21835.29",
145
+ // "best_bid_quantity": "0.02000000",
146
+ // "best_ask":"23011.18",
147
+ // "best_ask_quantity": "0.01500000"
143
148
  // }
144
149
  // ]
145
150
  // }
@@ -165,6 +170,11 @@ class coinbase extends coinbase$1 {
165
170
  // "low_52_w": "0.04908",
166
171
  // "high_52_w": "0.1801",
167
172
  // "price_percent_chg_24_h": "0.50177456859626"
173
+ // new as of 2024-04-12
174
+ // "best_bid":"0.07989",
175
+ // "best_bid_quantity": "500.0",
176
+ // "best_ask":"0.08308",
177
+ // "best_ask_quantity": "300.0"
168
178
  // }
169
179
  // ]
170
180
  // }
@@ -186,6 +196,9 @@ class coinbase extends coinbase$1 {
186
196
  const messageHash = channel + '::' + wsMarketId;
187
197
  newTickers.push(result);
188
198
  client.resolve(result, messageHash);
199
+ if (messageHash.endsWith('USD')) {
200
+ client.resolve(result, messageHash + 'C'); // sometimes we subscribe to BTC/USDC and coinbase returns BTC/USD
201
+ }
189
202
  }
190
203
  }
191
204
  const messageHashes = this.findMessageHashes(client, 'ticker_batch::');
@@ -197,6 +210,9 @@ class coinbase extends coinbase$1 {
197
210
  const tickers = this.filterByArray(newTickers, 'symbol', symbols);
198
211
  if (!this.isEmpty(tickers)) {
199
212
  client.resolve(tickers, messageHash);
213
+ if (messageHash.endsWith('USD')) {
214
+ client.resolve(tickers, messageHash + 'C'); // sometimes we subscribe to BTC/USDC and coinbase returns BTC/USD
215
+ }
200
216
  }
201
217
  }
202
218
  return message;
@@ -213,6 +229,11 @@ class coinbase extends coinbase$1 {
213
229
  // "low_52_w": "0.04908",
214
230
  // "high_52_w": "0.1801",
215
231
  // "price_percent_chg_24_h": "0.50177456859626"
232
+ // new as of 2024-04-12
233
+ // "best_bid":"0.07989",
234
+ // "best_bid_quantity": "500.0",
235
+ // "best_ask":"0.08308",
236
+ // "best_ask_quantity": "300.0"
216
237
  // }
217
238
  //
218
239
  const marketId = this.safeString(ticker, 'product_id');
@@ -225,10 +246,10 @@ class coinbase extends coinbase$1 {
225
246
  'datetime': this.iso8601(timestamp),
226
247
  'high': this.safeString(ticker, 'high_24_h'),
227
248
  'low': this.safeString(ticker, 'low_24_h'),
228
- 'bid': undefined,
229
- 'bidVolume': undefined,
230
- 'ask': undefined,
231
- 'askVolume': undefined,
249
+ 'bid': this.safeString(ticker, 'best_bid'),
250
+ 'bidVolume': this.safeString(ticker, 'best_bid_quantity'),
251
+ 'ask': this.safeString(ticker, 'best_ask'),
252
+ 'askVolume': this.safeString(ticker, 'best_ask_quantity'),
232
253
  'vwap': undefined,
233
254
  'open': undefined,
234
255
  'close': last,
@@ -346,6 +367,9 @@ class coinbase extends coinbase$1 {
346
367
  }
347
368
  }
348
369
  client.resolve(tradesArray, messageHash);
370
+ if (marketId.endsWith('USD')) {
371
+ client.resolve(tradesArray, messageHash + 'C'); // sometimes we subscribe to BTC/USDC and coinbase returns BTC/USD
372
+ }
349
373
  return message;
350
374
  }
351
375
  handleOrder(client, message) {
@@ -401,6 +425,9 @@ class coinbase extends coinbase$1 {
401
425
  const marketId = marketIds[i];
402
426
  const messageHash = 'user::' + marketId;
403
427
  client.resolve(this.orders, messageHash);
428
+ if (messageHash.endsWith('USD')) {
429
+ client.resolve(this.orders, messageHash + 'C'); // sometimes we subscribe to BTC/USDC and coinbase returns BTC/USD
430
+ }
404
431
  }
405
432
  client.resolve(this.orders, 'user');
406
433
  return message;
@@ -513,6 +540,9 @@ class coinbase extends coinbase$1 {
513
540
  orderbook['datetime'] = undefined;
514
541
  orderbook['symbol'] = symbol;
515
542
  client.resolve(orderbook, messageHash);
543
+ if (messageHash.endsWith('USD')) {
544
+ client.resolve(orderbook, messageHash + 'C'); // sometimes we subscribe to BTC/USDC and coinbase returns BTC/USD
545
+ }
516
546
  }
517
547
  else if (type === 'update') {
518
548
  const orderbook = this.orderbooks[symbol];
@@ -521,6 +551,9 @@ class coinbase extends coinbase$1 {
521
551
  orderbook['timestamp'] = this.parse8601(datetime);
522
552
  orderbook['symbol'] = symbol;
523
553
  client.resolve(orderbook, messageHash);
554
+ if (messageHash.endsWith('USD')) {
555
+ client.resolve(orderbook, messageHash + 'C'); // sometimes we subscribe to BTC/USDC and coinbase returns BTC/USD
556
+ }
524
557
  }
525
558
  }
526
559
  return message;
package/js/ccxt.d.ts CHANGED
@@ -3,8 +3,8 @@ import { Precise } from './src/base/Precise.js';
3
3
  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
- 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, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, ExchangeClosedByUser } from './src/base/errors.js';
7
- declare const version = "4.2.93";
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.2.95";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
@@ -519,5 +519,5 @@ declare const ccxt: {
519
519
  zaif: typeof zaif;
520
520
  zonda: typeof zonda;
521
521
  } & typeof functions & typeof errors;
522
- export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, ExchangeClosedByUser, 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, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
522
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, 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, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
523
523
  export default ccxt;
package/js/ccxt.js CHANGED
@@ -35,10 +35,10 @@ import { Exchange } from './src/base/Exchange.js';
35
35
  import { Precise } from './src/base/Precise.js';
36
36
  import * as functions from './src/base/functions.js';
37
37
  import * as errors from './src/base/errors.js';
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, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, ExchangeClosedByUser } from './src/base/errors.js';
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.2.94';
41
+ const version = '4.2.96';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -392,6 +392,6 @@ pro.exchanges = Object.keys(pro);
392
392
  pro['Exchange'] = Exchange; // now the same for rest and ts
393
393
  //-----------------------------------------------------------------------------
394
394
  const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
395
- export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, ExchangeClosedByUser, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
395
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
396
396
  export default ccxt;
397
397
  //-----------------------------------------------------------------------------
@@ -233,6 +233,12 @@ interface Exchange {
233
233
  privatePostBlurAddress(params?: {}): Promise<implicitReturnType>;
234
234
  privatePostVextWithdrawal(params?: {}): Promise<implicitReturnType>;
235
235
  privatePostVextAddress(params?: {}): Promise<implicitReturnType>;
236
+ privatePostCsprWithdrawal(params?: {}): Promise<implicitReturnType>;
237
+ privatePostCsprAddress(params?: {}): Promise<implicitReturnType>;
238
+ privatePostVchfWithdrawal(params?: {}): Promise<implicitReturnType>;
239
+ privatePostVchfAddress(params?: {}): Promise<implicitReturnType>;
240
+ privatePostVeurWithdrawal(params?: {}): Promise<implicitReturnType>;
241
+ privatePostVeurAddress(params?: {}): Promise<implicitReturnType>;
236
242
  }
237
243
  declare abstract class Exchange extends _Exchange {
238
244
  }
@@ -82,6 +82,7 @@ interface Exchange {
82
82
  v3PrivatePostBrokerageConvertTradeTradeId(params?: {}): Promise<implicitReturnType>;
83
83
  v3PrivatePostBrokerageCfmSweepsSchedule(params?: {}): Promise<implicitReturnType>;
84
84
  v3PrivatePostBrokerageIntxAllocate(params?: {}): Promise<implicitReturnType>;
85
+ v3PrivatePostBrokerageOrdersClosePosition(params?: {}): Promise<implicitReturnType>;
85
86
  v3PrivatePutBrokeragePortfoliosPortfolioUuid(params?: {}): Promise<implicitReturnType>;
86
87
  v3PrivateDeleteBrokeragePortfoliosPortfolioUuid(params?: {}): Promise<implicitReturnType>;
87
88
  v3PrivateDeleteBrokerageCfmSweeps(params?: {}): Promise<implicitReturnType>;
@@ -34,6 +34,7 @@ declare const errorHierarchy: {
34
34
  };
35
35
  NotSupported: {};
36
36
  ProxyError: {};
37
+ ExchangeClosedByUser: {};
37
38
  };
38
39
  OperationFailed: {
39
40
  NetworkError: {
@@ -46,7 +47,6 @@ declare const errorHierarchy: {
46
47
  RequestTimeout: {};
47
48
  };
48
49
  };
49
- ExchangeClosedByUser: {};
50
50
  };
51
51
  };
52
52
  export default errorHierarchy;
@@ -40,6 +40,7 @@ const errorHierarchy = {
40
40
  },
41
41
  'NotSupported': {},
42
42
  'ProxyError': {},
43
+ 'ExchangeClosedByUser': {},
43
44
  },
44
45
  'OperationFailed': {
45
46
  'NetworkError': {
@@ -52,7 +53,6 @@ const errorHierarchy = {
52
53
  'RequestTimeout': {},
53
54
  },
54
55
  },
55
- 'ExchangeClosedByUser': {},
56
56
  },
57
57
  };
58
58
  export default errorHierarchy;