ccxt 4.5.45 → 4.5.47
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 +5 -6
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -6
- package/dist/cjs/src/aftermath.js +1 -1
- package/dist/cjs/src/backpack.js +1 -1
- package/dist/cjs/src/base/Exchange.js +27 -0
- package/dist/cjs/src/binance.js +23 -17
- package/dist/cjs/src/bitfinex.js +6 -11
- package/dist/cjs/src/bitget.js +9 -4
- package/dist/cjs/src/bitmart.js +144 -21
- package/dist/cjs/src/bitmex.js +46 -0
- package/dist/cjs/src/bitstamp.js +14 -1
- package/dist/cjs/src/bittrade.js +1 -1
- package/dist/cjs/src/blofin.js +137 -29
- package/dist/cjs/src/bybit.js +58 -56
- package/dist/cjs/src/bydfi.js +102 -100
- package/dist/cjs/src/gate.js +37 -2
- package/dist/cjs/src/hollaex.js +1 -1
- package/dist/cjs/src/kraken.js +39 -29
- package/dist/cjs/src/kucoin.js +2161 -462
- package/dist/cjs/src/lighter.js +2 -2
- package/dist/cjs/src/okx.js +75 -58
- package/dist/cjs/src/paradex.js +2 -6
- package/dist/cjs/src/pro/bittrade.js +4 -0
- package/dist/cjs/src/pro/bydfi.js +19 -19
- package/dist/cjs/src/pro/gate.js +79 -54
- package/dist/cjs/src/pro/grvt.js +6 -4
- package/dist/cjs/src/pro/htx.js +4 -4
- package/dist/cjs/src/pro/lighter.js +1 -1
- package/dist/cjs/src/pro/okx.js +1 -1
- package/dist/cjs/src/whitebit.js +21 -2
- package/index.d.cts +2 -0
- package/js/ccxt.d.ts +2 -8
- package/js/ccxt.js +2 -6
- package/js/src/abstract/bitmart.d.ts +7 -0
- package/js/src/abstract/blofin.d.ts +28 -12
- package/js/src/abstract/bydfi.d.ts +29 -29
- package/js/src/abstract/kraken.d.ts +36 -29
- package/js/src/abstract/kucoin.d.ts +2 -0
- package/js/src/abstract/kucoinfutures.d.ts +2 -0
- package/js/src/aftermath.js +1 -1
- package/js/src/backpack.js +1 -1
- package/js/src/base/Exchange.d.ts +2 -0
- package/js/src/base/Exchange.js +27 -0
- package/js/src/binance.js +23 -17
- package/js/src/bitfinex.js +6 -11
- package/js/src/bitget.d.ts +1 -1
- package/js/src/bitget.js +9 -4
- package/js/src/bitmart.d.ts +18 -4
- package/js/src/bitmart.js +144 -21
- package/js/src/bitmex.d.ts +12 -0
- package/js/src/bitmex.js +46 -0
- package/js/src/bitstamp.js +14 -1
- package/js/src/bittrade.js +1 -1
- package/js/src/blofin.d.ts +2 -0
- package/js/src/blofin.js +137 -29
- package/js/src/bybit.d.ts +1 -0
- package/js/src/bybit.js +58 -56
- package/js/src/bydfi.d.ts +31 -31
- package/js/src/bydfi.js +102 -100
- package/js/src/gate.js +37 -2
- package/js/src/hollaex.js +1 -1
- package/js/src/kraken.js +39 -29
- package/js/src/kucoin.d.ts +249 -8
- package/js/src/kucoin.js +2161 -462
- package/js/src/lighter.js +2 -2
- package/js/src/okx.d.ts +1 -0
- package/js/src/okx.js +75 -58
- package/js/src/paradex.d.ts +0 -1
- package/js/src/paradex.js +2 -6
- package/js/src/pro/bittrade.js +4 -0
- package/js/src/pro/bydfi.d.ts +18 -18
- package/js/src/pro/bydfi.js +19 -19
- package/js/src/pro/gate.d.ts +2 -2
- package/js/src/pro/gate.js +79 -54
- package/js/src/pro/grvt.js +6 -4
- package/js/src/pro/htx.js +4 -4
- package/js/src/pro/lighter.js +1 -1
- package/js/src/pro/okx.js +1 -1
- package/js/src/whitebit.d.ts +1 -1
- package/js/src/whitebit.js +21 -2
- package/package.json +2 -2
- package/dist/cjs/src/abstract/coincatch.js +0 -11
- package/dist/cjs/src/coincatch.js +0 -5495
- package/dist/cjs/src/pro/coincatch.js +0 -1563
- package/js/src/abstract/coincatch.d.ts +0 -97
- package/js/src/abstract/coincatch.js +0 -5
- package/js/src/coincatch.d.ts +0 -788
- package/js/src/coincatch.js +0 -5488
- package/js/src/pro/coincatch.d.ts +0 -207
- package/js/src/pro/coincatch.js +0 -1556
package/dist/cjs/src/bitmex.js
CHANGED
|
@@ -3479,6 +3479,52 @@ class bitmex extends bitmex$1["default"] {
|
|
|
3479
3479
|
'datetime': datetime,
|
|
3480
3480
|
};
|
|
3481
3481
|
}
|
|
3482
|
+
/**
|
|
3483
|
+
* @method
|
|
3484
|
+
* @name bitmex#closePosition
|
|
3485
|
+
* @description closes open positions for a market
|
|
3486
|
+
* @see https://docs.bitmex.com/api-explorer/order-new
|
|
3487
|
+
* @see https://docs.bitmex.com/api-explorer/order-close-position
|
|
3488
|
+
* @param {string} symbol Unified CCXT market symbol
|
|
3489
|
+
* @param {string} side the buy or sell side of the closing order, if the position is long set the side to sell, reduceOnly is implied
|
|
3490
|
+
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
3491
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure}
|
|
3492
|
+
*/
|
|
3493
|
+
async closePosition(symbol, side = undefined, params = {}) {
|
|
3494
|
+
await this.loadMarkets();
|
|
3495
|
+
const market = this.market(symbol);
|
|
3496
|
+
const request = {
|
|
3497
|
+
'symbol': market['id'],
|
|
3498
|
+
'side': this.capitalize(side),
|
|
3499
|
+
'execInst': 'Close',
|
|
3500
|
+
};
|
|
3501
|
+
const response = await this.privatePostOrder(this.extend(request, params));
|
|
3502
|
+
//
|
|
3503
|
+
// {
|
|
3504
|
+
// "account": 395724,
|
|
3505
|
+
// "avgPx": 66358.8,
|
|
3506
|
+
// "cumQty": 200,
|
|
3507
|
+
// "currency": "USDT",
|
|
3508
|
+
// "execInst": "Close",
|
|
3509
|
+
// "leavesQty": 0,
|
|
3510
|
+
// "ordStatus": "Filled",
|
|
3511
|
+
// "ordType": "Market",
|
|
3512
|
+
// "orderID": "4e1ef998-33c1-4736-b58b-9d8b4d085c49",
|
|
3513
|
+
// "orderQty": 200,
|
|
3514
|
+
// "pool": "Primary",
|
|
3515
|
+
// "settlCurrency": "USDt",
|
|
3516
|
+
// "side": "Sell",
|
|
3517
|
+
// "strategy": "OneWay",
|
|
3518
|
+
// "symbol": "XBTUSDT",
|
|
3519
|
+
// "text": "Submitted via API.",
|
|
3520
|
+
// "timeInForce": "ImmediateOrCancel",
|
|
3521
|
+
// "timestamp": "2026-04-02T05:20:26.607Z",
|
|
3522
|
+
// "transactTime": "2026-04-02T05:20:26.606Z",
|
|
3523
|
+
// "workingIndicator": false
|
|
3524
|
+
// }
|
|
3525
|
+
//
|
|
3526
|
+
return this.parseOrder(response, market);
|
|
3527
|
+
}
|
|
3482
3528
|
handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
3483
3529
|
if (response === undefined) {
|
|
3484
3530
|
return undefined;
|
package/dist/cjs/src/bitstamp.js
CHANGED
|
@@ -524,7 +524,6 @@ class bitstamp extends bitstamp$1["default"] {
|
|
|
524
524
|
'Your account is frozen': errors.PermissionDenied,
|
|
525
525
|
'Please update your profile with your FATCA information, before using API.': errors.PermissionDenied,
|
|
526
526
|
'Order not found.': errors.OrderNotFound,
|
|
527
|
-
'Price is more than 20% below market price.': errors.InvalidOrder,
|
|
528
527
|
"Bitstamp.net is under scheduled maintenance. We'll be back soon.": errors.OnMaintenance,
|
|
529
528
|
'Order could not be placed.': errors.ExchangeNotAvailable,
|
|
530
529
|
'Invalid offset.': errors.BadRequest,
|
|
@@ -532,6 +531,7 @@ class bitstamp extends bitstamp$1["default"] {
|
|
|
532
531
|
},
|
|
533
532
|
'broad': {
|
|
534
533
|
'Minimum order size is': errors.InvalidOrder,
|
|
534
|
+
'Price is more than': errors.InvalidOrder,
|
|
535
535
|
'Check your account balance for details.': errors.InsufficientFunds,
|
|
536
536
|
'Ensure this value has at least': errors.InvalidAddress,
|
|
537
537
|
'Ensure that there are no more than': errors.InvalidOrder, // {"status": "error", "reason": {"amount": ["Ensure that there are no more than 0 decimal places."], "__all__": [""]}}
|
|
@@ -1137,6 +1137,19 @@ class bitstamp extends bitstamp$1["default"] {
|
|
|
1137
1137
|
priceString = this.safeString(trade, priceId, priceString);
|
|
1138
1138
|
amountString = this.safeString(trade, market['baseId'], amountString);
|
|
1139
1139
|
costString = this.safeString(trade, market['quoteId'], costString);
|
|
1140
|
+
// this endpoint is not aligned with "markets" endpoint
|
|
1141
|
+
const baseIdLower = market['baseId'].toLowerCase();
|
|
1142
|
+
const quoteIdLower = market['quoteId'].toLowerCase();
|
|
1143
|
+
const dashedIdLower = baseIdLower + '_' + quoteIdLower;
|
|
1144
|
+
if (priceString === undefined) {
|
|
1145
|
+
priceString = this.safeString(trade, dashedIdLower);
|
|
1146
|
+
}
|
|
1147
|
+
if (amountString === undefined) {
|
|
1148
|
+
amountString = this.safeString(trade, baseIdLower);
|
|
1149
|
+
}
|
|
1150
|
+
if (costString === undefined) {
|
|
1151
|
+
costString = this.safeString(trade, quoteIdLower);
|
|
1152
|
+
}
|
|
1140
1153
|
symbol = market['symbol'];
|
|
1141
1154
|
const datetimeString = this.safeString2(trade, 'date', 'datetime');
|
|
1142
1155
|
let timestamp = undefined;
|
package/dist/cjs/src/bittrade.js
CHANGED
|
@@ -1217,7 +1217,7 @@ class bittrade extends bittrade$1["default"] {
|
|
|
1217
1217
|
const response = await this[method](this.extend(request, params));
|
|
1218
1218
|
//
|
|
1219
1219
|
// { "status": "ok",
|
|
1220
|
-
// "data": [ { id:
|
|
1220
|
+
// "data": [ { id: 13997833015,
|
|
1221
1221
|
// "symbol": "ethbtc",
|
|
1222
1222
|
// "account-id": 3398321,
|
|
1223
1223
|
// "amount": "0.045000000000000000",
|
package/dist/cjs/src/blofin.js
CHANGED
|
@@ -180,35 +180,52 @@ class blofin extends blofin$1["default"] {
|
|
|
180
180
|
'market/tickers': 1,
|
|
181
181
|
'market/books': 1,
|
|
182
182
|
'market/trades': 1,
|
|
183
|
-
'market/candles': 1,
|
|
184
183
|
'market/mark-price': 1,
|
|
185
184
|
'market/funding-rate': 1,
|
|
186
185
|
'market/funding-rate-history': 1,
|
|
186
|
+
'market/candles': 1,
|
|
187
|
+
'market/index-candles': 1,
|
|
188
|
+
'market/mark-price-candles': 1,
|
|
189
|
+
'market/position-tiers': 1,
|
|
187
190
|
},
|
|
188
191
|
},
|
|
189
192
|
'private': {
|
|
190
193
|
'get': {
|
|
194
|
+
// account
|
|
191
195
|
'asset/balances': 1,
|
|
192
|
-
'trade/orders-pending': 1,
|
|
193
|
-
'trade/fills-history': 1,
|
|
194
|
-
'asset/deposit-history': 1,
|
|
195
|
-
'asset/withdrawal-history': 1,
|
|
196
196
|
'asset/bills': 1,
|
|
197
|
+
'asset/withdrawal-history': 1,
|
|
198
|
+
'asset/deposit-history': 1,
|
|
199
|
+
'account/config': 1,
|
|
200
|
+
'asset/currencies': 1,
|
|
201
|
+
// trading
|
|
197
202
|
'account/balance': 1,
|
|
198
203
|
'account/positions': 1,
|
|
199
|
-
'account/
|
|
204
|
+
'account/positions-history': 1,
|
|
200
205
|
'account/margin-mode': 1,
|
|
201
206
|
'account/position-mode': 1,
|
|
207
|
+
'account/leverage-info': 1,
|
|
202
208
|
'account/batch-leverage-info': 1,
|
|
209
|
+
'trade/orders-pending': 1,
|
|
210
|
+
'trade/order-detail': 1,
|
|
203
211
|
'trade/orders-tpsl-pending': 1,
|
|
212
|
+
'trade/order-tpsl-detail': 1,
|
|
204
213
|
'trade/orders-algo-pending': 1,
|
|
205
214
|
'trade/orders-history': 1,
|
|
206
215
|
'trade/orders-tpsl-history': 1,
|
|
207
216
|
'trade/orders-algo-history': 1,
|
|
217
|
+
'trade/fills-history': 1,
|
|
208
218
|
'trade/order/price-range': 1,
|
|
209
|
-
|
|
219
|
+
// affiliate
|
|
210
220
|
'affiliate/basic': 1,
|
|
221
|
+
'affiliate/referral-code': 1,
|
|
222
|
+
'affiliate/invitees': 1,
|
|
223
|
+
'affiliate/sub-invitees': 1,
|
|
224
|
+
'affiliate/sub-affiliates': 1,
|
|
225
|
+
'affiliate/invitees/daily/info': 1,
|
|
226
|
+
// copy trading
|
|
211
227
|
'copytrading/instruments': 1,
|
|
228
|
+
'copytrading/config': 1,
|
|
212
229
|
'copytrading/account/balance': 1,
|
|
213
230
|
'copytrading/account/positions-by-order': 1,
|
|
214
231
|
'copytrading/account/positions-details-by-order': 1,
|
|
@@ -220,21 +237,29 @@ class blofin extends blofin$1["default"] {
|
|
|
220
237
|
'copytrading/trade/position-history-by-order': 1,
|
|
221
238
|
'copytrading/trade/orders-history': 1,
|
|
222
239
|
'copytrading/trade/pending-tpsl-by-order': 1,
|
|
240
|
+
// user
|
|
241
|
+
'user/query-apikey': 1,
|
|
242
|
+
// tax
|
|
243
|
+
'spot/trade/fills-history': 1,
|
|
223
244
|
},
|
|
224
245
|
'post': {
|
|
246
|
+
// account
|
|
247
|
+
'asset/transfer': 1,
|
|
248
|
+
'asset/demo-apply-money': 1,
|
|
249
|
+
// trading
|
|
225
250
|
'account/set-margin-mode': 1,
|
|
226
251
|
'account/set-position-mode': 1,
|
|
227
|
-
'trade/order': 1,
|
|
228
|
-
'trade/order-algo': 1,
|
|
229
|
-
'trade/cancel-order': 1,
|
|
230
|
-
'trade/cancel-algo': 1,
|
|
231
252
|
'account/set-leverage': 1,
|
|
253
|
+
'trade/order': 1,
|
|
232
254
|
'trade/batch-orders': 1,
|
|
233
255
|
'trade/order-tpsl': 1,
|
|
256
|
+
'trade/order-algo': 1,
|
|
257
|
+
'trade/cancel-order': 1,
|
|
234
258
|
'trade/cancel-batch-orders': 1,
|
|
235
259
|
'trade/cancel-tpsl': 1,
|
|
260
|
+
'trade/cancel-algo': 1,
|
|
236
261
|
'trade/close-position': 1,
|
|
237
|
-
|
|
262
|
+
// copy trading
|
|
238
263
|
'copytrading/account/set-position-mode': 1,
|
|
239
264
|
'copytrading/account/set-leverage': 1,
|
|
240
265
|
'copytrading/trade/place-order': 1,
|
|
@@ -766,6 +791,21 @@ class blofin extends blofin$1["default"] {
|
|
|
766
791
|
// "brokerId": ""
|
|
767
792
|
// }
|
|
768
793
|
//
|
|
794
|
+
// fetchMyTrades spot
|
|
795
|
+
// {
|
|
796
|
+
// "instId": "DOGE-USDT",
|
|
797
|
+
// "tradeId": "6000001623870",
|
|
798
|
+
// "orderId": "6000011777113",
|
|
799
|
+
// "fillPrice": "0.091480000000000000",
|
|
800
|
+
// "fillSize": "30.000000000000000000",
|
|
801
|
+
// "fillPnl": null,
|
|
802
|
+
// "side": "buy",
|
|
803
|
+
// "fee": "0.030000000000000000",
|
|
804
|
+
// "ts": "1775213753407",
|
|
805
|
+
// "brokerId": null,
|
|
806
|
+
// "feeCurrency": "base_currency"
|
|
807
|
+
// }
|
|
808
|
+
//
|
|
769
809
|
const id = this.safeString(trade, 'tradeId');
|
|
770
810
|
const marketId = this.safeString(trade, 'instId');
|
|
771
811
|
market = this.safeMarket(marketId, market, '-');
|
|
@@ -777,27 +817,63 @@ class blofin extends blofin$1["default"] {
|
|
|
777
817
|
const orderId = this.safeString(trade, 'orderId');
|
|
778
818
|
const feeCost = this.safeString(trade, 'fee');
|
|
779
819
|
let fee = undefined;
|
|
820
|
+
let feeCurrency = this.safeString(trade, 'feeCurrency');
|
|
821
|
+
const isSpot = feeCurrency !== undefined;
|
|
822
|
+
if (feeCurrency === undefined) {
|
|
823
|
+
feeCurrency = market['settle'];
|
|
824
|
+
}
|
|
825
|
+
else if (feeCurrency === 'base_currency') {
|
|
826
|
+
feeCurrency = market['base'];
|
|
827
|
+
}
|
|
828
|
+
else if (feeCurrency === 'quote_currency') {
|
|
829
|
+
feeCurrency = market['quote'];
|
|
830
|
+
}
|
|
780
831
|
if (feeCost !== undefined) {
|
|
781
832
|
fee = {
|
|
782
833
|
'cost': feeCost,
|
|
783
|
-
'currency':
|
|
834
|
+
'currency': feeCurrency,
|
|
784
835
|
};
|
|
785
836
|
}
|
|
786
|
-
|
|
787
|
-
'
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
837
|
+
if (isSpot) {
|
|
838
|
+
const spotSymbol = market['base'] + '/' + market['quote'];
|
|
839
|
+
const cost = this.parseNumber(Precise["default"].stringMul(price, amount));
|
|
840
|
+
const result = {
|
|
841
|
+
'info': trade,
|
|
842
|
+
'timestamp': timestamp,
|
|
843
|
+
'datetime': this.iso8601(timestamp),
|
|
844
|
+
'symbol': spotSymbol,
|
|
845
|
+
'id': id,
|
|
846
|
+
'order': orderId,
|
|
847
|
+
'type': undefined,
|
|
848
|
+
'takerOrMaker': undefined,
|
|
849
|
+
'side': side,
|
|
850
|
+
'price': this.parseNumber(price),
|
|
851
|
+
'amount': this.parseNumber(amount),
|
|
852
|
+
'cost': cost,
|
|
853
|
+
'fee': {
|
|
854
|
+
'cost': this.parseNumber(feeCost),
|
|
855
|
+
'currency': feeCurrency,
|
|
856
|
+
},
|
|
857
|
+
};
|
|
858
|
+
return result;
|
|
859
|
+
}
|
|
860
|
+
else {
|
|
861
|
+
return this.safeTrade({
|
|
862
|
+
'info': trade,
|
|
863
|
+
'timestamp': timestamp,
|
|
864
|
+
'datetime': this.iso8601(timestamp),
|
|
865
|
+
'symbol': symbol,
|
|
866
|
+
'id': id,
|
|
867
|
+
'order': orderId,
|
|
868
|
+
'type': undefined,
|
|
869
|
+
'takerOrMaker': undefined,
|
|
870
|
+
'side': side,
|
|
871
|
+
'price': price,
|
|
872
|
+
'amount': amount,
|
|
873
|
+
'cost': undefined,
|
|
874
|
+
'fee': fee,
|
|
875
|
+
}, market);
|
|
876
|
+
}
|
|
801
877
|
}
|
|
802
878
|
/**
|
|
803
879
|
* @method
|
|
@@ -1608,6 +1684,8 @@ class blofin extends blofin$1["default"] {
|
|
|
1608
1684
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
1609
1685
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1610
1686
|
* @param {int} [params.until] Timestamp in ms of the latest time to retrieve trades for
|
|
1687
|
+
* @param {string} [params.type] 'swap' or 'spot' (defaults to 'swap'), required to fetch spot trade history
|
|
1688
|
+
* @param {string} [params.instId] *spot markets only* the market id of the spot market to fetch the trade history for (e.g. 'BTC-USDT')
|
|
1611
1689
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
1612
1690
|
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=trade-structure}
|
|
1613
1691
|
*/
|
|
@@ -1628,7 +1706,37 @@ class blofin extends blofin$1["default"] {
|
|
|
1628
1706
|
if (limit !== undefined) {
|
|
1629
1707
|
request['limit'] = limit; // default 100, max 100
|
|
1630
1708
|
}
|
|
1631
|
-
|
|
1709
|
+
let type = 'swap';
|
|
1710
|
+
[type, params] = this.handleMarketTypeAndParams('fetchMyTrades', market, params, type);
|
|
1711
|
+
let response = undefined;
|
|
1712
|
+
if (type === 'spot') {
|
|
1713
|
+
request['instType'] = 'SPOT';
|
|
1714
|
+
//
|
|
1715
|
+
// {
|
|
1716
|
+
// "code": "0",
|
|
1717
|
+
// "msg": "success",
|
|
1718
|
+
// "data": [
|
|
1719
|
+
// {
|
|
1720
|
+
// "instId": "DOGE-USDT",
|
|
1721
|
+
// "tradeId": "6000001623870",
|
|
1722
|
+
// "orderId": "6000011777113",
|
|
1723
|
+
// "fillPrice": "0.091480000000000000",
|
|
1724
|
+
// "fillSize": "30.000000000000000000",
|
|
1725
|
+
// "fillPnl": null,
|
|
1726
|
+
// "side": "buy",
|
|
1727
|
+
// "fee": "0.030000000000000000",
|
|
1728
|
+
// "ts": "1775213753407",
|
|
1729
|
+
// "brokerId": null,
|
|
1730
|
+
// "feeCurrency": "base_currency"
|
|
1731
|
+
// }
|
|
1732
|
+
// ]
|
|
1733
|
+
// }
|
|
1734
|
+
//
|
|
1735
|
+
response = await this.privateGetSpotTradeFillsHistory(this.extend(request, params));
|
|
1736
|
+
}
|
|
1737
|
+
else {
|
|
1738
|
+
response = await this.privateGetTradeFillsHistory(this.extend(request, params));
|
|
1739
|
+
}
|
|
1632
1740
|
const data = this.safeList(response, 'data', []);
|
|
1633
1741
|
return this.parseTrades(data, market, since, limit);
|
|
1634
1742
|
}
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -1130,8 +1130,12 @@ class bybit extends bybit$1["default"] {
|
|
|
1130
1130
|
'FUND': 'fund',
|
|
1131
1131
|
},
|
|
1132
1132
|
'networks': {
|
|
1133
|
+
'BTC': 'BTC',
|
|
1134
|
+
'ETH': 'ETH',
|
|
1133
1135
|
'ERC20': 'ETH',
|
|
1136
|
+
'TRX': 'TRX',
|
|
1134
1137
|
'TRC20': 'TRX',
|
|
1138
|
+
'BSC': 'BSC',
|
|
1135
1139
|
'BEP20': 'BSC',
|
|
1136
1140
|
'SOL': 'SOL',
|
|
1137
1141
|
'ACA': 'ACA',
|
|
@@ -1180,6 +1184,7 @@ class bybit extends bybit$1["default"] {
|
|
|
1180
1184
|
'OASIS': 'ROSE',
|
|
1181
1185
|
'OMNI': 'OMNI',
|
|
1182
1186
|
'ONE': 'ONE',
|
|
1187
|
+
'OP': 'OP',
|
|
1183
1188
|
'OPTIMISM': 'OP',
|
|
1184
1189
|
'POKT': 'POKT',
|
|
1185
1190
|
'QTUM': 'QTUM',
|
|
@@ -1210,8 +1215,7 @@ class bybit extends bybit$1["default"] {
|
|
|
1210
1215
|
'ETH': 'ERC20',
|
|
1211
1216
|
'TRX': 'TRC20',
|
|
1212
1217
|
'BSC': 'BEP20',
|
|
1213
|
-
'
|
|
1214
|
-
'SPL': 'SOL',
|
|
1218
|
+
'OP': 'OP',
|
|
1215
1219
|
},
|
|
1216
1220
|
'defaultNetwork': 'ERC20',
|
|
1217
1221
|
'defaultNetworks': {
|
|
@@ -1707,68 +1711,66 @@ class bybit extends bybit$1["default"] {
|
|
|
1707
1711
|
//
|
|
1708
1712
|
const data = this.safeDict(response, 'result', {});
|
|
1709
1713
|
const rows = this.safeList(data, 'rows', []);
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
'active': undefined,
|
|
1727
|
-
'deposit': this.safeInteger(chain, 'chainDeposit') === 1,
|
|
1728
|
-
'withdraw': this.safeInteger(chain, 'chainWithdraw') === 1,
|
|
1729
|
-
'fee': this.safeNumber(chain, 'withdrawFee'),
|
|
1730
|
-
'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'minAccuracy'))),
|
|
1731
|
-
'limits': {
|
|
1732
|
-
'withdraw': {
|
|
1733
|
-
'min': this.safeNumber(chain, 'withdrawMin'),
|
|
1734
|
-
'max': undefined,
|
|
1735
|
-
},
|
|
1736
|
-
'deposit': {
|
|
1737
|
-
'min': this.safeNumber(chain, 'depositMin'),
|
|
1738
|
-
'max': undefined,
|
|
1739
|
-
},
|
|
1740
|
-
},
|
|
1741
|
-
};
|
|
1742
|
-
}
|
|
1743
|
-
result[code] = this.safeCurrencyStructure({
|
|
1744
|
-
'info': currency,
|
|
1745
|
-
'code': code,
|
|
1746
|
-
'id': currencyId,
|
|
1747
|
-
'name': name,
|
|
1714
|
+
return this.parseCurrencies(rows);
|
|
1715
|
+
}
|
|
1716
|
+
parseCurrency(currency) {
|
|
1717
|
+
const currencyId = this.safeString(currency, 'coin');
|
|
1718
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
1719
|
+
const name = this.safeString(currency, 'name');
|
|
1720
|
+
const chains = this.safeList(currency, 'chains', []);
|
|
1721
|
+
const networks = {};
|
|
1722
|
+
for (let j = 0; j < chains.length; j++) {
|
|
1723
|
+
const chain = chains[j];
|
|
1724
|
+
const networkId = this.safeString(chain, 'chain');
|
|
1725
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
1726
|
+
networks[networkCode] = {
|
|
1727
|
+
'info': chain,
|
|
1728
|
+
'id': networkId,
|
|
1729
|
+
'network': networkCode,
|
|
1748
1730
|
'active': undefined,
|
|
1749
|
-
'deposit':
|
|
1750
|
-
'withdraw':
|
|
1751
|
-
'fee':
|
|
1752
|
-
'precision':
|
|
1731
|
+
'deposit': this.safeInteger(chain, 'chainDeposit') === 1,
|
|
1732
|
+
'withdraw': this.safeInteger(chain, 'chainWithdraw') === 1,
|
|
1733
|
+
'fee': this.safeNumber(chain, 'withdrawFee'),
|
|
1734
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'minAccuracy'))),
|
|
1753
1735
|
'limits': {
|
|
1754
|
-
'amount': {
|
|
1755
|
-
'min': undefined,
|
|
1756
|
-
'max': undefined,
|
|
1757
|
-
},
|
|
1758
1736
|
'withdraw': {
|
|
1759
|
-
'min':
|
|
1737
|
+
'min': this.safeNumber(chain, 'withdrawMin'),
|
|
1760
1738
|
'max': undefined,
|
|
1761
1739
|
},
|
|
1762
1740
|
'deposit': {
|
|
1763
|
-
'min':
|
|
1741
|
+
'min': this.safeNumber(chain, 'depositMin'),
|
|
1764
1742
|
'max': undefined,
|
|
1765
1743
|
},
|
|
1766
1744
|
},
|
|
1767
|
-
|
|
1768
|
-
'type': 'crypto', // atm exchange api provides only cryptos
|
|
1769
|
-
});
|
|
1745
|
+
};
|
|
1770
1746
|
}
|
|
1771
|
-
return
|
|
1747
|
+
return this.safeCurrencyStructure({
|
|
1748
|
+
'info': currency,
|
|
1749
|
+
'code': code,
|
|
1750
|
+
'id': currencyId,
|
|
1751
|
+
'name': name,
|
|
1752
|
+
'active': undefined,
|
|
1753
|
+
'deposit': undefined,
|
|
1754
|
+
'withdraw': undefined,
|
|
1755
|
+
'fee': undefined,
|
|
1756
|
+
'precision': undefined,
|
|
1757
|
+
'limits': {
|
|
1758
|
+
'amount': {
|
|
1759
|
+
'min': undefined,
|
|
1760
|
+
'max': undefined,
|
|
1761
|
+
},
|
|
1762
|
+
'withdraw': {
|
|
1763
|
+
'min': undefined,
|
|
1764
|
+
'max': undefined,
|
|
1765
|
+
},
|
|
1766
|
+
'deposit': {
|
|
1767
|
+
'min': undefined,
|
|
1768
|
+
'max': undefined,
|
|
1769
|
+
},
|
|
1770
|
+
},
|
|
1771
|
+
'networks': networks,
|
|
1772
|
+
'type': 'crypto', // atm exchange api provides only cryptos
|
|
1773
|
+
});
|
|
1772
1774
|
}
|
|
1773
1775
|
/**
|
|
1774
1776
|
* @method
|
|
@@ -6077,7 +6079,7 @@ class bybit extends bybit$1["default"] {
|
|
|
6077
6079
|
'txid': this.safeString(transaction, 'txID'),
|
|
6078
6080
|
'timestamp': timestamp,
|
|
6079
6081
|
'datetime': this.iso8601(timestamp),
|
|
6080
|
-
'network': this.networkIdToCode(this.safeString(transaction, 'chain')),
|
|
6082
|
+
'network': this.networkIdToCode(this.safeString(transaction, 'chain'), code),
|
|
6081
6083
|
'address': undefined,
|
|
6082
6084
|
'addressTo': toAddress,
|
|
6083
6085
|
'addressFrom': undefined,
|
|
@@ -6414,7 +6416,7 @@ class bybit extends bybit$1["default"] {
|
|
|
6414
6416
|
request['tag'] = tag;
|
|
6415
6417
|
}
|
|
6416
6418
|
const [networkCode, query] = this.handleNetworkCodeAndParams(params);
|
|
6417
|
-
const networkId = this.networkCodeToId(networkCode);
|
|
6419
|
+
const networkId = this.networkCodeToId(networkCode, code);
|
|
6418
6420
|
if (networkId !== undefined) {
|
|
6419
6421
|
request['chain'] = networkId.toUpperCase();
|
|
6420
6422
|
}
|