ccxt 4.2.30 → 4.2.31

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.
@@ -41,6 +41,9 @@ class bitforex extends bitforex$1 {
41
41
  'fetchClosedOrders': true,
42
42
  'fetchCrossBorrowRate': false,
43
43
  'fetchCrossBorrowRates': false,
44
+ 'fetchDepositAddress': false,
45
+ 'fetchDepositAddresses': false,
46
+ 'fetchDepositAddressesByNetwork': false,
44
47
  'fetchFundingHistory': false,
45
48
  'fetchFundingRate': false,
46
49
  'fetchFundingRateHistory': false,
@@ -204,6 +204,13 @@ class coinbase extends coinbase$1 {
204
204
  'brokerage/best_bid_ask',
205
205
  'brokerage/convert/trade/{trade_id}',
206
206
  'brokerage/time',
207
+ 'brokerage/cfm/balance_summary',
208
+ 'brokerage/cfm/positions',
209
+ 'brokerage/cfm/positions/{product_id}',
210
+ 'brokerage/cfm/sweeps',
211
+ 'brokerage/intx/portfolio/{portfolio_uuid}',
212
+ 'brokerage/intx/positions/{portfolio_uuid}',
213
+ 'brokerage/intx/positions/{portfolio_uuid}/{symbol}',
207
214
  ],
208
215
  'post': [
209
216
  'brokerage/orders',
@@ -214,12 +221,15 @@ class coinbase extends coinbase$1 {
214
221
  'brokerage/portfolios/move_funds',
215
222
  'brokerage/convert/quote',
216
223
  'brokerage/convert/trade/{trade_id}',
224
+ 'brokerage/cfm/sweeps/schedule',
225
+ 'brokerage/intx/allocate',
217
226
  ],
218
227
  'put': [
219
228
  'brokerage/portfolios/{portfolio_uuid}',
220
229
  ],
221
230
  'delete': [
222
231
  'brokerage/portfolios/{portfolio_uuid}',
232
+ 'brokerage/cfm/sweeps',
223
233
  ],
224
234
  },
225
235
  },
@@ -1343,6 +1343,7 @@ class deribit extends deribit$1 {
1343
1343
  request['end_timestamp'] = now;
1344
1344
  }
1345
1345
  else {
1346
+ since = Math.max(since - 1, 0);
1346
1347
  request['start_timestamp'] = since;
1347
1348
  if (limit === undefined) {
1348
1349
  request['end_timestamp'] = now;
@@ -5009,7 +5009,7 @@ class htx extends htx$1 {
5009
5009
  const marketId = this.safeString2(order, 'contract_code', 'symbol');
5010
5010
  market = this.safeMarket(marketId, market);
5011
5011
  const timestamp = this.safeIntegerN(order, ['created_at', 'created-at', 'create_date']);
5012
- const clientOrderId = this.safeString2(order, 'client_order_id', 'client-order-id');
5012
+ const clientOrderId = this.safeString2(order, 'client_order_id', 'client-or' + 'der-id'); // transpiler regex trick for php issue
5013
5013
  let cost = undefined;
5014
5014
  let amount = undefined;
5015
5015
  if ((type !== undefined) && (type.indexOf('market') >= 0)) {
@@ -975,7 +975,9 @@ class kraken extends kraken$1 {
975
975
  request['interval'] = timeframe;
976
976
  }
977
977
  if (since !== undefined) {
978
- request['since'] = this.parseToInt((since - 1) / 1000);
978
+ // contrary to kraken's api documentation, the since parameter must be passed in nanoseconds
979
+ // the adding of '000000' is copied from the fetchTrades function
980
+ request['since'] = this.numberToString(since) + '000000'; // expected to be in nanoseconds
979
981
  }
980
982
  const response = await this.publicGetOHLC(this.extend(request, params));
981
983
  //
@@ -42,6 +42,9 @@ class krakenfutures extends krakenfutures$1 {
42
42
  'fetchClosedOrders': undefined,
43
43
  'fetchCrossBorrowRate': false,
44
44
  'fetchCrossBorrowRates': false,
45
+ 'fetchDepositAddress': false,
46
+ 'fetchDepositAddresses': false,
47
+ 'fetchDepositAddressesByNetwork': false,
45
48
  'fetchFundingHistory': undefined,
46
49
  'fetchFundingRate': 'emulated',
47
50
  'fetchFundingRateHistory': true,
@@ -11,7 +11,7 @@ var rsa = require('./base/functions/rsa.js');
11
11
  // ---------------------------------------------------------------------------
12
12
  // ---------------------------------------------------------------------------
13
13
  /**
14
- * @class lbank2
14
+ * @class lbank
15
15
  * @augments Exchange
16
16
  */
17
17
  class lbank extends lbank$1 {
@@ -49,6 +49,7 @@ class lbank extends lbank$1 {
49
49
  'fetchClosedOrders': false,
50
50
  'fetchCrossBorrowRate': false,
51
51
  'fetchCrossBorrowRates': false,
52
+ 'fetchDepositAddress': true,
52
53
  'fetchDepositWithdrawFee': 'emulated',
53
54
  'fetchDepositWithdrawFees': true,
54
55
  'fetchFundingHistory': false,
@@ -297,7 +298,7 @@ class lbank extends lbank$1 {
297
298
  async fetchTime(params = {}) {
298
299
  /**
299
300
  * @method
300
- * @name lbank2#fetchTime
301
+ * @name lbank#fetchTime
301
302
  * @description fetches the current integer timestamp in milliseconds from the exchange server
302
303
  * @see https://www.lbank.com/en-US/docs/index.html#get-timestamp
303
304
  * @see https://www.lbank.com/en-US/docs/contract.html#get-the-current-time
@@ -338,8 +339,8 @@ class lbank extends lbank$1 {
338
339
  async fetchMarkets(params = {}) {
339
340
  /**
340
341
  * @method
341
- * @name lbank2#fetchMarkets
342
- * @description retrieves data on all markets for lbank2
342
+ * @name lbank#fetchMarkets
343
+ * @description retrieves data on all markets for lbank
343
344
  * @see https://www.lbank.com/en-US/docs/index.html#trading-pairs
344
345
  * @see https://www.lbank.com/en-US/docs/contract.html#query-contract-information-list
345
346
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -592,7 +593,7 @@ class lbank extends lbank$1 {
592
593
  async fetchTicker(symbol, params = {}) {
593
594
  /**
594
595
  * @method
595
- * @name lbank2#fetchTicker
596
+ * @name lbank#fetchTicker
596
597
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
597
598
  * @see https://www.lbank.com/en-US/docs/index.html#query-current-market-data-new
598
599
  * @param {string} symbol unified symbol of the market to fetch the ticker for
@@ -637,7 +638,7 @@ class lbank extends lbank$1 {
637
638
  async fetchTickers(symbols = undefined, params = {}) {
638
639
  /**
639
640
  * @method
640
- * @name lbank2#fetchTickers
641
+ * @name lbank#fetchTickers
641
642
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
642
643
  * @see https://www.lbank.com/en-US/docs/index.html#query-current-market-data-new
643
644
  * @see https://www.lbank.com/en-US/docs/contract.html#query-contract-market-list
@@ -717,7 +718,7 @@ class lbank extends lbank$1 {
717
718
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
718
719
  /**
719
720
  * @method
720
- * @name lbank2#fetchOrderBook
721
+ * @name lbank#fetchOrderBook
721
722
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
722
723
  * @see https://www.lbank.com/en-US/docs/index.html#query-market-depth
723
724
  * @see https://www.lbank.com/en-US/docs/contract.html#get-handicap
@@ -906,7 +907,7 @@ class lbank extends lbank$1 {
906
907
  async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
907
908
  /**
908
909
  * @method
909
- * @name lbank2#fetchTrades
910
+ * @name lbank#fetchTrades
910
911
  * @description get the list of most recent trades for a particular symbol
911
912
  * @see https://www.lbank.com/en-US/docs/index.html#query-historical-transactions
912
913
  * @see https://www.lbank.com/en-US/docs/index.html#recent-transactions-list
@@ -983,7 +984,7 @@ class lbank extends lbank$1 {
983
984
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
984
985
  /**
985
986
  * @method
986
- * @name lbank2#fetchOHLCV
987
+ * @name lbank#fetchOHLCV
987
988
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
988
989
  * @see https://www.lbank.com/en-US/docs/index.html#query-k-bar-data
989
990
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
@@ -1168,7 +1169,7 @@ class lbank extends lbank$1 {
1168
1169
  async fetchBalance(params = {}) {
1169
1170
  /**
1170
1171
  * @method
1171
- * @name lbank2#fetchBalance
1172
+ * @name lbank#fetchBalance
1172
1173
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
1173
1174
  * @see https://www.lbank.com/en-US/docs/index.html#asset-information
1174
1175
  * @see https://www.lbank.com/en-US/docs/index.html#account-information
@@ -1242,7 +1243,7 @@ class lbank extends lbank$1 {
1242
1243
  async fetchTradingFee(symbol, params = {}) {
1243
1244
  /**
1244
1245
  * @method
1245
- * @name lbank2#fetchTradingFee
1246
+ * @name lbank#fetchTradingFee
1246
1247
  * @description fetch the trading fees for a market
1247
1248
  * @see https://www.lbank.com/en-US/docs/index.html#transaction-fee-rate-query
1248
1249
  * @param {string} symbol unified market symbol
@@ -1256,7 +1257,7 @@ class lbank extends lbank$1 {
1256
1257
  async fetchTradingFees(params = {}) {
1257
1258
  /**
1258
1259
  * @method
1259
- * @name lbank2#fetchTradingFees
1260
+ * @name lbank#fetchTradingFees
1260
1261
  * @description fetch the trading fees for multiple markets
1261
1262
  * @see https://www.lbank.com/en-US/docs/index.html#transaction-fee-rate-query
1262
1263
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1297,7 +1298,7 @@ class lbank extends lbank$1 {
1297
1298
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
1298
1299
  /**
1299
1300
  * @method
1300
- * @name lbank2#createOrder
1301
+ * @name lbank#createOrder
1301
1302
  * @description create a trade order
1302
1303
  * @see https://www.lbank.com/en-US/docs/index.html#place-order
1303
1304
  * @see https://www.lbank.com/en-US/docs/index.html#place-an-order
@@ -1541,7 +1542,7 @@ class lbank extends lbank$1 {
1541
1542
  async fetchOrder(id, symbol = undefined, params = {}) {
1542
1543
  /**
1543
1544
  * @method
1544
- * @name lbank2#fetchOrder
1545
+ * @name lbank#fetchOrder
1545
1546
  * @description fetches information on an order made by the user
1546
1547
  * @see https://www.lbank.com/en-US/docs/index.html#query-order
1547
1548
  * @see https://www.lbank.com/en-US/docs/index.html#query-order-new
@@ -1645,7 +1646,7 @@ class lbank extends lbank$1 {
1645
1646
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1646
1647
  /**
1647
1648
  * @method
1648
- * @name lbank2#fetchMyTrades
1649
+ * @name lbank#fetchMyTrades
1649
1650
  * @description fetch all trades made by the user
1650
1651
  * @see https://www.lbank.com/en-US/docs/index.html#past-transaction-details
1651
1652
  * @param {string} symbol unified market symbol
@@ -1704,7 +1705,7 @@ class lbank extends lbank$1 {
1704
1705
  async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1705
1706
  /**
1706
1707
  * @method
1707
- * @name lbank2#fetchOrders
1708
+ * @name lbank#fetchOrders
1708
1709
  * @description fetches information on multiple orders made by the user
1709
1710
  * @see https://www.lbank.com/en-US/docs/index.html#query-all-orders
1710
1711
  * @param {string} symbol unified market symbol of the market orders were made in
@@ -1764,7 +1765,7 @@ class lbank extends lbank$1 {
1764
1765
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1765
1766
  /**
1766
1767
  * @method
1767
- * @name lbank2#fetchOpenOrders
1768
+ * @name lbank#fetchOpenOrders
1768
1769
  * @description fetch all unfilled currently open orders
1769
1770
  * @see https://www.lbank.com/en-US/docs/index.html#current-pending-order
1770
1771
  * @param {string} symbol unified market symbol
@@ -1821,7 +1822,7 @@ class lbank extends lbank$1 {
1821
1822
  async cancelOrder(id, symbol = undefined, params = {}) {
1822
1823
  /**
1823
1824
  * @method
1824
- * @name lbank2#cancelOrder
1825
+ * @name lbank#cancelOrder
1825
1826
  * @description cancels an open order
1826
1827
  * @see https://www.lbank.com/en-US/docs/index.html#cancel-order-new
1827
1828
  * @param {string} id order id
@@ -1863,7 +1864,7 @@ class lbank extends lbank$1 {
1863
1864
  async cancelAllOrders(symbol = undefined, params = {}) {
1864
1865
  /**
1865
1866
  * @method
1866
- * @name lbank2#cancelAllOrders
1867
+ * @name lbank#cancelAllOrders
1867
1868
  * @description cancel all open orders in a market
1868
1869
  * @see https://www.lbank.com/en-US/docs/index.html#cancel-all-pending-orders-for-a-single-trading-pair
1869
1870
  * @param {string} symbol unified market symbol of the market to cancel orders in
@@ -1910,7 +1911,7 @@ class lbank extends lbank$1 {
1910
1911
  async fetchDepositAddress(code, params = {}) {
1911
1912
  /**
1912
1913
  * @method
1913
- * @name lbank2#fetchDepositAddress
1914
+ * @name lbank#fetchDepositAddress
1914
1915
  * @description fetch the deposit address for a currency associated with this account
1915
1916
  * @see https://www.lbank.com/en-US/docs/index.html#get-deposit-address
1916
1917
  * @see https://www.lbank.com/en-US/docs/index.html#the-user-obtains-the-deposit-address
@@ -2014,7 +2015,7 @@ class lbank extends lbank$1 {
2014
2015
  async withdraw(code, amount, address, tag = undefined, params = {}) {
2015
2016
  /**
2016
2017
  * @method
2017
- * @name lbank2#withdraw
2018
+ * @name lbank#withdraw
2018
2019
  * @description make a withdrawal
2019
2020
  * @see https://www.lbank.com/en-US/docs/index.html#withdrawal
2020
2021
  * @param {string} code unified currency code
@@ -2180,7 +2181,7 @@ class lbank extends lbank$1 {
2180
2181
  async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
2181
2182
  /**
2182
2183
  * @method
2183
- * @name lbank2#fetchDeposits
2184
+ * @name lbank#fetchDeposits
2184
2185
  * @description fetch all deposits made to an account
2185
2186
  * @see https://www.lbank.com/en-US/docs/index.html#get-recharge-history
2186
2187
  * @param {string} code unified currency code
@@ -2233,7 +2234,7 @@ class lbank extends lbank$1 {
2233
2234
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
2234
2235
  /**
2235
2236
  * @method
2236
- * @name lbank2#fetchWithdrawals
2237
+ * @name lbank#fetchWithdrawals
2237
2238
  * @description fetch all withdrawals made from an account
2238
2239
  * @see https://www.lbank.com/en-US/docs/index.html#get-withdrawal-history
2239
2240
  * @param {string} code unified currency code
@@ -2290,10 +2291,10 @@ class lbank extends lbank$1 {
2290
2291
  async fetchTransactionFees(codes = undefined, params = {}) {
2291
2292
  /**
2292
2293
  * @method
2293
- * @name lbank2#fetchTransactionFees
2294
+ * @name lbank#fetchTransactionFees
2294
2295
  * @deprecated
2295
2296
  * @description please use fetchDepositWithdrawFees instead
2296
- * @param {string[]|undefined} codes not used by lbank2 fetchTransactionFees ()
2297
+ * @param {string[]|undefined} codes not used by lbank fetchTransactionFees ()
2297
2298
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2298
2299
  * @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
2299
2300
  */
@@ -2439,7 +2440,7 @@ class lbank extends lbank$1 {
2439
2440
  async fetchDepositWithdrawFees(codes = undefined, params = {}) {
2440
2441
  /**
2441
2442
  * @method
2442
- * @name lbank2#fetchDepositWithdrawFees
2443
+ * @name lbank#fetchDepositWithdrawFees
2443
2444
  * @description when using private endpoint, only returns information for currencies with non-zero balance, use public method by specifying this.options['fetchDepositWithdrawFees']['method'] = 'fetchPublicDepositWithdrawFees'
2444
2445
  * @see https://www.lbank.com/en-US/docs/index.html#get-all-coins-information
2445
2446
  * @see https://www.lbank.com/en-US/docs/index.html#withdrawal-configurations
@@ -341,9 +341,11 @@ class okx extends okx$1 {
341
341
  'tradingBot/grid/sub-orders': 1,
342
342
  'tradingBot/grid/positions': 1,
343
343
  'tradingBot/grid/ai-param': 1,
344
- 'tradingBot/public/rsi-back-testing': 1,
344
+ 'tradingBot/signal/signals': 1,
345
345
  'tradingBot/signal/orders-algo-details': 1,
346
+ 'tradingBot/signal/orders-algo-history': 1,
346
347
  'tradingBot/signal/positions': 1,
348
+ 'tradingBot/signal/positions-history': 1,
347
349
  'tradingBot/signal/sub-orders': 1,
348
350
  'tradingBot/signal/event-history': 1,
349
351
  'tradingBot/recurring/orders-algo-pending': 1,
@@ -463,6 +465,15 @@ class okx extends okx$1 {
463
465
  'tradingBot/grid/compute-margin-balance': 1,
464
466
  'tradingBot/grid/margin-balance': 1,
465
467
  'tradingBot/grid/min-investment': 1,
468
+ 'tradingBot/signal/create-signal': 1,
469
+ 'tradingBot/signal/order-algo': 1,
470
+ 'tradingBot/signal/stop-order-algo': 1,
471
+ 'tradingBot/signal/margin-balance': 1,
472
+ 'tradingBot/signal/amendTPSL': 1,
473
+ 'tradingBot/signal/set-instruments': 1,
474
+ 'tradingBot/signal/close-position': 1,
475
+ 'tradingBot/signal/sub-order': 1,
476
+ 'tradingBot/signal/cancel-sub-order': 1,
466
477
  'tradingBot/recurring/order-algo': 1,
467
478
  'tradingBot/recurring/amend-order-algo': 1,
468
479
  'tradingBot/recurring/stop-order-algo': 1,
@@ -4203,10 +4214,13 @@ class okx extends okx$1 {
4203
4214
  market = this.market(symbol);
4204
4215
  request['instId'] = market['id'];
4205
4216
  }
4217
+ if (since !== undefined) {
4218
+ request['begin'] = since;
4219
+ }
4206
4220
  [request, params] = this.handleUntilOption('end', request, params);
4207
4221
  const [type, query] = this.handleMarketTypeAndParams('fetchMyTrades', market, params);
4208
4222
  request['instType'] = this.convertToInstrumentType(type);
4209
- if (limit !== undefined) {
4223
+ if ((limit !== undefined) && (since === undefined)) { // let limit = n, okx will return the n most recent results, instead of the n results after limit, so limit should only be sent when since is undefined
4210
4224
  request['limit'] = limit; // default 100, max 100
4211
4225
  }
4212
4226
  const response = await this.privateGetTradeFillsHistory(this.extend(request, query));
@@ -34,6 +34,9 @@ class poloniexfutures extends poloniexfutures$1 {
34
34
  'fetchBalance': true,
35
35
  'fetchClosedOrders': true,
36
36
  'fetchCurrencies': false,
37
+ 'fetchDepositAddress': false,
38
+ 'fetchDepositAddresses': false,
39
+ 'fetchDepositAddressesByNetwork': false,
37
40
  'fetchFundingRate': true,
38
41
  'fetchFundingRateHistory': false,
39
42
  'fetchL3OrderBook': true,
@@ -95,7 +95,7 @@ class timex extends timex$1 {
95
95
  'rest': 'https://plasma-relay-backend.timex.io',
96
96
  },
97
97
  'www': 'https://timex.io',
98
- 'doc': 'https://docs.timex.io',
98
+ 'doc': 'https://plasma-relay-backend.timex.io/swagger-ui/index.html',
99
99
  'referral': 'https://timex.io/?refcode=1x27vNkTbP1uwkCck',
100
100
  },
101
101
  'api': {
@@ -19,7 +19,7 @@ class whitebit extends whitebit$1 {
19
19
  'name': 'WhiteBit',
20
20
  'version': 'v4',
21
21
  'countries': ['EE'],
22
- 'rateLimit': 500,
22
+ 'rateLimit': 50,
23
23
  'pro': true,
24
24
  'has': {
25
25
  'CORS': undefined,
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.2.29";
7
+ declare const version = "4.2.30";
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.2.30';
41
+ const version = '4.2.31';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -61,6 +61,13 @@ interface Exchange {
61
61
  v3PrivateGetBrokerageBestBidAsk(params?: {}): Promise<implicitReturnType>;
62
62
  v3PrivateGetBrokerageConvertTradeTradeId(params?: {}): Promise<implicitReturnType>;
63
63
  v3PrivateGetBrokerageTime(params?: {}): Promise<implicitReturnType>;
64
+ v3PrivateGetBrokerageCfmBalanceSummary(params?: {}): Promise<implicitReturnType>;
65
+ v3PrivateGetBrokerageCfmPositions(params?: {}): Promise<implicitReturnType>;
66
+ v3PrivateGetBrokerageCfmPositionsProductId(params?: {}): Promise<implicitReturnType>;
67
+ v3PrivateGetBrokerageCfmSweeps(params?: {}): Promise<implicitReturnType>;
68
+ v3PrivateGetBrokerageIntxPortfolioPortfolioUuid(params?: {}): Promise<implicitReturnType>;
69
+ v3PrivateGetBrokerageIntxPositionsPortfolioUuid(params?: {}): Promise<implicitReturnType>;
70
+ v3PrivateGetBrokerageIntxPositionsPortfolioUuidSymbol(params?: {}): Promise<implicitReturnType>;
64
71
  v3PrivatePostBrokerageOrders(params?: {}): Promise<implicitReturnType>;
65
72
  v3PrivatePostBrokerageOrdersBatchCancel(params?: {}): Promise<implicitReturnType>;
66
73
  v3PrivatePostBrokerageOrdersEdit(params?: {}): Promise<implicitReturnType>;
@@ -69,8 +76,11 @@ interface Exchange {
69
76
  v3PrivatePostBrokeragePortfoliosMoveFunds(params?: {}): Promise<implicitReturnType>;
70
77
  v3PrivatePostBrokerageConvertQuote(params?: {}): Promise<implicitReturnType>;
71
78
  v3PrivatePostBrokerageConvertTradeTradeId(params?: {}): Promise<implicitReturnType>;
79
+ v3PrivatePostBrokerageCfmSweepsSchedule(params?: {}): Promise<implicitReturnType>;
80
+ v3PrivatePostBrokerageIntxAllocate(params?: {}): Promise<implicitReturnType>;
72
81
  v3PrivatePutBrokeragePortfoliosPortfolioUuid(params?: {}): Promise<implicitReturnType>;
73
82
  v3PrivateDeleteBrokeragePortfoliosPortfolioUuid(params?: {}): Promise<implicitReturnType>;
83
+ v3PrivateDeleteBrokerageCfmSweeps(params?: {}): Promise<implicitReturnType>;
74
84
  }
75
85
  declare abstract class Exchange extends _Exchange {
76
86
  }
@@ -154,9 +154,11 @@ interface Exchange {
154
154
  privateGetTradingBotGridSubOrders(params?: {}): Promise<implicitReturnType>;
155
155
  privateGetTradingBotGridPositions(params?: {}): Promise<implicitReturnType>;
156
156
  privateGetTradingBotGridAiParam(params?: {}): Promise<implicitReturnType>;
157
- privateGetTradingBotPublicRsiBackTesting(params?: {}): Promise<implicitReturnType>;
157
+ privateGetTradingBotSignalSignals(params?: {}): Promise<implicitReturnType>;
158
158
  privateGetTradingBotSignalOrdersAlgoDetails(params?: {}): Promise<implicitReturnType>;
159
+ privateGetTradingBotSignalOrdersAlgoHistory(params?: {}): Promise<implicitReturnType>;
159
160
  privateGetTradingBotSignalPositions(params?: {}): Promise<implicitReturnType>;
161
+ privateGetTradingBotSignalPositionsHistory(params?: {}): Promise<implicitReturnType>;
160
162
  privateGetTradingBotSignalSubOrders(params?: {}): Promise<implicitReturnType>;
161
163
  privateGetTradingBotSignalEventHistory(params?: {}): Promise<implicitReturnType>;
162
164
  privateGetTradingBotRecurringOrdersAlgoPending(params?: {}): Promise<implicitReturnType>;
@@ -262,6 +264,15 @@ interface Exchange {
262
264
  privatePostTradingBotGridComputeMarginBalance(params?: {}): Promise<implicitReturnType>;
263
265
  privatePostTradingBotGridMarginBalance(params?: {}): Promise<implicitReturnType>;
264
266
  privatePostTradingBotGridMinInvestment(params?: {}): Promise<implicitReturnType>;
267
+ privatePostTradingBotSignalCreateSignal(params?: {}): Promise<implicitReturnType>;
268
+ privatePostTradingBotSignalOrderAlgo(params?: {}): Promise<implicitReturnType>;
269
+ privatePostTradingBotSignalStopOrderAlgo(params?: {}): Promise<implicitReturnType>;
270
+ privatePostTradingBotSignalMarginBalance(params?: {}): Promise<implicitReturnType>;
271
+ privatePostTradingBotSignalAmendTPSL(params?: {}): Promise<implicitReturnType>;
272
+ privatePostTradingBotSignalSetInstruments(params?: {}): Promise<implicitReturnType>;
273
+ privatePostTradingBotSignalClosePosition(params?: {}): Promise<implicitReturnType>;
274
+ privatePostTradingBotSignalSubOrder(params?: {}): Promise<implicitReturnType>;
275
+ privatePostTradingBotSignalCancelSubOrder(params?: {}): Promise<implicitReturnType>;
265
276
  privatePostTradingBotRecurringOrderAlgo(params?: {}): Promise<implicitReturnType>;
266
277
  privatePostTradingBotRecurringAmendOrderAlgo(params?: {}): Promise<implicitReturnType>;
267
278
  privatePostTradingBotRecurringStopOrderAlgo(params?: {}): Promise<implicitReturnType>;
@@ -588,7 +588,7 @@ export default class Exchange {
588
588
  checkWsProxySettings(): any[];
589
589
  checkConflictingProxies(proxyAgentSet: any, proxyUrlSet: any): void;
590
590
  findMessageHashes(client: any, element: string): string[];
591
- filterByLimit(array: object[], limit?: Int, key?: IndexType): any;
591
+ filterByLimit(array: object[], limit?: Int, key?: IndexType, fromStart?: boolean): any;
592
592
  filterBySinceLimit(array: object[], since?: Int, limit?: Int, key?: IndexType, tail?: boolean): any;
593
593
  filterByValueSinceLimit(array: object[], field: IndexType, value?: any, since?: Int, limit?: Int, key?: string, tail?: boolean): any;
594
594
  setSandboxMode(enabled: any): void;
@@ -1677,7 +1677,7 @@ export default class Exchange {
1677
1677
  }
1678
1678
  return result;
1679
1679
  }
1680
- filterByLimit(array, limit = undefined, key = 'timestamp') {
1680
+ filterByLimit(array, limit = undefined, key = 'timestamp', fromStart = false) {
1681
1681
  if (this.valueIsDefined(limit)) {
1682
1682
  const arrayLength = array.length;
1683
1683
  if (arrayLength > 0) {
@@ -1689,7 +1689,12 @@ export default class Exchange {
1689
1689
  ascending = first <= last; // true if array is sorted in ascending order based on 'timestamp'
1690
1690
  }
1691
1691
  }
1692
- array = ascending ? this.arraySlice(array, -limit) : this.arraySlice(array, 0, limit);
1692
+ if (fromStart) {
1693
+ array = ascending ? this.arraySlice(array, 0, limit) : this.arraySlice(array, -limit);
1694
+ }
1695
+ else {
1696
+ array = ascending ? this.arraySlice(array, -limit) : this.arraySlice(array, 0, limit);
1697
+ }
1693
1698
  }
1694
1699
  }
1695
1700
  return array;
@@ -1711,7 +1716,10 @@ export default class Exchange {
1711
1716
  if (tail && limit !== undefined) {
1712
1717
  return this.arraySlice(result, -limit);
1713
1718
  }
1714
- return this.filterByLimit(result, limit, key);
1719
+ // if the user provided a 'since' argument
1720
+ // we want to limit the result starting from the 'since'
1721
+ const shouldFilterFromStart = !tail && sinceIsDefined;
1722
+ return this.filterByLimit(result, limit, key, shouldFilterFromStart);
1715
1723
  }
1716
1724
  filterByValueSinceLimit(array, field, value = undefined, since = undefined, limit = undefined, key = 'timestamp', tail = false) {
1717
1725
  const valueIsDefined = this.valueIsDefined(value);
@@ -1736,7 +1744,7 @@ export default class Exchange {
1736
1744
  if (tail && limit !== undefined) {
1737
1745
  return this.arraySlice(result, -limit);
1738
1746
  }
1739
- return this.filterByLimit(result, limit, key);
1747
+ return this.filterByLimit(result, limit, key, sinceIsDefined);
1740
1748
  }
1741
1749
  setSandboxMode(enabled) {
1742
1750
  if (enabled) {
package/js/src/binance.js CHANGED
@@ -5856,7 +5856,7 @@ export default class binance extends Exchange {
5856
5856
  params = this.omit(params, 'type');
5857
5857
  const orders = await this.fetchOrders(symbol, since, undefined, params);
5858
5858
  const filteredOrders = this.filterBy(orders, 'status', 'canceled');
5859
- return this.filterByLimit(filteredOrders, limit);
5859
+ return this.filterBySinceLimit(filteredOrders, since, limit);
5860
5860
  }
5861
5861
  async cancelOrder(id, symbol = undefined, params = {}) {
5862
5862
  /**
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bitfinex2.js';
2
- import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderBook, Str, Transaction, Ticker, Balances, Tickers, Strings, Currency, Market, OpenInterest, Liquidation } from './base/types.js';
2
+ import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderBook, Str, Transaction, Ticker, Balances, Tickers, Strings, Currency, Market, OpenInterest, Liquidation, OrderRequest } from './base/types.js';
3
3
  /**
4
4
  * @class bitfinex2
5
5
  * @augments Exchange
@@ -58,9 +58,12 @@ export default class bitfinex2 extends Exchange {
58
58
  parseOrderFlags(flags: any): any;
59
59
  parseTimeInForce(orderType: any): string;
60
60
  parseOrder(order: any, market?: Market): Order;
61
+ createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, params?: {}): any;
61
62
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, params?: {}): Promise<Order>;
63
+ createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
62
64
  cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
63
65
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
66
+ cancelOrders(ids: any, symbol?: Str, params?: {}): Promise<Order[]>;
64
67
  fetchOpenOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
65
68
  fetchClosedOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
66
69
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
@@ -177,4 +180,6 @@ export default class bitfinex2 extends Exchange {
177
180
  symbol: any;
178
181
  status: string;
179
182
  };
183
+ fetchOrder(id: string, symbol?: string, params?: {}): Promise<Order>;
184
+ editOrder(id: string, symbol: any, type: any, side: any, amount?: any, price?: any, params?: {}): Promise<Order>;
180
185
  }