ccxt 4.1.89 → 4.1.91

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 (65) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.js +936 -358
  3. package/dist/ccxt.browser.min.js +3 -3
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/base/Exchange.js +2 -2
  6. package/dist/cjs/src/binance.js +61 -0
  7. package/dist/cjs/src/bitforex.js +2 -0
  8. package/dist/cjs/src/bitget.js +11 -4
  9. package/dist/cjs/src/bitmex.js +2 -0
  10. package/dist/cjs/src/blockchaincom.js +0 -41
  11. package/dist/cjs/src/bybit.js +29 -14
  12. package/dist/cjs/src/coinlist.js +2 -0
  13. package/dist/cjs/src/coinsph.js +2 -0
  14. package/dist/cjs/src/cryptocom.js +2 -0
  15. package/dist/cjs/src/gate.js +276 -11
  16. package/dist/cjs/src/htx.js +264 -219
  17. package/dist/cjs/src/kucoin.js +1 -0
  18. package/dist/cjs/src/kucoinfutures.js +37 -0
  19. package/dist/cjs/src/kuna.js +2 -0
  20. package/dist/cjs/src/mexc.js +2 -0
  21. package/dist/cjs/src/okcoin.js +4 -1
  22. package/dist/cjs/src/phemex.js +160 -26
  23. package/dist/cjs/src/poloniex.js +28 -2
  24. package/dist/cjs/src/pro/binance.js +6 -6
  25. package/dist/cjs/src/pro/bitmart.js +19 -18
  26. package/dist/cjs/src/pro/poloniex.js +15 -10
  27. package/dist/cjs/src/tokocrypto.js +2 -0
  28. package/dist/cjs/src/wazirx.js +2 -0
  29. package/dist/cjs/src/whitebit.js +2 -0
  30. package/dist/cjs/src/zaif.js +2 -3
  31. package/js/ccxt.d.ts +1 -1
  32. package/js/ccxt.js +1 -1
  33. package/js/src/base/Exchange.js +2 -2
  34. package/js/src/binance.d.ts +3 -0
  35. package/js/src/binance.js +61 -0
  36. package/js/src/bitforex.js +2 -0
  37. package/js/src/bitget.js +11 -4
  38. package/js/src/bitmex.js +2 -0
  39. package/js/src/blockchaincom.d.ts +0 -2
  40. package/js/src/blockchaincom.js +0 -41
  41. package/js/src/bybit.js +29 -14
  42. package/js/src/coinlist.js +2 -0
  43. package/js/src/coinsph.js +2 -0
  44. package/js/src/cryptocom.js +2 -0
  45. package/js/src/gate.d.ts +47 -0
  46. package/js/src/gate.js +276 -11
  47. package/js/src/htx.js +264 -219
  48. package/js/src/kucoin.js +1 -0
  49. package/js/src/kucoinfutures.d.ts +1 -0
  50. package/js/src/kucoinfutures.js +37 -0
  51. package/js/src/kuna.js +2 -0
  52. package/js/src/mexc.js +2 -0
  53. package/js/src/okcoin.js +4 -1
  54. package/js/src/phemex.d.ts +1 -0
  55. package/js/src/phemex.js +160 -26
  56. package/js/src/poloniex.js +28 -2
  57. package/js/src/pro/binance.js +6 -6
  58. package/js/src/pro/bitmart.d.ts +1 -1
  59. package/js/src/pro/bitmart.js +19 -18
  60. package/js/src/pro/poloniex.js +16 -11
  61. package/js/src/tokocrypto.js +2 -0
  62. package/js/src/wazirx.js +2 -0
  63. package/js/src/whitebit.js +2 -0
  64. package/js/src/zaif.js +2 -3
  65. package/package.json +1 -1
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 } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
7
- declare const version = "4.1.88";
7
+ declare const version = "4.1.90";
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, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.1.89';
41
+ const version = '4.1.91';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -3693,7 +3693,7 @@ export default class Exchange {
3693
3693
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3694
3694
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3695
3695
  */
3696
- if (this.options['createMarketOrderWithCost'] || (this.options['createMarketBuyOrderWithCost'] && this.options['createMarketSellOrderWithCost'])) {
3696
+ if (this.has['createMarketOrderWithCost'] || (this.has['createMarketBuyOrderWithCost'] && this.has['createMarketSellOrderWithCost'])) {
3697
3697
  return await this.createOrder(symbol, 'market', side, cost, 1, params);
3698
3698
  }
3699
3699
  throw new NotSupported(this.id + ' createMarketOrderWithCost() is not supported yet');
@@ -3708,7 +3708,7 @@ export default class Exchange {
3708
3708
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3709
3709
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3710
3710
  */
3711
- if (this.options['createMarketBuyOrderRequiresPrice'] || this.options['createMarketBuyOrderWithCost']) {
3711
+ if (this.options['createMarketBuyOrderRequiresPrice'] || this.has['createMarketBuyOrderWithCost']) {
3712
3712
  return await this.createOrder(symbol, 'market', 'buy', cost, 1, params);
3713
3713
  }
3714
3714
  throw new NotSupported(this.id + ' createMarketBuyOrderWithCost() is not supported yet');
@@ -48,6 +48,9 @@ export default class binance extends Exchange {
48
48
  createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
49
49
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, params?: {}): Promise<Order>;
50
50
  createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, params?: {}): any;
51
+ createMarketOrderWithCost(symbol: string, side: OrderSide, cost: any, params?: {}): Promise<Order>;
52
+ createMarketBuyOrderWithCost(symbol: string, cost: any, params?: {}): Promise<Order>;
53
+ createMarketSellOrderWithCost(symbol: string, cost: any, params?: {}): Promise<Order>;
51
54
  fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
52
55
  fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
53
56
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
package/js/src/binance.js CHANGED
@@ -44,6 +44,9 @@ export default class binance extends Exchange {
44
44
  'closeAllPositions': false,
45
45
  'closePosition': false,
46
46
  'createDepositAddress': false,
47
+ 'createMarketBuyOrderWithCost': true,
48
+ 'createMarketOrderWithCost': true,
49
+ 'createMarketSellOrderWithCost': true,
47
50
  'createOrder': true,
48
51
  'createOrders': true,
49
52
  'createPostOnlyOrder': true,
@@ -4657,6 +4660,64 @@ export default class binance extends Exchange {
4657
4660
  const requestParams = this.omit(params, ['quoteOrderQty', 'cost', 'stopPrice', 'test', 'type', 'newClientOrderId', 'clientOrderId', 'postOnly']);
4658
4661
  return this.extend(request, requestParams);
4659
4662
  }
4663
+ async createMarketOrderWithCost(symbol, side, cost, params = {}) {
4664
+ /**
4665
+ * @method
4666
+ * @name binance#createMarketOrderWithCost
4667
+ * @description create a market order by providing the symbol, side and cost
4668
+ * @see https://binance-docs.github.io/apidocs/spot/en/#new-order-trade
4669
+ * @param {string} symbol unified symbol of the market to create an order in
4670
+ * @param {string} side 'buy' or 'sell'
4671
+ * @param {float} cost how much you want to trade in units of the quote currency
4672
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4673
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4674
+ */
4675
+ await this.loadMarkets();
4676
+ const market = this.market(symbol);
4677
+ if (!market['spot']) {
4678
+ throw new NotSupported(this.id + ' createMarketOrderWithCost() supports spot orders only');
4679
+ }
4680
+ params['quoteOrderQty'] = cost;
4681
+ return await this.createOrder(symbol, 'market', side, cost, undefined, params);
4682
+ }
4683
+ async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
4684
+ /**
4685
+ * @method
4686
+ * @name binance#createMarketBuyOrderWithCost
4687
+ * @description create a market buy order by providing the symbol and cost
4688
+ * @see https://binance-docs.github.io/apidocs/spot/en/#new-order-trade
4689
+ * @param {string} symbol unified symbol of the market to create an order in
4690
+ * @param {float} cost how much you want to trade in units of the quote currency
4691
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4692
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4693
+ */
4694
+ await this.loadMarkets();
4695
+ const market = this.market(symbol);
4696
+ if (!market['spot']) {
4697
+ throw new NotSupported(this.id + ' createMarketBuyOrderWithCost() supports spot orders only');
4698
+ }
4699
+ params['quoteOrderQty'] = cost;
4700
+ return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
4701
+ }
4702
+ async createMarketSellOrderWithCost(symbol, cost, params = {}) {
4703
+ /**
4704
+ * @method
4705
+ * @name binance#createMarketSellOrderWithCost
4706
+ * @description create a market sell order by providing the symbol and cost
4707
+ * @see https://binance-docs.github.io/apidocs/spot/en/#new-order-trade
4708
+ * @param {string} symbol unified symbol of the market to create an order in
4709
+ * @param {float} cost how much you want to trade in units of the quote currency
4710
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4711
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4712
+ */
4713
+ await this.loadMarkets();
4714
+ const market = this.market(symbol);
4715
+ if (!market['spot']) {
4716
+ throw new NotSupported(this.id + ' createMarketSellOrderWithCost() supports spot orders only');
4717
+ }
4718
+ params['quoteOrderQty'] = cost;
4719
+ return await this.createOrder(symbol, 'market', 'sell', cost, undefined, params);
4720
+ }
4660
4721
  async fetchOrder(id, symbol = undefined, params = {}) {
4661
4722
  /**
4662
4723
  * @method
@@ -77,6 +77,8 @@ export default class bitforex extends Exchange {
77
77
  'fetchWithdrawal': false,
78
78
  'fetchWithdrawals': false,
79
79
  'reduceMargin': false,
80
+ 'repayCrossMargin': false,
81
+ 'repayIsolatedMargin': false,
80
82
  'setLeverage': false,
81
83
  'setMargin': false,
82
84
  'setMarginMode': false,
package/js/src/bitget.js CHANGED
@@ -3858,7 +3858,7 @@ export default class bitget extends Exchange {
3858
3858
  if (feeCostString !== undefined) {
3859
3859
  // swap
3860
3860
  fee = {
3861
- 'cost': feeCostString,
3861
+ 'cost': this.parseNumber(Precise.stringAbs(feeCostString)),
3862
3862
  'currency': market['settle'],
3863
3863
  };
3864
3864
  }
@@ -3866,10 +3866,17 @@ export default class bitget extends Exchange {
3866
3866
  if (feeDetail !== undefined) {
3867
3867
  const parsedFeeDetail = JSON.parse(feeDetail);
3868
3868
  const feeValues = Object.values(parsedFeeDetail);
3869
- const first = this.safeValue(feeValues, 0);
3869
+ let feeObject = undefined;
3870
+ for (let i = 0; i < feeValues.length; i++) {
3871
+ const feeValue = feeValues[i];
3872
+ if (this.safeValue(feeValue, 'feeCoinCode') !== undefined) {
3873
+ feeObject = feeValue;
3874
+ break;
3875
+ }
3876
+ }
3870
3877
  fee = {
3871
- 'cost': this.safeString(first, 'totalFee'),
3872
- 'currency': this.safeCurrencyCode(this.safeString(first, 'feeCoinCode')),
3878
+ 'cost': this.parseNumber(Precise.stringAbs(this.safeString(feeObject, 'totalFee'))),
3879
+ 'currency': this.safeCurrencyCode(this.safeString(feeObject, 'feeCoinCode')),
3873
3880
  };
3874
3881
  }
3875
3882
  let postOnly = undefined;
package/js/src/bitmex.js CHANGED
@@ -41,6 +41,8 @@ export default class bitmex extends Exchange {
41
41
  'cancelAllOrders': true,
42
42
  'cancelOrder': true,
43
43
  'cancelOrders': true,
44
+ 'closeAllPositions': false,
45
+ 'closePosition': true,
44
46
  'createOrder': true,
45
47
  'createReduceOnlyOrder': true,
46
48
  'editOrder': true,
@@ -36,8 +36,6 @@ export default class blockchaincom extends Exchange {
36
36
  }>;
37
37
  parseTransactionState(state: any): string;
38
38
  parseTransaction(transaction: any, currency?: Currency): Transaction;
39
- fetchWithdrawalWhitelist(params?: {}): Promise<any[]>;
40
- fetchWithdrawalWhitelistByCurrency(code: string, params?: {}): Promise<any[]>;
41
39
  withdraw(code: string, amount: any, address: any, tag?: any, params?: {}): Promise<Transaction>;
42
40
  fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
43
41
  fetchWithdrawal(id: string, code?: Str, params?: {}): Promise<Transaction>;
@@ -909,47 +909,6 @@ export default class blockchaincom extends Exchange {
909
909
  'fee': fee,
910
910
  };
911
911
  }
912
- async fetchWithdrawalWhitelist(params = {}) {
913
- /**
914
- * @method
915
- * @name blockchaincom#fetchWithdrawalWhitelist
916
- * @description fetch the list of withdrawal addresses on the whitelist
917
- * @param {object} [params] extra parameters specific to the exchange API endpoint
918
- * @returns {object} dictionary with keys beneficiaryId, name, currency
919
- */
920
- await this.loadMarkets();
921
- const response = await this.privateGetWhitelist();
922
- const result = [];
923
- for (let i = 0; i < response.length; i++) {
924
- const entry = response[i];
925
- result.push({
926
- 'beneficiaryId': this.safeString(entry, 'whitelistId'),
927
- 'name': this.safeString(entry, 'name'),
928
- 'currency': this.safeString(entry, 'currency'),
929
- 'info': entry,
930
- });
931
- }
932
- return result;
933
- }
934
- async fetchWithdrawalWhitelistByCurrency(code, params = {}) {
935
- await this.loadMarkets();
936
- const currency = this.currency(code);
937
- const request = {
938
- 'currency': currency['id'],
939
- };
940
- const response = await this.privateGetWhitelistCurrency(this.extend(request, params));
941
- const result = [];
942
- for (let i = 0; i < response.length; i++) {
943
- const entry = response[i];
944
- result.push({
945
- 'beneficiaryId': this.safeString(entry, 'whitelistId'),
946
- 'name': this.safeString(entry, 'name'),
947
- 'currency': this.safeString(entry, 'currency'),
948
- 'info': entry,
949
- });
950
- }
951
- return result;
952
- }
953
912
  async withdraw(code, amount, address, tag = undefined, params = {}) {
954
913
  /**
955
914
  * @method
package/js/src/bybit.js CHANGED
@@ -947,6 +947,7 @@ export default class bybit extends Exchange {
947
947
  },
948
948
  'precisionMode': TICK_SIZE,
949
949
  'options': {
950
+ 'fetchMarkets': ['spot', 'linear', 'inverse', 'option'],
950
951
  'enableUnifiedMargin': undefined,
951
952
  'enableUnifiedAccount': undefined,
952
953
  'createMarketBuyOrderRequiresPrice': true,
@@ -1452,21 +1453,35 @@ export default class bybit extends Exchange {
1452
1453
  if (this.options['adjustForTimeDifference']) {
1453
1454
  await this.loadTimeDifference();
1454
1455
  }
1455
- const promisesUnresolved = [
1456
- this.fetchSpotMarkets(params),
1457
- this.fetchFutureMarkets({ 'category': 'linear' }),
1458
- this.fetchFutureMarkets({ 'category': 'inverse' }),
1459
- this.fetchOptionMarkets({ 'baseCoin': 'BTC' }),
1460
- this.fetchOptionMarkets({ 'baseCoin': 'ETH' }),
1461
- this.fetchOptionMarkets({ 'baseCoin': 'SOL' }),
1462
- ];
1456
+ const promisesUnresolved = [];
1457
+ const fetchMarkets = this.safeValue(this.options, 'fetchMarkets', ['spot', 'linear', 'inverse']);
1458
+ for (let i = 0; i < fetchMarkets.length; i++) {
1459
+ const marketType = fetchMarkets[i];
1460
+ if (marketType === 'spot') {
1461
+ promisesUnresolved.push(this.fetchSpotMarkets(params));
1462
+ }
1463
+ else if (marketType === 'linear') {
1464
+ promisesUnresolved.push(this.fetchFutureMarkets({ 'category': 'linear' }));
1465
+ }
1466
+ else if (marketType === 'inverse') {
1467
+ promisesUnresolved.push(this.fetchFutureMarkets({ 'category': 'inverse' }));
1468
+ }
1469
+ else if (marketType === 'option') {
1470
+ promisesUnresolved.push(this.fetchOptionMarkets({ 'baseCoin': 'BTC' }));
1471
+ promisesUnresolved.push(this.fetchOptionMarkets({ 'baseCoin': 'ETH' }));
1472
+ promisesUnresolved.push(this.fetchOptionMarkets({ 'baseCoin': 'SOL' }));
1473
+ }
1474
+ else {
1475
+ throw new ExchangeError(this.id + ' fetchMarkets() this.options fetchMarkets "' + marketType + '" is not a supported market type');
1476
+ }
1477
+ }
1463
1478
  const promises = await Promise.all(promisesUnresolved);
1464
- const spotMarkets = promises[0];
1465
- const linearMarkets = promises[1];
1466
- const inverseMarkets = promises[2];
1467
- const btcOptionMarkets = promises[3];
1468
- const ethOptionMarkets = promises[4];
1469
- const solOptionMarkets = promises[5];
1479
+ const spotMarkets = this.safeValue(promises, 0, []);
1480
+ const linearMarkets = this.safeValue(promises, 1, []);
1481
+ const inverseMarkets = this.safeValue(promises, 2, []);
1482
+ const btcOptionMarkets = this.safeValue(promises, 3, []);
1483
+ const ethOptionMarkets = this.safeValue(promises, 4, []);
1484
+ const solOptionMarkets = this.safeValue(promises, 5, []);
1470
1485
  const futureMarkets = this.arrayConcat(linearMarkets, inverseMarkets);
1471
1486
  let optionMarkets = this.arrayConcat(btcOptionMarkets, ethOptionMarkets);
1472
1487
  optionMarkets = this.arrayConcat(optionMarkets, solOptionMarkets);
@@ -109,6 +109,8 @@ export default class coinlist extends Exchange {
109
109
  'fetchWithdrawals': false,
110
110
  'fetchWithdrawalWhitelist': false,
111
111
  'reduceMargin': false,
112
+ 'repayCrossMargin': false,
113
+ 'repayIsolatedMargin': false,
112
114
  'setLeverage': false,
113
115
  'setMargin': false,
114
116
  'setMarginMode': false,
package/js/src/coinsph.js CHANGED
@@ -111,6 +111,8 @@ export default class coinsph extends Exchange {
111
111
  'fetchWithdrawals': true,
112
112
  'fetchWithdrawalWhitelist': false,
113
113
  'reduceMargin': false,
114
+ 'repayCrossMargin': false,
115
+ 'repayIsolatedMargin': false,
114
116
  'setLeverage': false,
115
117
  'setMargin': false,
116
118
  'setMarginMode': false,
@@ -99,6 +99,8 @@ export default class cryptocom extends Exchange {
99
99
  'fetchVolatilityHistory': false,
100
100
  'fetchWithdrawals': true,
101
101
  'reduceMargin': false,
102
+ 'repayCrossMargin': false,
103
+ 'repayIsolatedMargin': false,
102
104
  'setLeverage': false,
103
105
  'setMarginMode': false,
104
106
  'setPositionMode': false,
package/js/src/gate.d.ts CHANGED
@@ -183,6 +183,7 @@ export default class gate extends Exchange {
183
183
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, params?: {}): Promise<Order>;
184
184
  createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
185
185
  createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, params?: {}): any;
186
+ createMarketBuyOrderWithCost(symbol: string, cost: any, params?: {}): Promise<Order>;
186
187
  editOrder(id: string, symbol: any, type: any, side: any, amount?: any, price?: any, params?: {}): Promise<Order>;
187
188
  parseOrderStatus(status: any): string;
188
189
  parseOrder(order: any, market?: Market): Order;
@@ -220,6 +221,51 @@ export default class gate extends Exchange {
220
221
  fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
221
222
  fetchLeverageTiers(symbols?: Strings, params?: {}): Promise<{}>;
222
223
  parseMarketLeverageTiers(info: any, market?: Market): any[];
224
+ repayIsolatedMargin(symbol: string, code: string, amount: any, params?: {}): Promise<{
225
+ id: number;
226
+ currency: string;
227
+ amount: number;
228
+ symbol: string;
229
+ timestamp: number;
230
+ datetime: string;
231
+ info: any;
232
+ }>;
233
+ repayCrossMargin(code: string, amount: any, params?: {}): Promise<{
234
+ id: number;
235
+ currency: string;
236
+ amount: number;
237
+ symbol: string;
238
+ timestamp: number;
239
+ datetime: string;
240
+ info: any;
241
+ }>;
242
+ borrowIsolatedMargin(symbol: string, code: string, amount: any, params?: {}): Promise<{
243
+ id: number;
244
+ currency: string;
245
+ amount: number;
246
+ symbol: string;
247
+ timestamp: number;
248
+ datetime: string;
249
+ info: any;
250
+ }>;
251
+ borrowCrossMargin(code: string, amount: any, params?: {}): Promise<{
252
+ id: number;
253
+ currency: string;
254
+ amount: number;
255
+ symbol: string;
256
+ timestamp: number;
257
+ datetime: string;
258
+ info: any;
259
+ }>;
260
+ parseMarginLoan(info: any, currency?: Currency): {
261
+ id: number;
262
+ currency: string;
263
+ amount: number;
264
+ symbol: string;
265
+ timestamp: number;
266
+ datetime: string;
267
+ info: any;
268
+ };
223
269
  sign(path: any, api?: any[], method?: string, params?: {}, headers?: any, body?: any): {
224
270
  url: any;
225
271
  method: string;
@@ -323,5 +369,6 @@ export default class gate extends Exchange {
323
369
  underlyingPrice: number;
324
370
  info: any;
325
371
  };
372
+ closePosition(symbol: string, side?: OrderSide, params?: {}): Promise<Order>;
326
373
  handleErrors(code: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
327
374
  }