ccxt 4.3.63 → 4.3.64

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/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/alpaca.js +1 -0
  5. package/dist/cjs/src/base/Exchange.js +3 -3
  6. package/dist/cjs/src/bingx.js +88 -0
  7. package/dist/cjs/src/bitfinex.js +1 -1
  8. package/dist/cjs/src/bitfinex2.js +1 -1
  9. package/dist/cjs/src/independentreserve.js +107 -0
  10. package/dist/cjs/src/kucoin.js +2 -0
  11. package/dist/cjs/src/pro/bitmart.js +3 -3
  12. package/dist/cjs/src/pro/gate.js +1 -1
  13. package/dist/cjs/src/pro/gemini.js +4 -2
  14. package/dist/cjs/src/pro/onetrading.js +3 -2
  15. package/dist/cjs/src/pro/vertex.js +3 -2
  16. package/dist/cjs/src/pro/woo.js +2 -1
  17. package/dist/cjs/src/pro/woofipro.js +2 -1
  18. package/dist/cjs/src/woo.js +31 -0
  19. package/js/ccxt.d.ts +1 -1
  20. package/js/ccxt.js +1 -1
  21. package/js/src/abstract/kucoin.d.ts +1 -0
  22. package/js/src/abstract/kucoinfutures.d.ts +1 -0
  23. package/js/src/alpaca.js +1 -0
  24. package/js/src/base/Exchange.js +3 -3
  25. package/js/src/bingx.d.ts +3 -1
  26. package/js/src/bingx.js +88 -0
  27. package/js/src/bitfinex.js +1 -1
  28. package/js/src/bitfinex2.js +1 -1
  29. package/js/src/independentreserve.d.ts +3 -1
  30. package/js/src/independentreserve.js +106 -0
  31. package/js/src/kucoin.js +2 -0
  32. package/js/src/pro/bitmart.js +3 -3
  33. package/js/src/pro/gate.js +1 -1
  34. package/js/src/pro/gemini.js +4 -2
  35. package/js/src/pro/onetrading.js +3 -2
  36. package/js/src/pro/vertex.js +3 -2
  37. package/js/src/pro/woo.js +2 -1
  38. package/js/src/pro/woofipro.js +2 -1
  39. package/js/src/whitebit.d.ts +1 -1
  40. package/js/src/woo.d.ts +2 -2
  41. package/js/src/woo.js +31 -0
  42. package/js/src/zonda.d.ts +1 -1
  43. package/package.json +1 -1
package/js/src/bingx.js CHANGED
@@ -83,6 +83,7 @@ export default class bingx extends Exchange {
83
83
  'fetchTickers': true,
84
84
  'fetchTime': true,
85
85
  'fetchTrades': true,
86
+ 'fetchTradingFee': true,
86
87
  'fetchTransfers': true,
87
88
  'fetchWithdrawals': true,
88
89
  'reduceMargin': true,
@@ -5351,6 +5352,93 @@ export default class bingx extends Exchange {
5351
5352
  'marginMode': marginType,
5352
5353
  };
5353
5354
  }
5355
+ async fetchTradingFee(symbol, params = {}) {
5356
+ /**
5357
+ * @method
5358
+ * @name bingx#fetchTradingFee
5359
+ * @description fetch the trading fees for a market
5360
+ * @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20Trading%20Commission%20Rate
5361
+ * @see https://bingx-api.github.io/docs/#/en-us/swapV2/account-api.html#Query%20Trading%20Commission%20Rate
5362
+ * @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Trade%20Commission%20Rate
5363
+ * @param {string} symbol unified market symbol
5364
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5365
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
5366
+ */
5367
+ await this.loadMarkets();
5368
+ const market = this.market(symbol);
5369
+ const request = {
5370
+ 'symbol': market['id'],
5371
+ };
5372
+ let response = undefined;
5373
+ let commission = {};
5374
+ const data = this.safeDict(response, 'data', {});
5375
+ if (market['spot']) {
5376
+ response = await this.spotV1PrivateGetUserCommissionRate(this.extend(request, params));
5377
+ //
5378
+ // {
5379
+ // "code": 0,
5380
+ // "msg": "",
5381
+ // "debugMsg": "",
5382
+ // "data": {
5383
+ // "takerCommissionRate": 0.001,
5384
+ // "makerCommissionRate": 0.001
5385
+ // }
5386
+ // }
5387
+ //
5388
+ commission = data;
5389
+ }
5390
+ else {
5391
+ if (market['inverse']) {
5392
+ response = await this.cswapV1PrivateGetUserCommissionRate(params);
5393
+ //
5394
+ // {
5395
+ // "code": 0,
5396
+ // "msg": "",
5397
+ // "timestamp": 1721365261438,
5398
+ // "data": {
5399
+ // "takerCommissionRate": "0.0005",
5400
+ // "makerCommissionRate": "0.0002"
5401
+ // }
5402
+ // }
5403
+ //
5404
+ commission = data;
5405
+ }
5406
+ else {
5407
+ response = await this.swapV2PrivateGetUserCommissionRate(params);
5408
+ //
5409
+ // {
5410
+ // "code": 0,
5411
+ // "msg": "",
5412
+ // "data": {
5413
+ // "commission": {
5414
+ // "takerCommissionRate": 0.0005,
5415
+ // "makerCommissionRate": 0.0002
5416
+ // }
5417
+ // }
5418
+ // }
5419
+ //
5420
+ commission = this.safeDict(data, 'commission', {});
5421
+ }
5422
+ }
5423
+ return this.parseTradingFee(commission, market);
5424
+ }
5425
+ parseTradingFee(fee, market = undefined) {
5426
+ //
5427
+ // {
5428
+ // "takerCommissionRate": 0.001,
5429
+ // "makerCommissionRate": 0.001
5430
+ // }
5431
+ //
5432
+ const symbol = (market !== undefined) ? market['symbol'] : undefined;
5433
+ return {
5434
+ 'info': fee,
5435
+ 'symbol': symbol,
5436
+ 'maker': this.safeNumber(fee, 'makerCommissionRate'),
5437
+ 'taker': this.safeNumber(fee, 'takerCommissionRate'),
5438
+ 'percentage': false,
5439
+ 'tierBased': false,
5440
+ };
5441
+ }
5354
5442
  sign(path, section = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
5355
5443
  const type = section[0];
5356
5444
  const version = section[1];
@@ -1641,7 +1641,7 @@ export default class bitfinex extends Exchange {
1641
1641
  // ]
1642
1642
  //
1643
1643
  const response = this.safeValue(responses, 0, {});
1644
- const id = this.safeNumber(response, 'withdrawal_id');
1644
+ const id = this.safeInteger(response, 'withdrawal_id');
1645
1645
  const message = this.safeString(response, 'message');
1646
1646
  const errorMessage = this.findBroadlyMatchedKey(this.exceptions['broad'], message);
1647
1647
  if (id === 0) {
@@ -2360,7 +2360,7 @@ export default class bitfinex2 extends Exchange {
2360
2360
  feeCost = Precise.stringAbs(feeCost);
2361
2361
  }
2362
2362
  amount = this.safeNumber(data, 5);
2363
- id = this.safeString(data, 0);
2363
+ id = this.safeInteger(data, 0);
2364
2364
  status = 'ok';
2365
2365
  if (id === 0) {
2366
2366
  id = undefined;
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/independentreserve.js';
2
- import type { Balances, Currency, Dict, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees } from './base/types.js';
2
+ import type { Balances, Currency, Dict, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees, Transaction } from './base/types.js';
3
3
  /**
4
4
  * @class independentreserve
5
5
  * @augments Exchange
@@ -37,6 +37,8 @@ export default class independentreserve extends Exchange {
37
37
  tag: string;
38
38
  network: any;
39
39
  };
40
+ withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
41
+ parseTransaction(transaction: Dict, currency?: Currency): Transaction;
40
42
  sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
41
43
  url: string;
42
44
  method: string;
@@ -9,6 +9,7 @@ import Exchange from './abstract/independentreserve.js';
9
9
  import { Precise } from './base/Precise.js';
10
10
  import { TICK_SIZE } from './base/functions/number.js';
11
11
  import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
12
+ import { BadRequest } from '../ccxt.js';
12
13
  // ---------------------------------------------------------------------------
13
14
  /**
14
15
  * @class independentreserve
@@ -80,6 +81,7 @@ export default class independentreserve extends Exchange {
80
81
  'setLeverage': false,
81
82
  'setMarginMode': false,
82
83
  'setPositionMode': false,
84
+ 'withdraw': true,
83
85
  },
84
86
  'urls': {
85
87
  'logo': 'https://user-images.githubusercontent.com/51840849/87182090-1e9e9080-c2ec-11ea-8e49-563db9a38f37.jpg',
@@ -806,6 +808,110 @@ export default class independentreserve extends Exchange {
806
808
  'network': undefined,
807
809
  };
808
810
  }
811
+ async withdraw(code, amount, address, tag = undefined, params = {}) {
812
+ /**
813
+ * @method
814
+ * @name independentreserve#withdraw
815
+ * @description make a withdrawal
816
+ * @see https://www.independentreserve.com/features/api#WithdrawDigitalCurrency
817
+ * @param {string} code unified currency code
818
+ * @param {float} amount the amount to withdraw
819
+ * @param {string} address the address to withdraw to
820
+ * @param {string} tag
821
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
822
+ *
823
+ * EXCHANGE SPECIFIC PARAMETERS
824
+ * @param {object} [params.comment] withdrawal comment, should not exceed 500 characters
825
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
826
+ */
827
+ [tag, params] = this.handleWithdrawTagAndParams(tag, params);
828
+ await this.loadMarkets();
829
+ const currency = this.currency(code);
830
+ const request = {
831
+ 'primaryCurrencyCode': currency['id'],
832
+ 'withdrawalAddress': address,
833
+ 'amount': this.currencyToPrecision(code, amount),
834
+ };
835
+ if (tag !== undefined) {
836
+ request['destinationTag'] = tag;
837
+ }
838
+ let networkCode = undefined;
839
+ [networkCode, params] = this.handleNetworkCodeAndParams(params);
840
+ if (networkCode !== undefined) {
841
+ throw new BadRequest(this.id + ' withdraw () does not accept params["networkCode"]');
842
+ }
843
+ const response = await this.privatePostWithdrawDigitalCurrency(this.extend(request, params));
844
+ //
845
+ // {
846
+ // "TransactionGuid": "dc932e19-562b-4c50-821e-a73fd048b93b",
847
+ // "PrimaryCurrencyCode": "Bch",
848
+ // "CreatedTimestampUtc": "2020-04-01T05:26:30.5093622+00:00",
849
+ // "Amount": {
850
+ // "Total": 0.1231,
851
+ // "Fee": 0.0001
852
+ // },
853
+ // "Destination": {
854
+ // "Address": "bc1qhpqxkjpvgkckw530yfmxyr53c94q8f4273a7ez",
855
+ // "Tag": null
856
+ // },
857
+ // "Status": "Pending",
858
+ // "Transaction": null
859
+ // }
860
+ //
861
+ return this.parseTransaction(response, currency);
862
+ }
863
+ parseTransaction(transaction, currency = undefined) {
864
+ //
865
+ // {
866
+ // "TransactionGuid": "dc932e19-562b-4c50-821e-a73fd048b93b",
867
+ // "PrimaryCurrencyCode": "Bch",
868
+ // "CreatedTimestampUtc": "2020-04-01T05:26:30.5093622+00:00",
869
+ // "Amount": {
870
+ // "Total": 0.1231,
871
+ // "Fee": 0.0001
872
+ // },
873
+ // "Destination": {
874
+ // "Address": "bc1qhpqxkjpvgkckw530yfmxyr53c94q8f4273a7ez",
875
+ // "Tag": null
876
+ // },
877
+ // "Status": "Pending",
878
+ // "Transaction": null
879
+ // }
880
+ //
881
+ const amount = this.safeDict(transaction, 'Amount');
882
+ const destination = this.safeDict(transaction, 'Destination');
883
+ const currencyId = this.safeString(transaction, 'PrimaryCurrencyCode');
884
+ const datetime = this.safeString(transaction, 'CreatedTimestampUtc');
885
+ const address = this.safeString(destination, 'Address');
886
+ const tag = this.safeString(destination, 'Tag');
887
+ const code = this.safeCurrencyCode(currencyId, currency);
888
+ return {
889
+ 'info': transaction,
890
+ 'id': this.safeString(transaction, 'TransactionGuid'),
891
+ 'txid': undefined,
892
+ 'type': 'withdraw',
893
+ 'currency': code,
894
+ 'network': undefined,
895
+ 'amount': this.safeNumber(amount, 'Total'),
896
+ 'status': this.safeString(transaction, 'Status'),
897
+ 'timestamp': this.parse8601(datetime),
898
+ 'datetime': datetime,
899
+ 'address': address,
900
+ 'addressFrom': undefined,
901
+ 'addressTo': address,
902
+ 'tag': tag,
903
+ 'tagFrom': undefined,
904
+ 'tagTo': tag,
905
+ 'updated': undefined,
906
+ 'comment': undefined,
907
+ 'fee': {
908
+ 'currency': code,
909
+ 'cost': this.safeNumber(amount, 'Fee'),
910
+ 'rate': undefined,
911
+ },
912
+ 'internal': false,
913
+ };
914
+ }
809
915
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
810
916
  let url = this.urls['api'][api] + '/' + path;
811
917
  if (api === 'public') {
package/js/src/kucoin.js CHANGED
@@ -162,6 +162,7 @@ export default class kucoin extends Exchange {
162
162
  'status': 4.5,
163
163
  // margin trading
164
164
  'mark-price/{symbol}/current': 3,
165
+ 'mark-price/all-symbols': 3,
165
166
  'margin/config': 25, // 25SW
166
167
  },
167
168
  'post': {
@@ -647,6 +648,7 @@ export default class kucoin extends Exchange {
647
648
  'currencies': 'v3',
648
649
  'currencies/{currency}': 'v3',
649
650
  'symbols': 'v2',
651
+ 'mark-price/all-symbols': 'v3',
650
652
  },
651
653
  },
652
654
  'private': {
@@ -757,8 +757,8 @@ export default class bitmart extends bitmartRest {
757
757
  const symbol = market['symbol'];
758
758
  const openTimestamp = this.safeInteger(position, 'create_time');
759
759
  const timestamp = this.safeInteger(position, 'update_time');
760
- const side = this.safeNumber(position, 'position_type');
761
- const marginModeId = this.safeNumber(position, 'open_type');
760
+ const side = this.safeInteger(position, 'position_type');
761
+ const marginModeId = this.safeInteger(position, 'open_type');
762
762
  return this.safePosition({
763
763
  'info': position,
764
764
  'id': undefined,
@@ -1322,7 +1322,7 @@ export default class bitmart extends bitmartRest {
1322
1322
  this.orderbooks[symbol] = ob;
1323
1323
  }
1324
1324
  const orderbook = this.orderbooks[symbol];
1325
- const way = this.safeNumber(data, 'way');
1325
+ const way = this.safeInteger(data, 'way');
1326
1326
  const side = (way === 1) ? 'bids' : 'asks';
1327
1327
  if (way === 1) {
1328
1328
  orderbook[side] = new Bids([], limit);
@@ -1289,7 +1289,7 @@ export default class gate extends gateRest {
1289
1289
  else if (event === 'finish') {
1290
1290
  const status = this.safeString(parsed, 'status');
1291
1291
  if (status === undefined) {
1292
- const left = this.safeNumber(info, 'left');
1292
+ const left = this.safeInteger(info, 'left');
1293
1293
  parsed['status'] = (left === 0) ? 'closed' : 'canceled';
1294
1294
  }
1295
1295
  }
@@ -9,6 +9,7 @@ import geminiRest from '../gemini.js';
9
9
  import { ArrayCache, ArrayCacheBySymbolById, ArrayCacheByTimestamp } from '../base/ws/Cache.js';
10
10
  import { ExchangeError, NotSupported } from '../base/errors.js';
11
11
  import { sha384 } from '../static_dependencies/noble-hashes/sha512.js';
12
+ import Precise from '../base/Precise.js';
12
13
  // ---------------------------------------------------------------------------
13
14
  export default class gemini extends geminiRest {
14
15
  describe() {
@@ -473,10 +474,11 @@ export default class gemini extends geminiRest {
473
474
  const entry = rawBidAskChanges[i];
474
475
  const rawSide = this.safeString(entry, 'side');
475
476
  const price = this.safeNumber(entry, 'price');
476
- const size = this.safeNumber(entry, 'remaining');
477
- if (size === 0) {
477
+ const sizeString = this.safeString(entry, 'remaining');
478
+ if (Precise.stringEq(sizeString, '0')) {
478
479
  continue;
479
480
  }
481
+ const size = this.parseNumber(sizeString);
480
482
  if (rawSide === 'bid') {
481
483
  currentBidAsk['bid'] = price;
482
484
  currentBidAsk['bidVolume'] = size;
@@ -8,6 +8,7 @@
8
8
  import onetradingRest from '../onetrading.js';
9
9
  import { NotSupported, ExchangeError } from '../base/errors.js';
10
10
  import { ArrayCacheBySymbolById, ArrayCacheByTimestamp } from '../base/ws/Cache.js';
11
+ import Precise from '../base/Precise.js';
11
12
  // ---------------------------------------------------------------------------
12
13
  export default class onetrading extends onetradingRest {
13
14
  describe() {
@@ -965,9 +966,9 @@ export default class onetrading extends onetradingRest {
965
966
  const previousOrderArray = this.filterByArray(this.orders, 'id', orderId, false);
966
967
  const previousOrder = this.safeValue(previousOrderArray, 0, {});
967
968
  symbol = previousOrder['symbol'];
968
- const filled = this.safeNumber(update, 'filled_amount');
969
+ const filled = this.safeString(update, 'filled_amount');
969
970
  let status = this.parseWsOrderStatus(updateType);
970
- if (updateType === 'ORDER_CLOSED' && filled === 0) {
971
+ if (updateType === 'ORDER_CLOSED' && Precise.stringEq(filled, '0')) {
971
972
  status = 'canceled';
972
973
  }
973
974
  const orderObject = {
@@ -845,9 +845,10 @@ export default class vertex extends vertexRest {
845
845
  //
846
846
  const marketId = this.safeString(order, 'product_id');
847
847
  const timestamp = this.parseToInt(Precise.stringDiv(this.safeString(order, 'timestamp'), '1000000'));
848
- const remaining = this.parseToNumeric(this.convertFromX18(this.safeString(order, 'amount')));
848
+ const remainingString = this.convertFromX18(this.safeString(order, 'amount'));
849
+ const remaining = this.parseToNumeric(remainingString);
849
850
  let status = this.parseWsOrderStatus(this.safeString(order, 'reason'));
850
- if (remaining === 0 && status === 'open') {
851
+ if (Precise.stringEq(remainingString, '0') && status === 'open') {
851
852
  status = 'closed';
852
853
  }
853
854
  market = this.safeMarket(marketId, market);
package/js/src/pro/woo.js CHANGED
@@ -665,9 +665,10 @@ export default class woo extends wooRest {
665
665
  'cost': this.safeString(order, 'totalFee'),
666
666
  'currency': this.safeString(order, 'feeAsset'),
667
667
  };
668
+ const priceString = this.safeString(order, 'price');
668
669
  let price = this.safeNumber(order, 'price');
669
670
  const avgPrice = this.safeNumber(order, 'avgPrice');
670
- if ((price === 0) && (avgPrice !== undefined)) {
671
+ if (Precise.stringEq(priceString, '0') && (avgPrice !== undefined)) {
671
672
  price = avgPrice;
672
673
  }
673
674
  const amount = this.safeFloat(order, 'quantity');
@@ -717,9 +717,10 @@ export default class woofipro extends woofiproRest {
717
717
  'cost': this.safeString(order, 'totalFee'),
718
718
  'currency': this.safeString(order, 'feeAsset'),
719
719
  };
720
+ const priceString = this.safeString(order, 'price');
720
721
  let price = this.safeNumber(order, 'price');
721
722
  const avgPrice = this.safeNumber(order, 'avgPrice');
722
- if ((price === 0) && (avgPrice !== undefined)) {
723
+ if (Precise.stringEq(priceString, '0') && (avgPrice !== undefined)) {
723
724
  price = avgPrice;
724
725
  }
725
726
  const amount = this.safeString(order, 'quantity');
@@ -96,7 +96,7 @@ export default class whitebit extends Exchange {
96
96
  previousFundingDatetime: any;
97
97
  };
98
98
  fetchDepositsWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
99
- isFiat(currency: any): boolean;
99
+ isFiat(currency: string): boolean;
100
100
  nonce(): number;
101
101
  sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
102
102
  url: string;
package/js/src/woo.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/woo.js';
2
- import type { TransferEntry, Balances, Conversion, Currency, FundingRateHistory, Int, Market, MarginModification, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Dict, Strings, Trade, Transaction, Leverage, Account, Currencies, TradingFees, TransferEntries, int } from './base/types.js';
2
+ import type { TransferEntry, Balances, Conversion, Currency, FundingRateHistory, Int, Market, MarginModification, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Dict, Strings, Trade, Transaction, Leverage, Account, Currencies, TradingFees, TransferEntries, int, FundingHistory } from './base/types.js';
3
3
  /**
4
4
  * @class woo
5
5
  * @augments Exchange
@@ -119,7 +119,7 @@ export default class woo extends Exchange {
119
119
  amount: number;
120
120
  rate: number;
121
121
  };
122
- fetchFundingHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").FundingHistory[]>;
122
+ fetchFundingHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingHistory[]>;
123
123
  parseFundingRate(fundingRate: any, market?: Market): {
124
124
  info: any;
125
125
  symbol: string;
package/js/src/woo.js CHANGED
@@ -2674,7 +2674,24 @@ export default class woo extends Exchange {
2674
2674
  };
2675
2675
  }
2676
2676
  async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
2677
+ /**
2678
+ * @method
2679
+ * @name woo#fetchFundingHistory
2680
+ * @description fetch the history of funding payments paid and received on this account
2681
+ * @see https://docs.woo.org/#get-funding-fee-history
2682
+ * @param {string} [symbol] unified market symbol
2683
+ * @param {int} [since] the earliest time in ms to fetch funding history for
2684
+ * @param {int} [limit] the maximum number of funding history structures to retrieve
2685
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2686
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
2687
+ * @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
2688
+ */
2677
2689
  await this.loadMarkets();
2690
+ let paginate = false;
2691
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchFundingHistory', 'paginate');
2692
+ if (paginate) {
2693
+ return await this.fetchPaginatedCallCursor('fetchFundingHistory', symbol, since, limit, params, 'page', 'page', 1, 500);
2694
+ }
2678
2695
  const request = {};
2679
2696
  let market = undefined;
2680
2697
  if (symbol !== undefined) {
@@ -2684,6 +2701,12 @@ export default class woo extends Exchange {
2684
2701
  if (since !== undefined) {
2685
2702
  request['start_t'] = since;
2686
2703
  }
2704
+ if (limit !== undefined) {
2705
+ request['size'] = limit;
2706
+ }
2707
+ else {
2708
+ request['size'] = 5000;
2709
+ }
2687
2710
  const response = await this.v1PrivateGetFundingFeeHistory(this.extend(request, params));
2688
2711
  //
2689
2712
  // {
@@ -2708,7 +2731,15 @@ export default class woo extends Exchange {
2708
2731
  // "success":true
2709
2732
  // }
2710
2733
  //
2734
+ const meta = this.safeDict(response, 'meta', {});
2735
+ const cursor = this.safeInteger(meta, 'current_page');
2711
2736
  const result = this.safeList(response, 'rows', []);
2737
+ const resultLength = result.length;
2738
+ if (resultLength > 0) {
2739
+ const lastItem = result[resultLength - 1];
2740
+ lastItem['page'] = cursor;
2741
+ result[resultLength - 1] = lastItem;
2742
+ }
2712
2743
  return this.parseIncomes(result, market, since, limit);
2713
2744
  }
2714
2745
  parseFundingRate(fundingRate, market = undefined) {
package/js/src/zonda.d.ts CHANGED
@@ -42,7 +42,7 @@ export default class zonda extends Exchange {
42
42
  fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
43
43
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
44
44
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
45
- isFiat(currency: any): boolean;
45
+ isFiat(currency: string): boolean;
46
46
  parseDepositAddress(depositAddress: any, currency?: Currency): {
47
47
  currency: string;
48
48
  address: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.3.63",
3
+ "version": "4.3.64",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.min.js",
6
6
  "type": "module",