ccxt 4.5.29 → 4.5.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.
Files changed (85) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.min.js +18 -18
  3. package/dist/cjs/ccxt.js +6 -4
  4. package/dist/cjs/src/base/Exchange.js +16 -1
  5. package/dist/cjs/src/base/ws/WsClient.js +1 -0
  6. package/dist/cjs/src/bingx.js +1 -1
  7. package/dist/cjs/src/bullish.js +1 -1
  8. package/dist/cjs/src/bybit.js +2 -0
  9. package/dist/cjs/src/bydfi.js +2907 -0
  10. package/dist/cjs/src/coinbase.js +34 -1
  11. package/dist/cjs/src/dydx.js +3 -3
  12. package/dist/cjs/src/gate.js +55 -8
  13. package/dist/cjs/src/hyperliquid.js +19 -4
  14. package/dist/cjs/src/kucoin.js +175 -68
  15. package/dist/cjs/src/pro/apex.js +7 -5
  16. package/dist/cjs/src/pro/ascendex.js +1 -1
  17. package/dist/cjs/src/pro/binance.js +10 -6
  18. package/dist/cjs/src/pro/bingx.js +6 -4
  19. package/dist/cjs/src/pro/bitmart.js +5 -3
  20. package/dist/cjs/src/pro/bybit.js +6 -4
  21. package/dist/cjs/src/pro/bydfi.js +1077 -0
  22. package/dist/cjs/src/pro/cryptocom.js +6 -4
  23. package/dist/cjs/src/pro/gate.js +5 -3
  24. package/dist/cjs/src/pro/hashkey.js +5 -3
  25. package/dist/cjs/src/pro/htx.js +1 -1
  26. package/dist/cjs/src/pro/hyperliquid.js +1 -1
  27. package/dist/cjs/src/pro/kucoinfutures.js +5 -3
  28. package/dist/cjs/src/pro/modetrade.js +5 -3
  29. package/dist/cjs/src/pro/p2b.js +1 -1
  30. package/dist/cjs/src/pro/toobit.js +12 -8
  31. package/dist/cjs/src/pro/woo.js +5 -3
  32. package/dist/cjs/src/pro/woofipro.js +5 -3
  33. package/dist/cjs/src/pro/xt.js +5 -3
  34. package/dist/cjs/src/toobit.js +2 -1
  35. package/js/ccxt.d.ts +8 -5
  36. package/js/ccxt.js +6 -4
  37. package/js/src/abstract/bydfi.d.ts +52 -0
  38. package/js/src/abstract/kucoin.d.ts +2 -0
  39. package/js/src/abstract/kucoinfutures.d.ts +2 -0
  40. package/js/src/base/Exchange.d.ts +3 -0
  41. package/js/src/base/Exchange.js +16 -1
  42. package/js/src/base/ws/WsClient.js +1 -0
  43. package/js/src/binance.d.ts +1 -1
  44. package/js/src/bingx.js +1 -1
  45. package/js/src/bullish.js +1 -1
  46. package/js/src/bybit.js +2 -0
  47. package/js/src/bydfi.d.ts +472 -0
  48. package/js/src/bydfi.js +2905 -0
  49. package/js/src/coinbase.d.ts +11 -0
  50. package/js/src/coinbase.js +34 -1
  51. package/js/src/dydx.js +3 -3
  52. package/js/src/exmo.d.ts +1 -1
  53. package/js/src/gate.js +55 -8
  54. package/js/src/hyperliquid.d.ts +1 -0
  55. package/js/src/hyperliquid.js +19 -4
  56. package/js/src/kucoin.d.ts +19 -3
  57. package/js/src/kucoin.js +175 -68
  58. package/js/src/pro/apex.js +7 -5
  59. package/js/src/pro/ascendex.js +1 -1
  60. package/js/src/pro/binance.js +10 -6
  61. package/js/src/pro/bingx.js +6 -4
  62. package/js/src/pro/bitmart.js +5 -3
  63. package/js/src/pro/bybit.js +6 -4
  64. package/js/src/pro/bydfi.d.ts +206 -0
  65. package/js/src/pro/bydfi.js +1076 -0
  66. package/js/src/pro/cryptocom.js +6 -4
  67. package/js/src/pro/gate.js +5 -3
  68. package/js/src/pro/hashkey.js +5 -3
  69. package/js/src/pro/htx.js +1 -1
  70. package/js/src/pro/hyperliquid.js +1 -1
  71. package/js/src/pro/kucoinfutures.js +5 -3
  72. package/js/src/pro/modetrade.js +5 -3
  73. package/js/src/pro/p2b.js +1 -1
  74. package/js/src/pro/toobit.js +12 -8
  75. package/js/src/pro/woo.js +5 -3
  76. package/js/src/pro/woofipro.js +5 -3
  77. package/js/src/pro/xt.js +5 -3
  78. package/js/src/toobit.js +2 -1
  79. package/package.json +1 -1
  80. package/dist/cjs/src/oceanex.js +0 -1125
  81. package/js/src/abstract/oceanex.d.ts +0 -30
  82. package/js/src/oceanex.d.ts +0 -231
  83. package/js/src/oceanex.js +0 -1124
  84. /package/dist/cjs/src/abstract/{oceanex.js → bydfi.js} +0 -0
  85. /package/js/src/abstract/{oceanex.js → bydfi.js} +0 -0
@@ -0,0 +1,472 @@
1
+ import Exchange from './abstract/bydfi.js';
2
+ import type { Balances, Currency, Dict, FundingRate, FundingRateHistory, Int, int, Leverage, MarginMode, Market, Num, OHLCV, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Trade, Transaction, TransferEntry, Ticker, Tickers } from './base/types.js';
3
+ /**
4
+ * @class bydfi
5
+ * @augments Exchange
6
+ */
7
+ export default class bydfi extends Exchange {
8
+ describe(): any;
9
+ /**
10
+ * @method
11
+ * @name bydfi#fetchMarkets
12
+ * @description retrieves data on all markets for bydfi
13
+ * @see https://developers.bydfi.com/en/swap/market#fetching-trading-rules-and-pairs
14
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
15
+ * @returns {object[]} an array of objects representing market data
16
+ */
17
+ fetchMarkets(params?: {}): Promise<Market[]>;
18
+ parseMarket(market: Dict): Market;
19
+ /**
20
+ * @method
21
+ * @name bydfi#fetchOrderBook
22
+ * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
23
+ * @see https://developers.bydfi.com/en/swap/market#depth-information
24
+ * @param {string} symbol unified symbol of the market to fetch the order book for
25
+ * @param {int} [limit] the maximum amount of order book entries to return, could be 5, 10, 20, 50, 100, 500 or 1000 (default 500)
26
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
27
+ * @param {string} [params.loc] crypto location, default: us
28
+ * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
29
+ */
30
+ fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
31
+ getClosestLimit(limit: Int): Int;
32
+ /**
33
+ * @method
34
+ * @name bydfi#fetchTrades
35
+ * @description get the list of most recent trades for a particular symbol
36
+ * @see https://developers.bydfi.com/en/swap/market#recent-trades
37
+ * @param {string} symbol unified symbol of the market to fetch trades for
38
+ * @param {int} [since] timestamp in ms of the earliest trade to fetch
39
+ * @param {int} [limit] the maximum amount of trades to fetch (default 500, max 1000)
40
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
41
+ * @param {int} [params.fromId] retrieve from which trade ID to start. Default to retrieve the most recent trade records
42
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=public-trades}
43
+ */
44
+ fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
45
+ /**
46
+ * @method
47
+ * @name bydfi#fetchMyTrades
48
+ * @description fetch all trades made by the user
49
+ * @see https://developers.bydfi.com/en/swap/trade#historical-trades-query
50
+ * @param {string} symbol unified market symbol
51
+ * @param {int} [since] the earliest time in ms to fetch trades for
52
+ * @param {int} [limit] the maximum number of trades structures to retrieve
53
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
54
+ * @param {int} [params.until] the latest time in ms to fetch trades for
55
+ * @param {string} [params.contractType] FUTURE or DELIVERY, default is FUTURE
56
+ * @param {string} [params.wallet] The unique code of a sub-wallet
57
+ * @param {string} [params.orderType] order type ('LIMIT', 'MARKET', 'LIQ', 'LIMIT_CLOSE', 'MARKET_CLOSE', 'STOP', 'TAKE_PROFIT', 'STOP_MARKET', 'TAKE_PROFIT_MARKET' or 'TRAILING_STOP_MARKET')
58
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=trade-structure}
59
+ */
60
+ fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
61
+ parseTrade(trade: Dict, market?: Market): Trade;
62
+ parseTradeType(type: Str): Str;
63
+ /**
64
+ * @method
65
+ * @name bydfi#fetchOHLCV
66
+ * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
67
+ * @see https://developers.bydfi.com/en/swap/market#candlestick-data
68
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
69
+ * @param {string} timeframe the length of time each candle represents
70
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
71
+ * @param {int} [limit] the maximum amount of candles to fetch (max 500)
72
+ * @param {object} [params] extra parameters specific to the bitteam api endpoint
73
+ * @param {int} [params.until] timestamp in ms of the latest candle to fetch
74
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
75
+ */
76
+ fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
77
+ parseOHLCV(ohlcv: any, market?: Market): OHLCV;
78
+ /**
79
+ * @method
80
+ * @name bydfi#fetchTickers
81
+ * @see https://developers.bydfi.com/en/swap/market#24hr-price-change-statistics
82
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
83
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
84
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
85
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/?id=ticker-structure}
86
+ */
87
+ fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
88
+ /**
89
+ * @method
90
+ * @name bydfi#fetchTicker
91
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
92
+ * @see https://developers.bydfi.com/en/swap/market#24hr-price-change-statistics
93
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
94
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
95
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/?id=ticker-structure}
96
+ */
97
+ fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
98
+ parseTicker(ticker: Dict, market?: Market): Ticker;
99
+ /**
100
+ * @method
101
+ * @name bydfi#fetchFundingRate
102
+ * @description fetch the current funding rate
103
+ * @see https://developers.bydfi.com/en/swap/market#recent-funding-rate
104
+ * @param {string} symbol unified market symbol
105
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
106
+ * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/?id=funding-rate-structure}
107
+ */
108
+ fetchFundingRate(symbol: string, params?: {}): Promise<FundingRate>;
109
+ parseFundingRate(contract: any, market?: Market): FundingRate;
110
+ /**
111
+ * @method
112
+ * @name bydfi#fetchFundingRateHistory
113
+ * @description fetches historical funding rate prices
114
+ * @see https://developers.bydfi.com/en/swap/market#historical-funding-rates
115
+ * @param {string} symbol unified symbol of the market to fetch the funding rate history for
116
+ * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
117
+ * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/?id=funding-rate-history-structure} to fetch
118
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
119
+ * @param {int} [params.until] timestamp in ms of the latest funding rate to fetch
120
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/?id=funding-rate-history-structure}
121
+ */
122
+ fetchFundingRateHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
123
+ parseFundingRateHistory(contract: any, market?: Market): {
124
+ info: any;
125
+ symbol: string;
126
+ fundingRate: number;
127
+ timestamp: number;
128
+ datetime: string;
129
+ };
130
+ /**
131
+ * @method
132
+ * @name bydfi#createOrder
133
+ * @description create a trade order
134
+ * @see https://developers.bydfi.com/en/swap/trade#placing-an-order
135
+ * @param {string} symbol unified symbol of the market to create an order in
136
+ * @param {string} type 'market' or 'limit'
137
+ * @param {string} side 'buy' or 'sell'
138
+ * @param {float} amount how much of currency you want to trade in units of base currency
139
+ * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
140
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
141
+ * @param {string} [params.wallet] The unique code of a sub-wallet. W001 is the default wallet and the main wallet code of the contract
142
+ * @param {bool} [params.hedged] true for hedged mode, false for one way mode, default is false
143
+ * @param {string} [params.clientOrderId] Custom order ID, must be unique for open orders
144
+ * @param {string} [params.timeInForce] 'GTC' (Good Till Cancelled), 'FOK' (Fill Or Kill), 'IOC' (Immediate Or Cancel), 'PO' (Post Only)
145
+ * @param {bool} [params.postOnly] true or false, whether the order is post-only
146
+ * @param {bool} [params.reduceOnly] true or false, true or false whether the order is reduce-only
147
+ * @param {float} [params.stopLossPrice] The price a stop loss order is triggered at
148
+ * @param {float} [params.takeProfitPrice] The price a take profit order is triggered at
149
+ * @param {float} [params.trailingTriggerPrice] the price to activate a trailing order, default uses the price argument or market price if price is not provided
150
+ * @param {float} [params.trailingPercent] the percent to trail away from the current market price
151
+ * @param {string} [params.triggerPriceType] 'MARK_PRICE' or 'CONTRACT_PRICE', default is 'CONTRACT_PRICE', the price type used to trigger stop orders
152
+ * @param {bool} [params.closePosition] true or false, whether to close all positions after triggering, only supported in STOP_MARKET and TAKE_PROFIT_MARKET; not used with quantity;
153
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure}
154
+ */
155
+ createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
156
+ createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): any;
157
+ encodeWorkingType(workingType: Str): Str;
158
+ /**
159
+ * @method
160
+ * @name bydfi#createOrders
161
+ * @description create a list of trade orders
162
+ * @see https://developers.bydfi.com/en/swap/trade#batch-order-placement
163
+ * @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
164
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
165
+ * @param {string} [params.wallet] The unique code of a sub-wallet. W001 is the default wallet and the main wallet code of the contract
166
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure}
167
+ */
168
+ createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
169
+ /**
170
+ * @method
171
+ * @name bydfi#editOrder
172
+ * @description edit a trade order
173
+ * @see https://developers.bydfi.com/en/swap/trade#order-modification
174
+ * @param {string} id order id (mandatory if params.clientOrderId is not provided)
175
+ * @param {string} [symbol] unified symbol of the market to create an order in
176
+ * @param {string} [type] not used by bydfi editOrder
177
+ * @param {string} [side] 'buy' or 'sell'
178
+ * @param {float} [amount] how much of the currency you want to trade in units of the base currency
179
+ * @param {float} [price] the price for the order, in units of the quote currency, ignored in market orders
180
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
181
+ * @param {string} [params.clientOrderId] a unique identifier for the order (could be alternative to id)
182
+ * @param {string} [params.wallet] The unique code of a sub-wallet. W001 is the default wallet and the main wallet code of the contract
183
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure}
184
+ */
185
+ editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
186
+ /**
187
+ * @method
188
+ * @name bydfi#editOrders
189
+ * @description edit a list of trade orders
190
+ * @see https://developers.bydfi.com/en/swap/trade#batch-order-modification
191
+ * @param {Array} orders list of orders to edit, each object should contain the parameters required by editOrder, namely id, symbol, amount, price and params
192
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
193
+ * @param {string} [params.wallet] The unique code of a sub-wallet. W001 is the default wallet and the main wallet code of the contract
194
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure}
195
+ */
196
+ editOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
197
+ createEditOrderRequest(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): any;
198
+ /**
199
+ * @method
200
+ * @name bydfi#cancelAllOrders
201
+ * @description cancel all open orders in a market
202
+ * @see https://developers.bydfi.com/en/swap/trade#complete-order-cancellation
203
+ * @param {string} symbol unified market symbol of the market to cancel orders in
204
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
205
+ * @param {string} [params.wallet] The unique code of a sub-wallet. W001 is the default wallet and the main wallet code of the contract
206
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
207
+ */
208
+ cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
209
+ /**
210
+ * @method
211
+ * @name bydfi#fetchOpenOrders
212
+ * @description fetch all unfilled currently open orders
213
+ * @see https://developers.bydfi.com/en/swap/trade#pending-order-query
214
+ * @see https://developers.bydfi.com/en/swap/trade#planned-order-query
215
+ * @param {string} symbol unified market symbol of the market orders were made in
216
+ * @param {int} [since] the earliest time in ms to fetch orders for
217
+ * @param {int} [limit] the maximum number of order structures to retrieve
218
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
219
+ * @param {bool} [params.trigger] true or false, whether to fetch conditional orders only
220
+ * @param {string} [params.wallet] The unique code of a sub-wallet. W001 is the default wallet and the main wallet code of the contract
221
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
222
+ */
223
+ fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
224
+ /**
225
+ * @method
226
+ * @name bydfi#fetchOpenOrder
227
+ * @description fetch an open order by the id
228
+ * @see https://developers.bydfi.com/en/swap/trade#pending-order-query
229
+ * @see https://developers.bydfi.com/en/swap/trade#planned-order-query
230
+ * @param {string} id order id (mandatory if params.clientOrderId is not provided)
231
+ * @param {string} symbol unified market symbol
232
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
233
+ * @param {bool} [params.trigger] true or false, whether to fetch conditional orders only
234
+ * @param {string} [params.clientOrderId] a unique identifier for the order (could be alternative to id)
235
+ * @param {string} [params.wallet] The unique code of a sub-wallet. W001 is the default wallet and the main wallet code of the contract
236
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure}
237
+ */
238
+ fetchOpenOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
239
+ /**
240
+ * @method
241
+ * @name bydfi#fetchCanceledAndClosedOrders
242
+ * @description fetches information on multiple canceled and closed orders made by the user
243
+ * @see https://developers.bydfi.com/en/swap/trade#historical-orders-query
244
+ * @param {string} symbol unified market symbol of the closed orders
245
+ * @param {int} [since] timestamp in ms of the earliest order
246
+ * @param {int} [limit] the max number of closed orders to return
247
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
248
+ * @param {int} [params.until] timestamp in ms of the latest order
249
+ * @param {string} [params.contractType] FUTURE or DELIVERY, default is FUTURE
250
+ * @param {string} [params.wallet] The unique code of a sub-wallet
251
+ * @param {string} [params.orderType] order type ('LIMIT', 'MARKET', 'LIQ', 'LIMIT_CLOSE', 'MARKET_CLOSE', 'STOP', 'TAKE_PROFIT', 'STOP_MARKET', 'TAKE_PROFIT_MARKET' or 'TRAILING_STOP_MARKET')
252
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
253
+ */
254
+ fetchCanceledAndClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
255
+ handleSinceAndUntil(methodName: string, since?: Int, params?: {}): Dict;
256
+ parseOrder(order: Dict, market?: Market): Order;
257
+ parseOrderType(type: Str): Str;
258
+ parseOrderTimeInForce(timeInForce: Str): Str;
259
+ parseOrderStatus(status: Str): Str;
260
+ /**
261
+ * @method
262
+ * @name bydfi#setLeverage
263
+ * @description set the level of leverage for a market
264
+ * @see https://developers.bydfi.com/en/swap/trade#set-leverage-for-single-trading-pair
265
+ * @param {float} leverage the rate of leverage
266
+ * @param {string} symbol unified market symbol
267
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
268
+ * @param {string} [params.wallet] The unique code of a sub-wallet. W001 is the default wallet and the main wallet code of the contract
269
+ * @returns {object} response from the exchange
270
+ */
271
+ setLeverage(leverage: int, symbol?: Str, params?: {}): Promise<import("./base/types.js").Dictionary<any>>;
272
+ /**
273
+ * @method
274
+ * @name bydfi#fetchLeverage
275
+ * @description fetch the set leverage for a market
276
+ * @see https://developers.bydfi.com/en/swap/trade#get-leverage-for-single-trading-pair
277
+ * @param {string} symbol unified market symbol
278
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
279
+ * @param {string} [params.wallet] The unique code of a sub-wallet. W001 is the default wallet and the main wallet code of the contract
280
+ * @returns {object} a [leverage structure]{@link https://docs.ccxt.com/?id=leverage-structure}
281
+ */
282
+ fetchLeverage(symbol: string, params?: {}): Promise<Leverage>;
283
+ parseLeverage(leverage: Dict, market?: Market): Leverage;
284
+ /**
285
+ * @method
286
+ * @name bydfi#fetchPositions
287
+ * @description fetch all open positions
288
+ * @see https://developers.bydfi.com/en/swap/trade#positions-query
289
+ * @param {string[]} [symbols] list of unified market symbols
290
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
291
+ * @param {string} [params.contractType] FUTURE or DELIVERY, default is FUTURE
292
+ * @param {string} [params.settleCoin] the settlement currency (USDT or USDC or USD)
293
+ * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/?id=position-structure}
294
+ */
295
+ fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
296
+ /**
297
+ * @method
298
+ * @name bydfi#fetchPositionsForSymbol
299
+ * @description fetch open positions for a single market
300
+ * @see https://developers.bydfi.com/en/swap/trade#positions-query
301
+ * @description fetch all open positions for specific symbol
302
+ * @param {string} symbol unified market symbol
303
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
304
+ * @param {string} [params.contractType] FUTURE or DELIVERY, default is FUTURE
305
+ * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/?id=position-structure}
306
+ */
307
+ fetchPositionsForSymbol(symbol: string, params?: {}): Promise<Position[]>;
308
+ parsePosition(position: Dict, market?: Market): Position;
309
+ parsePositionSide(side: Str): Str;
310
+ /**
311
+ * @method
312
+ * @name bydfi#fetchPositionHistory
313
+ * @description fetches historical positions
314
+ * @see https://developers.bydfi.com/en/swap/trade#query-historical-position-profit-and-loss-records
315
+ * @param {string} symbol a unified market symbol
316
+ * @param {int} [since] timestamp in ms of the earliest position to fetch , params["until"] - since <= 7 days
317
+ * @param {int} [limit] the maximum amount of records to fetch (default 500, max 500)
318
+ * @param {object} params extra parameters specific to the exchange api endpoint
319
+ * @param {int} [params.until] timestamp in ms of the latest position to fetch , params["until"] - since <= 7 days
320
+ * @param {string} [params.contractType] FUTURE or DELIVERY, default is FUTURE
321
+ * @param {string} [params.wallet] The unique code of a sub-wallet. W001 is the default wallet and the main wallet code of the contract
322
+ * @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/?id=position-structure}
323
+ */
324
+ fetchPositionHistory(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
325
+ /**
326
+ * @method
327
+ * @name bydfi#fetchPositionsHistory
328
+ * @description fetches historical positions
329
+ * @see https://developers.bydfi.com/en/swap/trade#query-historical-position-profit-and-loss-records
330
+ * @param {string[]} symbols a list of unified market symbols
331
+ * @param {int} [since] timestamp in ms of the earliest position to fetch , params["until"] - since <= 7 days
332
+ * @param {int} [limit] the maximum amount of records to fetch (default 500, max 500)
333
+ * @param {object} params extra parameters specific to the exchange api endpoint
334
+ * @param {int} [params.until] timestamp in ms of the latest position to fetch , params["until"] - since <= 7 days
335
+ * @param {string} [params.contractType] FUTURE or DELIVERY, default is FUTURE
336
+ * @param {string} [params.wallet] The unique code of a sub-wallet. W001 is the default wallet and the main wallet code of the contract
337
+ * @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/?id=position-structure}
338
+ */
339
+ fetchPositionsHistory(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
340
+ /**
341
+ * @method
342
+ * @name bydfi#fetchMarginMode
343
+ * @description fetches the margin mode of a trading pair
344
+ * @see https://developers.bydfi.com/en/swap/user#margin-mode-query
345
+ * @param {string} symbol unified symbol of the market to fetch the margin mode for
346
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
347
+ * @param {string} [params.contractType] FUTURE or DELIVERY, default is FUTURE
348
+ * @param {string} [params.wallet] The unique code of a sub-wallet. W001 is the default wallet and the main wallet code of the contract
349
+ * @returns {object} a [margin mode structure]{@link https://docs.ccxt.com/?id=margin-mode-structure}
350
+ */
351
+ fetchMarginMode(symbol: string, params?: {}): Promise<MarginMode>;
352
+ parseMarginMode(marginMode: Dict, market?: Market): MarginMode;
353
+ /**
354
+ * @method
355
+ * @name bydfi#setMarginMode
356
+ * @description set margin mode to 'cross' or 'isolated'
357
+ * @see https://developers.bydfi.com/en/swap/user#change-margin-type-cross-margin
358
+ * @param {string} marginMode 'cross' or 'isolated'
359
+ * @param {string} symbol unified market symbol
360
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
361
+ * @param {string} [params.contractType] FUTURE or DELIVERY, default is FUTURE
362
+ * @param {string} [params.wallet] The unique code of a sub-wallet. W001 is the default wallet and the main wallet code of the contract
363
+ * @returns {object} response from the exchange
364
+ */
365
+ setMarginMode(marginMode: string, symbol?: Str, params?: {}): Promise<any>;
366
+ /**
367
+ * @method
368
+ * @name bydfi#setPositionMode
369
+ * @description set hedged to true or false for a market, hedged for bydfi is set identically for all markets with same settle currency
370
+ * @see https://developers.bydfi.com/en/swap/user#change-position-mode-dual
371
+ * @param {bool} hedged set to true to use dualSidePosition
372
+ * @param {string} [symbol] not used by bydfi setPositionMode ()
373
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
374
+ * @param {string} [params.contractType] FUTURE or DELIVERY, default is FUTURE
375
+ * @param {string} [params.wallet] The unique code of a sub-wallet. W001 is the default wallet and the main wallet code of the contract
376
+ * @param {string} [params.settleCoin] The settlement currency - USDT or USDC or USD (default is USDT)
377
+ * @returns {object} response from the exchange
378
+ */
379
+ setPositionMode(hedged: boolean, symbol?: Str, params?: {}): Promise<any>;
380
+ /**
381
+ * @method
382
+ * @name bydfi#fetchPositionMode
383
+ * @description fetchs the position mode, hedged or one way, hedged for bydfi is set identically for all markets with same settle currency
384
+ * @see https://developers.bydfi.com/en/swap/user#get-position-mode
385
+ * @param {string} [symbol] unified symbol of the market to fetch the order book for
386
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
387
+ * @param {string} [params.contractType] FUTURE or DELIVERY, default is FUTURE
388
+ * @param {string} [params.wallet] The unique code of a sub-wallet. W001 is the default wallet and the main wallet code of the contract
389
+ * @param {string} [params.settleCoin] The settlement currency - USDT or USDC or USD (default is USDT or settle currency of the market if market is provided)
390
+ * @returns {object} an object detailing whether the market is in hedged or one-way mode
391
+ */
392
+ fetchPositionMode(symbol?: Str, params?: {}): Promise<{
393
+ info: any;
394
+ hedged: boolean;
395
+ }>;
396
+ /**
397
+ * @method
398
+ * @name bydfi#fetchBalance
399
+ * @description query for balance and get the amount of funds available for trading or funds locked in orders
400
+ * @see https://developers.bydfi.com/en/account#asset-inquiry
401
+ * @see https://developers.bydfi.com/en/swap/user#asset-query
402
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
403
+ * @param {string} [params.accountType] the type of account to fetch the balance for, either 'spot' or 'swap' or 'funding' (default is 'spot')
404
+ * @param {string} [params.wallet] *swap only* The unique code of a sub-wallet. W001 is the default wallet and the main wallet code of the contract
405
+ * @param {string} [params.asset] currency id for the balance to fetch
406
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/?id=balance-structure}
407
+ */
408
+ fetchBalance(params?: {}): Promise<Balances>;
409
+ parseBalance(response: any): Balances;
410
+ /**
411
+ * @method
412
+ * @name budfi#transfer
413
+ * @description transfer currency internally between wallets on the same account
414
+ * @see https://developers.bydfi.com/en/account#asset-transfer-between-accounts
415
+ * @param {string} code unified currency code
416
+ * @param {float} amount amount to transfer
417
+ * @param {string} fromAccount 'spot', 'funding', or 'swap'
418
+ * @param {string} toAccount 'spot', 'funding', or 'swap'
419
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
420
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/?id=transfer-structure}
421
+ */
422
+ transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
423
+ /**
424
+ * @method
425
+ * @name bydfi#fetchTransfers
426
+ * @description fetch a history of internal transfers made on an account
427
+ * @see https://developers.bydfi.com/en/account#query-wallet-transfer-records
428
+ * @param {string} code unified currency code of the currency transferred
429
+ * @param {int} [since] the earliest time in ms to fetch transfers for
430
+ * @param {int} [limit] the maximum number of transfers structures to retrieve (default 10)
431
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
432
+ * @param {int} [params.until] the latest time in ms to fetch entries for
433
+ * @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/?id=transfer-structure}
434
+ */
435
+ fetchTransfers(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<TransferEntry[]>;
436
+ parseTransfer(transfer: Dict, currency?: Currency): TransferEntry;
437
+ paraseTransferStatus(status: Str): Str;
438
+ /**
439
+ * @method
440
+ * @name bydfi#fetchDeposits
441
+ * @description fetch all deposits made to an account
442
+ * @see https://developers.bydfi.com/en/spot/account#query-deposit-records
443
+ * @param {string} code unified currency code (mandatory)
444
+ * @param {int} [since] the earliest time in ms to fetch deposits for
445
+ * @param {int} [limit] the maximum number of deposits structures to retrieve
446
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
447
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/?id=transaction-structure}
448
+ */
449
+ fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
450
+ /**
451
+ * @method
452
+ * @name bydfi#fetchWithdrawals
453
+ * @description fetch all withdrawals made from an account
454
+ * @see https://developers.bydfi.com/en/spot/account#query-withdrawal-records
455
+ * @param {string} code unified currency code (mandatory)
456
+ * @param {int} [since] the earliest time in ms to fetch withdrawals for
457
+ * @param {int} [limit] the maximum number of withdrawal structures to retrieve
458
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
459
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/?id=transaction-structure}
460
+ */
461
+ fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
462
+ fetchTransactionsHelper(type: any, code: any, since: any, limit: any, params: any): Promise<any[]>;
463
+ parseTransaction(transaction: Dict, currency?: Currency): Transaction;
464
+ parseTransactionStatus(status: Str): Str;
465
+ sign(path: any, api?: any, method?: string, params?: {}, headers?: any, body?: any): {
466
+ url: any;
467
+ method: string;
468
+ body: any;
469
+ headers: any;
470
+ };
471
+ handleErrors(httpCode: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
472
+ }