ccxt 4.2.36 → 4.2.38
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.
- package/CONTRIBUTING.md +3 -2
- package/README.md +8 -7
- package/dist/ccxt.browser.js +3085 -602
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +4 -1
- package/dist/cjs/src/abstract/blofin.js +9 -0
- package/dist/cjs/src/binance.js +147 -65
- package/dist/cjs/src/bitfinex2.js +122 -122
- package/dist/cjs/src/bitmex.js +22 -3
- package/dist/cjs/src/blofin.js +2103 -0
- package/dist/cjs/src/bybit.js +13 -4
- package/dist/cjs/src/pro/gemini.js +190 -3
- package/dist/cjs/src/pro/kucoin.js +93 -40
- package/js/ccxt.d.ts +5 -2
- package/js/ccxt.js +4 -2
- package/js/src/abstract/blofin.d.ts +36 -0
- package/js/src/abstract/blofin.js +11 -0
- package/js/src/base/types.d.ts +2 -0
- package/js/src/binance.js +147 -65
- package/js/src/bitfinex2.js +122 -122
- package/js/src/bitmex.js +22 -3
- package/js/src/blofin.d.ts +124 -0
- package/js/src/blofin.js +2104 -0
- package/js/src/bybit.js +13 -4
- package/js/src/pro/gemini.d.ts +5 -0
- package/js/src/pro/gemini.js +191 -4
- package/js/src/pro/kucoin.js +93 -40
- package/package.json +2 -2
package/js/src/bitfinex2.js
CHANGED
|
@@ -137,149 +137,149 @@ export default class bitfinex2 extends Exchange {
|
|
|
137
137
|
'api': {
|
|
138
138
|
'public': {
|
|
139
139
|
'get': {
|
|
140
|
-
'conf/{config}': 2.
|
|
141
|
-
'conf/pub:{action}:{object}': 2.
|
|
142
|
-
'conf/pub:{action}:{object}:{detail}': 2.
|
|
143
|
-
'conf/pub:map:{object}': 2.
|
|
144
|
-
'conf/pub:map:{object}:{detail}': 2.
|
|
145
|
-
'conf/pub:map:currency:{detail}': 2.
|
|
146
|
-
'conf/pub:map:currency:sym': 2.
|
|
147
|
-
'conf/pub:map:currency:label': 2.
|
|
148
|
-
'conf/pub:map:currency:unit': 2.
|
|
149
|
-
'conf/pub:map:currency:undl': 2.
|
|
150
|
-
'conf/pub:map:currency:pool': 2.
|
|
151
|
-
'conf/pub:map:currency:explorer': 2.
|
|
152
|
-
'conf/pub:map:currency:tx:fee': 2.
|
|
153
|
-
'conf/pub:map:tx:method': 2.
|
|
154
|
-
'conf/pub:list:{object}': 2.
|
|
155
|
-
'conf/pub:list:{object}:{detail}': 2.
|
|
156
|
-
'conf/pub:list:currency': 2.
|
|
157
|
-
'conf/pub:list:pair:exchange': 2.
|
|
158
|
-
'conf/pub:list:pair:margin': 2.
|
|
159
|
-
'conf/pub:list:pair:futures': 2.
|
|
160
|
-
'conf/pub:list:competitions': 2.
|
|
161
|
-
'conf/pub:info:{object}': 2.
|
|
162
|
-
'conf/pub:info:{object}:{detail}': 2.
|
|
163
|
-
'conf/pub:info:pair': 2.
|
|
164
|
-
'conf/pub:info:pair:futures': 2.
|
|
165
|
-
'conf/pub:info:tx:status': 2.
|
|
166
|
-
'conf/pub:fees': 2.
|
|
140
|
+
'conf/{config}': 2.7,
|
|
141
|
+
'conf/pub:{action}:{object}': 2.7,
|
|
142
|
+
'conf/pub:{action}:{object}:{detail}': 2.7,
|
|
143
|
+
'conf/pub:map:{object}': 2.7,
|
|
144
|
+
'conf/pub:map:{object}:{detail}': 2.7,
|
|
145
|
+
'conf/pub:map:currency:{detail}': 2.7,
|
|
146
|
+
'conf/pub:map:currency:sym': 2.7,
|
|
147
|
+
'conf/pub:map:currency:label': 2.7,
|
|
148
|
+
'conf/pub:map:currency:unit': 2.7,
|
|
149
|
+
'conf/pub:map:currency:undl': 2.7,
|
|
150
|
+
'conf/pub:map:currency:pool': 2.7,
|
|
151
|
+
'conf/pub:map:currency:explorer': 2.7,
|
|
152
|
+
'conf/pub:map:currency:tx:fee': 2.7,
|
|
153
|
+
'conf/pub:map:tx:method': 2.7,
|
|
154
|
+
'conf/pub:list:{object}': 2.7,
|
|
155
|
+
'conf/pub:list:{object}:{detail}': 2.7,
|
|
156
|
+
'conf/pub:list:currency': 2.7,
|
|
157
|
+
'conf/pub:list:pair:exchange': 2.7,
|
|
158
|
+
'conf/pub:list:pair:margin': 2.7,
|
|
159
|
+
'conf/pub:list:pair:futures': 2.7,
|
|
160
|
+
'conf/pub:list:competitions': 2.7,
|
|
161
|
+
'conf/pub:info:{object}': 2.7,
|
|
162
|
+
'conf/pub:info:{object}:{detail}': 2.7,
|
|
163
|
+
'conf/pub:info:pair': 2.7,
|
|
164
|
+
'conf/pub:info:pair:futures': 2.7,
|
|
165
|
+
'conf/pub:info:tx:status': 2.7,
|
|
166
|
+
'conf/pub:fees': 2.7,
|
|
167
167
|
'platform/status': 8,
|
|
168
|
-
'tickers': 2.
|
|
169
|
-
'ticker/{symbol}': 2.
|
|
170
|
-
'tickers/hist': 2.
|
|
171
|
-
'trades/{symbol}/hist': 2.
|
|
168
|
+
'tickers': 2.7,
|
|
169
|
+
'ticker/{symbol}': 2.7,
|
|
170
|
+
'tickers/hist': 2.7,
|
|
171
|
+
'trades/{symbol}/hist': 2.7,
|
|
172
172
|
'book/{symbol}/{precision}': 1,
|
|
173
173
|
'book/{symbol}/P0': 1,
|
|
174
174
|
'book/{symbol}/P1': 1,
|
|
175
175
|
'book/{symbol}/P2': 1,
|
|
176
176
|
'book/{symbol}/P3': 1,
|
|
177
177
|
'book/{symbol}/R0': 1,
|
|
178
|
-
'stats1/{key}:{size}:{symbol}:{side}/{section}': 2.
|
|
179
|
-
'stats1/{key}:{size}:{symbol}:{side}/last': 2.
|
|
180
|
-
'stats1/{key}:{size}:{symbol}:{side}/hist': 2.
|
|
181
|
-
'stats1/{key}:{size}:{symbol}/{section}': 2.
|
|
182
|
-
'stats1/{key}:{size}:{symbol}/last': 2.
|
|
183
|
-
'stats1/{key}:{size}:{symbol}/hist': 2.
|
|
184
|
-
'stats1/{key}:{size}:{symbol}:long/last': 2.
|
|
185
|
-
'stats1/{key}:{size}:{symbol}:long/hist': 2.
|
|
186
|
-
'stats1/{key}:{size}:{symbol}:short/last': 2.
|
|
187
|
-
'stats1/{key}:{size}:{symbol}:short/hist': 2.
|
|
188
|
-
'candles/trade:{timeframe}:{symbol}:{period}/{section}': 2.
|
|
189
|
-
'candles/trade:{timeframe}:{symbol}/{section}': 2.
|
|
190
|
-
'candles/trade:{timeframe}:{symbol}/last': 2.
|
|
191
|
-
'candles/trade:{timeframe}:{symbol}/hist': 2.
|
|
192
|
-
'status/{type}': 2.
|
|
193
|
-
'status/deriv': 2.
|
|
194
|
-
'status/deriv/{symbol}/hist': 2.
|
|
178
|
+
'stats1/{key}:{size}:{symbol}:{side}/{section}': 2.7,
|
|
179
|
+
'stats1/{key}:{size}:{symbol}:{side}/last': 2.7,
|
|
180
|
+
'stats1/{key}:{size}:{symbol}:{side}/hist': 2.7,
|
|
181
|
+
'stats1/{key}:{size}:{symbol}/{section}': 2.7,
|
|
182
|
+
'stats1/{key}:{size}:{symbol}/last': 2.7,
|
|
183
|
+
'stats1/{key}:{size}:{symbol}/hist': 2.7,
|
|
184
|
+
'stats1/{key}:{size}:{symbol}:long/last': 2.7,
|
|
185
|
+
'stats1/{key}:{size}:{symbol}:long/hist': 2.7,
|
|
186
|
+
'stats1/{key}:{size}:{symbol}:short/last': 2.7,
|
|
187
|
+
'stats1/{key}:{size}:{symbol}:short/hist': 2.7,
|
|
188
|
+
'candles/trade:{timeframe}:{symbol}:{period}/{section}': 2.7,
|
|
189
|
+
'candles/trade:{timeframe}:{symbol}/{section}': 2.7,
|
|
190
|
+
'candles/trade:{timeframe}:{symbol}/last': 2.7,
|
|
191
|
+
'candles/trade:{timeframe}:{symbol}/hist': 2.7,
|
|
192
|
+
'status/{type}': 2.7,
|
|
193
|
+
'status/deriv': 2.7,
|
|
194
|
+
'status/deriv/{symbol}/hist': 2.7,
|
|
195
195
|
'liquidations/hist': 80,
|
|
196
|
-
'rankings/{key}:{timeframe}:{symbol}/{section}': 2.
|
|
197
|
-
'rankings/{key}:{timeframe}:{symbol}/hist': 2.
|
|
198
|
-
'pulse/hist': 2.
|
|
199
|
-
'pulse/profile/{nickname}': 2.
|
|
196
|
+
'rankings/{key}:{timeframe}:{symbol}/{section}': 2.7,
|
|
197
|
+
'rankings/{key}:{timeframe}:{symbol}/hist': 2.7,
|
|
198
|
+
'pulse/hist': 2.7,
|
|
199
|
+
'pulse/profile/{nickname}': 2.7,
|
|
200
200
|
'funding/stats/{symbol}/hist': 10, // ratelimit not in docs
|
|
201
201
|
},
|
|
202
202
|
'post': {
|
|
203
|
-
'calc/trade/avg': 2.
|
|
204
|
-
'calc/fx': 2.
|
|
203
|
+
'calc/trade/avg': 2.7,
|
|
204
|
+
'calc/fx': 2.7,
|
|
205
205
|
},
|
|
206
206
|
},
|
|
207
207
|
'private': {
|
|
208
208
|
'post': {
|
|
209
209
|
// 'auth/r/orders/{symbol}/new', // outdated
|
|
210
210
|
// 'auth/r/stats/perf:{timeframe}/hist', // outdated
|
|
211
|
-
'auth/r/wallets': 2.
|
|
212
|
-
'auth/r/wallets/hist': 2.
|
|
213
|
-
'auth/r/orders': 2.
|
|
214
|
-
'auth/r/orders/{symbol}': 2.
|
|
215
|
-
'auth/w/order/submit': 2.
|
|
216
|
-
'auth/w/order/update': 2.
|
|
217
|
-
'auth/w/order/cancel': 2.
|
|
218
|
-
'auth/w/order/multi': 2.
|
|
219
|
-
'auth/w/order/cancel/multi': 2.
|
|
220
|
-
'auth/r/orders/{symbol}/hist': 2.
|
|
221
|
-
'auth/r/orders/hist': 2.
|
|
222
|
-
'auth/r/order/{symbol}:{id}/trades': 2.
|
|
223
|
-
'auth/r/trades/{symbol}/hist': 2.
|
|
224
|
-
'auth/r/trades/hist': 2.
|
|
225
|
-
'auth/r/ledgers/{currency}/hist': 2.
|
|
226
|
-
'auth/r/ledgers/hist': 2.
|
|
227
|
-
'auth/r/info/margin/{key}': 2.
|
|
228
|
-
'auth/r/info/margin/base': 2.
|
|
229
|
-
'auth/r/info/margin/sym_all': 2.
|
|
230
|
-
'auth/r/positions': 2.
|
|
231
|
-
'auth/w/position/claim': 2.
|
|
232
|
-
'auth/w/position/increase:': 2.
|
|
233
|
-
'auth/r/position/increase/info': 2.
|
|
234
|
-
'auth/r/positions/hist': 2.
|
|
235
|
-
'auth/r/positions/audit': 2.
|
|
236
|
-
'auth/r/positions/snap': 2.
|
|
237
|
-
'auth/w/deriv/collateral/set': 2.
|
|
238
|
-
'auth/w/deriv/collateral/limits': 2.
|
|
239
|
-
'auth/r/funding/offers': 2.
|
|
240
|
-
'auth/r/funding/offers/{symbol}': 2.
|
|
241
|
-
'auth/w/funding/offer/submit': 2.
|
|
242
|
-
'auth/w/funding/offer/cancel': 2.
|
|
243
|
-
'auth/w/funding/offer/cancel/all': 2.
|
|
244
|
-
'auth/w/funding/close': 2.
|
|
245
|
-
'auth/w/funding/auto': 2.
|
|
246
|
-
'auth/w/funding/keep': 2.
|
|
247
|
-
'auth/r/funding/offers/{symbol}/hist': 2.
|
|
248
|
-
'auth/r/funding/offers/hist': 2.
|
|
249
|
-
'auth/r/funding/loans': 2.
|
|
250
|
-
'auth/r/funding/loans/hist': 2.
|
|
251
|
-
'auth/r/funding/loans/{symbol}': 2.
|
|
252
|
-
'auth/r/funding/loans/{symbol}/hist': 2.
|
|
253
|
-
'auth/r/funding/credits': 2.
|
|
254
|
-
'auth/r/funding/credits/hist': 2.
|
|
255
|
-
'auth/r/funding/credits/{symbol}': 2.
|
|
256
|
-
'auth/r/funding/credits/{symbol}/hist': 2.
|
|
257
|
-
'auth/r/funding/trades/{symbol}/hist': 2.
|
|
258
|
-
'auth/r/funding/trades/hist': 2.
|
|
259
|
-
'auth/r/info/funding/{key}': 2.
|
|
260
|
-
'auth/r/info/user': 2.
|
|
261
|
-
'auth/r/summary': 2.
|
|
262
|
-
'auth/r/logins/hist': 2.
|
|
263
|
-
'auth/r/permissions': 2.
|
|
264
|
-
'auth/w/token': 2.
|
|
265
|
-
'auth/r/audit/hist': 2.
|
|
266
|
-
'auth/w/transfer': 2.
|
|
211
|
+
'auth/r/wallets': 2.7,
|
|
212
|
+
'auth/r/wallets/hist': 2.7,
|
|
213
|
+
'auth/r/orders': 2.7,
|
|
214
|
+
'auth/r/orders/{symbol}': 2.7,
|
|
215
|
+
'auth/w/order/submit': 2.7,
|
|
216
|
+
'auth/w/order/update': 2.7,
|
|
217
|
+
'auth/w/order/cancel': 2.7,
|
|
218
|
+
'auth/w/order/multi': 2.7,
|
|
219
|
+
'auth/w/order/cancel/multi': 2.7,
|
|
220
|
+
'auth/r/orders/{symbol}/hist': 2.7,
|
|
221
|
+
'auth/r/orders/hist': 2.7,
|
|
222
|
+
'auth/r/order/{symbol}:{id}/trades': 2.7,
|
|
223
|
+
'auth/r/trades/{symbol}/hist': 2.7,
|
|
224
|
+
'auth/r/trades/hist': 2.7,
|
|
225
|
+
'auth/r/ledgers/{currency}/hist': 2.7,
|
|
226
|
+
'auth/r/ledgers/hist': 2.7,
|
|
227
|
+
'auth/r/info/margin/{key}': 2.7,
|
|
228
|
+
'auth/r/info/margin/base': 2.7,
|
|
229
|
+
'auth/r/info/margin/sym_all': 2.7,
|
|
230
|
+
'auth/r/positions': 2.7,
|
|
231
|
+
'auth/w/position/claim': 2.7,
|
|
232
|
+
'auth/w/position/increase:': 2.7,
|
|
233
|
+
'auth/r/position/increase/info': 2.7,
|
|
234
|
+
'auth/r/positions/hist': 2.7,
|
|
235
|
+
'auth/r/positions/audit': 2.7,
|
|
236
|
+
'auth/r/positions/snap': 2.7,
|
|
237
|
+
'auth/w/deriv/collateral/set': 2.7,
|
|
238
|
+
'auth/w/deriv/collateral/limits': 2.7,
|
|
239
|
+
'auth/r/funding/offers': 2.7,
|
|
240
|
+
'auth/r/funding/offers/{symbol}': 2.7,
|
|
241
|
+
'auth/w/funding/offer/submit': 2.7,
|
|
242
|
+
'auth/w/funding/offer/cancel': 2.7,
|
|
243
|
+
'auth/w/funding/offer/cancel/all': 2.7,
|
|
244
|
+
'auth/w/funding/close': 2.7,
|
|
245
|
+
'auth/w/funding/auto': 2.7,
|
|
246
|
+
'auth/w/funding/keep': 2.7,
|
|
247
|
+
'auth/r/funding/offers/{symbol}/hist': 2.7,
|
|
248
|
+
'auth/r/funding/offers/hist': 2.7,
|
|
249
|
+
'auth/r/funding/loans': 2.7,
|
|
250
|
+
'auth/r/funding/loans/hist': 2.7,
|
|
251
|
+
'auth/r/funding/loans/{symbol}': 2.7,
|
|
252
|
+
'auth/r/funding/loans/{symbol}/hist': 2.7,
|
|
253
|
+
'auth/r/funding/credits': 2.7,
|
|
254
|
+
'auth/r/funding/credits/hist': 2.7,
|
|
255
|
+
'auth/r/funding/credits/{symbol}': 2.7,
|
|
256
|
+
'auth/r/funding/credits/{symbol}/hist': 2.7,
|
|
257
|
+
'auth/r/funding/trades/{symbol}/hist': 2.7,
|
|
258
|
+
'auth/r/funding/trades/hist': 2.7,
|
|
259
|
+
'auth/r/info/funding/{key}': 2.7,
|
|
260
|
+
'auth/r/info/user': 2.7,
|
|
261
|
+
'auth/r/summary': 2.7,
|
|
262
|
+
'auth/r/logins/hist': 2.7,
|
|
263
|
+
'auth/r/permissions': 2.7,
|
|
264
|
+
'auth/w/token': 2.7,
|
|
265
|
+
'auth/r/audit/hist': 2.7,
|
|
266
|
+
'auth/w/transfer': 2.7,
|
|
267
267
|
'auth/w/deposit/address': 24,
|
|
268
268
|
'auth/w/deposit/invoice': 24,
|
|
269
269
|
'auth/w/withdraw': 24,
|
|
270
|
-
'auth/r/movements/{currency}/hist': 2.
|
|
271
|
-
'auth/r/movements/hist': 2.
|
|
272
|
-
'auth/r/alerts': 5.
|
|
273
|
-
'auth/w/alert/set': 2.
|
|
274
|
-
'auth/w/alert/price:{symbol}:{price}/del': 2.
|
|
275
|
-
'auth/w/alert/{type}:{symbol}:{price}/del': 2.
|
|
276
|
-
'auth/calc/order/avail': 2.
|
|
277
|
-
'auth/w/settings/set': 2.
|
|
278
|
-
'auth/r/settings': 2.
|
|
279
|
-
'auth/w/settings/del': 2.
|
|
280
|
-
'auth/r/pulse/hist': 2.
|
|
270
|
+
'auth/r/movements/{currency}/hist': 2.7,
|
|
271
|
+
'auth/r/movements/hist': 2.7,
|
|
272
|
+
'auth/r/alerts': 5.34,
|
|
273
|
+
'auth/w/alert/set': 2.7,
|
|
274
|
+
'auth/w/alert/price:{symbol}:{price}/del': 2.7,
|
|
275
|
+
'auth/w/alert/{type}:{symbol}:{price}/del': 2.7,
|
|
276
|
+
'auth/calc/order/avail': 2.7,
|
|
277
|
+
'auth/w/settings/set': 2.7,
|
|
278
|
+
'auth/r/settings': 2.7,
|
|
279
|
+
'auth/w/settings/del': 2.7,
|
|
280
|
+
'auth/r/pulse/hist': 2.7,
|
|
281
281
|
'auth/w/pulse/add': 16,
|
|
282
|
-
'auth/w/pulse/del': 2.
|
|
282
|
+
'auth/w/pulse/del': 2.7,
|
|
283
283
|
},
|
|
284
284
|
},
|
|
285
285
|
},
|
package/js/src/bitmex.js
CHANGED
|
@@ -285,6 +285,7 @@ export default class bitmex extends Exchange {
|
|
|
285
285
|
* @method
|
|
286
286
|
* @name bitmex#fetchCurrencies
|
|
287
287
|
* @description fetches all available currencies on an exchange
|
|
288
|
+
* @see https://www.bitmex.com/api/explorer/#!/Wallet/Wallet_getAssetsConfig
|
|
288
289
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
289
290
|
* @returns {object} an associative dictionary of currencies
|
|
290
291
|
*/
|
|
@@ -770,6 +771,7 @@ export default class bitmex extends Exchange {
|
|
|
770
771
|
* @method
|
|
771
772
|
* @name bitmex#fetchBalance
|
|
772
773
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
774
|
+
* @see https://www.bitmex.com/api/explorer/#!/User/User_getMargin
|
|
773
775
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
774
776
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
775
777
|
*/
|
|
@@ -832,6 +834,7 @@ export default class bitmex extends Exchange {
|
|
|
832
834
|
* @method
|
|
833
835
|
* @name bitmex#fetchOrderBook
|
|
834
836
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
837
|
+
* @see https://www.bitmex.com/api/explorer/#!/OrderBook/OrderBook_getL2
|
|
835
838
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
836
839
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
837
840
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -875,6 +878,7 @@ export default class bitmex extends Exchange {
|
|
|
875
878
|
* @method
|
|
876
879
|
* @name bitmex#fetchOrder
|
|
877
880
|
* @description fetches information on an order made by the user
|
|
881
|
+
* @see https://www.bitmex.com/api/explorer/#!/Order/Order_getOrders
|
|
878
882
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
879
883
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
880
884
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -943,6 +947,7 @@ export default class bitmex extends Exchange {
|
|
|
943
947
|
* @method
|
|
944
948
|
* @name bitmex#fetchOpenOrders
|
|
945
949
|
* @description fetch all unfilled currently open orders
|
|
950
|
+
* @see https://www.bitmex.com/api/explorer/#!/Order/Order_getOrders
|
|
946
951
|
* @param {string} symbol unified market symbol
|
|
947
952
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
948
953
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -961,6 +966,7 @@ export default class bitmex extends Exchange {
|
|
|
961
966
|
* @method
|
|
962
967
|
* @name bitmex#fetchClosedOrders
|
|
963
968
|
* @description fetches information on multiple closed orders made by the user
|
|
969
|
+
* @see https://www.bitmex.com/api/explorer/#!/Order/Order_getOrders
|
|
964
970
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
965
971
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
966
972
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -975,8 +981,8 @@ export default class bitmex extends Exchange {
|
|
|
975
981
|
/**
|
|
976
982
|
* @method
|
|
977
983
|
* @name bitmex#fetchMyTrades
|
|
978
|
-
* @see https://www.bitmex.com/api/explorer/#!/Execution/Execution_getTradeHistory
|
|
979
984
|
* @description fetch all trades made by the user
|
|
985
|
+
* @see https://www.bitmex.com/api/explorer/#!/Execution/Execution_getTradeHistory
|
|
980
986
|
* @param {string} symbol unified market symbol
|
|
981
987
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
982
988
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -1185,6 +1191,7 @@ export default class bitmex extends Exchange {
|
|
|
1185
1191
|
* @method
|
|
1186
1192
|
* @name bitmex#fetchLedger
|
|
1187
1193
|
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
1194
|
+
* @see https://www.bitmex.com/api/explorer/#!/User/User_getWalletHistory
|
|
1188
1195
|
* @param {string} code unified currency code, default is undefined
|
|
1189
1196
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
1190
1197
|
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
@@ -1236,6 +1243,7 @@ export default class bitmex extends Exchange {
|
|
|
1236
1243
|
* @method
|
|
1237
1244
|
* @name bitmex#fetchDepositsWithdrawals
|
|
1238
1245
|
* @description fetch history of deposits and withdrawals
|
|
1246
|
+
* @see https://www.bitmex.com/api/explorer/#!/User/User_getWalletHistory
|
|
1239
1247
|
* @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
|
|
1240
1248
|
* @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
|
|
1241
1249
|
* @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
|
|
@@ -1354,6 +1362,7 @@ export default class bitmex extends Exchange {
|
|
|
1354
1362
|
* @method
|
|
1355
1363
|
* @name bitmex#fetchTicker
|
|
1356
1364
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
1365
|
+
* @see https://www.bitmex.com/api/explorer/#!/Instrument/Instrument_get
|
|
1357
1366
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1358
1367
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1359
1368
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -1375,6 +1384,7 @@ export default class bitmex extends Exchange {
|
|
|
1375
1384
|
* @method
|
|
1376
1385
|
* @name bitmex#fetchTickers
|
|
1377
1386
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
1387
|
+
* @see https://www.bitmex.com/api/explorer/#!/Instrument/Instrument_getActiveAndIndices
|
|
1378
1388
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1379
1389
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1380
1390
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -1457,8 +1467,8 @@ export default class bitmex extends Exchange {
|
|
|
1457
1467
|
/**
|
|
1458
1468
|
* @method
|
|
1459
1469
|
* @name bitmex#fetchOHLCV
|
|
1460
|
-
* @see https://www.bitmex.com/api/explorer/#!/Trade/Trade_getBucketed
|
|
1461
1470
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1471
|
+
* @see https://www.bitmex.com/api/explorer/#!/Trade/Trade_getBucketed
|
|
1462
1472
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1463
1473
|
* @param {string} timeframe the length of time each candle represents
|
|
1464
1474
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -1773,8 +1783,8 @@ export default class bitmex extends Exchange {
|
|
|
1773
1783
|
/**
|
|
1774
1784
|
* @method
|
|
1775
1785
|
* @name bitmex#fetchTrades
|
|
1776
|
-
* @see https://www.bitmex.com/api/explorer/#!/Trade/Trade_get
|
|
1777
1786
|
* @description get the list of most recent trades for a particular symbol
|
|
1787
|
+
* @see https://www.bitmex.com/api/explorer/#!/Trade/Trade_get
|
|
1778
1788
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
1779
1789
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
1780
1790
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -1995,6 +2005,7 @@ export default class bitmex extends Exchange {
|
|
|
1995
2005
|
* @method
|
|
1996
2006
|
* @name bitmex#cancelOrder
|
|
1997
2007
|
* @description cancels an open order
|
|
2008
|
+
* @see https://www.bitmex.com/api/explorer/#!/Order/Order_cancel
|
|
1998
2009
|
* @param {string} id order id
|
|
1999
2010
|
* @param {string} symbol not used by bitmex cancelOrder ()
|
|
2000
2011
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -2026,6 +2037,7 @@ export default class bitmex extends Exchange {
|
|
|
2026
2037
|
* @method
|
|
2027
2038
|
* @name bitmex#cancelOrders
|
|
2028
2039
|
* @description cancel multiple orders
|
|
2040
|
+
* @see https://www.bitmex.com/api/explorer/#!/Order/Order_cancel
|
|
2029
2041
|
* @param {string[]} ids order ids
|
|
2030
2042
|
* @param {string} symbol not used by bitmex cancelOrders ()
|
|
2031
2043
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -2051,6 +2063,7 @@ export default class bitmex extends Exchange {
|
|
|
2051
2063
|
* @method
|
|
2052
2064
|
* @name bitmex#cancelAllOrders
|
|
2053
2065
|
* @description cancel all open orders
|
|
2066
|
+
* @see https://www.bitmex.com/api/explorer/#!/Order/Order_cancelAll
|
|
2054
2067
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
2055
2068
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2056
2069
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -2109,6 +2122,7 @@ export default class bitmex extends Exchange {
|
|
|
2109
2122
|
* @method
|
|
2110
2123
|
* @name bitmex#fetchPositions
|
|
2111
2124
|
* @description fetch all open positions
|
|
2125
|
+
* @see https://www.bitmex.com/api/explorer/#!/Position/Position_get
|
|
2112
2126
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
2113
2127
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2114
2128
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
@@ -2367,6 +2381,7 @@ export default class bitmex extends Exchange {
|
|
|
2367
2381
|
* @method
|
|
2368
2382
|
* @name bitmex#withdraw
|
|
2369
2383
|
* @description make a withdrawal
|
|
2384
|
+
* @see https://www.bitmex.com/api/explorer/#!/User/User_requestWithdrawal
|
|
2370
2385
|
* @param {string} code unified currency code
|
|
2371
2386
|
* @param {float} amount the amount to withdraw
|
|
2372
2387
|
* @param {string} address the address to withdraw to
|
|
@@ -2414,6 +2429,7 @@ export default class bitmex extends Exchange {
|
|
|
2414
2429
|
* @method
|
|
2415
2430
|
* @name bitmex#fetchFundingRates
|
|
2416
2431
|
* @description fetch the funding rate for multiple markets
|
|
2432
|
+
* @see https://www.bitmex.com/api/explorer/#!/Instrument/Instrument_getActiveAndIndices
|
|
2417
2433
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
2418
2434
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2419
2435
|
* @returns {object} a dictionary of [funding rates structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexe by market symbols
|
|
@@ -2465,6 +2481,7 @@ export default class bitmex extends Exchange {
|
|
|
2465
2481
|
* @method
|
|
2466
2482
|
* @name bitmex#fetchFundingRateHistory
|
|
2467
2483
|
* @description Fetches the history of funding rates
|
|
2484
|
+
* @see https://www.bitmex.com/api/explorer/#!/Funding/Funding_get
|
|
2468
2485
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
2469
2486
|
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
2470
2487
|
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
@@ -2548,6 +2565,7 @@ export default class bitmex extends Exchange {
|
|
|
2548
2565
|
* @method
|
|
2549
2566
|
* @name bitmex#setLeverage
|
|
2550
2567
|
* @description set the level of leverage for a market
|
|
2568
|
+
* @see https://www.bitmex.com/api/explorer/#!/Position/Position_updateLeverage
|
|
2551
2569
|
* @param {float} leverage the rate of leverage
|
|
2552
2570
|
* @param {string} symbol unified market symbol
|
|
2553
2571
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -2575,6 +2593,7 @@ export default class bitmex extends Exchange {
|
|
|
2575
2593
|
* @method
|
|
2576
2594
|
* @name bitmex#setMarginMode
|
|
2577
2595
|
* @description set margin mode to 'cross' or 'isolated'
|
|
2596
|
+
* @see https://www.bitmex.com/api/explorer/#!/Position/Position_isolateMargin
|
|
2578
2597
|
* @param {string} marginMode 'cross' or 'isolated'
|
|
2579
2598
|
* @param {string} symbol unified market symbol
|
|
2580
2599
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import Exchange from './abstract/blofin.js';
|
|
2
|
+
import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderRequest, Str, Transaction, Ticker, OrderBook, Balances, Tickers, Market, Strings, Currency, Position, TransferEntry } from './base/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* @class blofin
|
|
5
|
+
* @augments Exchange
|
|
6
|
+
*/
|
|
7
|
+
export default class blofin extends Exchange {
|
|
8
|
+
describe(): any;
|
|
9
|
+
fetchMarkets(params?: {}): Promise<import("./base/types.js").MarketInterface[]>;
|
|
10
|
+
parseMarket(market: any): Market;
|
|
11
|
+
fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
|
|
12
|
+
parseTicker(ticker: any, market?: Market): Ticker;
|
|
13
|
+
fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
14
|
+
fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
15
|
+
parseTrade(trade: any, market?: Market): Trade;
|
|
16
|
+
fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
17
|
+
parseOHLCV(ohlcv: any, market?: Market): OHLCV;
|
|
18
|
+
fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
19
|
+
fetchFundingRateHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
|
|
20
|
+
parseFundingRate(contract: any, market?: Market): {
|
|
21
|
+
info: any;
|
|
22
|
+
symbol: string;
|
|
23
|
+
markPrice: any;
|
|
24
|
+
indexPrice: any;
|
|
25
|
+
interestRate: number;
|
|
26
|
+
estimatedSettlePrice: any;
|
|
27
|
+
timestamp: any;
|
|
28
|
+
datetime: any;
|
|
29
|
+
fundingRate: number;
|
|
30
|
+
fundingTimestamp: number;
|
|
31
|
+
fundingDatetime: string;
|
|
32
|
+
nextFundingRate: number;
|
|
33
|
+
nextFundingTimestamp: number;
|
|
34
|
+
nextFundingDatetime: string;
|
|
35
|
+
previousFundingRate: any;
|
|
36
|
+
previousFundingTimestamp: any;
|
|
37
|
+
previousFundingDatetime: any;
|
|
38
|
+
};
|
|
39
|
+
fetchFundingRate(symbol: string, params?: {}): Promise<{
|
|
40
|
+
info: any;
|
|
41
|
+
symbol: string;
|
|
42
|
+
markPrice: any;
|
|
43
|
+
indexPrice: any;
|
|
44
|
+
interestRate: number;
|
|
45
|
+
estimatedSettlePrice: any;
|
|
46
|
+
timestamp: any;
|
|
47
|
+
datetime: any;
|
|
48
|
+
fundingRate: number;
|
|
49
|
+
fundingTimestamp: number;
|
|
50
|
+
fundingDatetime: string;
|
|
51
|
+
nextFundingRate: number;
|
|
52
|
+
nextFundingTimestamp: number;
|
|
53
|
+
nextFundingDatetime: string;
|
|
54
|
+
previousFundingRate: any;
|
|
55
|
+
previousFundingTimestamp: any;
|
|
56
|
+
previousFundingDatetime: any;
|
|
57
|
+
}>;
|
|
58
|
+
parseBalanceByType(type: any, response: any): Balances;
|
|
59
|
+
parseTradingBalance(response: any): Balances;
|
|
60
|
+
parseFundingBalance(response: any): Balances;
|
|
61
|
+
parseTradingFee(fee: any, market?: Market): {
|
|
62
|
+
info: any;
|
|
63
|
+
symbol: string;
|
|
64
|
+
maker: number;
|
|
65
|
+
taker: number;
|
|
66
|
+
};
|
|
67
|
+
fetchBalance(params?: {}): Promise<Balances>;
|
|
68
|
+
createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): any;
|
|
69
|
+
parseOrderStatus(status: any): string;
|
|
70
|
+
parseOrder(order: any, market?: Market): Order;
|
|
71
|
+
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
72
|
+
createTpslOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount?: number, price?: number, params?: {}): any;
|
|
73
|
+
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
74
|
+
createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
|
|
75
|
+
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
76
|
+
fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
77
|
+
fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
78
|
+
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
79
|
+
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
80
|
+
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
|
81
|
+
parseTransactionStatus(status: any): string;
|
|
82
|
+
parseLedgerEntryType(type: any): string;
|
|
83
|
+
parseLedgerEntry(item: any, currency?: Currency): {
|
|
84
|
+
id: string;
|
|
85
|
+
info: any;
|
|
86
|
+
timestamp: number;
|
|
87
|
+
datetime: string;
|
|
88
|
+
fromAccount: string;
|
|
89
|
+
toAccount: string;
|
|
90
|
+
type: string;
|
|
91
|
+
currency: string;
|
|
92
|
+
amount: number;
|
|
93
|
+
clientId: string;
|
|
94
|
+
status: string;
|
|
95
|
+
};
|
|
96
|
+
parseIds(ids: any): any;
|
|
97
|
+
cancelOrders(ids: any, symbol?: Str, params?: {}): Promise<Order[]>;
|
|
98
|
+
transfer(code: string, amount: number, fromAccount: any, toAccount: any, params?: {}): Promise<TransferEntry>;
|
|
99
|
+
parseTransfer(transfer: any, currency?: Currency): {
|
|
100
|
+
info: any;
|
|
101
|
+
id: string;
|
|
102
|
+
timestamp: any;
|
|
103
|
+
datetime: any;
|
|
104
|
+
currency: any;
|
|
105
|
+
amount: any;
|
|
106
|
+
fromAccount: any;
|
|
107
|
+
toAccount: any;
|
|
108
|
+
status: any;
|
|
109
|
+
};
|
|
110
|
+
fetchPosition(symbol: string, params?: {}): Promise<Position>;
|
|
111
|
+
fetchPositions(symbols?: string[], params?: {}): Promise<Position[]>;
|
|
112
|
+
parsePosition(position: any, market?: Market): Position;
|
|
113
|
+
fetchLeverage(symbol: string, params?: {}): Promise<any>;
|
|
114
|
+
setLeverage(leverage: any, symbol?: Str, params?: {}): Promise<any>;
|
|
115
|
+
closePosition(symbol: string, side?: OrderSide, params?: {}): Promise<Order>;
|
|
116
|
+
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
117
|
+
handleErrors(httpCode: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
|
|
118
|
+
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
119
|
+
url: string;
|
|
120
|
+
method: string;
|
|
121
|
+
body: any;
|
|
122
|
+
headers: any;
|
|
123
|
+
};
|
|
124
|
+
}
|