ccxt 4.3.65 → 4.3.67
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/README.md +4 -3
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +2 -2
- package/dist/cjs/src/bingx.js +151 -19
- package/dist/cjs/src/bithumb.js +61 -17
- package/dist/cjs/src/hyperliquid.js +63 -7
- package/dist/cjs/src/independentreserve.js +0 -1
- package/dist/cjs/src/kraken.js +27 -0
- package/dist/cjs/src/pro/hyperliquid.js +103 -1
- package/dist/cjs/src/pro/okx.js +22 -9
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bingx.d.ts +7 -0
- package/js/src/base/Exchange.d.ts +14 -13
- package/js/src/base/Exchange.js +2 -2
- package/js/src/bingx.js +151 -19
- package/js/src/bithumb.js +61 -17
- package/js/src/hyperliquid.d.ts +3 -1
- package/js/src/hyperliquid.js +63 -7
- package/js/src/independentreserve.js +1 -1
- package/js/src/kraken.d.ts +7 -0
- package/js/src/kraken.js +27 -0
- package/js/src/pro/bitget.d.ts +1 -1
- package/js/src/pro/bybit.d.ts +1 -1
- package/js/src/pro/coinone.d.ts +1 -1
- package/js/src/pro/currencycom.d.ts +1 -1
- package/js/src/pro/hollaex.d.ts +1 -1
- package/js/src/pro/hyperliquid.d.ts +5 -2
- package/js/src/pro/hyperliquid.js +103 -1
- package/js/src/pro/kucoin.d.ts +1 -1
- package/js/src/pro/kucoinfutures.d.ts +1 -1
- package/js/src/pro/mexc.d.ts +1 -1
- package/js/src/pro/okcoin.d.ts +1 -1
- package/js/src/pro/okx.d.ts +2 -2
- package/js/src/pro/okx.js +23 -10
- package/js/src/pro/oxfun.d.ts +1 -1
- package/js/src/pro/p2b.d.ts +1 -1
- package/js/src/pro/poloniex.d.ts +1 -1
- package/js/src/pro/whitebit.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/src/abstract/bittrex.js +0 -9
- package/dist/cjs/src/bittrex.js +0 -2308
- package/dist/cjs/src/pro/bittrex.js +0 -959
- package/js/src/bittrex.d.ts +0 -97
- package/js/src/bittrex.js +0 -2309
- package/js/src/pro/bittrex.d.ts +0 -69
- package/js/src/pro/bittrex.js +0 -960
package/dist/cjs/ccxt.js
CHANGED
|
@@ -191,7 +191,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
191
191
|
|
|
192
192
|
//-----------------------------------------------------------------------------
|
|
193
193
|
// this is updated by vss.js when building
|
|
194
|
-
const version = '4.3.
|
|
194
|
+
const version = '4.3.67';
|
|
195
195
|
Exchange["default"].ccxtVersion = version;
|
|
196
196
|
const exchanges = {
|
|
197
197
|
'ace': ace,
|
|
@@ -800,7 +800,7 @@ class Exchange {
|
|
|
800
800
|
// @ts-ignore
|
|
801
801
|
this.httpProxyAgentModule = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackIgnore: true */ 'http-proxy-agent')); });
|
|
802
802
|
// @ts-ignore
|
|
803
|
-
this.
|
|
803
|
+
this.httpsProxyAgentModule = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackIgnore: true */ 'https-proxy-agent')); });
|
|
804
804
|
}
|
|
805
805
|
catch (e) { }
|
|
806
806
|
}
|
|
@@ -1180,7 +1180,7 @@ class Exchange {
|
|
|
1180
1180
|
return new OrderBook.CountedOrderBook(snapshot, depth);
|
|
1181
1181
|
}
|
|
1182
1182
|
handleMessage(client, message) { } // stub to override
|
|
1183
|
-
// ping (client) {} // stub to override
|
|
1183
|
+
// ping (client: Client) {} // stub to override
|
|
1184
1184
|
ping(client) {
|
|
1185
1185
|
return undefined;
|
|
1186
1186
|
}
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -283,6 +283,10 @@ class bingx extends bingx$1 {
|
|
|
283
283
|
'trade/leverage': 2,
|
|
284
284
|
'trade/forceOrders': 2,
|
|
285
285
|
'trade/allFillOrders': 2,
|
|
286
|
+
'trade/openOrders': 2,
|
|
287
|
+
'trade/orderDetail': 2,
|
|
288
|
+
'trade/orderHistory': 2,
|
|
289
|
+
'trade/marginType': 2,
|
|
286
290
|
'user/commissionRate': 2,
|
|
287
291
|
'user/positions': 2,
|
|
288
292
|
'user/balance': 2,
|
|
@@ -291,9 +295,12 @@ class bingx extends bingx$1 {
|
|
|
291
295
|
'trade/order': 2,
|
|
292
296
|
'trade/leverage': 2,
|
|
293
297
|
'trade/closeAllPositions': 2,
|
|
298
|
+
'trade/marginType': 2,
|
|
299
|
+
'trade/positionMargin': 2,
|
|
294
300
|
},
|
|
295
301
|
'delete': {
|
|
296
302
|
'trade/allOpenOrders': 2,
|
|
303
|
+
'trade/cancelOrder': 2,
|
|
297
304
|
},
|
|
298
305
|
},
|
|
299
306
|
},
|
|
@@ -3004,7 +3011,8 @@ class bingx extends bingx$1 {
|
|
|
3004
3011
|
// "clientOrderID": ""
|
|
3005
3012
|
// }
|
|
3006
3013
|
//
|
|
3007
|
-
// inverse swap cancelAllOrders
|
|
3014
|
+
// inverse swap cancelAllOrders, cancelOrder
|
|
3015
|
+
// inverse swap cancelAllOrders, cancelOrder, fetchOpenOrders
|
|
3008
3016
|
//
|
|
3009
3017
|
// {
|
|
3010
3018
|
// "symbol": "SOL-USD",
|
|
@@ -3166,13 +3174,14 @@ class bingx extends bingx$1 {
|
|
|
3166
3174
|
* @method
|
|
3167
3175
|
* @name bingx#cancelOrder
|
|
3168
3176
|
* @description cancels an open order
|
|
3169
|
-
* @see https://bingx-api.github.io/docs/#/spot/trade-api.html#Cancel%
|
|
3170
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Cancel%
|
|
3177
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Cancel%20Order
|
|
3178
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Cancel%20Order
|
|
3179
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Cancel%20an%20Order
|
|
3171
3180
|
* @param {string} id order id
|
|
3172
3181
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
3173
3182
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3174
3183
|
* @param {string} [params.clientOrderId] a unique id for the order
|
|
3175
|
-
* @returns {object}
|
|
3184
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3176
3185
|
*/
|
|
3177
3186
|
if (symbol === undefined) {
|
|
3178
3187
|
throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
@@ -3191,12 +3200,20 @@ class bingx extends bingx$1 {
|
|
|
3191
3200
|
request['orderId'] = id;
|
|
3192
3201
|
}
|
|
3193
3202
|
let response = undefined;
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3203
|
+
let type = undefined;
|
|
3204
|
+
let subType = undefined;
|
|
3205
|
+
[type, params] = this.handleMarketTypeAndParams('cancelOrder', market, params);
|
|
3206
|
+
[subType, params] = this.handleSubTypeAndParams('cancelOrder', market, params);
|
|
3207
|
+
if (type === 'spot') {
|
|
3208
|
+
response = await this.spotV1PrivatePostTradeCancel(this.extend(request, params));
|
|
3197
3209
|
}
|
|
3198
3210
|
else {
|
|
3199
|
-
|
|
3211
|
+
if (subType === 'inverse') {
|
|
3212
|
+
response = await this.cswapV1PrivateDeleteTradeCancelOrder(this.extend(request, params));
|
|
3213
|
+
}
|
|
3214
|
+
else {
|
|
3215
|
+
response = await this.swapV2PrivateDeleteTradeOrder(this.extend(request, params));
|
|
3216
|
+
}
|
|
3200
3217
|
}
|
|
3201
3218
|
//
|
|
3202
3219
|
// spot
|
|
@@ -3217,7 +3234,59 @@ class bingx extends bingx$1 {
|
|
|
3217
3234
|
// }
|
|
3218
3235
|
// }
|
|
3219
3236
|
//
|
|
3220
|
-
// swap
|
|
3237
|
+
// inverse swap
|
|
3238
|
+
//
|
|
3239
|
+
// {
|
|
3240
|
+
// "code": 0,
|
|
3241
|
+
// "msg": "",
|
|
3242
|
+
// "data": {
|
|
3243
|
+
// "order": {
|
|
3244
|
+
// "symbol": "SOL-USD",
|
|
3245
|
+
// "orderId": "1816002957423951872",
|
|
3246
|
+
// "side": "BUY",
|
|
3247
|
+
// "positionSide": "Long",
|
|
3248
|
+
// "type": "Pending",
|
|
3249
|
+
// "quantity": 0,
|
|
3250
|
+
// "origQty": "0",
|
|
3251
|
+
// "price": "150",
|
|
3252
|
+
// "executedQty": "0",
|
|
3253
|
+
// "avgPrice": "0",
|
|
3254
|
+
// "cumQuote": "0",
|
|
3255
|
+
// "stopPrice": "",
|
|
3256
|
+
// "profit": "0.0000",
|
|
3257
|
+
// "commission": "0.000000",
|
|
3258
|
+
// "status": "CANCELLED",
|
|
3259
|
+
// "time": 1721803819410,
|
|
3260
|
+
// "updateTime": 1721803819427,
|
|
3261
|
+
// "clientOrderId": "",
|
|
3262
|
+
// "leverage": "",
|
|
3263
|
+
// "takeProfit": {
|
|
3264
|
+
// "type": "",
|
|
3265
|
+
// "quantity": 0,
|
|
3266
|
+
// "stopPrice": 0,
|
|
3267
|
+
// "price": 0,
|
|
3268
|
+
// "workingType": "",
|
|
3269
|
+
// "stopGuaranteed": ""
|
|
3270
|
+
// },
|
|
3271
|
+
// "stopLoss": {
|
|
3272
|
+
// "type": "",
|
|
3273
|
+
// "quantity": 0,
|
|
3274
|
+
// "stopPrice": 0,
|
|
3275
|
+
// "price": 0,
|
|
3276
|
+
// "workingType": "",
|
|
3277
|
+
// "stopGuaranteed": ""
|
|
3278
|
+
// },
|
|
3279
|
+
// "advanceAttr": 0,
|
|
3280
|
+
// "positionID": 0,
|
|
3281
|
+
// "takeProfitEntrustPrice": 0,
|
|
3282
|
+
// "stopLossEntrustPrice": 0,
|
|
3283
|
+
// "orderType": "",
|
|
3284
|
+
// "workingType": ""
|
|
3285
|
+
// }
|
|
3286
|
+
// }
|
|
3287
|
+
// }
|
|
3288
|
+
//
|
|
3289
|
+
// linear swap
|
|
3221
3290
|
//
|
|
3222
3291
|
// {
|
|
3223
3292
|
// "code": 0,
|
|
@@ -3244,9 +3313,9 @@ class bingx extends bingx$1 {
|
|
|
3244
3313
|
// }
|
|
3245
3314
|
// }
|
|
3246
3315
|
//
|
|
3247
|
-
const data = this.
|
|
3248
|
-
const
|
|
3249
|
-
return this.parseOrder(
|
|
3316
|
+
const data = this.safeDict(response, 'data', {});
|
|
3317
|
+
const order = this.safeDict(data, 'order', data);
|
|
3318
|
+
return this.parseOrder(order, market);
|
|
3250
3319
|
}
|
|
3251
3320
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
3252
3321
|
/**
|
|
@@ -3726,9 +3795,10 @@ class bingx extends bingx$1 {
|
|
|
3726
3795
|
/**
|
|
3727
3796
|
* @method
|
|
3728
3797
|
* @name bingx#fetchOpenOrders
|
|
3729
|
-
* @see https://bingx-api.github.io/docs/#/spot/trade-api.html#Query%20Open%20Orders
|
|
3730
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Query%20all%20current%20pending%20orders
|
|
3731
3798
|
* @description fetch all unfilled currently open orders
|
|
3799
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Current%20Open%20Orders
|
|
3800
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Current%20All%20Open%20Orders
|
|
3801
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20all%20current%20pending%20orders
|
|
3732
3802
|
* @param {string} symbol unified market symbol
|
|
3733
3803
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
3734
3804
|
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
@@ -3742,13 +3812,21 @@ class bingx extends bingx$1 {
|
|
|
3742
3812
|
market = this.market(symbol);
|
|
3743
3813
|
request['symbol'] = market['id'];
|
|
3744
3814
|
}
|
|
3815
|
+
let type = undefined;
|
|
3816
|
+
let subType = undefined;
|
|
3745
3817
|
let response = undefined;
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3818
|
+
[type, params] = this.handleMarketTypeAndParams('fetchOpenOrders', market, params);
|
|
3819
|
+
[subType, params] = this.handleSubTypeAndParams('fetchOpenOrders', market, params);
|
|
3820
|
+
if (type === 'spot') {
|
|
3821
|
+
response = await this.spotV1PrivateGetTradeOpenOrders(this.extend(request, params));
|
|
3749
3822
|
}
|
|
3750
3823
|
else {
|
|
3751
|
-
|
|
3824
|
+
if (subType === 'inverse') {
|
|
3825
|
+
response = await this.cswapV1PrivateGetTradeOpenOrders(this.extend(request, params));
|
|
3826
|
+
}
|
|
3827
|
+
else {
|
|
3828
|
+
response = await this.swapV2PrivateGetTradeOpenOrders(this.extend(request, params));
|
|
3829
|
+
}
|
|
3752
3830
|
}
|
|
3753
3831
|
//
|
|
3754
3832
|
// spot
|
|
@@ -3776,7 +3854,61 @@ class bingx extends bingx$1 {
|
|
|
3776
3854
|
// }
|
|
3777
3855
|
// }
|
|
3778
3856
|
//
|
|
3779
|
-
// swap
|
|
3857
|
+
// inverse swap
|
|
3858
|
+
//
|
|
3859
|
+
// {
|
|
3860
|
+
// "code": 0,
|
|
3861
|
+
// "msg": "",
|
|
3862
|
+
// "data": {
|
|
3863
|
+
// "orders": [
|
|
3864
|
+
// {
|
|
3865
|
+
// "symbol": "SOL-USD",
|
|
3866
|
+
// "orderId": "1816013900044320768",
|
|
3867
|
+
// "side": "BUY",
|
|
3868
|
+
// "positionSide": "Long",
|
|
3869
|
+
// "type": "LIMIT",
|
|
3870
|
+
// "quantity": 1,
|
|
3871
|
+
// "origQty": "",
|
|
3872
|
+
// "price": "150",
|
|
3873
|
+
// "executedQty": "0",
|
|
3874
|
+
// "avgPrice": "0.000",
|
|
3875
|
+
// "cumQuote": "",
|
|
3876
|
+
// "stopPrice": "",
|
|
3877
|
+
// "profit": "0.0000",
|
|
3878
|
+
// "commission": "0.0000",
|
|
3879
|
+
// "status": "Pending",
|
|
3880
|
+
// "time": 1721806428334,
|
|
3881
|
+
// "updateTime": 1721806428352,
|
|
3882
|
+
// "clientOrderId": "",
|
|
3883
|
+
// "leverage": "",
|
|
3884
|
+
// "takeProfit": {
|
|
3885
|
+
// "type": "TAKE_PROFIT",
|
|
3886
|
+
// "quantity": 0,
|
|
3887
|
+
// "stopPrice": 0,
|
|
3888
|
+
// "price": 0,
|
|
3889
|
+
// "workingType": "MARK_PRICE",
|
|
3890
|
+
// "stopGuaranteed": ""
|
|
3891
|
+
// },
|
|
3892
|
+
// "stopLoss": {
|
|
3893
|
+
// "type": "STOP",
|
|
3894
|
+
// "quantity": 0,
|
|
3895
|
+
// "stopPrice": 0,
|
|
3896
|
+
// "price": 0,
|
|
3897
|
+
// "workingType": "MARK_PRICE",
|
|
3898
|
+
// "stopGuaranteed": ""
|
|
3899
|
+
// },
|
|
3900
|
+
// "advanceAttr": 0,
|
|
3901
|
+
// "positionID": 0,
|
|
3902
|
+
// "takeProfitEntrustPrice": 0,
|
|
3903
|
+
// "stopLossEntrustPrice": 0,
|
|
3904
|
+
// "orderType": "",
|
|
3905
|
+
// "workingType": "MARK_PRICE"
|
|
3906
|
+
// }
|
|
3907
|
+
// ]
|
|
3908
|
+
// }
|
|
3909
|
+
// }
|
|
3910
|
+
//
|
|
3911
|
+
// linear swap
|
|
3780
3912
|
//
|
|
3781
3913
|
// {
|
|
3782
3914
|
// "code": 0,
|
package/dist/cjs/src/bithumb.js
CHANGED
|
@@ -203,17 +203,57 @@ class bithumb extends bithumb$1 {
|
|
|
203
203
|
* @returns {object[]} an array of objects representing market data
|
|
204
204
|
*/
|
|
205
205
|
const result = [];
|
|
206
|
-
const quoteCurrencies = this.
|
|
206
|
+
const quoteCurrencies = this.safeDict(this.options, 'quoteCurrencies', {});
|
|
207
207
|
const quotes = Object.keys(quoteCurrencies);
|
|
208
|
+
const promises = [];
|
|
208
209
|
for (let i = 0; i < quotes.length; i++) {
|
|
209
|
-
const quote = quotes[i];
|
|
210
|
-
const quoteId = quote;
|
|
211
|
-
const extension = this.safeValue(quoteCurrencies, quote, {});
|
|
212
210
|
const request = {
|
|
213
|
-
'quoteId':
|
|
211
|
+
'quoteId': quotes[i],
|
|
214
212
|
};
|
|
215
|
-
|
|
216
|
-
|
|
213
|
+
promises.push(this.publicGetTickerALLQuoteId(this.extend(request, params)));
|
|
214
|
+
//
|
|
215
|
+
// {
|
|
216
|
+
// "status": "0000",
|
|
217
|
+
// "data": {
|
|
218
|
+
// "ETH": {
|
|
219
|
+
// "opening_price": "0.05153399",
|
|
220
|
+
// "closing_price": "0.05145144",
|
|
221
|
+
// "min_price": "0.05145144",
|
|
222
|
+
// "max_price": "0.05160781",
|
|
223
|
+
// "units_traded": "6.541124172077830855",
|
|
224
|
+
// "acc_trade_value": "0.33705472498492329997697755",
|
|
225
|
+
// "prev_closing_price": "0.0515943",
|
|
226
|
+
// "units_traded_24H": "43.368879902677400513",
|
|
227
|
+
// "acc_trade_value_24H": "2.24165339555398079994373342",
|
|
228
|
+
// "fluctate_24H": "-0.00018203",
|
|
229
|
+
// "fluctate_rate_24H": "-0.35"
|
|
230
|
+
// },
|
|
231
|
+
// "XRP": {
|
|
232
|
+
// "opening_price": "0.00000918",
|
|
233
|
+
// "closing_price": "0.0000092",
|
|
234
|
+
// "min_price": "0.00000918",
|
|
235
|
+
// "max_price": "0.0000092",
|
|
236
|
+
// "units_traded": "6516.949363",
|
|
237
|
+
// "acc_trade_value": "0.0598792533602796",
|
|
238
|
+
// "prev_closing_price": "0.00000916",
|
|
239
|
+
// "units_traded_24H": "229161.50354738",
|
|
240
|
+
// "acc_trade_value_24H": "2.0446589371637117",
|
|
241
|
+
// "fluctate_24H": "0.00000049",
|
|
242
|
+
// "fluctate_rate_24H": "5.63"
|
|
243
|
+
// },
|
|
244
|
+
// ...
|
|
245
|
+
// "date": "1721675913145"
|
|
246
|
+
// }
|
|
247
|
+
// }
|
|
248
|
+
//
|
|
249
|
+
}
|
|
250
|
+
const results = await Promise.all(promises);
|
|
251
|
+
for (let i = 0; i < quotes.length; i++) {
|
|
252
|
+
const quote = quotes[i];
|
|
253
|
+
const quoteId = quote;
|
|
254
|
+
const response = results[i];
|
|
255
|
+
const data = this.safeDict(response, 'data');
|
|
256
|
+
const extension = this.safeDict(quoteCurrencies, quote, {});
|
|
217
257
|
const currencyIds = Object.keys(data);
|
|
218
258
|
for (let j = 0; j < currencyIds.length; j++) {
|
|
219
259
|
const currencyId = currencyIds[j];
|
|
@@ -282,7 +322,7 @@ class bithumb extends bithumb$1 {
|
|
|
282
322
|
}
|
|
283
323
|
parseBalance(response) {
|
|
284
324
|
const result = { 'info': response };
|
|
285
|
-
const balances = this.
|
|
325
|
+
const balances = this.safeDict(response, 'data');
|
|
286
326
|
const codes = Object.keys(this.currencies);
|
|
287
327
|
for (let i = 0; i < codes.length; i++) {
|
|
288
328
|
const code = codes[i];
|
|
@@ -353,7 +393,7 @@ class bithumb extends bithumb$1 {
|
|
|
353
393
|
// }
|
|
354
394
|
// }
|
|
355
395
|
//
|
|
356
|
-
const data = this.
|
|
396
|
+
const data = this.safeDict(response, 'data', {});
|
|
357
397
|
const timestamp = this.safeInteger(data, 'timestamp');
|
|
358
398
|
return this.parseOrderBook(data, symbol, timestamp, 'bids', 'asks', 'price', 'quantity');
|
|
359
399
|
}
|
|
@@ -417,15 +457,19 @@ class bithumb extends bithumb$1 {
|
|
|
417
457
|
*/
|
|
418
458
|
await this.loadMarkets();
|
|
419
459
|
const result = {};
|
|
420
|
-
const quoteCurrencies = this.
|
|
460
|
+
const quoteCurrencies = this.safeDict(this.options, 'quoteCurrencies', {});
|
|
421
461
|
const quotes = Object.keys(quoteCurrencies);
|
|
462
|
+
const promises = [];
|
|
422
463
|
for (let i = 0; i < quotes.length; i++) {
|
|
423
|
-
const quote = quotes[i];
|
|
424
|
-
const quoteId = quote;
|
|
425
464
|
const request = {
|
|
426
|
-
'quoteId':
|
|
465
|
+
'quoteId': quotes[i],
|
|
427
466
|
};
|
|
428
|
-
|
|
467
|
+
promises.push(this.publicGetTickerALLQuoteId(this.extend(request, params)));
|
|
468
|
+
}
|
|
469
|
+
const responses = await Promise.all(promises);
|
|
470
|
+
for (let i = 0; i < quotes.length; i++) {
|
|
471
|
+
const quote = quotes[i];
|
|
472
|
+
const response = responses[i];
|
|
429
473
|
//
|
|
430
474
|
// {
|
|
431
475
|
// "status":"0000",
|
|
@@ -447,7 +491,7 @@ class bithumb extends bithumb$1 {
|
|
|
447
491
|
// }
|
|
448
492
|
// }
|
|
449
493
|
//
|
|
450
|
-
const data = this.
|
|
494
|
+
const data = this.safeDict(response, 'data', {});
|
|
451
495
|
const timestamp = this.safeInteger(data, 'date');
|
|
452
496
|
const tickers = this.omit(data, 'date');
|
|
453
497
|
const currencyIds = Object.keys(tickers);
|
|
@@ -832,7 +876,7 @@ class bithumb extends bithumb$1 {
|
|
|
832
876
|
// }
|
|
833
877
|
//
|
|
834
878
|
const timestamp = this.safeIntegerProduct(order, 'order_date', 0.001);
|
|
835
|
-
const sideProperty = this.
|
|
879
|
+
const sideProperty = this.safeString2(order, 'type', 'side');
|
|
836
880
|
const side = (sideProperty === 'bid') ? 'buy' : 'sell';
|
|
837
881
|
const status = this.parseOrderStatus(this.safeString(order, 'order_status'));
|
|
838
882
|
const price = this.safeString2(order, 'order_price', 'price');
|
|
@@ -863,7 +907,7 @@ class bithumb extends bithumb$1 {
|
|
|
863
907
|
symbol = market['symbol'];
|
|
864
908
|
}
|
|
865
909
|
const id = this.safeString(order, 'order_id');
|
|
866
|
-
const rawTrades = this.
|
|
910
|
+
const rawTrades = this.safeList(order, 'contract', []);
|
|
867
911
|
return this.safeOrder({
|
|
868
912
|
'info': order,
|
|
869
913
|
'id': id,
|
|
@@ -94,8 +94,8 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
94
94
|
'fetchPositions': true,
|
|
95
95
|
'fetchPositionsRisk': false,
|
|
96
96
|
'fetchPremiumIndexOHLCV': false,
|
|
97
|
-
'fetchTicker':
|
|
98
|
-
'fetchTickers':
|
|
97
|
+
'fetchTicker': 'emulated',
|
|
98
|
+
'fetchTickers': true,
|
|
99
99
|
'fetchTime': false,
|
|
100
100
|
'fetchTrades': true,
|
|
101
101
|
'fetchTradingFee': true,
|
|
@@ -324,12 +324,12 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
324
324
|
// ]
|
|
325
325
|
//
|
|
326
326
|
//
|
|
327
|
-
|
|
328
|
-
|
|
327
|
+
const meta = this.safeDict(response, 0, {});
|
|
328
|
+
const universe = this.safeList(meta, 'universe', []);
|
|
329
329
|
const assetCtxs = this.safeDict(response, 1, {});
|
|
330
330
|
const result = [];
|
|
331
|
-
for (let i = 0; i <
|
|
332
|
-
const data = this.extend(this.safeDict(
|
|
331
|
+
for (let i = 0; i < universe.length; i++) {
|
|
332
|
+
const data = this.extend(this.safeDict(universe, i, {}), this.safeDict(assetCtxs, i, {}));
|
|
333
333
|
data['baseId'] = i;
|
|
334
334
|
result.push(data);
|
|
335
335
|
}
|
|
@@ -444,11 +444,13 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
444
444
|
//
|
|
445
445
|
// response differs depending on the environment (mainnet vs sandbox)
|
|
446
446
|
const first = this.safeDict(response, 0, {});
|
|
447
|
+
const second = this.safeList(response, 1, []);
|
|
447
448
|
const meta = this.safeList2(first, 'universe', 'spot_infos', []);
|
|
448
449
|
const tokens = this.safeList2(first, 'tokens', 'token_infos', []);
|
|
449
450
|
const markets = [];
|
|
450
451
|
for (let i = 0; i < meta.length; i++) {
|
|
451
452
|
const market = this.safeDict(meta, i, {});
|
|
453
|
+
const extraData = this.safeDict(second, i, {});
|
|
452
454
|
const marketName = this.safeString(market, 'name');
|
|
453
455
|
// if (marketName.indexOf ('/') < 0) {
|
|
454
456
|
// // there are some weird spot markets in testnet, eg @2
|
|
@@ -525,7 +527,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
525
527
|
},
|
|
526
528
|
},
|
|
527
529
|
'created': undefined,
|
|
528
|
-
'info': market,
|
|
530
|
+
'info': this.extend(extraData, market),
|
|
529
531
|
}));
|
|
530
532
|
}
|
|
531
533
|
return markets;
|
|
@@ -753,6 +755,60 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
753
755
|
const timestamp = this.safeInteger(response, 'time');
|
|
754
756
|
return this.parseOrderBook(result, market['symbol'], timestamp, 'bids', 'asks', 'px', 'sz');
|
|
755
757
|
}
|
|
758
|
+
async fetchTickers(symbols = undefined, params = {}) {
|
|
759
|
+
/**
|
|
760
|
+
* @method
|
|
761
|
+
* @name hyperliquid#fetchTickers
|
|
762
|
+
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
763
|
+
* @see https://www.bitmex.com/api/explorer/#!/Instrument/Instrument_getActiveAndIndices
|
|
764
|
+
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
765
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
766
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
767
|
+
*/
|
|
768
|
+
await this.loadMarkets();
|
|
769
|
+
symbols = this.marketSymbols(symbols);
|
|
770
|
+
// at this stage, to get tickers data, we use fetchMarkets endpoints
|
|
771
|
+
const response = await this.fetchMarkets(params);
|
|
772
|
+
// same response as under "fetchMarkets"
|
|
773
|
+
const result = {};
|
|
774
|
+
for (let i = 0; i < response.length; i++) {
|
|
775
|
+
const market = response[i];
|
|
776
|
+
const info = market['info'];
|
|
777
|
+
const ticker = this.parseTicker(info, market);
|
|
778
|
+
const symbol = this.safeString(ticker, 'symbol');
|
|
779
|
+
result[symbol] = ticker;
|
|
780
|
+
}
|
|
781
|
+
return this.filterByArrayTickers(result, 'symbol', symbols);
|
|
782
|
+
}
|
|
783
|
+
parseTicker(ticker, market = undefined) {
|
|
784
|
+
//
|
|
785
|
+
// {
|
|
786
|
+
// "prevDayPx": "3400.5",
|
|
787
|
+
// "dayNtlVlm": "511297257.47936022",
|
|
788
|
+
// "markPx": "3464.7",
|
|
789
|
+
// "midPx": "3465.05",
|
|
790
|
+
// "oraclePx": "3460.1", // only in swap
|
|
791
|
+
// "openInterest": "64638.1108", // only in swap
|
|
792
|
+
// "premium": "0.00141614", // only in swap
|
|
793
|
+
// "funding": "0.00008727", // only in swap
|
|
794
|
+
// "impactPxs": [ "3465.0", "3465.1" ], // only in swap
|
|
795
|
+
// "coin": "PURR", // only in spot
|
|
796
|
+
// "circulatingSupply": "998949190.03400207", // only in spot
|
|
797
|
+
// },
|
|
798
|
+
//
|
|
799
|
+
const bidAsk = this.safeList(ticker, 'impactPxs');
|
|
800
|
+
return this.safeTicker({
|
|
801
|
+
'symbol': market['symbol'],
|
|
802
|
+
'timestamp': undefined,
|
|
803
|
+
'datetime': undefined,
|
|
804
|
+
'previousClose': this.safeNumber(ticker, 'prevDayPx'),
|
|
805
|
+
'close': this.safeNumber(ticker, 'midPx'),
|
|
806
|
+
'bid': this.safeNumber(bidAsk, 0),
|
|
807
|
+
'ask': this.safeNumber(bidAsk, 1),
|
|
808
|
+
'quoteVolume': this.safeNumber(ticker, 'dayNtlVlm'),
|
|
809
|
+
'info': ticker,
|
|
810
|
+
}, market);
|
|
811
|
+
}
|
|
756
812
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
757
813
|
/**
|
|
758
814
|
* @method
|
|
@@ -4,7 +4,6 @@ var independentreserve$1 = require('./abstract/independentreserve.js');
|
|
|
4
4
|
var Precise = require('./base/Precise.js');
|
|
5
5
|
var number = require('./base/functions/number.js');
|
|
6
6
|
var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
|
|
7
|
-
require('../ccxt.js');
|
|
8
7
|
var errors = require('./base/errors.js');
|
|
9
8
|
|
|
10
9
|
// ---------------------------------------------------------------------------
|
package/dist/cjs/src/kraken.js
CHANGED
|
@@ -80,6 +80,7 @@ class kraken extends kraken$1 {
|
|
|
80
80
|
'fetchOrderTrades': 'emulated',
|
|
81
81
|
'fetchPositions': true,
|
|
82
82
|
'fetchPremiumIndexOHLCV': false,
|
|
83
|
+
'fetchStatus': true,
|
|
83
84
|
'fetchTicker': true,
|
|
84
85
|
'fetchTickers': true,
|
|
85
86
|
'fetchTime': true,
|
|
@@ -637,6 +638,32 @@ class kraken extends kraken$1 {
|
|
|
637
638
|
}
|
|
638
639
|
return result;
|
|
639
640
|
}
|
|
641
|
+
async fetchStatus(params = {}) {
|
|
642
|
+
/**
|
|
643
|
+
* @method
|
|
644
|
+
* @name kraken#fetchStatus
|
|
645
|
+
* @description the latest known information on the availability of the exchange API
|
|
646
|
+
* @see https://docs.kraken.com/api/docs/rest-api/get-system-status/
|
|
647
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
648
|
+
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
649
|
+
*/
|
|
650
|
+
const response = await this.publicGetSystemStatus(params);
|
|
651
|
+
//
|
|
652
|
+
// {
|
|
653
|
+
// error: [],
|
|
654
|
+
// result: { status: 'online', timestamp: '2024-07-22T16:34:44Z' }
|
|
655
|
+
// }
|
|
656
|
+
//
|
|
657
|
+
const result = this.safeDict(response, 'result');
|
|
658
|
+
const statusRaw = this.safeString(result, 'status');
|
|
659
|
+
return {
|
|
660
|
+
'status': (statusRaw === 'online') ? 'ok' : 'maintenance',
|
|
661
|
+
'updated': undefined,
|
|
662
|
+
'eta': undefined,
|
|
663
|
+
'url': undefined,
|
|
664
|
+
'info': response,
|
|
665
|
+
};
|
|
666
|
+
}
|
|
640
667
|
async fetchCurrencies(params = {}) {
|
|
641
668
|
/**
|
|
642
669
|
* @method
|