ccxt 4.2.59 → 4.2.60

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 +406 -165
  4. package/dist/ccxt.browser.min.js +3 -3
  5. package/dist/cjs/ccxt.js +1 -1
  6. package/dist/cjs/src/ascendex.js +10 -12
  7. package/dist/cjs/src/bingx.js +38 -0
  8. package/dist/cjs/src/bitfinex2.js +21 -4
  9. package/dist/cjs/src/bitget.js +9 -2
  10. package/dist/cjs/src/bitmart.js +41 -23
  11. package/dist/cjs/src/blofin.js +59 -1
  12. package/dist/cjs/src/hitbtc.js +1 -1
  13. package/dist/cjs/src/htx.js +4 -1
  14. package/dist/cjs/src/kraken.js +42 -39
  15. package/dist/cjs/src/kucoinfutures.js +1 -0
  16. package/dist/cjs/src/pro/binance.js +16 -3
  17. package/dist/cjs/src/wazirx.js +6 -1
  18. package/dist/cjs/src/woo.js +157 -77
  19. package/js/ccxt.d.ts +1 -1
  20. package/js/ccxt.js +1 -1
  21. package/js/src/abstract/blofin.d.ts +1 -0
  22. package/js/src/abstract/wazirx.d.ts +5 -0
  23. package/js/src/ascendex.d.ts +2 -2
  24. package/js/src/ascendex.js +10 -12
  25. package/js/src/bingx.d.ts +3 -1
  26. package/js/src/bingx.js +38 -0
  27. package/js/src/bitfinex2.js +21 -4
  28. package/js/src/bitget.js +9 -2
  29. package/js/src/bitmart.d.ts +9 -2
  30. package/js/src/bitmart.js +41 -23
  31. package/js/src/blofin.d.ts +2 -1
  32. package/js/src/blofin.js +59 -1
  33. package/js/src/hitbtc.js +1 -1
  34. package/js/src/htx.js +4 -1
  35. package/js/src/kraken.js +42 -39
  36. package/js/src/kucoinfutures.js +1 -0
  37. package/js/src/pro/binance.js +16 -3
  38. package/js/src/pro/deribit.d.ts +1 -1
  39. package/js/src/wazirx.js +6 -1
  40. package/js/src/woo.d.ts +8 -0
  41. package/js/src/woo.js +157 -77
  42. package/package.json +1 -1
  43. package/skip-tests.json +42 -16
@@ -30,8 +30,8 @@ export default class bitfinex2 extends Exchange {
30
30
  'spot': true,
31
31
  'margin': true,
32
32
  'swap': true,
33
- 'future': undefined,
34
- 'option': undefined,
33
+ 'future': false,
34
+ 'option': false,
35
35
  'addMargin': false,
36
36
  'borrowCrossMargin': false,
37
37
  'borrowIsolatedMargin': false,
@@ -42,6 +42,7 @@ export default class bitfinex2 extends Exchange {
42
42
  'createLimitOrder': true,
43
43
  'createMarketOrder': true,
44
44
  'createOrder': true,
45
+ 'createPostOnlyOrder': true,
45
46
  'createReduceOnlyOrder': true,
46
47
  'createStopLimitOrder': true,
47
48
  'createStopMarketOrder': true,
@@ -52,8 +53,11 @@ export default class bitfinex2 extends Exchange {
52
53
  'editOrder': true,
53
54
  'fetchBalance': true,
54
55
  'fetchBorrowInterest': false,
55
- 'fetchBorrowRateHistories': false,
56
+ 'fetchBorrowRate': false,
56
57
  'fetchBorrowRateHistory': false,
58
+ 'fetchBorrowRateHistories': false,
59
+ 'fetchBorrowRates': false,
60
+ 'fetchBorrowRatesPerSymbol': false,
57
61
  'fetchClosedOrder': true,
58
62
  'fetchClosedOrders': true,
59
63
  'fetchCrossBorrowRate': false,
@@ -82,6 +86,8 @@ export default class bitfinex2 extends Exchange {
82
86
  'fetchOpenOrder': true,
83
87
  'fetchOpenOrders': true,
84
88
  'fetchOrder': true,
89
+ 'fetchOrderBook': true,
90
+ 'fetchOrderBooks': false,
85
91
  'fetchOrderTrades': true,
86
92
  'fetchPosition': false,
87
93
  'fetchPositionMode': false,
@@ -101,6 +107,8 @@ export default class bitfinex2 extends Exchange {
101
107
  'setMargin': true,
102
108
  'setMarginMode': false,
103
109
  'setPositionMode': false,
110
+ 'signIn': false,
111
+ 'transfer': true,
104
112
  'withdraw': true,
105
113
  },
106
114
  'timeframes': {
@@ -1533,7 +1541,16 @@ export default class bitfinex2 extends Exchange {
1533
1541
  * @param {float} amount how much you want to trade in units of the base currency
1534
1542
  * @param {float} [price] the price of the order, in units of the quote currency, ignored in market orders
1535
1543
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1536
- * @returns {object} request to be sent to the exchange
1544
+ * @param {float} [params.stopPrice] The price at which a trigger order is triggered at
1545
+ * @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
1546
+ * @param {bool} [params.postOnly]
1547
+ * @param {bool} [params.reduceOnly] Ensures that the executed order does not flip the opened position.
1548
+ * @param {int} [params.flags] additional order parameters: 4096 (Post Only), 1024 (Reduce Only), 16384 (OCO), 64 (Hidden), 512 (Close), 524288 (No Var Rates)
1549
+ * @param {int} [params.lev] leverage for a derivative order, supported by derivative symbol orders only. The value should be between 1 and 100 inclusive.
1550
+ * @param {string} [params.price_traling] The trailing price for a trailing stop order
1551
+ * @param {string} [params.price_aux_limit] Order price for stop limit orders
1552
+ * @param {string} [params.price_oco_stop] OCO stop price
1553
+ * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1537
1554
  */
1538
1555
  const market = this.market(symbol);
1539
1556
  let amountString = this.amountToPrecision(symbol, amount);
package/js/src/bitget.js CHANGED
@@ -2931,8 +2931,15 @@ export default class bitget extends Exchange {
2931
2931
  const currencyCode = this.safeCurrencyCode(this.safeString(feeStructure, 'feeCoin'));
2932
2932
  fee = {
2933
2933
  'currency': currencyCode,
2934
- 'cost': Precise.stringAbs(this.safeString(feeStructure, 'totalFee')),
2935
2934
  };
2935
+ const feeCostString = this.safeString(feeStructure, 'totalFee');
2936
+ const deduction = this.safeString(feeStructure, 'deduction') === 'yes' ? true : false;
2937
+ if (deduction) {
2938
+ fee['cost'] = feeCostString;
2939
+ }
2940
+ else {
2941
+ fee['cost'] = Precise.stringNeg(feeCostString);
2942
+ }
2936
2943
  }
2937
2944
  return this.safeTrade({
2938
2945
  'info': trade,
@@ -4031,7 +4038,7 @@ export default class bitget extends Exchange {
4031
4038
  * @see https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Place-Order
4032
4039
  * @param {string} symbol unified symbol of the market to create an order in
4033
4040
  * @param {string} type 'market' or 'limit'
4034
- * @param {string} side 'buy' or 'sell' or 'open_long' or 'open_short' or 'close_long' or 'close_short'
4041
+ * @param {string} side 'buy' or 'sell'
4035
4042
  * @param {float} amount how much you want to trade in units of the base currency
4036
4043
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
4037
4044
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -76,13 +76,20 @@ export default class bitmart extends Exchange {
76
76
  fetchCanceledOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
77
77
  fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
78
78
  fetchDepositAddress(code: string, params?: {}): Promise<{
79
+ info: any;
79
80
  currency: string;
80
81
  address: string;
81
82
  tag: string;
82
83
  network: any;
83
- info: any;
84
84
  }>;
85
- safeNetwork(networkId: any): any;
85
+ parseDepositAddress(depositAddress: any, currency?: any): {
86
+ info: any;
87
+ currency: string;
88
+ address: string;
89
+ tag: string;
90
+ network: any;
91
+ };
92
+ safeNetworkCode(networkId: any, currency?: any): string;
86
93
  withdraw(code: string, amount: number, address: any, tag?: any, params?: {}): Promise<any>;
87
94
  fetchTransactionsByType(type: any, code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
88
95
  fetchDeposit(id: string, code?: Str, params?: {}): Promise<Transaction>;
package/js/src/bitmart.js CHANGED
@@ -515,6 +515,7 @@ export default class bitmart extends Exchange {
515
515
  },
516
516
  'networks': {
517
517
  'ERC20': 'ERC20',
518
+ 'SOL': 'SOL',
518
519
  'BTC': 'BTC',
519
520
  'TRC20': 'TRC20',
520
521
  // todo: should be TRX after unification
@@ -537,7 +538,6 @@ export default class bitmart extends Exchange {
537
538
  'FIO': 'FIO',
538
539
  'SCRT': 'SCRT',
539
540
  'IOTX': 'IOTX',
540
- 'SOL': 'SOL',
541
541
  'ALGO': 'ALGO',
542
542
  'ATOM': 'ATOM',
543
543
  'DOT': 'DOT',
@@ -3090,6 +3090,7 @@ export default class bitmart extends Exchange {
3090
3090
  * @method
3091
3091
  * @name bitmart#fetchDepositAddress
3092
3092
  * @description fetch the deposit address for a currency associated with this account
3093
+ * @see https://developer-pro.bitmart.com/en/spot/#deposit-address-keyed
3093
3094
  * @param {string} code unified currency code
3094
3095
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3095
3096
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -3112,40 +3113,57 @@ export default class bitmart extends Exchange {
3112
3113
  }
3113
3114
  const response = await this.privateGetAccountV1DepositAddress(this.extend(request, params));
3114
3115
  //
3115
- // {
3116
- // "message":"OK",
3117
- // "code":1000,
3118
- // "trace":"0e6edd79-f77f-4251-abe5-83ba75d06c1a",
3119
- // "data":{
3120
- // "currency":"USDT-TRC20",
3121
- // "chain":"USDT-TRC20",
3122
- // "address":"TGR3ghy2b5VLbyAYrmiE15jasR6aPHTvC5",
3123
- // "address_memo":""
3124
- // }
3125
- // }
3116
+ // {
3117
+ // "message": "OK",
3118
+ // "code": 1000,
3119
+ // "trace": "0e6edd79-f77f-4251-abe5-83ba75d06c1a",
3120
+ // "data": {
3121
+ // currency: 'ETH',
3122
+ // chain: 'Ethereum',
3123
+ // address: '0x99B5EEc2C520f86F0F62F05820d28D05D36EccCf',
3124
+ // address_memo: ''
3125
+ // }
3126
+ // }
3126
3127
  //
3127
3128
  const data = this.safeValue(response, 'data', {});
3128
- const address = this.safeString(data, 'address');
3129
- const tag = this.safeString(data, 'address_memo');
3130
- const chain = this.safeString(data, 'chain');
3129
+ return this.parseDepositAddress(data, currency);
3130
+ }
3131
+ parseDepositAddress(depositAddress, currency = undefined) {
3132
+ //
3133
+ // {
3134
+ // currency: 'ETH',
3135
+ // chain: 'Ethereum',
3136
+ // address: '0x99B5EEc2C520f86F0F62F05820d28D05D36EccCf',
3137
+ // address_memo: ''
3138
+ // }
3139
+ //
3140
+ const currencyId = this.safeString(depositAddress, 'currency');
3141
+ const address = this.safeString(depositAddress, 'address');
3142
+ const chain = this.safeString(depositAddress, 'chain');
3131
3143
  let network = undefined;
3144
+ currency = this.safeCurrency(currencyId, currency);
3132
3145
  if (chain !== undefined) {
3133
3146
  const parts = chain.split('-');
3134
- const networkId = this.safeString(parts, 1);
3135
- network = this.safeNetwork(networkId);
3147
+ const partsLength = parts.length;
3148
+ const networkId = this.safeString(parts, partsLength - 1);
3149
+ network = this.safeNetworkCode(networkId, currency);
3136
3150
  }
3137
3151
  this.checkAddress(address);
3138
3152
  return {
3139
- 'currency': code,
3153
+ 'info': depositAddress,
3154
+ 'currency': this.safeString(currency, 'code'),
3140
3155
  'address': address,
3141
- 'tag': tag,
3156
+ 'tag': this.safeString(depositAddress, 'address_memo'),
3142
3157
  'network': network,
3143
- 'info': response,
3144
3158
  };
3145
3159
  }
3146
- safeNetwork(networkId) {
3147
- // TODO: parse
3148
- return networkId;
3160
+ safeNetworkCode(networkId, currency = undefined) {
3161
+ const name = this.safeString(currency, 'name');
3162
+ if (networkId === name) {
3163
+ const code = this.safeString(currency, 'code');
3164
+ return code;
3165
+ }
3166
+ return this.networkIdToCode(networkId);
3149
3167
  }
3150
3168
  async withdraw(code, amount, address, tag = undefined, params = {}) {
3151
3169
  /**
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/blofin.js';
2
- import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderRequest, Str, Transaction, Ticker, OrderBook, Balances, Tickers, Market, Strings, Currency, Position, TransferEntry, Leverage } from './base/types.js';
2
+ import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderRequest, Str, Transaction, Ticker, OrderBook, Balances, Tickers, Market, Strings, Currency, Position, TransferEntry, Leverage, Leverages } from './base/types.js';
3
3
  /**
4
4
  * @class blofin
5
5
  * @augments Exchange
@@ -110,6 +110,7 @@ export default class blofin extends Exchange {
110
110
  fetchPosition(symbol: string, params?: {}): Promise<Position>;
111
111
  fetchPositions(symbols?: string[], params?: {}): Promise<Position[]>;
112
112
  parsePosition(position: any, market?: Market): Position;
113
+ fetchLeverages(symbols?: string[], params?: {}): Promise<Leverages>;
113
114
  fetchLeverage(symbol: string, params?: {}): Promise<Leverage>;
114
115
  parseLeverage(leverage: any, market?: any): Leverage;
115
116
  setLeverage(leverage: Int, symbol?: Str, params?: {}): Promise<any>;
package/js/src/blofin.js CHANGED
@@ -83,6 +83,7 @@ export default class blofin extends Exchange {
83
83
  'fetchLedger': true,
84
84
  'fetchLedgerEntry': undefined,
85
85
  'fetchLeverage': true,
86
+ 'fetchLeverages': true,
86
87
  'fetchLeverageTiers': false,
87
88
  'fetchMarketLeverageTiers': false,
88
89
  'fetchMarkets': true,
@@ -187,6 +188,7 @@ export default class blofin extends Exchange {
187
188
  'account/balance': 1,
188
189
  'account/positions': 1,
189
190
  'account/leverage-info': 1,
191
+ 'account/batch-leverage-info': 1,
190
192
  'trade/orders-tpsl-pending': 1,
191
193
  'trade/orders-history': 1,
192
194
  'trade/orders-tpsl-history': 1,
@@ -1884,12 +1886,68 @@ export default class blofin extends Exchange {
1884
1886
  'takeProfitPrice': undefined,
1885
1887
  });
1886
1888
  }
1889
+ async fetchLeverages(symbols = undefined, params = {}) {
1890
+ /**
1891
+ * @method
1892
+ * @name blofin#fetchLeverages
1893
+ * @description fetch the set leverage for all contract markets
1894
+ * @see https://docs.blofin.com/index.html#get-multiple-leverage
1895
+ * @param {string[]} symbols a list of unified market symbols, required on blofin
1896
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1897
+ * @param {string} [params.marginMode] 'cross' or 'isolated'
1898
+ * @returns {object} a list of [leverage structures]{@link https://docs.ccxt.com/#/?id=leverage-structure}
1899
+ */
1900
+ await this.loadMarkets();
1901
+ if (symbols === undefined) {
1902
+ throw new ArgumentsRequired(this.id + ' fetchLeverages() requires a symbols argument');
1903
+ }
1904
+ let marginMode = undefined;
1905
+ [marginMode, params] = this.handleMarginModeAndParams('fetchLeverages', params);
1906
+ if (marginMode === undefined) {
1907
+ marginMode = this.safeString(params, 'marginMode', 'cross'); // cross as default marginMode
1908
+ }
1909
+ if ((marginMode !== 'cross') && (marginMode !== 'isolated')) {
1910
+ throw new BadRequest(this.id + ' fetchLeverages() requires a marginMode parameter that must be either cross or isolated');
1911
+ }
1912
+ symbols = this.marketSymbols(symbols);
1913
+ let instIds = '';
1914
+ for (let i = 0; i < symbols.length; i++) {
1915
+ const entry = symbols[i];
1916
+ const entryMarket = this.market(entry);
1917
+ if (i > 0) {
1918
+ instIds = instIds + ',' + entryMarket['id'];
1919
+ }
1920
+ else {
1921
+ instIds = instIds + entryMarket['id'];
1922
+ }
1923
+ }
1924
+ const request = {
1925
+ 'instId': instIds,
1926
+ 'marginMode': marginMode,
1927
+ };
1928
+ const response = await this.privateGetAccountBatchLeverageInfo(this.extend(request, params));
1929
+ //
1930
+ // {
1931
+ // "code": "0",
1932
+ // "msg": "success",
1933
+ // "data": [
1934
+ // {
1935
+ // "leverage": "3",
1936
+ // "marginMode": "cross",
1937
+ // "instId": "BTC-USDT"
1938
+ // },
1939
+ // ]
1940
+ // }
1941
+ //
1942
+ const leverages = this.safeList(response, 'data', []);
1943
+ return this.parseLeverages(leverages, symbols, 'instId');
1944
+ }
1887
1945
  async fetchLeverage(symbol, params = {}) {
1888
1946
  /**
1889
1947
  * @method
1890
1948
  * @name blofin#fetchLeverage
1891
1949
  * @description fetch the set leverage for a market
1892
- * @see https://blofin.com/docs#set-leverage
1950
+ * @see https://docs.blofin.com/index.html#get-leverage
1893
1951
  * @param {string} symbol unified market symbol
1894
1952
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1895
1953
  * @param {string} [params.marginMode] 'cross' or 'isolated'
package/js/src/hitbtc.js CHANGED
@@ -2702,7 +2702,7 @@ export default class hitbtc extends Exchange {
2702
2702
  if ((network !== undefined) && (code === 'USDT')) {
2703
2703
  const parsedNetwork = this.safeString(networks, network);
2704
2704
  if (parsedNetwork !== undefined) {
2705
- request['currency'] = parsedNetwork;
2705
+ request['network_code'] = parsedNetwork;
2706
2706
  }
2707
2707
  params = this.omit(params, 'network');
2708
2708
  }
package/js/src/htx.js CHANGED
@@ -2594,7 +2594,10 @@ export default class htx extends Exchange {
2594
2594
  amountString = this.safeString(trade, 'trade_volume', amountString);
2595
2595
  const costString = this.safeString(trade, 'trade_turnover');
2596
2596
  let fee = undefined;
2597
- let feeCost = this.safeString2(trade, 'filled-fees', 'trade_fee');
2597
+ let feeCost = this.safeString(trade, 'filled-fees');
2598
+ if (feeCost === undefined) {
2599
+ feeCost = Precise.stringNeg(this.safeString(trade, 'trade_fee'));
2600
+ }
2598
2601
  const feeCurrencyId = this.safeString2(trade, 'fee-currency', 'fee_asset');
2599
2602
  let feeCurrency = this.safeCurrencyCode(feeCurrencyId);
2600
2603
  const filledPoints = this.safeString(trade, 'filled-points');
package/js/src/kraken.js CHANGED
@@ -24,7 +24,10 @@ export default class kraken extends Exchange {
24
24
  'name': 'Kraken',
25
25
  'countries': ['US'],
26
26
  'version': '0',
27
- 'rateLimit': 3000,
27
+ // rate-limits: https://support.kraken.com/hc/en-us/articles/206548367-What-are-the-API-rate-limits-#1
28
+ // for public: 1 req/s
29
+ // for private: every second 0.33 weight added to your allowed capacity (some private endpoints need 1 weight, some need 2)
30
+ 'rateLimit': 1000,
28
31
  'certified': false,
29
32
  'pro': true,
30
33
  'has': {
@@ -154,7 +157,7 @@ export default class kraken extends Exchange {
154
157
  },
155
158
  'public': {
156
159
  'get': {
157
- // public endpoint rate-limits are described in article: https://support.kraken.com/hc/en-us/articles/206548367-What-are-the-API-rate-limits-#1
160
+ // rate-limits explained in comment in the top of this file
158
161
  'Assets': 1,
159
162
  'AssetPairs': 1,
160
163
  'Depth': 1,
@@ -170,48 +173,48 @@ export default class kraken extends Exchange {
170
173
  'post': {
171
174
  'AddOrder': 0,
172
175
  'AddOrderBatch': 0,
173
- 'AddExport': 1,
174
- 'Balance': 1,
175
- 'CancelAll': 1,
176
- 'CancelAllOrdersAfter': 1,
176
+ 'AddExport': 3,
177
+ 'Balance': 3,
178
+ 'CancelAll': 3,
179
+ 'CancelAllOrdersAfter': 3,
177
180
  'CancelOrder': 0,
178
181
  'CancelOrderBatch': 0,
179
- 'ClosedOrders': 1,
180
- 'DepositAddresses': 1,
181
- 'DepositMethods': 1,
182
- 'DepositStatus': 1,
182
+ 'ClosedOrders': 3,
183
+ 'DepositAddresses': 3,
184
+ 'DepositMethods': 3,
185
+ 'DepositStatus': 3,
183
186
  'EditOrder': 0,
184
- 'ExportStatus': 1,
185
- 'GetWebSocketsToken': 1,
186
- 'Ledgers': 2,
187
- 'OpenOrders': 1,
188
- 'OpenPositions': 1,
189
- 'QueryLedgers': 1,
190
- 'QueryOrders': 1,
191
- 'QueryTrades': 1,
192
- 'RetrieveExport': 1,
193
- 'RemoveExport': 1,
194
- 'BalanceEx': 1,
195
- 'TradeBalance': 1,
196
- 'TradesHistory': 2,
197
- 'TradeVolume': 1,
198
- 'Withdraw': 1,
199
- 'WithdrawCancel': 1,
200
- 'WithdrawInfo': 1,
201
- 'WithdrawMethods': 1,
202
- 'WithdrawAddresses': 1,
203
- 'WithdrawStatus': 1,
204
- 'WalletTransfer': 1,
187
+ 'ExportStatus': 3,
188
+ 'GetWebSocketsToken': 3,
189
+ 'Ledgers': 6,
190
+ 'OpenOrders': 3,
191
+ 'OpenPositions': 3,
192
+ 'QueryLedgers': 3,
193
+ 'QueryOrders': 3,
194
+ 'QueryTrades': 3,
195
+ 'RetrieveExport': 3,
196
+ 'RemoveExport': 3,
197
+ 'BalanceEx': 3,
198
+ 'TradeBalance': 3,
199
+ 'TradesHistory': 6,
200
+ 'TradeVolume': 3,
201
+ 'Withdraw': 3,
202
+ 'WithdrawCancel': 3,
203
+ 'WithdrawInfo': 3,
204
+ 'WithdrawMethods': 3,
205
+ 'WithdrawAddresses': 3,
206
+ 'WithdrawStatus': 3,
207
+ 'WalletTransfer': 3,
205
208
  // sub accounts
206
- 'CreateSubaccount': 1,
207
- 'AccountTransfer': 1,
209
+ 'CreateSubaccount': 3,
210
+ 'AccountTransfer': 3,
208
211
  // earn
209
- 'Earn/Allocate': 1,
210
- 'Earn/Deallocate': 1,
211
- 'Earn/AllocateStatus': 1,
212
- 'Earn/DeallocateStatus': 1,
213
- 'Earn/Strategies': 1,
214
- 'Earn/Allocations': 1,
212
+ 'Earn/Allocate': 3,
213
+ 'Earn/Deallocate': 3,
214
+ 'Earn/AllocateStatus': 3,
215
+ 'Earn/DeallocateStatus': 3,
216
+ 'Earn/Strategies': 3,
217
+ 'Earn/Allocations': 3,
215
218
  },
216
219
  },
217
220
  },
@@ -36,6 +36,7 @@ export default class kucoinfutures extends kucoin {
36
36
  'addMargin': true,
37
37
  'cancelAllOrders': true,
38
38
  'cancelOrder': true,
39
+ 'closeAllPositions': false,
39
40
  'closePosition': true,
40
41
  'closePositions': false,
41
42
  'createDepositAddress': true,
@@ -2602,8 +2602,21 @@ export default class binance extends binanceRest {
2602
2602
  // }
2603
2603
  //
2604
2604
  const marketId = this.safeString(position, 's');
2605
- const positionSide = this.safeStringLower(position, 'ps');
2606
- const hedged = positionSide !== 'both';
2605
+ const contracts = this.safeString(position, 'pa');
2606
+ const contractsAbs = Precise.stringAbs(this.safeString(position, 'pa'));
2607
+ let positionSide = this.safeStringLower(position, 'ps');
2608
+ let hedged = true;
2609
+ if (positionSide === 'both') {
2610
+ hedged = false;
2611
+ if (!Precise.stringEq(contracts, '0')) {
2612
+ if (Precise.stringLt(contracts, '0')) {
2613
+ positionSide = 'short';
2614
+ }
2615
+ else {
2616
+ positionSide = 'long';
2617
+ }
2618
+ }
2619
+ }
2607
2620
  return this.safePosition({
2608
2621
  'info': position,
2609
2622
  'id': undefined,
@@ -2614,7 +2627,7 @@ export default class binance extends binanceRest {
2614
2627
  'entryPrice': this.safeNumber(position, 'ep'),
2615
2628
  'unrealizedPnl': this.safeNumber(position, 'up'),
2616
2629
  'percentage': undefined,
2617
- 'contracts': this.safeNumber(position, 'pa'),
2630
+ 'contracts': this.parseNumber(contractsAbs),
2618
2631
  'contractSize': undefined,
2619
2632
  'markPrice': undefined,
2620
2633
  'side': positionSide,
@@ -25,7 +25,7 @@ export default class deribit extends deribitRest {
25
25
  watchOHLCVForSymbols(symbolsAndTimeframes: string[][], since?: Int, limit?: Int, params?: {}): Promise<import("../base/types.js").Dictionary<import("../base/types.js").Dictionary<OHLCV[]>>>;
26
26
  handleOHLCV(client: Client, message: any): void;
27
27
  parseWsOHLCV(ohlcv: any, market?: any): OHLCV;
28
- watchMultipleWrapper(channelName: string, channelDescriptor: string, symbolsArray?: any, params?: {}): Promise<any>;
28
+ watchMultipleWrapper(channelName: string, channelDescriptor: Str, symbolsArray?: any, params?: {}): Promise<any>;
29
29
  handleMessage(client: Client, message: any): void;
30
30
  handleAuthenticationMessage(client: Client, message: any): any;
31
31
  authenticate(params?: {}): Promise<any>;
package/js/src/wazirx.js CHANGED
@@ -113,7 +113,7 @@ export default class wazirx extends Exchange {
113
113
  'public': {
114
114
  'get': {
115
115
  'exchangeInfo': 1,
116
- 'depth': 1,
116
+ 'depth': 0.5,
117
117
  'ping': 1,
118
118
  'systemStatus': 1,
119
119
  'tickers/24hr': 1,
@@ -132,6 +132,11 @@ export default class wazirx extends Exchange {
132
132
  'openOrders': 1,
133
133
  'order': 0.5,
134
134
  'myTrades': 0.5,
135
+ 'coins': 12,
136
+ 'crypto/withdraws': 12,
137
+ 'crypto/deposits/address': 60,
138
+ 'sub_account/fund_transfer/history': 1,
139
+ 'sub_account/accounts': 1,
135
140
  },
136
141
  'post': {
137
142
  'order': 0.1,
package/js/src/woo.d.ts CHANGED
@@ -6,6 +6,14 @@ import type { TransferEntry, Balances, Currency, FundingRateHistory, Int, Market
6
6
  */
7
7
  export default class woo extends Exchange {
8
8
  describe(): any;
9
+ fetchStatus(params?: {}): Promise<{
10
+ status: string;
11
+ updated: any;
12
+ eta: any;
13
+ url: any;
14
+ info: any;
15
+ }>;
16
+ fetchTime(params?: {}): Promise<number>;
9
17
  fetchMarkets(params?: {}): Promise<import("./base/types.js").MarketInterface[]>;
10
18
  parseMarket(market: any): Market;
11
19
  fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;