ccxt 4.4.36 → 4.4.37

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 (38) hide show
  1. package/README.md +7 -7
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +6 -6
  4. package/dist/cjs/src/abstract/bitfinex1.js +9 -0
  5. package/dist/cjs/src/base/Exchange.js +6 -1
  6. package/dist/cjs/src/bitfinex.js +3178 -1161
  7. package/dist/cjs/src/bitfinex1.js +1760 -0
  8. package/dist/cjs/src/coinbase.js +87 -0
  9. package/dist/cjs/src/gate.js +1 -1
  10. package/dist/cjs/src/hyperliquid.js +125 -14
  11. package/dist/cjs/src/paradex.js +4 -2
  12. package/dist/cjs/src/pro/bitfinex.js +760 -271
  13. package/dist/cjs/src/pro/bitfinex1.js +675 -0
  14. package/dist/cjs/src/pro/probit.js +1 -0
  15. package/js/ccxt.d.ts +8 -8
  16. package/js/ccxt.js +6 -6
  17. package/js/src/abstract/bitfinex.d.ts +135 -64
  18. package/js/src/abstract/bitfinex1.d.ts +72 -0
  19. package/js/src/base/Exchange.js +6 -1
  20. package/js/src/bitfinex.d.ts +316 -106
  21. package/js/src/bitfinex.js +3179 -1162
  22. package/js/src/bitfinex1.d.ts +296 -0
  23. package/js/src/bitfinex1.js +1761 -0
  24. package/js/src/coinbase.d.ts +33 -0
  25. package/js/src/coinbase.js +87 -0
  26. package/js/src/gate.js +1 -1
  27. package/js/src/hyperliquid.d.ts +6 -1
  28. package/js/src/hyperliquid.js +125 -14
  29. package/js/src/paradex.d.ts +2 -0
  30. package/js/src/paradex.js +4 -2
  31. package/js/src/pro/bitfinex.d.ts +42 -10
  32. package/js/src/pro/bitfinex.js +761 -272
  33. package/js/src/pro/bitfinex1.d.ts +67 -0
  34. package/js/src/pro/bitfinex1.js +676 -0
  35. package/js/src/pro/probit.js +1 -0
  36. package/package.json +1 -1
  37. package/js/src/abstract/bitfinex2.d.ts +0 -143
  38. /package/js/src/abstract/{bitfinex2.js → bitfinex1.js} +0 -0
@@ -1,70 +1,54 @@
1
1
  import Exchange from './abstract/bitfinex.js';
2
- import type { TransferEntry, Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, Num, TradingFees, Dict, int, DepositAddress } from './base/types.js';
2
+ import type { TransferEntry, Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderBook, Str, Transaction, Ticker, Balances, Tickers, Strings, Currency, Market, OpenInterest, Liquidation, OrderRequest, Num, MarginModification, Currencies, TradingFees, Dict, LedgerEntry, FundingRate, FundingRates, DepositAddress } from './base/types.js';
3
3
  /**
4
4
  * @class bitfinex
5
5
  * @augments Exchange
6
6
  */
7
7
  export default class bitfinex extends Exchange {
8
8
  describe(): any;
9
+ isFiat(code: any): boolean;
10
+ getCurrencyId(code: any): string;
11
+ getCurrencyName(code: any): any;
12
+ amountToPrecision(symbol: any, amount: any): string;
13
+ priceToPrecision(symbol: any, price: any): string;
9
14
  /**
10
15
  * @method
11
- * @name bitfinex#fetchTransactionFees
12
- * @deprecated
13
- * @description please use fetchDepositWithdrawFees instead
14
- * @see https://docs.bitfinex.com/v1/reference/rest-auth-fees
15
- * @param {string[]|undefined} codes list of unified currency codes
16
- * @param {object} [params] extra parameters specific to the exchange API endpoint
17
- * @returns {object[]} a list of [fees structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
18
- */
19
- fetchTransactionFees(codes?: Strings, params?: {}): Promise<Dict>;
20
- /**
21
- * @method
22
- * @name bitfinex#fetchDepositWithdrawFees
23
- * @description fetch deposit and withdraw fees
24
- * @see https://docs.bitfinex.com/v1/reference/rest-auth-fees
25
- * @param {string[]|undefined} codes list of unified currency codes
16
+ * @name bitfinex#fetchStatus
17
+ * @description the latest known information on the availability of the exchange API
18
+ * @see https://docs.bitfinex.com/reference/rest-public-platform-status
26
19
  * @param {object} [params] extra parameters specific to the exchange API endpoint
27
- * @returns {object[]} a list of [fees structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
20
+ * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
28
21
  */
29
- fetchDepositWithdrawFees(codes?: Strings, params?: {}): Promise<any>;
30
- parseDepositWithdrawFee(fee: any, currency?: Currency): {
31
- withdraw: {
32
- fee: number;
33
- percentage: any;
34
- };
35
- deposit: {
36
- fee: any;
37
- percentage: any;
38
- };
39
- networks: {};
22
+ fetchStatus(params?: {}): Promise<{
23
+ status: string;
24
+ updated: any;
25
+ eta: any;
26
+ url: any;
40
27
  info: any;
41
- };
42
- /**
43
- * @method
44
- * @name bitfinex#fetchTradingFees
45
- * @description fetch the trading fees for multiple markets
46
- * @see https://docs.bitfinex.com/v1/reference/rest-auth-summary
47
- * @param {object} [params] extra parameters specific to the exchange API endpoint
48
- * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
49
- */
50
- fetchTradingFees(params?: {}): Promise<TradingFees>;
28
+ }>;
51
29
  /**
52
30
  * @method
53
31
  * @name bitfinex#fetchMarkets
54
32
  * @description retrieves data on all markets for bitfinex
55
- * @see https://docs.bitfinex.com/v1/reference/rest-public-symbols
56
- * @see https://docs.bitfinex.com/v1/reference/rest-public-symbol-details
33
+ * @see https://docs.bitfinex.com/reference/rest-public-conf
57
34
  * @param {object} [params] extra parameters specific to the exchange API endpoint
58
35
  * @returns {object[]} an array of objects representing market data
59
36
  */
60
37
  fetchMarkets(params?: {}): Promise<Market[]>;
61
- amountToPrecision(symbol: any, amount: any): string;
62
- priceToPrecision(symbol: any, price: any): string;
38
+ /**
39
+ * @method
40
+ * @name bitfinex#fetchCurrencies
41
+ * @description fetches all available currencies on an exchange
42
+ * @see https://docs.bitfinex.com/reference/rest-public-conf
43
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
44
+ * @returns {object} an associative dictionary of currencies
45
+ */
46
+ fetchCurrencies(params?: {}): Promise<Currencies>;
63
47
  /**
64
48
  * @method
65
49
  * @name bitfinex#fetchBalance
66
50
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
67
- * @see https://docs.bitfinex.com/v1/reference/rest-auth-wallet-balances
51
+ * @see https://docs.bitfinex.com/reference/rest-auth-wallets
68
52
  * @param {object} [params] extra parameters specific to the exchange API endpoint
69
53
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
70
54
  */
@@ -73,7 +57,7 @@ export default class bitfinex extends Exchange {
73
57
  * @method
74
58
  * @name bitfinex#transfer
75
59
  * @description transfer currency internally between wallets on the same account
76
- * @see https://docs.bitfinex.com/v1/reference/rest-auth-transfer-between-wallets
60
+ * @see https://docs.bitfinex.com/reference/rest-auth-transfer
77
61
  * @param {string} code unified currency code
78
62
  * @param {float} amount amount to transfer
79
63
  * @param {string} fromAccount account to transfer from
@@ -84,23 +68,25 @@ export default class bitfinex extends Exchange {
84
68
  transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
85
69
  parseTransfer(transfer: Dict, currency?: Currency): TransferEntry;
86
70
  parseTransferStatus(status: Str): Str;
87
- convertDerivativesId(currencyId: any, type: any): any;
71
+ convertDerivativesId(currency: any, type: any): any;
88
72
  /**
89
73
  * @method
90
74
  * @name bitfinex#fetchOrderBook
91
75
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
92
- * @see https://docs.bitfinex.com/v1/reference/rest-public-orderbook
76
+ * @see https://docs.bitfinex.com/reference/rest-public-book
93
77
  * @param {string} symbol unified symbol of the market to fetch the order book for
94
- * @param {int} [limit] the maximum amount of order book entries to return
78
+ * @param {int} [limit] the maximum amount of order book entries to return, bitfinex only allows 1, 25, or 100
95
79
  * @param {object} [params] extra parameters specific to the exchange API endpoint
96
80
  * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
97
81
  */
98
82
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
83
+ parseTicker(ticker: Dict, market?: Market): Ticker;
99
84
  /**
100
85
  * @method
101
86
  * @name bitfinex#fetchTickers
102
87
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
103
- * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
88
+ * @see https://docs.bitfinex.com/reference/rest-public-tickers
89
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
104
90
  * @param {object} [params] extra parameters specific to the exchange API endpoint
105
91
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
106
92
  */
@@ -109,80 +95,143 @@ export default class bitfinex extends Exchange {
109
95
  * @method
110
96
  * @name bitfinex#fetchTicker
111
97
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
112
- * @see https://docs.bitfinex.com/v1/reference/rest-public-ticker
98
+ * @see https://docs.bitfinex.com/reference/rest-public-ticker
113
99
  * @param {string} symbol unified symbol of the market to fetch the ticker for
114
100
  * @param {object} [params] extra parameters specific to the exchange API endpoint
115
101
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
116
102
  */
117
103
  fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
118
- parseTicker(ticker: Dict, market?: Market): Ticker;
119
104
  parseTrade(trade: Dict, market?: Market): Trade;
120
105
  /**
121
106
  * @method
122
107
  * @name bitfinex#fetchTrades
123
108
  * @description get the list of most recent trades for a particular symbol
124
- * @see https://docs.bitfinex.com/v1/reference/rest-public-trades
109
+ * @see https://docs.bitfinex.com/reference/rest-public-trades
125
110
  * @param {string} symbol unified symbol of the market to fetch trades for
126
111
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
127
- * @param {int} [limit] the maximum amount of trades to fetch
112
+ * @param {int} [limit] the maximum amount of trades to fetch, default 120, max 10000
128
113
  * @param {object} [params] extra parameters specific to the exchange API endpoint
114
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
115
+ * @param {int} [params.until] the latest time in ms to fetch entries for
129
116
  * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
130
117
  */
131
118
  fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
132
119
  /**
133
120
  * @method
134
- * @name bitfinex#fetchMyTrades
135
- * @description fetch all trades made by the user
136
- * @see https://docs.bitfinex.com/v1/reference/rest-auth-past-trades
137
- * @param {string} symbol unified market symbol
138
- * @param {int} [since] the earliest time in ms to fetch trades for
139
- * @param {int} [limit] the maximum number of trades structures to retrieve
121
+ * @name bitfinex#fetchOHLCV
122
+ * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
123
+ * @see https://docs.bitfinex.com/reference/rest-public-candles
124
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
125
+ * @param {string} timeframe the length of time each candle represents
126
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
127
+ * @param {int} [limit] the maximum amount of candles to fetch, default 100 max 10000
140
128
  * @param {object} [params] extra parameters specific to the exchange API endpoint
141
- * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
129
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
130
+ * @param {int} [params.until] timestamp in ms of the latest candle to fetch
131
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
142
132
  */
143
- fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
133
+ fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
134
+ parseOHLCV(ohlcv: any, market?: Market): OHLCV;
135
+ parseOrderStatus(status: Str): string;
136
+ parseOrderFlags(flags: any): any;
137
+ parseTimeInForce(orderType: any): string;
138
+ parseOrder(order: Dict, market?: Market): Order;
139
+ createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): any;
144
140
  /**
145
141
  * @method
146
142
  * @name bitfinex#createOrder
147
- * @description create a trade order
148
- * @see https://docs.bitfinex.com/v1/reference/rest-auth-new-order
149
- * @param {string} symbol unified symbol of the market to create an order in
150
- * @param {string} type 'market' or 'limit'
143
+ * @description create an order on the exchange
144
+ * @see https://docs.bitfinex.com/reference/rest-auth-submit-order
145
+ * @param {string} symbol unified CCXT market symbol
146
+ * @param {string} type 'limit' or 'market'
151
147
  * @param {string} side 'buy' or 'sell'
152
- * @param {float} amount how much of currency you want to trade in units of base currency
153
- * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
148
+ * @param {float} amount the amount of currency to trade
149
+ * @param {float} [price] price of the order
154
150
  * @param {object} [params] extra parameters specific to the exchange API endpoint
151
+ * @param {float} [params.stopPrice] the price that triggers a trigger order
152
+ * @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
153
+ * @param {boolean} [params.postOnly] set to true if you want to make a post only order
154
+ * @param {boolean} [params.reduceOnly] indicates that the order is to reduce the size of a position
155
+ * @param {int} [params.flags] additional order parameters: 4096 (Post Only), 1024 (Reduce Only), 16384 (OCO), 64 (Hidden), 512 (Close), 524288 (No Var Rates)
156
+ * @param {int} [params.lev] leverage for a derivative order, supported by derivative symbol orders only. The value should be between 1 and 100 inclusive.
157
+ * @param {string} [params.price_aux_limit] order price for stop limit orders
158
+ * @param {string} [params.price_oco_stop] OCO stop price
159
+ * @param {string} [params.trailingAmount] *swap only* the quote amount to trail away from the current market price
155
160
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
156
161
  */
157
162
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
158
- editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
163
+ /**
164
+ * @method
165
+ * @name bitfinex#createOrders
166
+ * @description create a list of trade orders
167
+ * @see https://docs.bitfinex.com/reference/rest-auth-order-multi
168
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
169
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
170
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
171
+ */
172
+ createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
173
+ /**
174
+ * @method
175
+ * @name bitfinex#cancelAllOrders
176
+ * @description cancel all open orders
177
+ * @see https://docs.bitfinex.com/reference/rest-auth-cancel-orders-multiple
178
+ * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
179
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
180
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
181
+ */
182
+ cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
159
183
  /**
160
184
  * @method
161
185
  * @name bitfinex#cancelOrder
162
186
  * @description cancels an open order
163
- * @see https://docs.bitfinex.com/v1/reference/rest-auth-cancel-order
187
+ * @see https://docs.bitfinex.com/reference/rest-auth-cancel-order
164
188
  * @param {string} id order id
165
- * @param {string} symbol not used by bitfinex cancelOrder ()
189
+ * @param {string} symbol Not used by bitfinex cancelOrder ()
166
190
  * @param {object} [params] extra parameters specific to the exchange API endpoint
167
191
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
168
192
  */
169
193
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
170
194
  /**
171
195
  * @method
172
- * @name bitfinex#cancelAllOrders
173
- * @description cancel all open orders
174
- * @see https://docs.bitfinex.com/v1/reference/rest-auth-cancel-all-orders
175
- * @param {string} symbol not used by bitfinex cancelAllOrders
196
+ * @name bitfinex#cancelOrders
197
+ * @description cancel multiple orders at the same time
198
+ * @see https://docs.bitfinex.com/reference/rest-auth-cancel-orders-multiple
199
+ * @param {string[]} ids order ids
200
+ * @param {string} symbol unified market symbol, default is undefined
176
201
  * @param {object} [params] extra parameters specific to the exchange API endpoint
177
- * @returns {object} response from exchange
202
+ * @returns {object} an array of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
178
203
  */
179
- cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
180
- parseOrder(order: Dict, market?: Market): Order;
204
+ cancelOrders(ids: any, symbol?: Str, params?: {}): Promise<Order[]>;
205
+ /**
206
+ * @method
207
+ * @name bitfinex#fetchOpenOrder
208
+ * @description fetch an open order by it's id
209
+ * @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders
210
+ * @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders-by-symbol
211
+ * @param {string} id order id
212
+ * @param {string} symbol unified market symbol, default is undefined
213
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
214
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
215
+ */
216
+ fetchOpenOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
217
+ /**
218
+ * @method
219
+ * @name bitfinex#fetchClosedOrder
220
+ * @description fetch an open order by it's id
221
+ * @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders
222
+ * @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders-by-symbol
223
+ * @param {string} id order id
224
+ * @param {string} symbol unified market symbol, default is undefined
225
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
226
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
227
+ */
228
+ fetchClosedOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
181
229
  /**
182
230
  * @method
183
231
  * @name bitfinex#fetchOpenOrders
184
232
  * @description fetch all unfilled currently open orders
185
- * @see https://docs.bitfinex.com/v1/reference/rest-auth-active-orders
233
+ * @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders
234
+ * @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders-by-symbol
186
235
  * @param {string} symbol unified market symbol
187
236
  * @param {int} [since] the earliest time in ms to fetch open orders for
188
237
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -194,45 +243,48 @@ export default class bitfinex extends Exchange {
194
243
  * @method
195
244
  * @name bitfinex#fetchClosedOrders
196
245
  * @description fetches information on multiple closed orders made by the user
197
- * @see https://docs.bitfinex.com/v1/reference/rest-auth-orders-history
246
+ * @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders
247
+ * @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders-by-symbol
198
248
  * @param {string} symbol unified market symbol of the market orders were made in
199
249
  * @param {int} [since] the earliest time in ms to fetch orders for
200
250
  * @param {int} [limit] the maximum number of order structures to retrieve
201
251
  * @param {object} [params] extra parameters specific to the exchange API endpoint
252
+ * @param {int} [params.until] the latest time in ms to fetch entries for
253
+ * @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)
202
254
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
203
255
  */
204
256
  fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
205
257
  /**
206
258
  * @method
207
- * @name bitfinex#fetchOrder
208
- * @description fetches information on an order made by the user
209
- * @see https://docs.bitfinex.com/v1/reference/rest-auth-order-status
210
- * @param {string} id the order id
211
- * @param {string} symbol not used by bitfinex fetchOrder
259
+ * @name bitfinex#fetchOrderTrades
260
+ * @description fetch all the trades made from a single order
261
+ * @see https://docs.bitfinex.com/reference/rest-auth-order-trades
262
+ * @param {string} id order id
263
+ * @param {string} symbol unified market symbol
264
+ * @param {int} [since] the earliest time in ms to fetch trades for
265
+ * @param {int} [limit] the maximum number of trades to retrieve
212
266
  * @param {object} [params] extra parameters specific to the exchange API endpoint
213
- * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
267
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
214
268
  */
215
- fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
216
- parseOHLCV(ohlcv: any, market?: Market): OHLCV;
269
+ fetchOrderTrades(id: string, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
217
270
  /**
218
271
  * @method
219
- * @name bitfinex#fetchOHLCV
220
- * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
221
- * @see https://docs.bitfinex.com/reference/rest-public-candles#aggregate-funding-currency-candles
222
- * @param {string} symbol unified symbol of the market to fetch OHLCV data for
223
- * @param {string} timeframe the length of time each candle represents
224
- * @param {int} [since] timestamp in ms of the earliest candle to fetch
225
- * @param {int} [limit] the maximum amount of candles to fetch
272
+ * @name bitfinex#fetchMyTrades
273
+ * @description fetch all trades made by the user
274
+ * @see https://docs.bitfinex.com/reference/rest-auth-trades
275
+ * @see https://docs.bitfinex.com/reference/rest-auth-trades-by-symbol
276
+ * @param {string} symbol unified market symbol
277
+ * @param {int} [since] the earliest time in ms to fetch trades for
278
+ * @param {int} [limit] the maximum number of trades structures to retrieve
226
279
  * @param {object} [params] extra parameters specific to the exchange API endpoint
227
- * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
280
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
228
281
  */
229
- fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
230
- getCurrencyName(code: any): any;
282
+ fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
231
283
  /**
232
284
  * @method
233
285
  * @name bitfinex#createDepositAddress
234
286
  * @description create a currency deposit address
235
- * @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit
287
+ * @see https://docs.bitfinex.com/reference/rest-auth-deposit-address
236
288
  * @param {string} code unified currency code of the currency for the deposit address
237
289
  * @param {object} [params] extra parameters specific to the exchange API endpoint
238
290
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -242,31 +294,41 @@ export default class bitfinex extends Exchange {
242
294
  * @method
243
295
  * @name bitfinex#fetchDepositAddress
244
296
  * @description fetch the deposit address for a currency associated with this account
245
- * @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit
297
+ * @see https://docs.bitfinex.com/reference/rest-auth-deposit-address
246
298
  * @param {string} code unified currency code
247
299
  * @param {object} [params] extra parameters specific to the exchange API endpoint
248
300
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
249
301
  */
250
302
  fetchDepositAddress(code: string, params?: {}): Promise<DepositAddress>;
303
+ parseTransactionStatus(status: Str): string;
304
+ parseTransaction(transaction: Dict, currency?: Currency): Transaction;
305
+ /**
306
+ * @method
307
+ * @name bitfinex#fetchTradingFees
308
+ * @description fetch the trading fees for multiple markets
309
+ * @see https://docs.bitfinex.com/reference/rest-auth-summary
310
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
311
+ * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
312
+ */
313
+ fetchTradingFees(params?: {}): Promise<TradingFees>;
251
314
  /**
252
315
  * @method
253
316
  * @name bitfinex#fetchDepositsWithdrawals
254
317
  * @description fetch history of deposits and withdrawals
255
- * @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit-withdrawal-history
256
- * @param {string} code unified currency code for the currency of the deposit/withdrawals
318
+ * @see https://docs.bitfinex.com/reference/movement-info
319
+ * @see https://docs.bitfinex.com/reference/rest-auth-movements
320
+ * @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
257
321
  * @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
258
322
  * @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
259
323
  * @param {object} [params] extra parameters specific to the exchange API endpoint
260
324
  * @returns {object} a list of [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
261
325
  */
262
326
  fetchDepositsWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
263
- parseTransaction(transaction: Dict, currency?: Currency): Transaction;
264
- parseTransactionStatus(status: Str): string;
265
327
  /**
266
328
  * @method
267
329
  * @name bitfinex#withdraw
268
330
  * @description make a withdrawal
269
- * @see https://docs.bitfinex.com/v1/reference/rest-auth-withdrawal
331
+ * @see https://docs.bitfinex.com/reference/rest-auth-withdraw
270
332
  * @param {string} code unified currency code
271
333
  * @param {float} amount the amount to withdraw
272
334
  * @param {string} address the address to withdraw to
@@ -279,12 +341,13 @@ export default class bitfinex extends Exchange {
279
341
  * @method
280
342
  * @name bitfinex#fetchPositions
281
343
  * @description fetch all open positions
282
- * @see https://docs.bitfinex.com/v1/reference/rest-auth-active-positions
344
+ * @see https://docs.bitfinex.com/reference/rest-auth-positions
283
345
  * @param {string[]|undefined} symbols list of unified market symbols
284
346
  * @param {object} [params] extra parameters specific to the exchange API endpoint
285
347
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
286
348
  */
287
- fetchPositions(symbols?: Strings, params?: {}): Promise<any>;
349
+ fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
350
+ parsePosition(position: Dict, market?: Market): import("./base/types.js").Position;
288
351
  nonce(): number;
289
352
  sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
290
353
  url: string;
@@ -292,5 +355,152 @@ export default class bitfinex extends Exchange {
292
355
  body: any;
293
356
  headers: any;
294
357
  };
295
- handleErrors(code: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
358
+ handleErrors(statusCode: any, statusText: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
359
+ parseLedgerEntryType(type: Str): string;
360
+ parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
361
+ /**
362
+ * @method
363
+ * @name bitfinex#fetchLedger
364
+ * @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
365
+ * @see https://docs.bitfinex.com/reference/rest-auth-ledgers
366
+ * @param {string} [code] unified currency code, default is undefined
367
+ * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
368
+ * @param {int} [limit] max number of ledger entries to return, default is undefined, max is 2500
369
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
370
+ * @param {int} [params.until] timestamp in ms of the latest ledger entry
371
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
372
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
373
+ */
374
+ fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
375
+ /**
376
+ * @method
377
+ * @name bitfinex#fetchFundingRates
378
+ * @description fetch the current funding rate for multiple symbols
379
+ * @see https://docs.bitfinex.com/reference/rest-public-derivatives-status
380
+ * @param {string[]} symbols list of unified market symbols
381
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
382
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
383
+ */
384
+ fetchFundingRates(symbols?: Strings, params?: {}): Promise<FundingRates>;
385
+ /**
386
+ * @method
387
+ * @name bitfinex#fetchFundingRateHistory
388
+ * @description fetches historical funding rate prices
389
+ * @see https://docs.bitfinex.com/reference/rest-public-derivatives-status-history
390
+ * @param {string} symbol unified market symbol
391
+ * @param {int} [since] timestamp in ms of the earliest funding rate entry
392
+ * @param {int} [limit] max number of funding rate entrys to return
393
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
394
+ * @param {int} [params.until] timestamp in ms of the latest funding rate
395
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
396
+ * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
397
+ */
398
+ fetchFundingRateHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
399
+ parseFundingRate(contract: any, market?: Market): FundingRate;
400
+ parseFundingRateHistory(contract: any, market?: Market): {
401
+ info: any;
402
+ symbol: string;
403
+ markPrice: number;
404
+ indexPrice: number;
405
+ interestRate: any;
406
+ estimatedSettlePrice: any;
407
+ timestamp: number;
408
+ datetime: string;
409
+ fundingRate: number;
410
+ fundingTimestamp: any;
411
+ fundingDatetime: any;
412
+ nextFundingRate: number;
413
+ nextFundingTimestamp: number;
414
+ nextFundingDatetime: string;
415
+ previousFundingRate: any;
416
+ previousFundingTimestamp: any;
417
+ previousFundingDatetime: any;
418
+ };
419
+ /**
420
+ * @method
421
+ * @name bitfinex#fetchOpenInterest
422
+ * @description retrieves the open interest of a contract trading pair
423
+ * @see https://docs.bitfinex.com/reference/rest-public-derivatives-status
424
+ * @param {string} symbol unified CCXT market symbol
425
+ * @param {object} [params] exchange specific parameters
426
+ * @returns {object} an [open interest structure]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
427
+ */
428
+ fetchOpenInterest(symbol: string, params?: {}): Promise<OpenInterest>;
429
+ /**
430
+ * @method
431
+ * @name bitfinex#fetchOpenInterestHistory
432
+ * @description retrieves the open interest history of a currency
433
+ * @see https://docs.bitfinex.com/reference/rest-public-derivatives-status-history
434
+ * @param {string} symbol unified CCXT market symbol
435
+ * @param {string} timeframe the time period of each row of data, not used by bitfinex
436
+ * @param {int} [since] the time in ms of the earliest record to retrieve as a unix timestamp
437
+ * @param {int} [limit] the number of records in the response
438
+ * @param {object} [params] exchange specific parameters
439
+ * @param {int} [params.until] the time in ms of the latest record to retrieve as a unix timestamp
440
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
441
+ * @returns An array of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
442
+ */
443
+ fetchOpenInterestHistory(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OpenInterest[]>;
444
+ parseOpenInterest(interest: any, market?: Market): OpenInterest;
445
+ /**
446
+ * @method
447
+ * @name bitfinex#fetchLiquidations
448
+ * @description retrieves the public liquidations of a trading pair
449
+ * @see https://docs.bitfinex.com/reference/rest-public-liquidations
450
+ * @param {string} symbol unified CCXT market symbol
451
+ * @param {int} [since] the earliest time in ms to fetch liquidations for
452
+ * @param {int} [limit] the maximum number of liquidation structures to retrieve
453
+ * @param {object} [params] exchange specific parameters
454
+ * @param {int} [params.until] timestamp in ms of the latest liquidation
455
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
456
+ * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
457
+ */
458
+ fetchLiquidations(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
459
+ parseLiquidation(liquidation: any, market?: Market): Liquidation;
460
+ /**
461
+ * @method
462
+ * @name bitfinex#setMargin
463
+ * @description either adds or reduces margin in a swap position in order to set the margin to a specific value
464
+ * @see https://docs.bitfinex.com/reference/rest-auth-deriv-pos-collateral-set
465
+ * @param {string} symbol unified market symbol of the market to set margin in
466
+ * @param {float} amount the amount to set the margin to
467
+ * @param {object} [params] parameters specific to the exchange API endpoint
468
+ * @returns {object} A [margin structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#add-margin-structure}
469
+ */
470
+ setMargin(symbol: string, amount: number, params?: {}): Promise<MarginModification>;
471
+ parseMarginModification(data: any, market?: any): MarginModification;
472
+ /**
473
+ * @method
474
+ * @name bitfinex#fetchOrder
475
+ * @description fetches information on an order made by the user
476
+ * @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders
477
+ * @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders-by-symbol
478
+ * @param {string} id the order id
479
+ * @param {string} [symbol] unified symbol of the market the order was made in
480
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
481
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
482
+ */
483
+ fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
484
+ /**
485
+ * @method
486
+ * @name bitfinex#editOrder
487
+ * @description edit a trade order
488
+ * @see https://docs.bitfinex.com/reference/rest-auth-update-order
489
+ * @param {string} id edit order id
490
+ * @param {string} symbol unified symbol of the market to edit an order in
491
+ * @param {string} type 'market' or 'limit'
492
+ * @param {string} side 'buy' or 'sell'
493
+ * @param {float} amount how much you want to trade in units of the base currency
494
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
495
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
496
+ * @param {float} [params.stopPrice] the price that triggers a trigger order
497
+ * @param {boolean} [params.postOnly] set to true if you want to make a post only order
498
+ * @param {boolean} [params.reduceOnly] indicates that the order is to reduce the size of a position
499
+ * @param {int} [params.flags] additional order parameters: 4096 (Post Only), 1024 (Reduce Only), 16384 (OCO), 64 (Hidden), 512 (Close), 524288 (No Var Rates)
500
+ * @param {int} [params.leverage] leverage for a derivative order, supported by derivative symbol orders only, the value should be between 1 and 100 inclusive
501
+ * @param {int} [params.clientOrderId] a unique client order id for the order
502
+ * @param {float} [params.trailingAmount] *swap only* the quote amount to trail away from the current market price
503
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
504
+ */
505
+ editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
296
506
  }