ccxt 4.2.12 → 4.2.13

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 (63) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.js +718 -240
  3. package/dist/ccxt.browser.min.js +3 -3
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/js/ccxt.js +1 -1
  6. package/dist/cjs/js/src/bigone.js +89 -22
  7. package/dist/cjs/js/src/binance.js +34 -27
  8. package/dist/cjs/js/src/bingx.js +106 -36
  9. package/dist/cjs/js/src/bitget.js +13 -6
  10. package/dist/cjs/js/src/bitmart.js +3 -3
  11. package/dist/cjs/js/src/bybit.js +1 -1
  12. package/dist/cjs/js/src/coinbase.js +176 -26
  13. package/dist/cjs/js/src/coinlist.js +1 -1
  14. package/dist/cjs/js/src/coinone.js +1 -1
  15. package/dist/cjs/js/src/deribit.js +1 -1
  16. package/dist/cjs/js/src/gate.js +74 -56
  17. package/dist/cjs/js/src/gemini.js +1 -1
  18. package/dist/cjs/js/src/htx.js +26 -1
  19. package/dist/cjs/js/src/independentreserve.js +7 -5
  20. package/dist/cjs/js/src/kraken.js +3 -7
  21. package/dist/cjs/js/src/lbank.js +59 -33
  22. package/dist/cjs/js/src/oceanex.js +1 -1
  23. package/dist/cjs/js/src/okx.js +2 -1
  24. package/dist/cjs/js/src/phemex.js +9 -2
  25. package/dist/cjs/js/src/pro/kraken.js +1 -1
  26. package/dist/cjs/js/src/pro/okx.js +52 -2
  27. package/dist/cjs/js/src/probit.js +4 -2
  28. package/dist/cjs/js/src/wavesexchange.js +1 -1
  29. package/dist/cjs/js/src/woo.js +52 -2
  30. package/js/ccxt.d.ts +1 -1
  31. package/js/ccxt.js +1 -1
  32. package/js/src/abstract/bingx.d.ts +2 -0
  33. package/js/src/abstract/okx.d.ts +1 -0
  34. package/js/src/bigone.d.ts +2 -0
  35. package/js/src/bigone.js +89 -22
  36. package/js/src/binance.js +34 -27
  37. package/js/src/bingx.js +106 -36
  38. package/js/src/bitget.js +13 -6
  39. package/js/src/bitmart.js +3 -3
  40. package/js/src/bybit.js +1 -1
  41. package/js/src/coinbase.d.ts +26 -3
  42. package/js/src/coinbase.js +176 -26
  43. package/js/src/coinlist.js +1 -1
  44. package/js/src/coinone.js +1 -1
  45. package/js/src/deribit.js +1 -1
  46. package/js/src/gate.js +74 -56
  47. package/js/src/gemini.js +1 -1
  48. package/js/src/htx.d.ts +1 -0
  49. package/js/src/htx.js +26 -1
  50. package/js/src/independentreserve.js +7 -5
  51. package/js/src/kraken.js +3 -7
  52. package/js/src/lbank.js +59 -33
  53. package/js/src/oceanex.js +1 -1
  54. package/js/src/okx.js +2 -1
  55. package/js/src/phemex.js +9 -2
  56. package/js/src/pro/kraken.js +1 -1
  57. package/js/src/pro/okx.d.ts +1 -0
  58. package/js/src/pro/okx.js +52 -2
  59. package/js/src/probit.js +4 -2
  60. package/js/src/wavesexchange.js +1 -1
  61. package/js/src/woo.d.ts +2 -0
  62. package/js/src/woo.js +52 -2
  63. package/package.json +1 -1
@@ -102,7 +102,7 @@ class coinbase extends coinbase$1 {
102
102
  'setLeverage': false,
103
103
  'setMarginMode': false,
104
104
  'setPositionMode': false,
105
- 'withdraw': undefined,
105
+ 'withdraw': true,
106
106
  },
107
107
  'urls': {
108
108
  'logo': 'https://user-images.githubusercontent.com/1294454/40811661-b6eceae2-653a-11e8-829e-10bfadb078cf.jpg',
@@ -773,46 +773,102 @@ class coinbase extends coinbase$1 {
773
773
  // "next_step": null
774
774
  // }
775
775
  //
776
- const subtotalObject = this.safeValue(transaction, 'subtotal', {});
777
- const feeObject = this.safeValue(transaction, 'fee', {});
778
- const id = this.safeString(transaction, 'id');
779
- const timestamp = this.parse8601(this.safeValue(transaction, 'created_at'));
780
- const updated = this.parse8601(this.safeValue(transaction, 'updated_at'));
781
- const type = this.safeString(transaction, 'resource');
782
- const amount = this.safeNumber(subtotalObject, 'amount');
783
- const currencyId = this.safeString(subtotalObject, 'currency');
784
- const code = this.safeCurrencyCode(currencyId, currency);
785
- const feeCost = this.safeNumber(feeObject, 'amount');
786
- const feeCurrencyId = this.safeString(feeObject, 'currency');
787
- const feeCurrency = this.safeCurrencyCode(feeCurrencyId);
788
- const fee = {
789
- 'cost': feeCost,
790
- 'currency': feeCurrency,
791
- };
776
+ // withdraw
777
+ //
778
+ // {
779
+ // "id": "a1794ecf-5693-55fa-70cf-ef731748ed82",
780
+ // "type": "send",
781
+ // "status": "pending",
782
+ // "amount": {
783
+ // "amount": "-14.008308",
784
+ // "currency": "USDC"
785
+ // },
786
+ // "native_amount": {
787
+ // "amount": "-18.74",
788
+ // "currency": "CAD"
789
+ // },
790
+ // "description": null,
791
+ // "created_at": "2024-01-12T01:27:31Z",
792
+ // "updated_at": "2024-01-12T01:27:31Z",
793
+ // "resource": "transaction",
794
+ // "resource_path": "/v2/accounts/a34bgfad-ed67-538b-bffc-730c98c10da0/transactions/a1794ecf-5693-55fa-70cf-ef731748ed82",
795
+ // "instant_exchange": false,
796
+ // "network": {
797
+ // "status": "pending",
798
+ // "status_description": "Pending (est. less than 10 minutes)",
799
+ // "transaction_fee": {
800
+ // "amount": "4.008308",
801
+ // "currency": "USDC"
802
+ // },
803
+ // "transaction_amount": {
804
+ // "amount": "10.000000",
805
+ // "currency": "USDC"
806
+ // },
807
+ // "confirmations": 0
808
+ // },
809
+ // "to": {
810
+ // "resource": "ethereum_address",
811
+ // "address": "0x9...",
812
+ // "currency": "USDC",
813
+ // "address_info": {
814
+ // "address": "0x9..."
815
+ // }
816
+ // },
817
+ // "idem": "748d8591-dg9a-7831-a45b-crd61dg78762",
818
+ // "details": {
819
+ // "title": "Sent USDC",
820
+ // "subtitle": "To USDC address on Ethereum network",
821
+ // "header": "Sent 14.008308 USDC ($18.74)",
822
+ // "health": "warning"
823
+ // },
824
+ // "hide_native_amount": false
825
+ // }
826
+ //
827
+ const transactionType = this.safeString(transaction, 'type');
828
+ let amountAndCurrencyObject = undefined;
829
+ let feeObject = undefined;
830
+ if (transactionType === 'send') {
831
+ const network = this.safeValue(transaction, 'network', {});
832
+ amountAndCurrencyObject = this.safeValue(network, 'transaction_amount', {});
833
+ feeObject = this.safeValue(network, 'transaction_fee', {});
834
+ }
835
+ else {
836
+ amountAndCurrencyObject = this.safeValue(transaction, 'subtotal', {});
837
+ feeObject = this.safeValue(transaction, 'fee', {});
838
+ }
792
839
  let status = this.parseTransactionStatus(this.safeString(transaction, 'status'));
793
840
  if (status === undefined) {
794
841
  const committed = this.safeValue(transaction, 'committed');
795
842
  status = committed ? 'ok' : 'pending';
796
843
  }
844
+ const id = this.safeString(transaction, 'id');
845
+ const currencyId = this.safeString(amountAndCurrencyObject, 'currency');
846
+ const feeCurrencyId = this.safeString(feeObject, 'currency');
847
+ const datetime = this.safeValue(transaction, 'created_at');
848
+ const toObject = this.safeValue(transaction, 'to', {});
849
+ const toAddress = this.safeString(toObject, 'address');
797
850
  return {
798
851
  'info': transaction,
799
852
  'id': id,
800
853
  'txid': id,
801
- 'timestamp': timestamp,
802
- 'datetime': this.iso8601(timestamp),
854
+ 'timestamp': this.parse8601(datetime),
855
+ 'datetime': datetime,
803
856
  'network': undefined,
804
- 'address': undefined,
805
- 'addressTo': undefined,
857
+ 'address': toAddress,
858
+ 'addressTo': toAddress,
806
859
  'addressFrom': undefined,
807
860
  'tag': undefined,
808
861
  'tagTo': undefined,
809
862
  'tagFrom': undefined,
810
- 'type': type,
811
- 'amount': amount,
812
- 'currency': code,
863
+ 'type': this.safeString(transaction, 'resource'),
864
+ 'amount': this.safeNumber(amountAndCurrencyObject, 'amount'),
865
+ 'currency': this.safeCurrencyCode(currencyId, currency),
813
866
  'status': status,
814
- 'updated': updated,
815
- 'fee': fee,
867
+ 'updated': this.parse8601(this.safeValue(transaction, 'updated_at')),
868
+ 'fee': {
869
+ 'cost': this.safeNumber(feeObject, 'amount'),
870
+ 'currency': this.safeCurrencyCode(feeCurrencyId),
871
+ },
816
872
  };
817
873
  }
818
874
  parseTrade(trade, market = undefined) {
@@ -3166,6 +3222,100 @@ class coinbase extends coinbase$1 {
3166
3222
  const tickers = this.safeValue(response, 'pricebooks', []);
3167
3223
  return this.parseTickers(tickers, symbols);
3168
3224
  }
3225
+ async withdraw(code, amount, address, tag = undefined, params = {}) {
3226
+ /**
3227
+ * @method
3228
+ * @name coinbase#withdraw
3229
+ * @description make a withdrawal
3230
+ * @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-transactions#send-money
3231
+ * @param {string} code unified currency code
3232
+ * @param {float} amount the amount to withdraw
3233
+ * @param {string} address the address to withdraw to
3234
+ * @param {string} [tag] an optional tag for the withdrawal
3235
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3236
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3237
+ */
3238
+ [tag, params] = this.handleWithdrawTagAndParams(tag, params);
3239
+ this.checkAddress(address);
3240
+ await this.loadMarkets();
3241
+ const currency = this.currency(code);
3242
+ let accountId = this.safeString2(params, 'account_id', 'accountId');
3243
+ params = this.omit(params, ['account_id', 'accountId']);
3244
+ if (accountId === undefined) {
3245
+ if (code === undefined) {
3246
+ throw new errors.ArgumentsRequired(this.id + ' withdraw() requires an account_id (or accountId) parameter OR a currency code argument');
3247
+ }
3248
+ accountId = await this.findAccountId(code);
3249
+ if (accountId === undefined) {
3250
+ throw new errors.ExchangeError(this.id + ' withdraw() could not find account id for ' + code);
3251
+ }
3252
+ }
3253
+ const request = {
3254
+ 'account_id': accountId,
3255
+ 'type': 'send',
3256
+ 'to': address,
3257
+ 'amount': amount,
3258
+ 'currency': currency['id'],
3259
+ };
3260
+ if (tag !== undefined) {
3261
+ request['destination_tag'] = tag;
3262
+ }
3263
+ const response = await this.v2PrivatePostAccountsAccountIdTransactions(this.extend(request, params));
3264
+ //
3265
+ // {
3266
+ // "data": {
3267
+ // "id": "a1794ecf-5693-55fa-70cf-ef731748ed82",
3268
+ // "type": "send",
3269
+ // "status": "pending",
3270
+ // "amount": {
3271
+ // "amount": "-14.008308",
3272
+ // "currency": "USDC"
3273
+ // },
3274
+ // "native_amount": {
3275
+ // "amount": "-18.74",
3276
+ // "currency": "CAD"
3277
+ // },
3278
+ // "description": null,
3279
+ // "created_at": "2024-01-12T01:27:31Z",
3280
+ // "updated_at": "2024-01-12T01:27:31Z",
3281
+ // "resource": "transaction",
3282
+ // "resource_path": "/v2/accounts/a34bgfad-ed67-538b-bffc-730c98c10da0/transactions/a1794ecf-5693-55fa-70cf-ef731748ed82",
3283
+ // "instant_exchange": false,
3284
+ // "network": {
3285
+ // "status": "pending",
3286
+ // "status_description": "Pending (est. less than 10 minutes)",
3287
+ // "transaction_fee": {
3288
+ // "amount": "4.008308",
3289
+ // "currency": "USDC"
3290
+ // },
3291
+ // "transaction_amount": {
3292
+ // "amount": "10.000000",
3293
+ // "currency": "USDC"
3294
+ // },
3295
+ // "confirmations": 0
3296
+ // },
3297
+ // "to": {
3298
+ // "resource": "ethereum_address",
3299
+ // "address": "0x9...",
3300
+ // "currency": "USDC",
3301
+ // "address_info": {
3302
+ // "address": "0x9..."
3303
+ // }
3304
+ // },
3305
+ // "idem": "748d8591-dg9a-7831-a45b-crd61dg78762",
3306
+ // "details": {
3307
+ // "title": "Sent USDC",
3308
+ // "subtitle": "To USDC address on Ethereum network",
3309
+ // "header": "Sent 14.008308 USDC ($18.74)",
3310
+ // "health": "warning"
3311
+ // },
3312
+ // "hide_native_amount": false
3313
+ // }
3314
+ // }
3315
+ //
3316
+ const data = this.safeValue(response, 'data', {});
3317
+ return this.parseTransaction(data, currency);
3318
+ }
3169
3319
  sign(path, api = [], method = 'GET', params = {}, headers = undefined, body = undefined) {
3170
3320
  const version = api[0];
3171
3321
  const signed = api[1] === 'private';
@@ -750,7 +750,7 @@ class coinlist extends coinlist$1 {
750
750
  request['start_time'] = this.iso8601(since);
751
751
  }
752
752
  if (limit !== undefined) {
753
- request['count'] = limit;
753
+ request['count'] = Math.min(limit, 500);
754
754
  }
755
755
  const until = this.safeInteger2(params, 'till', 'until');
756
756
  if (until !== undefined) {
@@ -709,7 +709,7 @@ class coinone extends coinone$1 {
709
709
  'target_currency': market['base'],
710
710
  };
711
711
  if (limit !== undefined) {
712
- request['size'] = limit; // only support 10, 50, 100, 150, 200
712
+ request['size'] = Math.min(limit, 200);
713
713
  }
714
714
  const response = await this.v2PublicGetTradesQuoteCurrencyTargetCurrency(this.extend(request, params));
715
715
  //
@@ -36,11 +36,11 @@ class deribit extends deribit$1 {
36
36
  'cancelOrder': true,
37
37
  'cancelOrders': false,
38
38
  'createDepositAddress': true,
39
- 'createTrailingAmountOrder': true,
40
39
  'createOrder': true,
41
40
  'createStopLimitOrder': true,
42
41
  'createStopMarketOrder': true,
43
42
  'createStopOrder': true,
43
+ 'createTrailingAmountOrder': true,
44
44
  'editOrder': true,
45
45
  'fetchAccounts': true,
46
46
  'fetchBalance': true,
@@ -3120,7 +3120,7 @@ class gate extends gate$1 {
3120
3120
  request['to'] = this.parseToInt(until / 1000);
3121
3121
  }
3122
3122
  if (limit !== undefined) {
3123
- request['limit'] = limit; // default 100, max 1000
3123
+ request['limit'] = Math.min(limit, 1000); // default 100, max 1000
3124
3124
  }
3125
3125
  if (since !== undefined && (market['contract'])) {
3126
3126
  request['from'] = this.parseToInt(since / 1000);
@@ -5260,29 +5260,35 @@ class gate extends gate$1 {
5260
5260
  // swap and future
5261
5261
  //
5262
5262
  // {
5263
- // "value": "12.475572",
5263
+ // "value": "4.60516",
5264
5264
  // "leverage": "0",
5265
5265
  // "mode": "single",
5266
5266
  // "realised_point": "0",
5267
5267
  // "contract": "BTC_USDT",
5268
- // "entry_price": "62422.6",
5269
- // "mark_price": "62377.86",
5268
+ // "entry_price": "46030.3",
5269
+ // "mark_price": "46051.6",
5270
5270
  // "history_point": "0",
5271
- // "realised_pnl": "-0.00624226",
5272
- // "close_order": null,
5273
- // "size": "2",
5274
- // "cross_leverage_limit": "25",
5275
- // "pending_orders": "0",
5276
- // "adl_ranking": "5",
5277
- // "maintenance_rate": "0.005",
5278
- // "unrealised_pnl": "-0.008948",
5279
- // "user": "663337",
5280
- // "leverage_max": "100",
5281
- // "history_pnl": "14.98868396636",
5271
+ // "realised_pnl": "-0.002301515",
5272
+ // "close_order": null,
5273
+ // "size": 1,
5274
+ // "cross_leverage_limit": "0",
5275
+ // "pending_orders": 0,
5276
+ // "adl_ranking": 5,
5277
+ // "maintenance_rate": "0.004",
5278
+ // "unrealised_pnl": "0.00213",
5279
+ // "user": 5691076,
5280
+ // "leverage_max": "125",
5281
+ // "history_pnl": "0",
5282
5282
  // "risk_limit": "1000000",
5283
- // "margin": "0.740721495056",
5284
- // "last_close_pnl": "-0.041996015",
5285
- // "liq_price": "59058.58"
5283
+ // "margin": "8.997698485",
5284
+ // "last_close_pnl": "0",
5285
+ // "liq_price": "0",
5286
+ // "update_time": 1705034246,
5287
+ // "update_id": 1,
5288
+ // "initial_margin": "0",
5289
+ // "maintenance_margin": "0",
5290
+ // "open_time": 1705034246,
5291
+ // "trade_max_size": "0"
5286
5292
  // }
5287
5293
  //
5288
5294
  // option
@@ -5333,14 +5339,14 @@ class gate extends gate$1 {
5333
5339
  const takerFee = '0.00075';
5334
5340
  const feePaid = Precise["default"].stringMul(takerFee, notional);
5335
5341
  const initialMarginString = Precise["default"].stringAdd(Precise["default"].stringDiv(notional, leverage), feePaid);
5336
- const timestamp = this.safeInteger(position, 'time_ms');
5342
+ const timestamp = this.safeTimestamp(position, 'open_time');
5337
5343
  return this.safePosition({
5338
5344
  'info': position,
5339
5345
  'id': undefined,
5340
5346
  'symbol': this.safeString(market, 'symbol'),
5341
- 'timestamp': undefined,
5342
- 'datetime': undefined,
5343
- 'lastUpdateTimestamp': timestamp,
5347
+ 'timestamp': timestamp,
5348
+ 'datetime': this.iso8601(timestamp),
5349
+ 'lastUpdateTimestamp': this.safeTimestamp(position, 'update_time'),
5344
5350
  'initialMargin': this.parseNumber(initialMarginString),
5345
5351
  'initialMarginPercentage': this.parseNumber(Precise["default"].stringDiv(initialMarginString, notional)),
5346
5352
  'maintenanceMargin': this.parseNumber(Precise["default"].stringMul(maintenanceRate, notional)),
@@ -5399,29 +5405,35 @@ class gate extends gate$1 {
5399
5405
  // swap and future
5400
5406
  //
5401
5407
  // {
5402
- // "value": "12.475572",
5408
+ // "value": "4.60516",
5403
5409
  // "leverage": "0",
5404
5410
  // "mode": "single",
5405
5411
  // "realised_point": "0",
5406
5412
  // "contract": "BTC_USDT",
5407
- // "entry_price": "62422.6",
5408
- // "mark_price": "62377.86",
5413
+ // "entry_price": "46030.3",
5414
+ // "mark_price": "46051.6",
5409
5415
  // "history_point": "0",
5410
- // "realised_pnl": "-0.00624226",
5411
- // "close_order": null,
5412
- // "size": "2",
5413
- // "cross_leverage_limit": "25",
5414
- // "pending_orders": "0",
5415
- // "adl_ranking": "5",
5416
- // "maintenance_rate": "0.005",
5417
- // "unrealised_pnl": "-0.008948",
5418
- // "user": "6693577",
5419
- // "leverage_max": "100",
5420
- // "history_pnl": "14.98868396636",
5416
+ // "realised_pnl": "-0.002301515",
5417
+ // "close_order": null,
5418
+ // "size": 1,
5419
+ // "cross_leverage_limit": "0",
5420
+ // "pending_orders": 0,
5421
+ // "adl_ranking": 5,
5422
+ // "maintenance_rate": "0.004",
5423
+ // "unrealised_pnl": "0.00213",
5424
+ // "user": 5691076,
5425
+ // "leverage_max": "125",
5426
+ // "history_pnl": "0",
5421
5427
  // "risk_limit": "1000000",
5422
- // "margin": "0.740721495056",
5423
- // "last_close_pnl": "-0.041996015",
5424
- // "liq_price": "59058.58"
5428
+ // "margin": "8.997698485",
5429
+ // "last_close_pnl": "0",
5430
+ // "liq_price": "0",
5431
+ // "update_time": 1705034246,
5432
+ // "update_id": 1,
5433
+ // "initial_margin": "0",
5434
+ // "maintenance_margin": "0",
5435
+ // "open_time": 1705034246,
5436
+ // "trade_max_size": "0"
5425
5437
  // }
5426
5438
  //
5427
5439
  // option
@@ -5501,29 +5513,35 @@ class gate extends gate$1 {
5501
5513
  //
5502
5514
  // [
5503
5515
  // {
5504
- // "value": "12.475572",
5516
+ // "value": "4.602828",
5505
5517
  // "leverage": "0",
5506
5518
  // "mode": "single",
5507
5519
  // "realised_point": "0",
5508
5520
  // "contract": "BTC_USDT",
5509
- // "entry_price": "62422.6",
5510
- // "mark_price": "62377.86",
5521
+ // "entry_price": "46030.3",
5522
+ // "mark_price": "46028.28",
5511
5523
  // "history_point": "0",
5512
- // "realised_pnl": "-0.00624226",
5513
- // "close_order": null,
5514
- // "size": "2",
5515
- // "cross_leverage_limit": "25",
5516
- // "pending_orders": "0",
5517
- // "adl_ranking": "5",
5518
- // "maintenance_rate": "0.005",
5519
- // "unrealised_pnl": "-0.008948",
5520
- // "user": "6693577",
5521
- // "leverage_max": "100",
5522
- // "history_pnl": "14.98868396636",
5524
+ // "realised_pnl": "-0.002301515",
5525
+ // "close_order": null,
5526
+ // "size": 1,
5527
+ // "cross_leverage_limit": "0",
5528
+ // "pending_orders": 0,
5529
+ // "adl_ranking": 5,
5530
+ // "maintenance_rate": "0.004",
5531
+ // "unrealised_pnl": "-0.000202",
5532
+ // "user": 5691076,
5533
+ // "leverage_max": "125",
5534
+ // "history_pnl": "0",
5523
5535
  // "risk_limit": "1000000",
5524
- // "margin": "0.740721495056",
5525
- // "last_close_pnl": "-0.041996015",
5526
- // "liq_price": "59058.58"
5536
+ // "margin": "8.997698485",
5537
+ // "last_close_pnl": "0",
5538
+ // "liq_price": "0",
5539
+ // "update_time": 1705034246,
5540
+ // "update_id": 1,
5541
+ // "initial_margin": "0",
5542
+ // "maintenance_margin": "0",
5543
+ // "open_time": 1705034246,
5544
+ // "trade_max_size": "0"
5527
5545
  // }
5528
5546
  // ]
5529
5547
  //
@@ -951,7 +951,7 @@ class gemini extends gemini$1 {
951
951
  'symbol': market['id'],
952
952
  };
953
953
  if (limit !== undefined) {
954
- request['limit_trades'] = limit;
954
+ request['limit_trades'] = Math.min(limit, 500);
955
955
  }
956
956
  if (since !== undefined) {
957
957
  request['timestamp'] = since;
@@ -41,13 +41,13 @@ class htx extends htx$1 {
41
41
  'createMarketBuyOrderWithCost': true,
42
42
  'createMarketOrderWithCost': false,
43
43
  'createMarketSellOrderWithCost': false,
44
- 'createTrailingPercentOrder': true,
45
44
  'createOrder': true,
46
45
  'createOrders': true,
47
46
  'createReduceOnlyOrder': false,
48
47
  'createStopLimitOrder': true,
49
48
  'createStopMarketOrder': true,
50
49
  'createStopOrder': true,
50
+ 'createTrailingPercentOrder': true,
51
51
  'fetchAccounts': true,
52
52
  'fetchBalance': true,
53
53
  'fetchBidsAsks': undefined,
@@ -4969,6 +4969,31 @@ class htx extends htx$1 {
4969
4969
  params['createMarketBuyOrderRequiresPrice'] = false;
4970
4970
  return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
4971
4971
  }
4972
+ async createTrailingPercentOrder(symbol, type, side, amount, price = undefined, trailingPercent = undefined, trailingTriggerPrice = undefined, params = {}) {
4973
+ /**
4974
+ * @method
4975
+ * @name createTrailingPercentOrder
4976
+ * @description create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
4977
+ * @param {string} symbol unified symbol of the market to create an order in
4978
+ * @param {string} type 'market' or 'limit'
4979
+ * @param {string} side 'buy' or 'sell'
4980
+ * @param {float} amount how much you want to trade in units of the base currency, or number of contracts
4981
+ * @param {float} [price] the price for the order to be filled at, in units of the quote currency, ignored in market orders
4982
+ * @param {float} trailingPercent the percent to trail away from the current market price
4983
+ * @param {float} trailingTriggerPrice the price to activate a trailing order, default uses the price argument
4984
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4985
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4986
+ */
4987
+ if (trailingPercent === undefined) {
4988
+ throw new errors.ArgumentsRequired(this.id + ' createTrailingPercentOrder() requires a trailingPercent argument');
4989
+ }
4990
+ if (trailingTriggerPrice === undefined) {
4991
+ throw new errors.ArgumentsRequired(this.id + ' createTrailingPercentOrder() requires a trailingTriggerPrice argument');
4992
+ }
4993
+ params['trailingPercent'] = trailingPercent;
4994
+ params['trailingTriggerPrice'] = trailingTriggerPrice;
4995
+ return await this.createOrder(symbol, type, side, amount, price, params);
4996
+ }
4972
4997
  async createSpotOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
4973
4998
  /**
4974
4999
  * @method
@@ -683,20 +683,22 @@ class independentreserve extends independentreserve$1 {
683
683
  */
684
684
  await this.loadMarkets();
685
685
  const market = this.market(symbol);
686
- const capitalizedOrderType = this.capitalize(type);
687
- const method = 'privatePostPlace' + capitalizedOrderType + 'Order';
688
- let orderType = capitalizedOrderType;
686
+ let orderType = this.capitalize(type);
689
687
  orderType += (side === 'sell') ? 'Offer' : 'Bid';
690
688
  const request = this.ordered({
691
689
  'primaryCurrencyCode': market['baseId'],
692
690
  'secondaryCurrencyCode': market['quoteId'],
693
691
  'orderType': orderType,
694
692
  });
693
+ let response = undefined;
694
+ request['volume'] = amount;
695
695
  if (type === 'limit') {
696
696
  request['price'] = price;
697
+ response = await this.privatePostPlaceLimitOrder(this.extend(request, params));
698
+ }
699
+ else {
700
+ response = await this.privatePostPlaceMarketOrder(this.extend(request, params));
697
701
  }
698
- request['volume'] = amount;
699
- const response = await this[method](this.extend(request, params));
700
702
  return this.safeOrder({
701
703
  'info': response,
702
704
  'id': response['OrderGuid'],
@@ -38,8 +38,8 @@ class kraken extends kraken$1 {
38
38
  'createOrder': true,
39
39
  'createStopLimitOrder': true,
40
40
  'createStopMarketOrder': true,
41
- 'createTrailingAmountOrder': true,
42
41
  'createStopOrder': true,
42
+ 'createTrailingAmountOrder': true,
43
43
  'editOrder': true,
44
44
  'fetchBalance': true,
45
45
  'fetchBorrowInterest': false,
@@ -1264,12 +1264,8 @@ class kraken extends kraken$1 {
1264
1264
  request['since'] = since * 1e6;
1265
1265
  request['since'] = since.toString() + '000000'; // expected to be in nanoseconds
1266
1266
  }
1267
- // https://github.com/ccxt/ccxt/issues/5698
1268
- if (limit !== undefined && limit !== 1000) {
1269
- const fetchTradesWarning = this.safeValue(this.options, 'fetchTradesWarning', true);
1270
- if (fetchTradesWarning) {
1271
- throw new errors.ExchangeError(this.id + ' fetchTrades() cannot serve ' + limit.toString() + " trades without breaking the pagination, see https://github.com/ccxt/ccxt/issues/5698 for more details. Set exchange.options['fetchTradesWarning'] to acknowledge this warning and silence it.");
1272
- }
1267
+ if (limit !== undefined) {
1268
+ request['count'] = limit;
1273
1269
  }
1274
1270
  const response = await this.publicGetTrades(this.extend(request, params));
1275
1271
  //