ccxt 4.2.12 → 4.2.14

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 (81) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.js +1338 -366
  3. package/dist/ccxt.browser.min.js +7 -7
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/js/ccxt.js +1 -1
  6. package/dist/cjs/js/src/base/Exchange.js +148 -1
  7. package/dist/cjs/js/src/bigone.js +125 -54
  8. package/dist/cjs/js/src/binance.js +142 -27
  9. package/dist/cjs/js/src/binanceus.js +8 -0
  10. package/dist/cjs/js/src/bingx.js +110 -36
  11. package/dist/cjs/js/src/bitget.js +17 -6
  12. package/dist/cjs/js/src/bitmart.js +3 -3
  13. package/dist/cjs/js/src/bybit.js +5 -1
  14. package/dist/cjs/js/src/coinbase.js +176 -26
  15. package/dist/cjs/js/src/coinex.js +3 -0
  16. package/dist/cjs/js/src/coinlist.js +1 -1
  17. package/dist/cjs/js/src/coinone.js +1 -1
  18. package/dist/cjs/js/src/delta.js +7 -1
  19. package/dist/cjs/js/src/deribit.js +1 -1
  20. package/dist/cjs/js/src/gate.js +79 -56
  21. package/dist/cjs/js/src/gemini.js +1 -1
  22. package/dist/cjs/js/src/htx.js +151 -1
  23. package/dist/cjs/js/src/independentreserve.js +7 -5
  24. package/dist/cjs/js/src/kraken.js +22 -14
  25. package/dist/cjs/js/src/kucoin.js +5 -0
  26. package/dist/cjs/js/src/kucoinfutures.js +131 -77
  27. package/dist/cjs/js/src/lbank.js +59 -33
  28. package/dist/cjs/js/src/oceanex.js +1 -1
  29. package/dist/cjs/js/src/okx.js +11 -9
  30. package/dist/cjs/js/src/phemex.js +9 -2
  31. package/dist/cjs/js/src/pro/kraken.js +1 -1
  32. package/dist/cjs/js/src/pro/okx.js +52 -2
  33. package/dist/cjs/js/src/probit.js +4 -2
  34. package/dist/cjs/js/src/wavesexchange.js +1 -1
  35. package/dist/cjs/js/src/woo.js +56 -2
  36. package/js/ccxt.d.ts +1 -1
  37. package/js/ccxt.js +1 -1
  38. package/js/src/abstract/bigone.d.ts +1 -0
  39. package/js/src/abstract/bingx.d.ts +2 -0
  40. package/js/src/abstract/kucoin.d.ts +4 -0
  41. package/js/src/abstract/kucoinfutures.d.ts +4 -0
  42. package/js/src/abstract/okx.d.ts +1 -0
  43. package/js/src/base/Exchange.d.ts +8 -0
  44. package/js/src/base/Exchange.js +148 -1
  45. package/js/src/bigone.d.ts +2 -0
  46. package/js/src/bigone.js +125 -54
  47. package/js/src/binance.d.ts +9 -0
  48. package/js/src/binance.js +142 -27
  49. package/js/src/binanceus.js +8 -0
  50. package/js/src/bingx.js +110 -36
  51. package/js/src/bitget.js +17 -6
  52. package/js/src/bitmart.js +3 -3
  53. package/js/src/bybit.js +5 -1
  54. package/js/src/coinbase.d.ts +26 -3
  55. package/js/src/coinbase.js +176 -26
  56. package/js/src/coinex.js +3 -0
  57. package/js/src/coinlist.js +1 -1
  58. package/js/src/coinone.js +1 -1
  59. package/js/src/delta.js +7 -1
  60. package/js/src/deribit.js +1 -1
  61. package/js/src/gate.js +79 -56
  62. package/js/src/gemini.js +1 -1
  63. package/js/src/htx.d.ts +10 -0
  64. package/js/src/htx.js +151 -1
  65. package/js/src/independentreserve.js +7 -5
  66. package/js/src/kraken.js +22 -14
  67. package/js/src/kucoin.js +5 -0
  68. package/js/src/kucoinfutures.d.ts +4 -2
  69. package/js/src/kucoinfutures.js +131 -77
  70. package/js/src/lbank.js +59 -33
  71. package/js/src/oceanex.js +1 -1
  72. package/js/src/okx.js +11 -9
  73. package/js/src/phemex.js +9 -2
  74. package/js/src/pro/kraken.js +1 -1
  75. package/js/src/pro/okx.d.ts +1 -0
  76. package/js/src/pro/okx.js +52 -2
  77. package/js/src/probit.js +4 -2
  78. package/js/src/wavesexchange.js +1 -1
  79. package/js/src/woo.d.ts +2 -0
  80. package/js/src/woo.js +56 -2
  81. package/package.json +1 -1
@@ -105,7 +105,7 @@ export default class coinbase extends Exchange {
105
105
  'setLeverage': false,
106
106
  'setMarginMode': false,
107
107
  'setPositionMode': false,
108
- 'withdraw': undefined,
108
+ 'withdraw': true,
109
109
  },
110
110
  'urls': {
111
111
  'logo': 'https://user-images.githubusercontent.com/1294454/40811661-b6eceae2-653a-11e8-829e-10bfadb078cf.jpg',
@@ -776,46 +776,102 @@ export default class coinbase extends Exchange {
776
776
  // "next_step": null
777
777
  // }
778
778
  //
779
- const subtotalObject = this.safeValue(transaction, 'subtotal', {});
780
- const feeObject = this.safeValue(transaction, 'fee', {});
781
- const id = this.safeString(transaction, 'id');
782
- const timestamp = this.parse8601(this.safeValue(transaction, 'created_at'));
783
- const updated = this.parse8601(this.safeValue(transaction, 'updated_at'));
784
- const type = this.safeString(transaction, 'resource');
785
- const amount = this.safeNumber(subtotalObject, 'amount');
786
- const currencyId = this.safeString(subtotalObject, 'currency');
787
- const code = this.safeCurrencyCode(currencyId, currency);
788
- const feeCost = this.safeNumber(feeObject, 'amount');
789
- const feeCurrencyId = this.safeString(feeObject, 'currency');
790
- const feeCurrency = this.safeCurrencyCode(feeCurrencyId);
791
- const fee = {
792
- 'cost': feeCost,
793
- 'currency': feeCurrency,
794
- };
779
+ // withdraw
780
+ //
781
+ // {
782
+ // "id": "a1794ecf-5693-55fa-70cf-ef731748ed82",
783
+ // "type": "send",
784
+ // "status": "pending",
785
+ // "amount": {
786
+ // "amount": "-14.008308",
787
+ // "currency": "USDC"
788
+ // },
789
+ // "native_amount": {
790
+ // "amount": "-18.74",
791
+ // "currency": "CAD"
792
+ // },
793
+ // "description": null,
794
+ // "created_at": "2024-01-12T01:27:31Z",
795
+ // "updated_at": "2024-01-12T01:27:31Z",
796
+ // "resource": "transaction",
797
+ // "resource_path": "/v2/accounts/a34bgfad-ed67-538b-bffc-730c98c10da0/transactions/a1794ecf-5693-55fa-70cf-ef731748ed82",
798
+ // "instant_exchange": false,
799
+ // "network": {
800
+ // "status": "pending",
801
+ // "status_description": "Pending (est. less than 10 minutes)",
802
+ // "transaction_fee": {
803
+ // "amount": "4.008308",
804
+ // "currency": "USDC"
805
+ // },
806
+ // "transaction_amount": {
807
+ // "amount": "10.000000",
808
+ // "currency": "USDC"
809
+ // },
810
+ // "confirmations": 0
811
+ // },
812
+ // "to": {
813
+ // "resource": "ethereum_address",
814
+ // "address": "0x9...",
815
+ // "currency": "USDC",
816
+ // "address_info": {
817
+ // "address": "0x9..."
818
+ // }
819
+ // },
820
+ // "idem": "748d8591-dg9a-7831-a45b-crd61dg78762",
821
+ // "details": {
822
+ // "title": "Sent USDC",
823
+ // "subtitle": "To USDC address on Ethereum network",
824
+ // "header": "Sent 14.008308 USDC ($18.74)",
825
+ // "health": "warning"
826
+ // },
827
+ // "hide_native_amount": false
828
+ // }
829
+ //
830
+ const transactionType = this.safeString(transaction, 'type');
831
+ let amountAndCurrencyObject = undefined;
832
+ let feeObject = undefined;
833
+ if (transactionType === 'send') {
834
+ const network = this.safeValue(transaction, 'network', {});
835
+ amountAndCurrencyObject = this.safeValue(network, 'transaction_amount', {});
836
+ feeObject = this.safeValue(network, 'transaction_fee', {});
837
+ }
838
+ else {
839
+ amountAndCurrencyObject = this.safeValue(transaction, 'subtotal', {});
840
+ feeObject = this.safeValue(transaction, 'fee', {});
841
+ }
795
842
  let status = this.parseTransactionStatus(this.safeString(transaction, 'status'));
796
843
  if (status === undefined) {
797
844
  const committed = this.safeValue(transaction, 'committed');
798
845
  status = committed ? 'ok' : 'pending';
799
846
  }
847
+ const id = this.safeString(transaction, 'id');
848
+ const currencyId = this.safeString(amountAndCurrencyObject, 'currency');
849
+ const feeCurrencyId = this.safeString(feeObject, 'currency');
850
+ const datetime = this.safeValue(transaction, 'created_at');
851
+ const toObject = this.safeValue(transaction, 'to', {});
852
+ const toAddress = this.safeString(toObject, 'address');
800
853
  return {
801
854
  'info': transaction,
802
855
  'id': id,
803
856
  'txid': id,
804
- 'timestamp': timestamp,
805
- 'datetime': this.iso8601(timestamp),
857
+ 'timestamp': this.parse8601(datetime),
858
+ 'datetime': datetime,
806
859
  'network': undefined,
807
- 'address': undefined,
808
- 'addressTo': undefined,
860
+ 'address': toAddress,
861
+ 'addressTo': toAddress,
809
862
  'addressFrom': undefined,
810
863
  'tag': undefined,
811
864
  'tagTo': undefined,
812
865
  'tagFrom': undefined,
813
- 'type': type,
814
- 'amount': amount,
815
- 'currency': code,
866
+ 'type': this.safeString(transaction, 'resource'),
867
+ 'amount': this.safeNumber(amountAndCurrencyObject, 'amount'),
868
+ 'currency': this.safeCurrencyCode(currencyId, currency),
816
869
  'status': status,
817
- 'updated': updated,
818
- 'fee': fee,
870
+ 'updated': this.parse8601(this.safeValue(transaction, 'updated_at')),
871
+ 'fee': {
872
+ 'cost': this.safeNumber(feeObject, 'amount'),
873
+ 'currency': this.safeCurrencyCode(feeCurrencyId),
874
+ },
819
875
  };
820
876
  }
821
877
  parseTrade(trade, market = undefined) {
@@ -3169,6 +3225,100 @@ export default class coinbase extends Exchange {
3169
3225
  const tickers = this.safeValue(response, 'pricebooks', []);
3170
3226
  return this.parseTickers(tickers, symbols);
3171
3227
  }
3228
+ async withdraw(code, amount, address, tag = undefined, params = {}) {
3229
+ /**
3230
+ * @method
3231
+ * @name coinbase#withdraw
3232
+ * @description make a withdrawal
3233
+ * @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-transactions#send-money
3234
+ * @param {string} code unified currency code
3235
+ * @param {float} amount the amount to withdraw
3236
+ * @param {string} address the address to withdraw to
3237
+ * @param {string} [tag] an optional tag for the withdrawal
3238
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3239
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3240
+ */
3241
+ [tag, params] = this.handleWithdrawTagAndParams(tag, params);
3242
+ this.checkAddress(address);
3243
+ await this.loadMarkets();
3244
+ const currency = this.currency(code);
3245
+ let accountId = this.safeString2(params, 'account_id', 'accountId');
3246
+ params = this.omit(params, ['account_id', 'accountId']);
3247
+ if (accountId === undefined) {
3248
+ if (code === undefined) {
3249
+ throw new ArgumentsRequired(this.id + ' withdraw() requires an account_id (or accountId) parameter OR a currency code argument');
3250
+ }
3251
+ accountId = await this.findAccountId(code);
3252
+ if (accountId === undefined) {
3253
+ throw new ExchangeError(this.id + ' withdraw() could not find account id for ' + code);
3254
+ }
3255
+ }
3256
+ const request = {
3257
+ 'account_id': accountId,
3258
+ 'type': 'send',
3259
+ 'to': address,
3260
+ 'amount': amount,
3261
+ 'currency': currency['id'],
3262
+ };
3263
+ if (tag !== undefined) {
3264
+ request['destination_tag'] = tag;
3265
+ }
3266
+ const response = await this.v2PrivatePostAccountsAccountIdTransactions(this.extend(request, params));
3267
+ //
3268
+ // {
3269
+ // "data": {
3270
+ // "id": "a1794ecf-5693-55fa-70cf-ef731748ed82",
3271
+ // "type": "send",
3272
+ // "status": "pending",
3273
+ // "amount": {
3274
+ // "amount": "-14.008308",
3275
+ // "currency": "USDC"
3276
+ // },
3277
+ // "native_amount": {
3278
+ // "amount": "-18.74",
3279
+ // "currency": "CAD"
3280
+ // },
3281
+ // "description": null,
3282
+ // "created_at": "2024-01-12T01:27:31Z",
3283
+ // "updated_at": "2024-01-12T01:27:31Z",
3284
+ // "resource": "transaction",
3285
+ // "resource_path": "/v2/accounts/a34bgfad-ed67-538b-bffc-730c98c10da0/transactions/a1794ecf-5693-55fa-70cf-ef731748ed82",
3286
+ // "instant_exchange": false,
3287
+ // "network": {
3288
+ // "status": "pending",
3289
+ // "status_description": "Pending (est. less than 10 minutes)",
3290
+ // "transaction_fee": {
3291
+ // "amount": "4.008308",
3292
+ // "currency": "USDC"
3293
+ // },
3294
+ // "transaction_amount": {
3295
+ // "amount": "10.000000",
3296
+ // "currency": "USDC"
3297
+ // },
3298
+ // "confirmations": 0
3299
+ // },
3300
+ // "to": {
3301
+ // "resource": "ethereum_address",
3302
+ // "address": "0x9...",
3303
+ // "currency": "USDC",
3304
+ // "address_info": {
3305
+ // "address": "0x9..."
3306
+ // }
3307
+ // },
3308
+ // "idem": "748d8591-dg9a-7831-a45b-crd61dg78762",
3309
+ // "details": {
3310
+ // "title": "Sent USDC",
3311
+ // "subtitle": "To USDC address on Ethereum network",
3312
+ // "header": "Sent 14.008308 USDC ($18.74)",
3313
+ // "health": "warning"
3314
+ // },
3315
+ // "hide_native_amount": false
3316
+ // }
3317
+ // }
3318
+ //
3319
+ const data = this.safeValue(response, 'data', {});
3320
+ return this.parseTransaction(data, currency);
3321
+ }
3172
3322
  sign(path, api = [], method = 'GET', params = {}, headers = undefined, body = undefined) {
3173
3323
  const version = api[0];
3174
3324
  const signed = api[1] === 'private';
package/js/src/coinex.js CHANGED
@@ -51,6 +51,9 @@ export default class coinex extends Exchange {
51
51
  'createMarketBuyOrderWithCost': true,
52
52
  'createMarketOrderWithCost': false,
53
53
  'createMarketSellOrderWithCost': false,
54
+ 'createTriggerOrder': true,
55
+ 'createTakeProfitOrder': true,
56
+ 'createStopLossOrder': true,
54
57
  'createOrder': true,
55
58
  'createOrders': true,
56
59
  'createReduceOnlyOrder': true,
@@ -753,7 +753,7 @@ export default class coinlist extends Exchange {
753
753
  request['start_time'] = this.iso8601(since);
754
754
  }
755
755
  if (limit !== undefined) {
756
- request['count'] = limit;
756
+ request['count'] = Math.min(limit, 500);
757
757
  }
758
758
  const until = this.safeInteger2(params, 'till', 'until');
759
759
  if (until !== undefined) {
package/js/src/coinone.js CHANGED
@@ -712,7 +712,7 @@ export default class coinone extends Exchange {
712
712
  'target_currency': market['base'],
713
713
  };
714
714
  if (limit !== undefined) {
715
- request['size'] = limit; // only support 10, 50, 100, 150, 200
715
+ request['size'] = Math.min(limit, 200);
716
716
  }
717
717
  const response = await this.v2PublicGetTradesQuoteCurrencyTargetCurrency(this.extend(request, params));
718
718
  //
package/js/src/delta.js CHANGED
@@ -2074,7 +2074,13 @@ export default class delta extends Exchange {
2074
2074
  if (limit !== undefined) {
2075
2075
  request['page_size'] = limit;
2076
2076
  }
2077
- const response = await this[method](this.extend(request, params));
2077
+ let response = undefined;
2078
+ if (method === 'privateGetOrders') {
2079
+ response = await this.privateGetOrders(this.extend(request, params));
2080
+ }
2081
+ else if (method === 'privateGetOrdersHistory') {
2082
+ response = await this.privateGetOrdersHistory(this.extend(request, params));
2083
+ }
2078
2084
  //
2079
2085
  // {
2080
2086
  // "success": true,
package/js/src/deribit.js CHANGED
@@ -39,11 +39,11 @@ export default class deribit extends Exchange {
39
39
  'cancelOrder': true,
40
40
  'cancelOrders': false,
41
41
  'createDepositAddress': true,
42
- 'createTrailingAmountOrder': true,
43
42
  'createOrder': true,
44
43
  'createStopLimitOrder': true,
45
44
  'createStopMarketOrder': true,
46
45
  'createStopOrder': true,
46
+ 'createTrailingAmountOrder': true,
47
47
  'editOrder': true,
48
48
  'fetchAccounts': true,
49
49
  'fetchBalance': true,
package/js/src/gate.js CHANGED
@@ -93,6 +93,9 @@ export default class gate extends Exchange {
93
93
  'createReduceOnlyOrder': true,
94
94
  'createStopLimitOrder': true,
95
95
  'createStopMarketOrder': false,
96
+ 'createTriggerOrder': true,
97
+ 'createTakeProfitOrder': true,
98
+ 'createStopLossOrder': true,
96
99
  'createStopOrder': true,
97
100
  'editOrder': true,
98
101
  'fetchBalance': true,
@@ -3123,7 +3126,7 @@ export default class gate extends Exchange {
3123
3126
  request['to'] = this.parseToInt(until / 1000);
3124
3127
  }
3125
3128
  if (limit !== undefined) {
3126
- request['limit'] = limit; // default 100, max 1000
3129
+ request['limit'] = Math.min(limit, 1000); // default 100, max 1000
3127
3130
  }
3128
3131
  if (since !== undefined && (market['contract'])) {
3129
3132
  request['from'] = this.parseToInt(since / 1000);
@@ -3769,6 +3772,8 @@ export default class gate extends Exchange {
3769
3772
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3770
3773
  * @param {float} [params.stopPrice] The price at which a trigger order is triggered at
3771
3774
  * @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
3775
+ * @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
3776
+ * @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
3772
3777
  * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
3773
3778
  * @param {int} [params.iceberg] Amount to display for the iceberg order, Null or 0 for normal orders, Set to -1 to hide the order completely
3774
3779
  * @param {string} [params.text] User defined information
@@ -5263,29 +5268,35 @@ export default class gate extends Exchange {
5263
5268
  // swap and future
5264
5269
  //
5265
5270
  // {
5266
- // "value": "12.475572",
5271
+ // "value": "4.60516",
5267
5272
  // "leverage": "0",
5268
5273
  // "mode": "single",
5269
5274
  // "realised_point": "0",
5270
5275
  // "contract": "BTC_USDT",
5271
- // "entry_price": "62422.6",
5272
- // "mark_price": "62377.86",
5276
+ // "entry_price": "46030.3",
5277
+ // "mark_price": "46051.6",
5273
5278
  // "history_point": "0",
5274
- // "realised_pnl": "-0.00624226",
5275
- // "close_order": null,
5276
- // "size": "2",
5277
- // "cross_leverage_limit": "25",
5278
- // "pending_orders": "0",
5279
- // "adl_ranking": "5",
5280
- // "maintenance_rate": "0.005",
5281
- // "unrealised_pnl": "-0.008948",
5282
- // "user": "663337",
5283
- // "leverage_max": "100",
5284
- // "history_pnl": "14.98868396636",
5279
+ // "realised_pnl": "-0.002301515",
5280
+ // "close_order": null,
5281
+ // "size": 1,
5282
+ // "cross_leverage_limit": "0",
5283
+ // "pending_orders": 0,
5284
+ // "adl_ranking": 5,
5285
+ // "maintenance_rate": "0.004",
5286
+ // "unrealised_pnl": "0.00213",
5287
+ // "user": 5691076,
5288
+ // "leverage_max": "125",
5289
+ // "history_pnl": "0",
5285
5290
  // "risk_limit": "1000000",
5286
- // "margin": "0.740721495056",
5287
- // "last_close_pnl": "-0.041996015",
5288
- // "liq_price": "59058.58"
5291
+ // "margin": "8.997698485",
5292
+ // "last_close_pnl": "0",
5293
+ // "liq_price": "0",
5294
+ // "update_time": 1705034246,
5295
+ // "update_id": 1,
5296
+ // "initial_margin": "0",
5297
+ // "maintenance_margin": "0",
5298
+ // "open_time": 1705034246,
5299
+ // "trade_max_size": "0"
5289
5300
  // }
5290
5301
  //
5291
5302
  // option
@@ -5336,14 +5347,14 @@ export default class gate extends Exchange {
5336
5347
  const takerFee = '0.00075';
5337
5348
  const feePaid = Precise.stringMul(takerFee, notional);
5338
5349
  const initialMarginString = Precise.stringAdd(Precise.stringDiv(notional, leverage), feePaid);
5339
- const timestamp = this.safeInteger(position, 'time_ms');
5350
+ const timestamp = this.safeTimestamp(position, 'open_time');
5340
5351
  return this.safePosition({
5341
5352
  'info': position,
5342
5353
  'id': undefined,
5343
5354
  'symbol': this.safeString(market, 'symbol'),
5344
- 'timestamp': undefined,
5345
- 'datetime': undefined,
5346
- 'lastUpdateTimestamp': timestamp,
5355
+ 'timestamp': timestamp,
5356
+ 'datetime': this.iso8601(timestamp),
5357
+ 'lastUpdateTimestamp': this.safeTimestamp(position, 'update_time'),
5347
5358
  'initialMargin': this.parseNumber(initialMarginString),
5348
5359
  'initialMarginPercentage': this.parseNumber(Precise.stringDiv(initialMarginString, notional)),
5349
5360
  'maintenanceMargin': this.parseNumber(Precise.stringMul(maintenanceRate, notional)),
@@ -5402,29 +5413,35 @@ export default class gate extends Exchange {
5402
5413
  // swap and future
5403
5414
  //
5404
5415
  // {
5405
- // "value": "12.475572",
5416
+ // "value": "4.60516",
5406
5417
  // "leverage": "0",
5407
5418
  // "mode": "single",
5408
5419
  // "realised_point": "0",
5409
5420
  // "contract": "BTC_USDT",
5410
- // "entry_price": "62422.6",
5411
- // "mark_price": "62377.86",
5421
+ // "entry_price": "46030.3",
5422
+ // "mark_price": "46051.6",
5412
5423
  // "history_point": "0",
5413
- // "realised_pnl": "-0.00624226",
5414
- // "close_order": null,
5415
- // "size": "2",
5416
- // "cross_leverage_limit": "25",
5417
- // "pending_orders": "0",
5418
- // "adl_ranking": "5",
5419
- // "maintenance_rate": "0.005",
5420
- // "unrealised_pnl": "-0.008948",
5421
- // "user": "6693577",
5422
- // "leverage_max": "100",
5423
- // "history_pnl": "14.98868396636",
5424
+ // "realised_pnl": "-0.002301515",
5425
+ // "close_order": null,
5426
+ // "size": 1,
5427
+ // "cross_leverage_limit": "0",
5428
+ // "pending_orders": 0,
5429
+ // "adl_ranking": 5,
5430
+ // "maintenance_rate": "0.004",
5431
+ // "unrealised_pnl": "0.00213",
5432
+ // "user": 5691076,
5433
+ // "leverage_max": "125",
5434
+ // "history_pnl": "0",
5424
5435
  // "risk_limit": "1000000",
5425
- // "margin": "0.740721495056",
5426
- // "last_close_pnl": "-0.041996015",
5427
- // "liq_price": "59058.58"
5436
+ // "margin": "8.997698485",
5437
+ // "last_close_pnl": "0",
5438
+ // "liq_price": "0",
5439
+ // "update_time": 1705034246,
5440
+ // "update_id": 1,
5441
+ // "initial_margin": "0",
5442
+ // "maintenance_margin": "0",
5443
+ // "open_time": 1705034246,
5444
+ // "trade_max_size": "0"
5428
5445
  // }
5429
5446
  //
5430
5447
  // option
@@ -5504,29 +5521,35 @@ export default class gate extends Exchange {
5504
5521
  //
5505
5522
  // [
5506
5523
  // {
5507
- // "value": "12.475572",
5524
+ // "value": "4.602828",
5508
5525
  // "leverage": "0",
5509
5526
  // "mode": "single",
5510
5527
  // "realised_point": "0",
5511
5528
  // "contract": "BTC_USDT",
5512
- // "entry_price": "62422.6",
5513
- // "mark_price": "62377.86",
5529
+ // "entry_price": "46030.3",
5530
+ // "mark_price": "46028.28",
5514
5531
  // "history_point": "0",
5515
- // "realised_pnl": "-0.00624226",
5516
- // "close_order": null,
5517
- // "size": "2",
5518
- // "cross_leverage_limit": "25",
5519
- // "pending_orders": "0",
5520
- // "adl_ranking": "5",
5521
- // "maintenance_rate": "0.005",
5522
- // "unrealised_pnl": "-0.008948",
5523
- // "user": "6693577",
5524
- // "leverage_max": "100",
5525
- // "history_pnl": "14.98868396636",
5532
+ // "realised_pnl": "-0.002301515",
5533
+ // "close_order": null,
5534
+ // "size": 1,
5535
+ // "cross_leverage_limit": "0",
5536
+ // "pending_orders": 0,
5537
+ // "adl_ranking": 5,
5538
+ // "maintenance_rate": "0.004",
5539
+ // "unrealised_pnl": "-0.000202",
5540
+ // "user": 5691076,
5541
+ // "leverage_max": "125",
5542
+ // "history_pnl": "0",
5526
5543
  // "risk_limit": "1000000",
5527
- // "margin": "0.740721495056",
5528
- // "last_close_pnl": "-0.041996015",
5529
- // "liq_price": "59058.58"
5544
+ // "margin": "8.997698485",
5545
+ // "last_close_pnl": "0",
5546
+ // "liq_price": "0",
5547
+ // "update_time": 1705034246,
5548
+ // "update_id": 1,
5549
+ // "initial_margin": "0",
5550
+ // "maintenance_margin": "0",
5551
+ // "open_time": 1705034246,
5552
+ // "trade_max_size": "0"
5530
5553
  // }
5531
5554
  // ]
5532
5555
  //
package/js/src/gemini.js CHANGED
@@ -954,7 +954,7 @@ export default class gemini extends Exchange {
954
954
  'symbol': market['id'],
955
955
  };
956
956
  if (limit !== undefined) {
957
- request['limit_trades'] = limit;
957
+ request['limit_trades'] = Math.min(limit, 500);
958
958
  }
959
959
  if (since !== undefined) {
960
960
  request['timestamp'] = since;
package/js/src/htx.d.ts CHANGED
@@ -51,6 +51,15 @@ export default class htx extends Exchange {
51
51
  parseTicker(ticker: any, market?: Market): Ticker;
52
52
  fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
53
53
  fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
54
+ fetchLastPrices(symbols?: Strings, params?: {}): Promise<any>;
55
+ parseLastPrice(entry: any, market?: Market): {
56
+ symbol: string;
57
+ timestamp: any;
58
+ datetime: any;
59
+ price: number;
60
+ side: string;
61
+ info: any;
62
+ };
54
63
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
55
64
  parseTrade(trade: any, market?: Market): Trade;
56
65
  fetchOrderTrades(id: string, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
@@ -84,6 +93,7 @@ export default class htx extends Exchange {
84
93
  parseOrderStatus(status: any): string;
85
94
  parseOrder(order: any, market?: Market): Order;
86
95
  createMarketBuyOrderWithCost(symbol: string, cost: any, params?: {}): Promise<Order>;
96
+ createTrailingPercentOrder(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, trailingPercent?: any, trailingTriggerPrice?: any, params?: {}): Promise<Order>;
87
97
  createSpotOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, params?: {}): Promise<any>;
88
98
  createContractOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, params?: {}): any;
89
99
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, params?: {}): Promise<Order>;