ccxt 4.4.91 → 4.4.93
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 +3 -3
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ascendex.js +9 -8
- package/dist/cjs/src/base/Exchange.js +81 -33
- package/dist/cjs/src/binance.js +44 -1
- package/dist/cjs/src/bitmart.js +7 -0
- package/dist/cjs/src/bitmex.js +4 -4
- package/dist/cjs/src/bitvavo.js +10 -1
- package/dist/cjs/src/bybit.js +83 -8
- package/dist/cjs/src/coinbaseexchange.js +53 -0
- package/dist/cjs/src/coincheck.js +47 -4
- package/dist/cjs/src/coinex.js +19 -14
- package/dist/cjs/src/cryptomus.js +30 -53
- package/dist/cjs/src/deribit.js +6 -6
- package/dist/cjs/src/exmo.js +72 -59
- package/dist/cjs/src/htx.js +1 -1
- package/dist/cjs/src/hyperliquid.js +3 -2
- package/dist/cjs/src/krakenfutures.js +1 -1
- package/dist/cjs/src/kucoin.js +13 -15
- package/dist/cjs/src/latoken.js +19 -74
- package/dist/cjs/src/lbank.js +118 -34
- package/dist/cjs/src/okx.js +158 -2
- package/dist/cjs/src/paradex.js +54 -0
- package/dist/cjs/src/phemex.js +3 -3
- package/dist/cjs/src/pro/bitstamp.js +55 -16
- package/dist/cjs/src/pro/bybit.js +6 -7
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/lbank.d.ts +1 -0
- package/js/src/ascendex.js +9 -8
- package/js/src/base/Exchange.d.ts +5 -1
- package/js/src/base/Exchange.js +81 -33
- package/js/src/binance.d.ts +10 -0
- package/js/src/binance.js +44 -1
- package/js/src/bitmart.d.ts +7 -0
- package/js/src/bitmart.js +7 -0
- package/js/src/bitmex.d.ts +1 -1
- package/js/src/bitmex.js +4 -4
- package/js/src/bitvavo.js +10 -1
- package/js/src/bybit.d.ts +12 -1
- package/js/src/bybit.js +83 -8
- package/js/src/coinbaseexchange.js +53 -0
- package/js/src/coincheck.js +48 -5
- package/js/src/coinex.js +16 -13
- package/js/src/cryptomus.js +30 -53
- package/js/src/deribit.js +6 -6
- package/js/src/exmo.js +72 -59
- package/js/src/htx.js +1 -1
- package/js/src/hyperliquid.js +3 -2
- package/js/src/krakenfutures.js +1 -1
- package/js/src/kucoin.js +13 -15
- package/js/src/latoken.d.ts +0 -1
- package/js/src/latoken.js +19 -74
- package/js/src/lbank.d.ts +9 -1
- package/js/src/lbank.js +118 -34
- package/js/src/okx.d.ts +13 -1
- package/js/src/okx.js +158 -2
- package/js/src/paradex.d.ts +10 -0
- package/js/src/paradex.js +54 -0
- package/js/src/phemex.js +3 -3
- package/js/src/pro/bitstamp.js +55 -16
- package/js/src/pro/bybit.js +7 -8
- package/package.json +1 -1
|
@@ -28,31 +28,73 @@ class coinbaseexchange extends coinbaseexchange$1 {
|
|
|
28
28
|
'swap': false,
|
|
29
29
|
'future': false,
|
|
30
30
|
'option': false,
|
|
31
|
+
'addMargin': false,
|
|
32
|
+
'borrowCrossMargin': false,
|
|
33
|
+
'borrowIsolatedMargin': false,
|
|
34
|
+
'borrowMargin': false,
|
|
31
35
|
'cancelAllOrders': true,
|
|
32
36
|
'cancelOrder': true,
|
|
37
|
+
'closeAllPositions': false,
|
|
38
|
+
'closePosition': false,
|
|
33
39
|
'createDepositAddress': true,
|
|
34
40
|
'createOrder': true,
|
|
41
|
+
'createOrderWithTakeProfitAndStopLoss': false,
|
|
42
|
+
'createOrderWithTakeProfitAndStopLossWs': false,
|
|
43
|
+
'createPostOnlyOrder': false,
|
|
35
44
|
'createReduceOnlyOrder': false,
|
|
36
45
|
'createStopLimitOrder': true,
|
|
37
46
|
'createStopMarketOrder': true,
|
|
38
47
|
'createStopOrder': true,
|
|
39
48
|
'fetchAccounts': true,
|
|
40
49
|
'fetchBalance': true,
|
|
50
|
+
'fetchBorrowInterest': false,
|
|
51
|
+
'fetchBorrowRate': false,
|
|
52
|
+
'fetchBorrowRateHistories': false,
|
|
53
|
+
'fetchBorrowRateHistory': false,
|
|
54
|
+
'fetchBorrowRates': false,
|
|
55
|
+
'fetchBorrowRatesPerSymbol': false,
|
|
41
56
|
'fetchClosedOrders': true,
|
|
57
|
+
'fetchCrossBorrowRate': false,
|
|
58
|
+
'fetchCrossBorrowRates': false,
|
|
42
59
|
'fetchCurrencies': true,
|
|
43
60
|
'fetchDepositAddress': false,
|
|
44
61
|
'fetchDeposits': true,
|
|
45
62
|
'fetchDepositsWithdrawals': true,
|
|
46
63
|
'fetchFundingHistory': false,
|
|
64
|
+
'fetchFundingInterval': false,
|
|
65
|
+
'fetchFundingIntervals': false,
|
|
47
66
|
'fetchFundingRate': false,
|
|
48
67
|
'fetchFundingRateHistory': false,
|
|
49
68
|
'fetchFundingRates': false,
|
|
69
|
+
'fetchGreeks': false,
|
|
70
|
+
'fetchIndexOHLCV': false,
|
|
71
|
+
'fetchIsolatedBorrowRate': false,
|
|
72
|
+
'fetchIsolatedBorrowRates': false,
|
|
73
|
+
'fetchIsolatedPositions': false,
|
|
50
74
|
'fetchLedger': true,
|
|
75
|
+
'fetchLeverage': false,
|
|
76
|
+
'fetchLeverages': false,
|
|
77
|
+
'fetchLeverageTiers': false,
|
|
78
|
+
'fetchLiquidations': false,
|
|
79
|
+
'fetchLongShortRatio': false,
|
|
80
|
+
'fetchLongShortRatioHistory': false,
|
|
81
|
+
'fetchMarginAdjustmentHistory': false,
|
|
51
82
|
'fetchMarginMode': false,
|
|
83
|
+
'fetchMarginModes': false,
|
|
84
|
+
'fetchMarketLeverageTiers': false,
|
|
52
85
|
'fetchMarkets': true,
|
|
86
|
+
'fetchMarkOHLCV': false,
|
|
87
|
+
'fetchMarkPrices': false,
|
|
88
|
+
'fetchMyLiquidations': false,
|
|
89
|
+
'fetchMySettlementHistory': false,
|
|
53
90
|
'fetchMyTrades': true,
|
|
54
91
|
'fetchOHLCV': true,
|
|
92
|
+
'fetchOpenInterest': false,
|
|
93
|
+
'fetchOpenInterestHistory': false,
|
|
94
|
+
'fetchOpenInterests': false,
|
|
55
95
|
'fetchOpenOrders': true,
|
|
96
|
+
'fetchOption': false,
|
|
97
|
+
'fetchOptionChain': false,
|
|
56
98
|
'fetchOrder': true,
|
|
57
99
|
'fetchOrderBook': true,
|
|
58
100
|
'fetchOrders': true,
|
|
@@ -64,6 +106,8 @@ class coinbaseexchange extends coinbaseexchange$1 {
|
|
|
64
106
|
'fetchPositionsForSymbol': false,
|
|
65
107
|
'fetchPositionsHistory': false,
|
|
66
108
|
'fetchPositionsRisk': false,
|
|
109
|
+
'fetchPremiumIndexOHLCV': false,
|
|
110
|
+
'fetchSettlementHistory': false,
|
|
67
111
|
'fetchTicker': true,
|
|
68
112
|
'fetchTickers': true,
|
|
69
113
|
'fetchTime': true,
|
|
@@ -71,7 +115,16 @@ class coinbaseexchange extends coinbaseexchange$1 {
|
|
|
71
115
|
'fetchTradingFee': false,
|
|
72
116
|
'fetchTradingFees': true,
|
|
73
117
|
'fetchTransactions': 'emulated',
|
|
118
|
+
'fetchVolatilityHistory': false,
|
|
74
119
|
'fetchWithdrawals': true,
|
|
120
|
+
'reduceMargin': false,
|
|
121
|
+
'repayCrossMargin': false,
|
|
122
|
+
'repayIsolatedMargin': false,
|
|
123
|
+
'repayMargin': false,
|
|
124
|
+
'setLeverage': false,
|
|
125
|
+
'setMargin': false,
|
|
126
|
+
'setMarginMode': false,
|
|
127
|
+
'setPositionMode': false,
|
|
75
128
|
'withdraw': true,
|
|
76
129
|
},
|
|
77
130
|
'timeframes': {
|
|
@@ -26,30 +26,59 @@ class coincheck extends coincheck$1 {
|
|
|
26
26
|
'future': false,
|
|
27
27
|
'option': false,
|
|
28
28
|
'addMargin': false,
|
|
29
|
+
'borrowCrossMargin': false,
|
|
30
|
+
'borrowIsolatedMargin': false,
|
|
31
|
+
'borrowMargin': false,
|
|
29
32
|
'cancelOrder': true,
|
|
30
33
|
'closeAllPositions': false,
|
|
31
34
|
'closePosition': false,
|
|
32
35
|
'createOrder': true,
|
|
36
|
+
'createOrderWithTakeProfitAndStopLoss': false,
|
|
37
|
+
'createOrderWithTakeProfitAndStopLossWs': false,
|
|
38
|
+
'createPostOnlyOrder': false,
|
|
33
39
|
'createReduceOnlyOrder': false,
|
|
34
40
|
'fetchBalance': true,
|
|
41
|
+
'fetchBorrowInterest': false,
|
|
42
|
+
'fetchBorrowRate': false,
|
|
35
43
|
'fetchBorrowRateHistories': false,
|
|
36
44
|
'fetchBorrowRateHistory': false,
|
|
45
|
+
'fetchBorrowRates': false,
|
|
46
|
+
'fetchBorrowRatesPerSymbol': false,
|
|
37
47
|
'fetchCrossBorrowRate': false,
|
|
38
48
|
'fetchCrossBorrowRates': false,
|
|
39
49
|
'fetchDeposits': true,
|
|
40
50
|
'fetchFundingHistory': false,
|
|
51
|
+
'fetchFundingInterval': false,
|
|
52
|
+
'fetchFundingIntervals': false,
|
|
41
53
|
'fetchFundingRate': false,
|
|
42
54
|
'fetchFundingRateHistory': false,
|
|
43
55
|
'fetchFundingRates': false,
|
|
56
|
+
'fetchGreeks': false,
|
|
44
57
|
'fetchIndexOHLCV': false,
|
|
45
58
|
'fetchIsolatedBorrowRate': false,
|
|
46
59
|
'fetchIsolatedBorrowRates': false,
|
|
60
|
+
'fetchIsolatedPositions': false,
|
|
47
61
|
'fetchLeverage': false,
|
|
62
|
+
'fetchLeverages': false,
|
|
63
|
+
'fetchLeverageTiers': false,
|
|
64
|
+
'fetchLiquidations': false,
|
|
65
|
+
'fetchLongShortRatio': false,
|
|
66
|
+
'fetchLongShortRatioHistory': false,
|
|
67
|
+
'fetchMarginAdjustmentHistory': false,
|
|
48
68
|
'fetchMarginMode': false,
|
|
69
|
+
'fetchMarginModes': false,
|
|
70
|
+
'fetchMarketLeverageTiers': false,
|
|
49
71
|
'fetchMarkOHLCV': false,
|
|
72
|
+
'fetchMarkPrices': false,
|
|
73
|
+
'fetchMyLiquidations': false,
|
|
74
|
+
'fetchMySettlementHistory': false,
|
|
50
75
|
'fetchMyTrades': true,
|
|
76
|
+
'fetchOpenInterest': false,
|
|
51
77
|
'fetchOpenInterestHistory': false,
|
|
78
|
+
'fetchOpenInterests': false,
|
|
52
79
|
'fetchOpenOrders': true,
|
|
80
|
+
'fetchOption': false,
|
|
81
|
+
'fetchOptionChain': false,
|
|
53
82
|
'fetchOrderBook': true,
|
|
54
83
|
'fetchPosition': false,
|
|
55
84
|
'fetchPositionHistory': false,
|
|
@@ -59,13 +88,19 @@ class coincheck extends coincheck$1 {
|
|
|
59
88
|
'fetchPositionsHistory': false,
|
|
60
89
|
'fetchPositionsRisk': false,
|
|
61
90
|
'fetchPremiumIndexOHLCV': false,
|
|
91
|
+
'fetchSettlementHistory': false,
|
|
62
92
|
'fetchTicker': true,
|
|
63
93
|
'fetchTrades': true,
|
|
64
94
|
'fetchTradingFee': false,
|
|
65
95
|
'fetchTradingFees': true,
|
|
96
|
+
'fetchVolatilityHistory': false,
|
|
66
97
|
'fetchWithdrawals': true,
|
|
67
98
|
'reduceMargin': false,
|
|
99
|
+
'repayCrossMargin': false,
|
|
100
|
+
'repayIsolatedMargin': false,
|
|
101
|
+
'repayMargin': false,
|
|
68
102
|
'setLeverage': false,
|
|
103
|
+
'setMargin': false,
|
|
69
104
|
'setMarginMode': false,
|
|
70
105
|
'setPositionMode': false,
|
|
71
106
|
'ws': true,
|
|
@@ -645,10 +680,18 @@ class coincheck extends coincheck$1 {
|
|
|
645
680
|
'pair': market['id'],
|
|
646
681
|
};
|
|
647
682
|
if (type === 'market') {
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
683
|
+
request['order_type'] = type + '_' + side;
|
|
684
|
+
if (side === 'sell') {
|
|
685
|
+
request['amount'] = amount;
|
|
686
|
+
}
|
|
687
|
+
else {
|
|
688
|
+
const cost = this.safeNumber(params, 'cost');
|
|
689
|
+
params = this.omit(params, 'cost');
|
|
690
|
+
if (cost !== undefined) {
|
|
691
|
+
throw new errors.ArgumentsRequired(this.id + ' createOrder() : you should use "cost" parameter instead of "amount" argument to create market buy orders');
|
|
692
|
+
}
|
|
693
|
+
request['market_buy_amount'] = cost;
|
|
694
|
+
}
|
|
652
695
|
}
|
|
653
696
|
else {
|
|
654
697
|
request['order_type'] = side;
|
package/dist/cjs/src/coinex.js
CHANGED
|
@@ -657,6 +657,7 @@ class coinex extends coinex$1 {
|
|
|
657
657
|
'broad': {
|
|
658
658
|
'ip not allow visit': errors.PermissionDenied,
|
|
659
659
|
'service too busy': errors.ExchangeNotAvailable,
|
|
660
|
+
'Service is not available during funding fee settlement': errors.OperationFailed,
|
|
660
661
|
},
|
|
661
662
|
},
|
|
662
663
|
});
|
|
@@ -721,6 +722,7 @@ class coinex extends coinex$1 {
|
|
|
721
722
|
const canWithdraw = this.safeBool(asset, 'withdraw_enabled');
|
|
722
723
|
const firstChain = this.safeDict(chains, 0, {});
|
|
723
724
|
const firstPrecisionString = this.parsePrecision(this.safeString(firstChain, 'withdrawal_precision'));
|
|
725
|
+
const networks = {};
|
|
724
726
|
for (let j = 0; j < chains.length; j++) {
|
|
725
727
|
const chain = chains[j];
|
|
726
728
|
const networkId = this.safeString(chain, 'chain');
|
|
@@ -733,7 +735,7 @@ class coinex extends coinex$1 {
|
|
|
733
735
|
const minNetworkWithdrawString = this.safeString(chain, 'min_withdraw_amount');
|
|
734
736
|
const canDepositChain = this.safeBool(chain, 'deposit_enabled');
|
|
735
737
|
const canWithdrawChain = this.safeBool(chain, 'withdraw_enabled');
|
|
736
|
-
|
|
738
|
+
const network = {
|
|
737
739
|
'id': networkId,
|
|
738
740
|
'network': networkId,
|
|
739
741
|
'name': undefined,
|
|
@@ -757,7 +759,8 @@ class coinex extends coinex$1 {
|
|
|
757
759
|
},
|
|
758
760
|
},
|
|
759
761
|
'info': chain,
|
|
760
|
-
}
|
|
762
|
+
};
|
|
763
|
+
networks[networkId] = network;
|
|
761
764
|
}
|
|
762
765
|
result[code] = this.safeCurrencyStructure({
|
|
763
766
|
'id': currencyId,
|
|
@@ -782,7 +785,7 @@ class coinex extends coinex$1 {
|
|
|
782
785
|
'max': undefined,
|
|
783
786
|
},
|
|
784
787
|
},
|
|
785
|
-
'networks':
|
|
788
|
+
'networks': networks,
|
|
786
789
|
'type': 'crypto',
|
|
787
790
|
'info': coin,
|
|
788
791
|
});
|
|
@@ -815,17 +818,19 @@ class coinex extends coinex$1 {
|
|
|
815
818
|
// "code": 0,
|
|
816
819
|
// "data": [
|
|
817
820
|
// {
|
|
818
|
-
// "
|
|
821
|
+
// "market": "BTCUSDT",
|
|
822
|
+
// "taker_fee_rate": "0.002",
|
|
823
|
+
// "maker_fee_rate": "0.002",
|
|
824
|
+
// "min_amount": "0.0005",
|
|
825
|
+
// "base_ccy": "BTC",
|
|
826
|
+
// "quote_ccy": "USDT",
|
|
819
827
|
// "base_ccy_precision": 8,
|
|
828
|
+
// "quote_ccy_precision": 2,
|
|
820
829
|
// "is_amm_available": true,
|
|
821
|
-
// "is_margin_available":
|
|
822
|
-
// "
|
|
823
|
-
// "
|
|
824
|
-
//
|
|
825
|
-
// "quote_ccy": "USDT",
|
|
826
|
-
// "quote_ccy_precision": 6,
|
|
827
|
-
// "taker_fee_rate": "0.003"
|
|
828
|
-
// },
|
|
830
|
+
// "is_margin_available": true,
|
|
831
|
+
// "is_pre_trading_available": true,
|
|
832
|
+
// "is_api_trading_available": true
|
|
833
|
+
// }
|
|
829
834
|
// ],
|
|
830
835
|
// "message": "OK"
|
|
831
836
|
// }
|
|
@@ -851,11 +856,11 @@ class coinex extends coinex$1 {
|
|
|
851
856
|
'settleId': undefined,
|
|
852
857
|
'type': 'spot',
|
|
853
858
|
'spot': true,
|
|
854
|
-
'margin':
|
|
859
|
+
'margin': this.safeBool(market, 'is_margin_available'),
|
|
855
860
|
'swap': false,
|
|
856
861
|
'future': false,
|
|
857
862
|
'option': false,
|
|
858
|
-
'active':
|
|
863
|
+
'active': this.safeBool(market, 'is_api_trading_available'),
|
|
859
864
|
'contract': false,
|
|
860
865
|
'linear': undefined,
|
|
861
866
|
'inverse': undefined,
|
|
@@ -363,68 +363,45 @@ class cryptomus extends cryptomus$1 {
|
|
|
363
363
|
// }
|
|
364
364
|
//
|
|
365
365
|
const coins = this.safeList(response, 'result');
|
|
366
|
+
const groupedById = this.groupBy(coins, 'currency_code');
|
|
367
|
+
const keys = Object.keys(groupedById);
|
|
366
368
|
const result = {};
|
|
367
|
-
for (let i = 0; i <
|
|
368
|
-
const
|
|
369
|
-
const
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
'
|
|
378
|
-
'
|
|
379
|
-
'deposit': undefined,
|
|
380
|
-
'withdraw': undefined,
|
|
381
|
-
'fee': undefined,
|
|
369
|
+
for (let i = 0; i < keys.length; i++) {
|
|
370
|
+
const id = keys[i];
|
|
371
|
+
const code = this.safeCurrencyCode(id);
|
|
372
|
+
const networks = {};
|
|
373
|
+
const networkEntries = groupedById[id];
|
|
374
|
+
for (let j = 0; j < networkEntries.length; j++) {
|
|
375
|
+
const networkEntry = networkEntries[j];
|
|
376
|
+
const networkId = this.safeString(networkEntry, 'network_code');
|
|
377
|
+
const networkCode = this.networkIdToCode(networkId);
|
|
378
|
+
networks[networkCode] = {
|
|
379
|
+
'id': networkId,
|
|
380
|
+
'network': networkCode,
|
|
382
381
|
'limits': {
|
|
383
382
|
'withdraw': {
|
|
384
|
-
'min':
|
|
385
|
-
'max':
|
|
383
|
+
'min': this.safeNumber(networkEntry, 'min_withdraw'),
|
|
384
|
+
'max': this.safeNumber(networkEntry, 'max_withdraw'),
|
|
386
385
|
},
|
|
387
386
|
'deposit': {
|
|
388
|
-
'min':
|
|
389
|
-
'max':
|
|
387
|
+
'min': this.safeNumber(networkEntry, 'min_deposit'),
|
|
388
|
+
'max': this.safeNumber(networkEntry, 'max_deposit'),
|
|
390
389
|
},
|
|
391
390
|
},
|
|
392
|
-
'
|
|
393
|
-
'
|
|
391
|
+
'active': undefined,
|
|
392
|
+
'deposit': this.safeBool(networkEntry, 'can_withdraw'),
|
|
393
|
+
'withdraw': this.safeBool(networkEntry, 'can_deposit'),
|
|
394
|
+
'fee': undefined,
|
|
395
|
+
'precision': undefined,
|
|
396
|
+
'info': networkEntry,
|
|
394
397
|
};
|
|
395
398
|
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
'
|
|
400
|
-
'
|
|
401
|
-
|
|
402
|
-
'withdraw': {
|
|
403
|
-
'min': this.safeNumber(networkEntry, 'min_withdraw'),
|
|
404
|
-
'max': this.safeNumber(networkEntry, 'max_withdraw'),
|
|
405
|
-
},
|
|
406
|
-
'deposit': {
|
|
407
|
-
'min': this.safeNumber(networkEntry, 'min_deposit'),
|
|
408
|
-
'max': this.safeNumber(networkEntry, 'max_deposit'),
|
|
409
|
-
},
|
|
410
|
-
},
|
|
411
|
-
'active': undefined,
|
|
412
|
-
'deposit': this.safeBool(networkEntry, 'can_withdraw'),
|
|
413
|
-
'withdraw': this.safeBool(networkEntry, 'can_deposit'),
|
|
414
|
-
'fee': undefined,
|
|
415
|
-
'precision': undefined,
|
|
416
|
-
'info': networkEntry,
|
|
417
|
-
};
|
|
418
|
-
// add entry in info
|
|
419
|
-
const info = this.safeList(result[code], 'info', []);
|
|
420
|
-
info.push(networkEntry);
|
|
421
|
-
result[code]['info'] = info;
|
|
422
|
-
}
|
|
423
|
-
// only after all entries are formed in currencies, restructure each entry
|
|
424
|
-
const allKeys = Object.keys(result);
|
|
425
|
-
for (let i = 0; i < allKeys.length; i++) {
|
|
426
|
-
const code = allKeys[i];
|
|
427
|
-
result[code] = this.safeCurrencyStructure(result[code]); // this is needed after adding network entry
|
|
399
|
+
result[code] = this.safeCurrencyStructure({
|
|
400
|
+
'id': id,
|
|
401
|
+
'code': code,
|
|
402
|
+
'networks': networks,
|
|
403
|
+
'info': networkEntries,
|
|
404
|
+
});
|
|
428
405
|
}
|
|
429
406
|
return result;
|
|
430
407
|
}
|
package/dist/cjs/src/deribit.js
CHANGED
|
@@ -2691,21 +2691,21 @@ class deribit extends deribit$1 {
|
|
|
2691
2691
|
const unrealizedPnl = this.safeString(position, 'floating_profit_loss');
|
|
2692
2692
|
const initialMarginString = this.safeString(position, 'initial_margin');
|
|
2693
2693
|
const notionalString = this.safeString(position, 'size_currency');
|
|
2694
|
+
const notionalStringAbs = Precise["default"].stringAbs(notionalString);
|
|
2694
2695
|
const maintenanceMarginString = this.safeString(position, 'maintenance_margin');
|
|
2695
|
-
const currentTime = this.milliseconds();
|
|
2696
2696
|
return this.safePosition({
|
|
2697
2697
|
'info': position,
|
|
2698
2698
|
'id': undefined,
|
|
2699
2699
|
'symbol': this.safeString(market, 'symbol'),
|
|
2700
|
-
'timestamp':
|
|
2701
|
-
'datetime':
|
|
2700
|
+
'timestamp': undefined,
|
|
2701
|
+
'datetime': undefined,
|
|
2702
2702
|
'lastUpdateTimestamp': undefined,
|
|
2703
2703
|
'initialMargin': this.parseNumber(initialMarginString),
|
|
2704
|
-
'initialMarginPercentage': this.parseNumber(Precise["default"].stringMul(Precise["default"].stringDiv(initialMarginString,
|
|
2704
|
+
'initialMarginPercentage': this.parseNumber(Precise["default"].stringMul(Precise["default"].stringDiv(initialMarginString, notionalStringAbs), '100')),
|
|
2705
2705
|
'maintenanceMargin': this.parseNumber(maintenanceMarginString),
|
|
2706
|
-
'maintenanceMarginPercentage': this.parseNumber(Precise["default"].stringMul(Precise["default"].stringDiv(maintenanceMarginString,
|
|
2706
|
+
'maintenanceMarginPercentage': this.parseNumber(Precise["default"].stringMul(Precise["default"].stringDiv(maintenanceMarginString, notionalStringAbs), '100')),
|
|
2707
2707
|
'entryPrice': this.safeNumber(position, 'average_price'),
|
|
2708
|
-
'notional': this.parseNumber(
|
|
2708
|
+
'notional': this.parseNumber(notionalStringAbs),
|
|
2709
2709
|
'leverage': this.safeInteger(position, 'leverage'),
|
|
2710
2710
|
'unrealizedPnl': this.parseNumber(unrealizedPnl),
|
|
2711
2711
|
'contracts': undefined,
|
package/dist/cjs/src/exmo.js
CHANGED
|
@@ -670,8 +670,9 @@ class exmo extends exmo$1 {
|
|
|
670
670
|
* @returns {object} an associative dictionary of currencies
|
|
671
671
|
*/
|
|
672
672
|
async fetchCurrencies(params = {}) {
|
|
673
|
+
const promises = [];
|
|
673
674
|
//
|
|
674
|
-
|
|
675
|
+
promises.push(this.publicGetCurrencyListExtended(params));
|
|
675
676
|
//
|
|
676
677
|
// [
|
|
677
678
|
// {"name":"VLX","description":"Velas"},
|
|
@@ -680,7 +681,7 @@ class exmo extends exmo$1 {
|
|
|
680
681
|
// {"name":"USD","description":"US Dollar"}
|
|
681
682
|
// ]
|
|
682
683
|
//
|
|
683
|
-
|
|
684
|
+
promises.push(this.publicGetPaymentsProvidersCryptoList(params));
|
|
684
685
|
//
|
|
685
686
|
// {
|
|
686
687
|
// "BTC":[
|
|
@@ -705,86 +706,98 @@ class exmo extends exmo$1 {
|
|
|
705
706
|
// ],
|
|
706
707
|
// }
|
|
707
708
|
//
|
|
709
|
+
const responses = await Promise.all(promises);
|
|
710
|
+
const currencyList = responses[0];
|
|
711
|
+
const cryptoList = responses[1];
|
|
708
712
|
const result = {};
|
|
709
713
|
for (let i = 0; i < currencyList.length; i++) {
|
|
710
714
|
const currency = currencyList[i];
|
|
711
715
|
const currencyId = this.safeString(currency, 'name');
|
|
712
|
-
const
|
|
713
|
-
const providers = this.safeValue(cryptoList, currencyId);
|
|
714
|
-
let active = false;
|
|
716
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
715
717
|
let type = 'crypto';
|
|
716
|
-
const
|
|
717
|
-
|
|
718
|
-
'min': undefined,
|
|
719
|
-
'max': undefined,
|
|
720
|
-
},
|
|
721
|
-
'withdraw': {
|
|
722
|
-
'min': undefined,
|
|
723
|
-
'max': undefined,
|
|
724
|
-
},
|
|
725
|
-
};
|
|
726
|
-
let fee = undefined;
|
|
727
|
-
let depositEnabled = undefined;
|
|
728
|
-
let withdrawEnabled = undefined;
|
|
718
|
+
const networks = {};
|
|
719
|
+
const providers = this.safeList(cryptoList, currencyId);
|
|
729
720
|
if (providers === undefined) {
|
|
730
|
-
active = true;
|
|
731
721
|
type = 'fiat';
|
|
732
722
|
}
|
|
733
723
|
else {
|
|
734
724
|
for (let j = 0; j < providers.length; j++) {
|
|
735
725
|
const provider = providers[j];
|
|
726
|
+
const name = this.safeString(provider, 'name');
|
|
727
|
+
// get network-id by removing extra things
|
|
728
|
+
let networkId = name.replace(currencyId + ' ', '');
|
|
729
|
+
networkId = networkId.replace('(', '');
|
|
730
|
+
const replaceChar = ')'; // transpiler trick
|
|
731
|
+
networkId = networkId.replace(replaceChar, '');
|
|
732
|
+
const networkCode = this.networkIdToCode(networkId);
|
|
733
|
+
if (!(networkCode in networks)) {
|
|
734
|
+
networks[networkCode] = {
|
|
735
|
+
'id': networkId,
|
|
736
|
+
'network': networkCode,
|
|
737
|
+
'active': undefined,
|
|
738
|
+
'deposit': undefined,
|
|
739
|
+
'withdraw': undefined,
|
|
740
|
+
'fee': undefined,
|
|
741
|
+
'limits': {
|
|
742
|
+
'withdraw': {
|
|
743
|
+
'min': undefined,
|
|
744
|
+
'max': undefined,
|
|
745
|
+
},
|
|
746
|
+
'deposit': {
|
|
747
|
+
'min': undefined,
|
|
748
|
+
'max': undefined,
|
|
749
|
+
},
|
|
750
|
+
},
|
|
751
|
+
'info': [], // set as array, because of multiple network sub-entries
|
|
752
|
+
};
|
|
753
|
+
}
|
|
736
754
|
const typeInner = this.safeString(provider, 'type');
|
|
737
755
|
const minValue = this.safeString(provider, 'min');
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
}
|
|
742
|
-
const activeProvider = this.safeValue(provider, 'enabled');
|
|
756
|
+
const maxValue = this.safeString(provider, 'max');
|
|
757
|
+
const activeProvider = this.safeBool(provider, 'enabled');
|
|
758
|
+
const networkEntry = networks[networkCode];
|
|
743
759
|
if (typeInner === 'deposit') {
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
else if (!activeProvider) {
|
|
748
|
-
depositEnabled = false;
|
|
749
|
-
}
|
|
760
|
+
networkEntry['deposit'] = activeProvider;
|
|
761
|
+
networkEntry['limits']['deposit']['min'] = minValue;
|
|
762
|
+
networkEntry['limits']['deposit']['max'] = maxValue;
|
|
750
763
|
}
|
|
751
764
|
else if (typeInner === 'withdraw') {
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
else if (!activeProvider) {
|
|
756
|
-
withdrawEnabled = false;
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
if (activeProvider) {
|
|
760
|
-
active = true;
|
|
761
|
-
const limitMin = this.numberToString(limits[typeInner]['min']);
|
|
762
|
-
if ((limits[typeInner]['min'] === undefined) || (Precise["default"].stringLt(minValue, limitMin))) {
|
|
763
|
-
limits[typeInner]['min'] = minValue;
|
|
764
|
-
limits[typeInner]['max'] = maxValue;
|
|
765
|
-
if (typeInner === 'withdraw') {
|
|
766
|
-
const commissionDesc = this.safeString(provider, 'commission_desc');
|
|
767
|
-
fee = this.parseFixedFloatValue(commissionDesc);
|
|
768
|
-
}
|
|
769
|
-
}
|
|
765
|
+
networkEntry['withdraw'] = activeProvider;
|
|
766
|
+
networkEntry['limits']['withdraw']['min'] = minValue;
|
|
767
|
+
networkEntry['limits']['withdraw']['max'] = maxValue;
|
|
770
768
|
}
|
|
769
|
+
const info = this.safeList(networkEntry, 'info');
|
|
770
|
+
info.push(provider);
|
|
771
|
+
networkEntry['info'] = info;
|
|
772
|
+
networks[networkCode] = networkEntry;
|
|
771
773
|
}
|
|
772
774
|
}
|
|
773
|
-
|
|
774
|
-
result[code] = {
|
|
775
|
+
result[code] = this.safeCurrencyStructure({
|
|
775
776
|
'id': currencyId,
|
|
776
777
|
'code': code,
|
|
777
|
-
'name':
|
|
778
|
+
'name': this.safeString(currency, 'description'),
|
|
778
779
|
'type': type,
|
|
779
|
-
'active':
|
|
780
|
-
'deposit':
|
|
781
|
-
'withdraw':
|
|
782
|
-
'fee':
|
|
780
|
+
'active': undefined,
|
|
781
|
+
'deposit': undefined,
|
|
782
|
+
'withdraw': undefined,
|
|
783
|
+
'fee': undefined,
|
|
783
784
|
'precision': this.parseNumber('1e-8'),
|
|
784
|
-
'limits':
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
785
|
+
'limits': {
|
|
786
|
+
'withdraw': {
|
|
787
|
+
'min': undefined,
|
|
788
|
+
'max': undefined,
|
|
789
|
+
},
|
|
790
|
+
'deposit': {
|
|
791
|
+
'min': undefined,
|
|
792
|
+
'max': undefined,
|
|
793
|
+
},
|
|
794
|
+
},
|
|
795
|
+
'info': {
|
|
796
|
+
'currency': currency,
|
|
797
|
+
'providers': providers,
|
|
798
|
+
},
|
|
799
|
+
'networks': networks,
|
|
800
|
+
});
|
|
788
801
|
}
|
|
789
802
|
return result;
|
|
790
803
|
}
|
package/dist/cjs/src/htx.js
CHANGED
|
@@ -6856,7 +6856,7 @@ class htx extends htx$1 {
|
|
|
6856
6856
|
let fee = this.safeNumber(params, 'fee');
|
|
6857
6857
|
if (fee === undefined) {
|
|
6858
6858
|
const currencies = await this.fetchCurrencies();
|
|
6859
|
-
this.currencies = this.deepExtend(this.currencies, currencies);
|
|
6859
|
+
this.currencies = this.mapToSafeMap(this.deepExtend(this.currencies, currencies));
|
|
6860
6860
|
const targetNetwork = this.safeValue(currency['networks'], networkCode, {});
|
|
6861
6861
|
fee = this.safeNumber(targetNetwork, 'fee');
|
|
6862
6862
|
if (fee === undefined) {
|
|
@@ -45,9 +45,9 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
45
45
|
'createMarketBuyOrderWithCost': false,
|
|
46
46
|
'createMarketOrderWithCost': false,
|
|
47
47
|
'createMarketSellOrderWithCost': false,
|
|
48
|
-
'createOrderWithTakeProfitAndStopLoss': true,
|
|
49
48
|
'createOrder': true,
|
|
50
49
|
'createOrders': true,
|
|
50
|
+
'createOrderWithTakeProfitAndStopLoss': true,
|
|
51
51
|
'createReduceOnlyOrder': true,
|
|
52
52
|
'createStopOrder': true,
|
|
53
53
|
'createTriggerOrder': true,
|
|
@@ -692,7 +692,8 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
692
692
|
// }
|
|
693
693
|
//
|
|
694
694
|
const quoteId = 'USDC';
|
|
695
|
-
const
|
|
695
|
+
const baseName = this.safeString(market, 'name');
|
|
696
|
+
const base = this.safeCurrencyCode(baseName);
|
|
696
697
|
const quote = this.safeCurrencyCode(quoteId);
|
|
697
698
|
const baseId = this.safeString(market, 'baseId');
|
|
698
699
|
const settleId = 'USDC';
|
|
@@ -531,7 +531,7 @@ class krakenfutures extends krakenfutures$1 {
|
|
|
531
531
|
'precision': undefined,
|
|
532
532
|
});
|
|
533
533
|
}
|
|
534
|
-
this.currencies = this.deepExtend(currencies, this.currencies);
|
|
534
|
+
this.currencies = this.mapToSafeMap(this.deepExtend(currencies, this.currencies));
|
|
535
535
|
return result;
|
|
536
536
|
}
|
|
537
537
|
/**
|