ccxt 4.3.44 → 4.3.46

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 (64) hide show
  1. package/README.md +130 -130
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +6 -1
  4. package/dist/cjs/src/abstract/oxfun.js +9 -0
  5. package/dist/cjs/src/base/Exchange.js +1 -0
  6. package/dist/cjs/src/binance.js +2 -0
  7. package/dist/cjs/src/bingx.js +25 -17
  8. package/dist/cjs/src/bitmart.js +5 -0
  9. package/dist/cjs/src/bitstamp.js +18 -2
  10. package/dist/cjs/src/bitteam.js +5 -7
  11. package/dist/cjs/src/coinmetro.js +8 -17
  12. package/dist/cjs/src/hyperliquid.js +29 -21
  13. package/dist/cjs/src/idex.js +1 -0
  14. package/dist/cjs/src/kucoin.js +28 -1
  15. package/dist/cjs/src/luno.js +9 -1
  16. package/dist/cjs/src/mexc.js +8 -6
  17. package/dist/cjs/src/okx.js +1 -0
  18. package/dist/cjs/src/oxfun.js +2900 -0
  19. package/dist/cjs/src/pro/binanceus.js +0 -8
  20. package/dist/cjs/src/pro/oxfun.js +1034 -0
  21. package/dist/cjs/src/tokocrypto.js +8 -10
  22. package/dist/cjs/src/wavesexchange.js +122 -110
  23. package/dist/cjs/src/woofipro.js +1 -0
  24. package/dist/cjs/src/xt.js +1 -1
  25. package/js/ccxt.d.ts +8 -2
  26. package/js/ccxt.js +6 -2
  27. package/js/src/abstract/binance.d.ts +2 -0
  28. package/js/src/abstract/binancecoinm.d.ts +2 -0
  29. package/js/src/abstract/binanceus.d.ts +2 -0
  30. package/js/src/abstract/binanceusdm.d.ts +2 -0
  31. package/js/src/abstract/bitstamp.d.ts +16 -0
  32. package/js/src/abstract/kucoin.d.ts +14 -0
  33. package/js/src/abstract/kucoinfutures.d.ts +14 -0
  34. package/js/src/abstract/mexc.d.ts +2 -0
  35. package/js/src/abstract/oxfun.d.ts +37 -0
  36. package/js/src/abstract/oxfun.js +11 -0
  37. package/js/src/base/Exchange.d.ts +1 -0
  38. package/js/src/base/Exchange.js +1 -0
  39. package/js/src/binance.js +2 -0
  40. package/js/src/bingx.js +26 -18
  41. package/js/src/bitmart.js +5 -0
  42. package/js/src/bitstamp.js +18 -2
  43. package/js/src/bitteam.js +6 -8
  44. package/js/src/coinmetro.js +9 -18
  45. package/js/src/hyperliquid.d.ts +3 -3
  46. package/js/src/hyperliquid.js +29 -21
  47. package/js/src/idex.js +1 -0
  48. package/js/src/kucoin.js +28 -1
  49. package/js/src/luno.d.ts +1 -1
  50. package/js/src/luno.js +9 -1
  51. package/js/src/mexc.js +8 -6
  52. package/js/src/okx.js +1 -0
  53. package/js/src/oxfun.d.ts +129 -0
  54. package/js/src/oxfun.js +2901 -0
  55. package/js/src/pro/binanceus.js +0 -8
  56. package/js/src/pro/oxfun.d.ts +38 -0
  57. package/js/src/pro/oxfun.js +1035 -0
  58. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
  59. package/js/src/tokocrypto.js +9 -11
  60. package/js/src/wavesexchange.d.ts +7 -7
  61. package/js/src/wavesexchange.js +123 -111
  62. package/js/src/woofipro.js +1 -0
  63. package/js/src/xt.js +1 -1
  64. package/package.json +1 -1
package/js/src/kucoin.js CHANGED
@@ -124,6 +124,7 @@ export default class kucoin extends Exchange {
124
124
  'futuresPublic': 'https://api-futures.kucoin.com',
125
125
  'webExchange': 'https://kucoin.com/_api',
126
126
  'broker': 'https://api-broker.kucoin.com',
127
+ 'earn': 'https://api.kucoin.com',
127
128
  },
128
129
  'www': 'https://www.kucoin.com',
129
130
  'doc': [
@@ -391,6 +392,9 @@ export default class kucoin extends Exchange {
391
392
  'broker/nd/account': 2,
392
393
  'broker/nd/account/apikey': 2,
393
394
  'broker/nd/rebase/download': 3,
395
+ 'broker/nd/transfer/detail': 1,
396
+ 'broker/nd/deposit/detail': 1,
397
+ 'broker/nd/withdraw/detail': 1,
394
398
  },
395
399
  'post': {
396
400
  'broker/nd/transfer': 1,
@@ -402,6 +406,25 @@ export default class kucoin extends Exchange {
402
406
  'broker/nd/account/apikey': 3,
403
407
  },
404
408
  },
409
+ 'earn': {
410
+ 'get': {
411
+ 'otc-loan/loan': 1,
412
+ 'otc-loan/accounts': 1,
413
+ 'earn/redeem-preview': 7.5,
414
+ 'earn/saving/products': 7.5,
415
+ 'earn/hold-assets': 7.5,
416
+ 'earn/promotion/products': 7.5,
417
+ 'earn/kcs-staking/products': 7.5,
418
+ 'earn/staking/products': 7.5,
419
+ 'earn/eth-staking/products': 7.5, // 5EW
420
+ },
421
+ 'post': {
422
+ 'earn/orders': 7.5, // 5EW
423
+ },
424
+ 'delete': {
425
+ 'earn/orders': 7.5, // 5EW
426
+ },
427
+ },
405
428
  },
406
429
  'timeframes': {
407
430
  '1m': '1min',
@@ -4798,6 +4821,9 @@ export default class kucoin extends Exchange {
4798
4821
  if (api === 'webExchange') {
4799
4822
  endpoint = '/' + this.implodeParams(path, params);
4800
4823
  }
4824
+ if (api === 'earn') {
4825
+ endpoint = '/api/v1/' + this.implodeParams(path, params);
4826
+ }
4801
4827
  const query = this.omit(params, this.extractParams(path));
4802
4828
  let endpart = '';
4803
4829
  headers = (headers !== undefined) ? headers : {};
@@ -4816,7 +4842,8 @@ export default class kucoin extends Exchange {
4816
4842
  const isFuturePrivate = (api === 'futuresPrivate');
4817
4843
  const isPrivate = (api === 'private');
4818
4844
  const isBroker = (api === 'broker');
4819
- if (isPrivate || isFuturePrivate || isBroker) {
4845
+ const isEarn = (api === 'earn');
4846
+ if (isPrivate || isFuturePrivate || isBroker || isEarn) {
4820
4847
  this.checkRequiredCredentials();
4821
4848
  const timestamp = this.nonce().toString();
4822
4849
  headers = this.extend({
package/js/src/luno.d.ts CHANGED
@@ -28,7 +28,7 @@ export default class luno extends Exchange {
28
28
  fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
29
29
  fetchTradingFee(symbol: string, params?: {}): Promise<TradingFeeInterface>;
30
30
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
31
- cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
31
+ cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
32
32
  fetchLedgerByEntries(code?: Str, entry?: any, limit?: any, params?: {}): Promise<any>;
33
33
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
34
34
  parseLedgerComment(comment: any): {
package/js/src/luno.js CHANGED
@@ -964,7 +964,15 @@ export default class luno extends Exchange {
964
964
  const request = {
965
965
  'order_id': id,
966
966
  };
967
- return await this.privatePostStoporder(this.extend(request, params));
967
+ const response = await this.privatePostStoporder(this.extend(request, params));
968
+ //
969
+ // {
970
+ // "success": true
971
+ // }
972
+ //
973
+ return this.safeOrder({
974
+ 'info': response,
975
+ });
968
976
  }
969
977
  async fetchLedgerByEntries(code = undefined, entry = undefined, limit = undefined, params = {}) {
970
978
  // by default without entry number or limit number, return most recent entry
package/js/src/mexc.js CHANGED
@@ -224,6 +224,7 @@ export default class mexc extends Exchange {
224
224
  'sub-account/margin': 1,
225
225
  'batchOrders': 10,
226
226
  'capital/withdraw/apply': 1,
227
+ 'capital/withdraw': 1,
227
228
  'capital/transfer': 1,
228
229
  'capital/transfer/internal': 1,
229
230
  'capital/deposit/address': 1,
@@ -242,6 +243,7 @@ export default class mexc extends Exchange {
242
243
  'margin/order': 1,
243
244
  'margin/openOrders': 1,
244
245
  'userDataStream': 1,
246
+ 'capital/withdraw': 1,
245
247
  },
246
248
  },
247
249
  },
@@ -1069,7 +1071,7 @@ export default class mexc extends Exchange {
1069
1071
  const chains = this.safeValue(currency, 'networkList', []);
1070
1072
  for (let j = 0; j < chains.length; j++) {
1071
1073
  const chain = chains[j];
1072
- const networkId = this.safeString(chain, 'network');
1074
+ const networkId = this.safeString2(chain, 'network', 'netWork');
1073
1075
  const network = this.networkIdToCode(networkId);
1074
1076
  const isDepositEnabled = this.safeBool(chain, 'depositEnable', false);
1075
1077
  const isWithdrawEnabled = this.safeBool(chain, 'withdrawEnable', false);
@@ -5225,7 +5227,7 @@ export default class mexc extends Exchange {
5225
5227
  * @method
5226
5228
  * @name mexc#withdraw
5227
5229
  * @description make a withdrawal
5228
- * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw
5230
+ * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-new
5229
5231
  * @param {string} code unified currency code
5230
5232
  * @param {float} amount the amount to withdraw
5231
5233
  * @param {string} address the address to withdraw to
@@ -5235,7 +5237,7 @@ export default class mexc extends Exchange {
5235
5237
  */
5236
5238
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
5237
5239
  const networks = this.safeValue(this.options, 'networks', {});
5238
- let network = this.safeString2(params, 'network', 'chain'); // this line allows the user to specify either ERC20 or ETH
5240
+ let network = this.safeString2(params, 'network', 'netWork'); // this line allows the user to specify either ERC20 or ETH
5239
5241
  network = this.safeString(networks, network, network); // handle ETH > ERC-20 alias
5240
5242
  this.checkAddress(address);
5241
5243
  await this.loadMarkets();
@@ -5249,10 +5251,10 @@ export default class mexc extends Exchange {
5249
5251
  request['memo'] = tag;
5250
5252
  }
5251
5253
  if (network !== undefined) {
5252
- request['network'] = network;
5253
- params = this.omit(params, ['network', 'chain']);
5254
+ request['netWork'] = network;
5255
+ params = this.omit(params, ['network', 'netWork']);
5254
5256
  }
5255
- const response = await this.spotPrivatePostCapitalWithdrawApply(this.extend(request, params));
5257
+ const response = await this.spotPrivatePostCapitalWithdraw(this.extend(request, params));
5256
5258
  //
5257
5259
  // {
5258
5260
  // "id":"7213fea8e94b4a5593d507237e5a555b"
package/js/src/okx.js CHANGED
@@ -2461,6 +2461,7 @@ export default class okx extends Exchange {
2461
2461
  * @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-balance
2462
2462
  * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-balance
2463
2463
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2464
+ * @param {string} [params.type] wallet type, ['funding' or 'trading'] default is 'trading'
2464
2465
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
2465
2466
  */
2466
2467
  await this.loadMarkets();
@@ -0,0 +1,129 @@
1
+ import Exchange from './abstract/oxfun.js';
2
+ import type { Account, Balances, Currencies, Currency, Int, Market, Num, OHLCV, Order, OrderBook, OrderType, OrderSide, OrderRequest, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry } from './base/types.js';
3
+ /**
4
+ * @class oxfun
5
+ * @augments Exchange
6
+ */
7
+ export default class oxfun extends Exchange {
8
+ describe(): any;
9
+ fetchMarkets(params?: {}): Promise<Market[]>;
10
+ parseMarkets(markets: any): Market[];
11
+ parseMarket(market: any): Market;
12
+ fetchCurrencies(params?: {}): Promise<Currencies>;
13
+ fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
14
+ fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
15
+ parseTicker(ticker: any, market?: Market): Ticker;
16
+ fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
17
+ parseOHLCV(ohlcv: any, market?: Market): OHLCV;
18
+ fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
19
+ fetchFundingRates(symbols?: Strings, params?: {}): Promise<any>;
20
+ parseFundingRate(fundingRate: any, market?: Market): {
21
+ info: any;
22
+ symbol: string;
23
+ markPrice: any;
24
+ indexPrice: any;
25
+ interestRate: number;
26
+ estimatedSettlePrice: any;
27
+ timestamp: number;
28
+ datetime: string;
29
+ fundingRate: number;
30
+ fundingTimestamp: any;
31
+ fundingDatetime: any;
32
+ nextFundingRate: any;
33
+ nextFundingTimestamp: any;
34
+ nextFundingDatetime: any;
35
+ previousFundingRate: any;
36
+ previousFundingTimestamp: any;
37
+ previousFundingDatetime: any;
38
+ };
39
+ fetchFundingRateHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").FundingRateHistory[]>;
40
+ parseFundingRateHistory(info: any, market?: Market): {
41
+ info: any;
42
+ symbol: string;
43
+ fundingRate: number;
44
+ timestamp: number;
45
+ datetime: string;
46
+ };
47
+ fetchFundingHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").FundingHistory[]>;
48
+ parseIncome(income: any, market?: Market): {
49
+ info: any;
50
+ symbol: string;
51
+ code: string;
52
+ timestamp: number;
53
+ datetime: string;
54
+ id: string;
55
+ amount: number;
56
+ rate: number;
57
+ };
58
+ fetchLeverageTiers(symbols?: Strings, params?: {}): Promise<import("./base/types.js").LeverageTiers>;
59
+ parseMarketLeverageTiers(info: any, market?: Market): any[];
60
+ fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
61
+ fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
62
+ parseTrade(trade: any, market?: Market): Trade;
63
+ fetchBalance(params?: {}): Promise<Balances>;
64
+ parseBalance(balance: any): Balances;
65
+ fetchAccounts(params?: {}): Promise<Account[]>;
66
+ parseAccount(account: any): {
67
+ id: string;
68
+ type: any;
69
+ code: any;
70
+ info: any;
71
+ };
72
+ transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
73
+ fetchTransfers(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").TransferEntries>;
74
+ parseTransfer(transfer: any, currency?: Currency): {
75
+ id: string;
76
+ timestamp: number;
77
+ datetime: string;
78
+ currency: string;
79
+ amount: number;
80
+ fromAccount: string;
81
+ toAccount: string;
82
+ status: string;
83
+ info: any;
84
+ };
85
+ parseTransferStatus(status: any): string;
86
+ fetchDepositAddress(code: string, params?: {}): Promise<{
87
+ currency: string;
88
+ address: string;
89
+ tag: any;
90
+ network: any;
91
+ info: any;
92
+ }>;
93
+ parseDepositAddress(depositAddress: any, currency?: Currency): {
94
+ currency: string;
95
+ address: string;
96
+ tag: any;
97
+ network: any;
98
+ info: any;
99
+ };
100
+ fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
101
+ fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
102
+ parseTransactions(transactions: any, currency?: Currency, since?: Int, limit?: Int, params?: {}): Transaction[];
103
+ parseTransaction(transaction: any, currency?: Currency): Transaction;
104
+ parseDepositStatus(status: any): string;
105
+ parseWithdrawalStatus(status: any): string;
106
+ withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
107
+ fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
108
+ parsePosition(position: any, market?: Market): import("./base/types.js").Position;
109
+ createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
110
+ createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
111
+ createOrderRequest(symbol: string, type: string, side: string, amount: any, price?: any, params?: {}): any;
112
+ createMarketBuyOrderWithCost(symbol: string, cost: number, params?: {}): Promise<Order>;
113
+ fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
114
+ fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
115
+ cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
116
+ cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
117
+ cancelOrders(ids: string[], symbol?: Str, params?: {}): Promise<Order[]>;
118
+ parseOrder(order: any, market?: Market): Order;
119
+ parseOrderStatus(status: any): string;
120
+ parseOrderType(type: any): string;
121
+ parseOrderTimeInForce(type: any): string;
122
+ sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
123
+ url: string;
124
+ method: string;
125
+ body: any;
126
+ headers: any;
127
+ };
128
+ handleErrors(code: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
129
+ }