ccxt 4.3.68 → 4.3.70
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 +6 -6
- package/dist/ccxt.browser.min.js +5 -5
- package/dist/cjs/ccxt.js +3 -1
- package/dist/cjs/src/ascendex.js +1 -1
- package/dist/cjs/src/base/Exchange.js +365 -353
- package/dist/cjs/src/binance.js +1 -1
- package/dist/cjs/src/bingx.js +134 -75
- package/dist/cjs/src/blofin.js +63 -6
- package/dist/cjs/src/btcbox.js +2 -1
- package/dist/cjs/src/bybit.js +1 -1
- package/dist/cjs/src/coinbaseinternational.js +247 -3
- package/dist/cjs/src/cryptocom.js +9 -1
- package/dist/cjs/src/hitbtc.js +1 -1
- package/dist/cjs/src/hyperliquid.js +0 -3
- package/dist/cjs/src/kucoin.js +12 -5
- package/dist/cjs/src/oxfun.js +2 -2
- package/dist/cjs/src/poloniex.js +34 -33
- package/dist/cjs/src/poloniexfutures.js +26 -26
- package/dist/cjs/src/pro/blofin.js +665 -0
- package/dist/cjs/src/pro/coinbaseinternational.js +154 -9
- package/dist/cjs/src/pro/cryptocom.js +3 -1
- package/dist/cjs/src/pro/hitbtc.js +26 -8
- package/dist/cjs/src/pro/okx.js +7 -0
- package/dist/cjs/src/pro/poloniex.js +50 -25
- package/dist/cjs/src/pro/poloniexfutures.js +5 -5
- package/dist/cjs/src/pro/woo.js +5 -4
- package/js/ccxt.d.ts +6 -3
- package/js/ccxt.js +3 -1
- package/js/src/abstract/coinbaseinternational.d.ts +1 -1
- package/js/src/ascendex.js +1 -1
- package/js/src/base/Exchange.d.ts +108 -82
- package/js/src/base/Exchange.js +365 -353
- package/js/src/base/types.d.ts +0 -2
- package/js/src/binance.d.ts +2 -2
- package/js/src/binance.js +1 -1
- package/js/src/bingx.d.ts +2 -2
- package/js/src/bingx.js +134 -75
- package/js/src/bitget.d.ts +2 -2
- package/js/src/bitmart.d.ts +2 -2
- package/js/src/bitrue.d.ts +2 -2
- package/js/src/blofin.d.ts +1 -1
- package/js/src/blofin.js +63 -6
- package/js/src/btcbox.js +2 -1
- package/js/src/bybit.d.ts +2 -2
- package/js/src/bybit.js +1 -1
- package/js/src/coinbaseinternational.d.ts +17 -1
- package/js/src/coinbaseinternational.js +247 -3
- package/js/src/coinex.d.ts +2 -2
- package/js/src/coinlist.d.ts +2 -2
- package/js/src/cryptocom.js +10 -2
- package/js/src/deribit.d.ts +2 -2
- package/js/src/digifinex.d.ts +2 -2
- package/js/src/hitbtc.js +1 -1
- package/js/src/hyperliquid.js +0 -3
- package/js/src/kucoin.js +12 -5
- package/js/src/latoken.d.ts +2 -2
- package/js/src/mexc.d.ts +2 -2
- package/js/src/okx.d.ts +2 -2
- package/js/src/oxfun.d.ts +1 -1
- package/js/src/oxfun.js +2 -2
- package/js/src/phemex.d.ts +2 -2
- package/js/src/poloniex.js +34 -33
- package/js/src/poloniexfutures.js +26 -26
- package/js/src/pro/blofin.d.ts +39 -0
- package/js/src/pro/blofin.js +668 -0
- package/js/src/pro/coinbaseinternational.d.ts +5 -1
- package/js/src/pro/coinbaseinternational.js +155 -10
- package/js/src/pro/cryptocom.js +4 -2
- package/js/src/pro/hitbtc.d.ts +1 -1
- package/js/src/pro/hitbtc.js +26 -8
- package/js/src/pro/okx.js +7 -0
- package/js/src/pro/poloniex.js +50 -25
- package/js/src/pro/poloniexfutures.js +5 -5
- package/js/src/pro/woo.js +5 -4
- package/js/src/woo.d.ts +2 -2
- package/package.json +1 -1
package/dist/cjs/src/binance.js
CHANGED
|
@@ -12636,7 +12636,7 @@ class binance extends binance$1 {
|
|
|
12636
12636
|
async fetchMarginModes(symbols = undefined, params = {}) {
|
|
12637
12637
|
/**
|
|
12638
12638
|
* @method
|
|
12639
|
-
* @name binance#
|
|
12639
|
+
* @name binance#fetchMarginModes
|
|
12640
12640
|
* @description fetches margin modes ("isolated" or "cross") that the market for the symbol in in, with symbol=undefined all markets for a subType (linear/inverse) are returned
|
|
12641
12641
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
12642
12642
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -1132,7 +1132,27 @@ class bingx extends bingx$1 {
|
|
|
1132
1132
|
// "s": "BTC-USDT"
|
|
1133
1133
|
// }
|
|
1134
1134
|
//
|
|
1135
|
-
|
|
1135
|
+
// inverse swap fetchMyTrades
|
|
1136
|
+
//
|
|
1137
|
+
// {
|
|
1138
|
+
// "orderId": "1817441228670648320",
|
|
1139
|
+
// "symbol": "SOL-USD",
|
|
1140
|
+
// "type": "MARKET",
|
|
1141
|
+
// "side": "BUY",
|
|
1142
|
+
// "positionSide": "LONG",
|
|
1143
|
+
// "tradeId": "97244554",
|
|
1144
|
+
// "volume": "2",
|
|
1145
|
+
// "tradePrice": "182.652",
|
|
1146
|
+
// "amount": "20.00000000",
|
|
1147
|
+
// "realizedPnl": "0.00000000",
|
|
1148
|
+
// "commission": "-0.00005475",
|
|
1149
|
+
// "currency": "SOL",
|
|
1150
|
+
// "buyer": true,
|
|
1151
|
+
// "maker": false,
|
|
1152
|
+
// "tradeTime": 1722146730000
|
|
1153
|
+
// }
|
|
1154
|
+
//
|
|
1155
|
+
let time = this.safeIntegerN(trade, ['time', 'filledTm', 'T', 'tradeTime']);
|
|
1136
1156
|
const datetimeId = this.safeString(trade, 'filledTm');
|
|
1137
1157
|
if (datetimeId !== undefined) {
|
|
1138
1158
|
time = this.parse8601(datetimeId);
|
|
@@ -1145,8 +1165,8 @@ class bingx extends bingx$1 {
|
|
|
1145
1165
|
const currencyId = this.safeStringN(trade, ['currency', 'N', 'commissionAsset']);
|
|
1146
1166
|
const currencyCode = this.safeCurrencyCode(currencyId);
|
|
1147
1167
|
const m = this.safeBool(trade, 'm');
|
|
1148
|
-
const marketId = this.
|
|
1149
|
-
const isBuyerMaker = this.
|
|
1168
|
+
const marketId = this.safeString2(trade, 's', 'symbol');
|
|
1169
|
+
const isBuyerMaker = this.safeBoolN(trade, ['buyerMaker', 'isBuyerMaker', 'maker']);
|
|
1150
1170
|
let takeOrMaker = undefined;
|
|
1151
1171
|
if ((isBuyerMaker !== undefined) || (m !== undefined)) {
|
|
1152
1172
|
takeOrMaker = (isBuyerMaker || m) ? 'maker' : 'taker';
|
|
@@ -1183,7 +1203,7 @@ class bingx extends bingx$1 {
|
|
|
1183
1203
|
'type': this.safeStringLower(trade, 'o'),
|
|
1184
1204
|
'side': this.parseOrderSide(side),
|
|
1185
1205
|
'takerOrMaker': takeOrMaker,
|
|
1186
|
-
'price': this.
|
|
1206
|
+
'price': this.safeStringN(trade, ['price', 'p', 'tradePrice']),
|
|
1187
1207
|
'amount': amount,
|
|
1188
1208
|
'cost': cost,
|
|
1189
1209
|
'fee': {
|
|
@@ -4896,14 +4916,16 @@ class bingx extends bingx$1 {
|
|
|
4896
4916
|
* @method
|
|
4897
4917
|
* @name bingx#fetchMyTrades
|
|
4898
4918
|
* @description fetch all trades made by the user
|
|
4899
|
-
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%
|
|
4900
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Query%20historical%20transaction%20orders
|
|
4919
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20transaction%20details
|
|
4920
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20historical%20transaction%20orders
|
|
4921
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Order%20Trade%20Detail
|
|
4901
4922
|
* @param {string} [symbol] unified market symbol
|
|
4902
4923
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
4903
4924
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
4904
4925
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4905
4926
|
* @param {int} [params.until] timestamp in ms for the ending date filter, default is undefined
|
|
4906
4927
|
* @param {string} params.trandingUnit COIN (directly represent assets such as BTC and ETH) or CONT (represents the number of contract sheets)
|
|
4928
|
+
* @param {string} params.orderId the order id required for inverse swap
|
|
4907
4929
|
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
4908
4930
|
*/
|
|
4909
4931
|
if (symbol === undefined) {
|
|
@@ -4911,84 +4933,121 @@ class bingx extends bingx$1 {
|
|
|
4911
4933
|
}
|
|
4912
4934
|
await this.loadMarkets();
|
|
4913
4935
|
const market = this.market(symbol);
|
|
4914
|
-
const
|
|
4915
|
-
let response = undefined;
|
|
4916
|
-
const request = {
|
|
4917
|
-
'symbol': market['id'],
|
|
4918
|
-
};
|
|
4919
|
-
if (since !== undefined) {
|
|
4920
|
-
const startTimeReq = market['spot'] ? 'startTime' : 'startTs';
|
|
4921
|
-
request[startTimeReq] = since;
|
|
4922
|
-
}
|
|
4923
|
-
else if (market['swap']) {
|
|
4924
|
-
request['startTs'] = now - 7776000000; // 90 days
|
|
4925
|
-
}
|
|
4926
|
-
const until = this.safeInteger(params, 'until');
|
|
4927
|
-
params = this.omit(params, 'until');
|
|
4928
|
-
if (until !== undefined) {
|
|
4929
|
-
const endTimeReq = market['spot'] ? 'endTime' : 'endTs';
|
|
4930
|
-
request[endTimeReq] = until;
|
|
4931
|
-
}
|
|
4932
|
-
else if (market['swap']) {
|
|
4933
|
-
request['endTs'] = now;
|
|
4934
|
-
}
|
|
4936
|
+
const request = {};
|
|
4935
4937
|
let fills = undefined;
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4938
|
+
let response = undefined;
|
|
4939
|
+
let subType = undefined;
|
|
4940
|
+
[subType, params] = this.handleSubTypeAndParams('fetchMyTrades', market, params);
|
|
4941
|
+
if (subType === 'inverse') {
|
|
4942
|
+
const orderId = this.safeString(params, 'orderId');
|
|
4943
|
+
if (orderId === undefined) {
|
|
4944
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchMyTrades() requires an orderId argument for inverse swap trades');
|
|
4945
|
+
}
|
|
4946
|
+
response = await this.cswapV1PrivateGetTradeAllFillOrders(this.extend(request, params));
|
|
4947
|
+
fills = this.safeList(response, 'data', []);
|
|
4940
4948
|
//
|
|
4941
4949
|
// {
|
|
4942
4950
|
// "code": 0,
|
|
4943
4951
|
// "msg": "",
|
|
4944
|
-
// "
|
|
4945
|
-
// "data":
|
|
4946
|
-
//
|
|
4947
|
-
//
|
|
4948
|
-
//
|
|
4949
|
-
//
|
|
4950
|
-
//
|
|
4951
|
-
//
|
|
4952
|
-
//
|
|
4953
|
-
//
|
|
4954
|
-
//
|
|
4955
|
-
//
|
|
4956
|
-
//
|
|
4957
|
-
//
|
|
4958
|
-
//
|
|
4959
|
-
//
|
|
4960
|
-
//
|
|
4961
|
-
//
|
|
4952
|
+
// "timestamp": 1722147756019,
|
|
4953
|
+
// "data": [
|
|
4954
|
+
// {
|
|
4955
|
+
// "orderId": "1817441228670648320",
|
|
4956
|
+
// "symbol": "SOL-USD",
|
|
4957
|
+
// "type": "MARKET",
|
|
4958
|
+
// "side": "BUY",
|
|
4959
|
+
// "positionSide": "LONG",
|
|
4960
|
+
// "tradeId": "97244554",
|
|
4961
|
+
// "volume": "2",
|
|
4962
|
+
// "tradePrice": "182.652",
|
|
4963
|
+
// "amount": "20.00000000",
|
|
4964
|
+
// "realizedPnl": "0.00000000",
|
|
4965
|
+
// "commission": "-0.00005475",
|
|
4966
|
+
// "currency": "SOL",
|
|
4967
|
+
// "buyer": true,
|
|
4968
|
+
// "maker": false,
|
|
4969
|
+
// "tradeTime": 1722146730000
|
|
4970
|
+
// }
|
|
4971
|
+
// ]
|
|
4962
4972
|
// }
|
|
4963
4973
|
//
|
|
4964
4974
|
}
|
|
4965
4975
|
else {
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4976
|
+
request['symbol'] = market['id'];
|
|
4977
|
+
const now = this.milliseconds();
|
|
4978
|
+
if (since !== undefined) {
|
|
4979
|
+
const startTimeReq = market['spot'] ? 'startTime' : 'startTs';
|
|
4980
|
+
request[startTimeReq] = since;
|
|
4981
|
+
}
|
|
4982
|
+
else if (market['swap']) {
|
|
4983
|
+
request['startTs'] = now - 7776000000; // 90 days
|
|
4984
|
+
}
|
|
4985
|
+
const until = this.safeInteger(params, 'until');
|
|
4986
|
+
params = this.omit(params, 'until');
|
|
4987
|
+
if (until !== undefined) {
|
|
4988
|
+
const endTimeReq = market['spot'] ? 'endTime' : 'endTs';
|
|
4989
|
+
request[endTimeReq] = until;
|
|
4990
|
+
}
|
|
4991
|
+
else if (market['swap']) {
|
|
4992
|
+
request['endTs'] = now;
|
|
4993
|
+
}
|
|
4994
|
+
if (market['spot']) {
|
|
4995
|
+
response = await this.spotV1PrivateGetTradeMyTrades(this.extend(request, params));
|
|
4996
|
+
const data = this.safeDict(response, 'data', {});
|
|
4997
|
+
fills = this.safeList(data, 'fills', []);
|
|
4998
|
+
//
|
|
4999
|
+
// {
|
|
5000
|
+
// "code": 0,
|
|
5001
|
+
// "msg": "",
|
|
5002
|
+
// "debugMsg": "",
|
|
5003
|
+
// "data": {
|
|
5004
|
+
// "fills": [
|
|
5005
|
+
// {
|
|
5006
|
+
// "symbol": "LTC-USDT",
|
|
5007
|
+
// "id": 36237072,
|
|
5008
|
+
// "orderId": 1674069326895775744,
|
|
5009
|
+
// "price": "85.891",
|
|
5010
|
+
// "qty": "0.0582",
|
|
5011
|
+
// "quoteQty": "4.9988562000000005",
|
|
5012
|
+
// "commission": -0.00005820000000000001,
|
|
5013
|
+
// "commissionAsset": "LTC",
|
|
5014
|
+
// "time": 1687964205000,
|
|
5015
|
+
// "isBuyer": true,
|
|
5016
|
+
// "isMaker": false
|
|
5017
|
+
// }
|
|
5018
|
+
// ]
|
|
5019
|
+
// }
|
|
5020
|
+
// }
|
|
5021
|
+
//
|
|
5022
|
+
}
|
|
5023
|
+
else {
|
|
5024
|
+
const tradingUnit = this.safeStringUpper(params, 'tradingUnit', 'CONT');
|
|
5025
|
+
params = this.omit(params, 'tradingUnit');
|
|
5026
|
+
request['tradingUnit'] = tradingUnit;
|
|
5027
|
+
response = await this.swapV2PrivateGetTradeAllFillOrders(this.extend(request, params));
|
|
5028
|
+
const data = this.safeDict(response, 'data', {});
|
|
5029
|
+
fills = this.safeList(data, 'fill_orders', []);
|
|
5030
|
+
//
|
|
5031
|
+
// {
|
|
5032
|
+
// "code": "0",
|
|
5033
|
+
// "msg": '',
|
|
5034
|
+
// "data": { fill_orders: [
|
|
5035
|
+
// {
|
|
5036
|
+
// "volume": "0.1",
|
|
5037
|
+
// "price": "106.75",
|
|
5038
|
+
// "amount": "10.6750",
|
|
5039
|
+
// "commission": "-0.0053",
|
|
5040
|
+
// "currency": "USDT",
|
|
5041
|
+
// "orderId": "1676213270274379776",
|
|
5042
|
+
// "liquidatedPrice": "0.00",
|
|
5043
|
+
// "liquidatedMarginRatio": "0.00",
|
|
5044
|
+
// "filledTime": "2023-07-04T20:56:01.000+0800"
|
|
5045
|
+
// }
|
|
5046
|
+
// ]
|
|
5047
|
+
// }
|
|
5048
|
+
// }
|
|
5049
|
+
//
|
|
5050
|
+
}
|
|
4992
5051
|
}
|
|
4993
5052
|
return this.parseTrades(fills, market, since, limit, params);
|
|
4994
5053
|
}
|
package/dist/cjs/src/blofin.js
CHANGED
|
@@ -20,6 +20,7 @@ class blofin extends blofin$1 {
|
|
|
20
20
|
'countries': ['US'],
|
|
21
21
|
'version': 'v1',
|
|
22
22
|
'rateLimit': 100,
|
|
23
|
+
'pro': true,
|
|
23
24
|
'has': {
|
|
24
25
|
'CORS': undefined,
|
|
25
26
|
'spot': false,
|
|
@@ -94,7 +95,7 @@ class blofin extends blofin$1 {
|
|
|
94
95
|
'fetchOpenInterestHistory': false,
|
|
95
96
|
'fetchOpenOrder': undefined,
|
|
96
97
|
'fetchOpenOrders': true,
|
|
97
|
-
'fetchOrder':
|
|
98
|
+
'fetchOrder': undefined,
|
|
98
99
|
'fetchOrderBook': true,
|
|
99
100
|
'fetchOrderBooks': false,
|
|
100
101
|
'fetchOrders': false,
|
|
@@ -144,11 +145,12 @@ class blofin extends blofin$1 {
|
|
|
144
145
|
'2h': '2H',
|
|
145
146
|
'4h': '4H',
|
|
146
147
|
'6h': '6H',
|
|
148
|
+
'8h': '8H',
|
|
147
149
|
'12h': '12H',
|
|
148
150
|
'1d': '1D',
|
|
151
|
+
'3d': '3D',
|
|
149
152
|
'1w': '1W',
|
|
150
153
|
'1M': '1M',
|
|
151
|
-
'3M': '3M',
|
|
152
154
|
},
|
|
153
155
|
'hostname': 'www.blofin.com',
|
|
154
156
|
'urls': {
|
|
@@ -489,6 +491,25 @@ class blofin extends blofin$1 {
|
|
|
489
491
|
return this.parseOrderBook(first, symbol, timestamp);
|
|
490
492
|
}
|
|
491
493
|
parseTicker(ticker, market = undefined) {
|
|
494
|
+
//
|
|
495
|
+
// response similar for REST & WS
|
|
496
|
+
//
|
|
497
|
+
// {
|
|
498
|
+
// instId: "ADA-USDT",
|
|
499
|
+
// ts: "1707736811486",
|
|
500
|
+
// last: "0.5315",
|
|
501
|
+
// lastSize: "4",
|
|
502
|
+
// askPrice: "0.5318",
|
|
503
|
+
// askSize: "248",
|
|
504
|
+
// bidPrice: "0.5315",
|
|
505
|
+
// bidSize: "63",
|
|
506
|
+
// open24h: "0.5555",
|
|
507
|
+
// high24h: "0.5563",
|
|
508
|
+
// low24h: "0.5315",
|
|
509
|
+
// volCurrency24h: "198560100",
|
|
510
|
+
// vol24h: "1985601",
|
|
511
|
+
// }
|
|
512
|
+
//
|
|
492
513
|
const timestamp = this.safeInteger(ticker, 'ts');
|
|
493
514
|
const marketId = this.safeString(ticker, 'instId');
|
|
494
515
|
market = this.safeMarket(marketId, market, '-');
|
|
@@ -561,7 +582,8 @@ class blofin extends blofin$1 {
|
|
|
561
582
|
}
|
|
562
583
|
parseTrade(trade, market = undefined) {
|
|
563
584
|
//
|
|
564
|
-
// fetch trades
|
|
585
|
+
// fetch trades (response similar for REST & WS)
|
|
586
|
+
//
|
|
565
587
|
// {
|
|
566
588
|
// "tradeId": "3263934920",
|
|
567
589
|
// "instId": "LTC-USDT",
|
|
@@ -570,6 +592,7 @@ class blofin extends blofin$1 {
|
|
|
570
592
|
// "side": "buy",
|
|
571
593
|
// "ts": "1707232020854"
|
|
572
594
|
// }
|
|
595
|
+
//
|
|
573
596
|
// my trades
|
|
574
597
|
// {
|
|
575
598
|
// "instId": "LTC-USDT",
|
|
@@ -848,10 +871,12 @@ class blofin extends blofin$1 {
|
|
|
848
871
|
return this.parseFundingBalance(response);
|
|
849
872
|
}
|
|
850
873
|
else {
|
|
851
|
-
return this.
|
|
874
|
+
return this.parseBalance(response);
|
|
852
875
|
}
|
|
853
876
|
}
|
|
854
|
-
|
|
877
|
+
parseBalance(response) {
|
|
878
|
+
//
|
|
879
|
+
// "data" similar for REST & WS
|
|
855
880
|
//
|
|
856
881
|
// {
|
|
857
882
|
// "code": "0",
|
|
@@ -873,7 +898,8 @@ class blofin extends blofin$1 {
|
|
|
873
898
|
// "orderFrozen": "14920.994472632597427761",
|
|
874
899
|
// "equityUsd": "10011254.077985990315787910",
|
|
875
900
|
// "isolatedUnrealizedPnl": "-22.151999999999999999952",
|
|
876
|
-
// "bonus": "0"
|
|
901
|
+
// "bonus": "0" // present only in REST
|
|
902
|
+
// "unrealizedPnl": "0" // present only in WS
|
|
877
903
|
// }
|
|
878
904
|
// ]
|
|
879
905
|
// }
|
|
@@ -1035,6 +1061,8 @@ class blofin extends blofin$1 {
|
|
|
1035
1061
|
return this.safeString(statuses, status, status);
|
|
1036
1062
|
}
|
|
1037
1063
|
parseOrder(order, market = undefined) {
|
|
1064
|
+
//
|
|
1065
|
+
// response similar for REST & WS
|
|
1038
1066
|
//
|
|
1039
1067
|
// {
|
|
1040
1068
|
// "orderId": "2075628533",
|
|
@@ -1063,6 +1091,9 @@ class blofin extends blofin$1 {
|
|
|
1063
1091
|
// "cancelSource": "not_canceled",
|
|
1064
1092
|
// "cancelSourceReason": null,
|
|
1065
1093
|
// "brokerId": "ec6dd3a7dd982d0b"
|
|
1094
|
+
// "filled_amount": "1.000000000000000000", // filledAmount in "ws" watchOrders
|
|
1095
|
+
// "cancelSource": "", // only in WS
|
|
1096
|
+
// "instType": "SWAP", // only in WS
|
|
1066
1097
|
// }
|
|
1067
1098
|
//
|
|
1068
1099
|
const id = this.safeString2(order, 'tpslId', 'orderId');
|
|
@@ -1812,6 +1843,32 @@ class blofin extends blofin$1 {
|
|
|
1812
1843
|
return this.filterByArrayPositions(result, 'symbol', symbols, false);
|
|
1813
1844
|
}
|
|
1814
1845
|
parsePosition(position, market = undefined) {
|
|
1846
|
+
//
|
|
1847
|
+
// response similar for REST & WS
|
|
1848
|
+
//
|
|
1849
|
+
// {
|
|
1850
|
+
// instType: 'SWAP',
|
|
1851
|
+
// instId: 'LTC-USDT',
|
|
1852
|
+
// marginMode: 'cross',
|
|
1853
|
+
// positionId: '644159',
|
|
1854
|
+
// positionSide: 'net',
|
|
1855
|
+
// positions: '1',
|
|
1856
|
+
// availablePositions: '1',
|
|
1857
|
+
// averagePrice: '68.16',
|
|
1858
|
+
// unrealizedPnl: '0.80631223',
|
|
1859
|
+
// unrealizedPnlRatio: '0.03548909463028169',
|
|
1860
|
+
// leverage: '3',
|
|
1861
|
+
// liquidationPrice: '10.116655172370356435',
|
|
1862
|
+
// markPrice: '68.96',
|
|
1863
|
+
// initialMargin: '22.988770743333333333',
|
|
1864
|
+
// margin: '', // this field might not exist in rest response
|
|
1865
|
+
// marginRatio: '152.523509620342499273',
|
|
1866
|
+
// maintenanceMargin: '0.34483156115',
|
|
1867
|
+
// adl: '4',
|
|
1868
|
+
// createTime: '1707235776528',
|
|
1869
|
+
// updateTime: '1707235776528'
|
|
1870
|
+
// }
|
|
1871
|
+
//
|
|
1815
1872
|
const marketId = this.safeString(position, 'instId');
|
|
1816
1873
|
market = this.safeMarket(marketId, market);
|
|
1817
1874
|
const symbol = market['symbol'];
|
package/dist/cjs/src/btcbox.js
CHANGED
|
@@ -5,6 +5,7 @@ var errors = require('./base/errors.js');
|
|
|
5
5
|
var Precise = require('./base/Precise.js');
|
|
6
6
|
var number = require('./base/functions/number.js');
|
|
7
7
|
var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
|
|
8
|
+
var md5 = require('./static_dependencies/noble-hashes/md5.js');
|
|
8
9
|
|
|
9
10
|
// ---------------------------------------------------------------------------
|
|
10
11
|
// ---------------------------------------------------------------------------
|
|
@@ -676,7 +677,7 @@ class btcbox extends btcbox$1 {
|
|
|
676
677
|
'nonce': nonce,
|
|
677
678
|
}, params);
|
|
678
679
|
const request = this.urlencode(query);
|
|
679
|
-
const secret = this.hash(this.encode(this.secret),
|
|
680
|
+
const secret = this.hash(this.encode(this.secret), md5.md5);
|
|
680
681
|
query['signature'] = this.hmac(this.encode(request), this.encode(secret), sha256.sha256);
|
|
681
682
|
body = this.urlencode(query);
|
|
682
683
|
headers = {
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -8198,7 +8198,7 @@ class bybit extends bybit$1 {
|
|
|
8198
8198
|
const quoteValueString = Precise["default"].stringMul(baseValueString, priceString);
|
|
8199
8199
|
return this.safeLiquidation({
|
|
8200
8200
|
'info': liquidation,
|
|
8201
|
-
'symbol': this.safeSymbol(marketId, market),
|
|
8201
|
+
'symbol': this.safeSymbol(marketId, market, undefined, 'contract'),
|
|
8202
8202
|
'contracts': this.parseNumber(contractsString),
|
|
8203
8203
|
'contractSize': this.parseNumber(contractSizeString),
|
|
8204
8204
|
'price': this.parseNumber(priceString),
|