ccxt 4.4.96 → 4.4.98
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 +15 -15
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +2 -1
- package/dist/cjs/src/base/Exchange.js +63 -15
- package/dist/cjs/src/base/errors.js +8 -1
- package/dist/cjs/src/base/functions/number.js +30 -9
- package/dist/cjs/src/binance.js +95 -34
- package/dist/cjs/src/binancecoinm.js +5 -1
- package/dist/cjs/src/binanceus.js +3 -1
- package/dist/cjs/src/binanceusdm.js +3 -1
- package/dist/cjs/src/bingx.js +1 -1
- package/dist/cjs/src/bitget.js +18 -2
- package/dist/cjs/src/coinmetro.js +2 -3
- package/dist/cjs/src/cryptocom.js +77 -1
- package/dist/cjs/src/exmo.js +1 -1
- package/dist/cjs/src/foxbit.js +1 -1
- package/dist/cjs/src/gate.js +1 -2
- package/dist/cjs/src/hashkey.js +39 -0
- package/dist/cjs/src/hyperliquid.js +42 -27
- package/dist/cjs/src/independentreserve.js +35 -0
- package/dist/cjs/src/indodax.js +34 -0
- package/dist/cjs/src/kucoin.js +2 -1
- package/dist/cjs/src/latoken.js +42 -0
- package/dist/cjs/src/luno.js +36 -0
- package/dist/cjs/src/mercado.js +34 -0
- package/dist/cjs/src/mexc.js +3 -25
- package/dist/cjs/src/ndax.js +8 -0
- package/dist/cjs/src/okx.js +1 -0
- package/dist/cjs/src/phemex.js +36 -31
- package/dist/cjs/src/pro/binancecoinm.js +3 -1
- package/dist/cjs/src/pro/binanceus.js +3 -1
- package/dist/cjs/src/pro/binanceusdm.js +3 -1
- package/dist/cjs/src/pro/bybit.js +33 -0
- package/js/ccxt.d.ts +3 -3
- package/js/ccxt.js +3 -3
- package/js/src/abstract/binance.d.ts +3 -0
- package/js/src/abstract/binancecoinm.d.ts +3 -0
- package/js/src/abstract/binanceus.d.ts +3 -0
- package/js/src/abstract/binanceusdm.d.ts +3 -0
- package/js/src/abstract/phemex.d.ts +1 -0
- package/js/src/base/Exchange.d.ts +11 -3
- package/js/src/base/Exchange.js +63 -15
- package/js/src/base/errorHierarchy.d.ts +1 -0
- package/js/src/base/errorHierarchy.js +1 -0
- package/js/src/base/errors.d.ts +5 -1
- package/js/src/base/errors.js +8 -2
- package/js/src/base/functions/number.js +30 -9
- package/js/src/binance.d.ts +1 -0
- package/js/src/binance.js +95 -34
- package/js/src/binancecoinm.js +5 -1
- package/js/src/binanceus.js +3 -1
- package/js/src/binanceusdm.js +3 -1
- package/js/src/bingx.js +1 -1
- package/js/src/bitget.js +18 -2
- package/js/src/coinmetro.js +2 -3
- package/js/src/cryptocom.d.ts +12 -1
- package/js/src/cryptocom.js +77 -1
- package/js/src/exmo.js +1 -1
- package/js/src/foxbit.js +1 -1
- package/js/src/gate.js +1 -2
- package/js/src/hashkey.js +39 -0
- package/js/src/hyperliquid.js +42 -27
- package/js/src/independentreserve.js +35 -0
- package/js/src/indodax.js +34 -0
- package/js/src/kucoin.js +2 -1
- package/js/src/latoken.js +42 -0
- package/js/src/luno.js +36 -0
- package/js/src/mercado.js +34 -0
- package/js/src/mexc.d.ts +0 -1
- package/js/src/mexc.js +3 -25
- package/js/src/ndax.js +8 -0
- package/js/src/okx.js +2 -1
- package/js/src/phemex.js +36 -31
- package/js/src/pro/binancecoinm.js +3 -1
- package/js/src/pro/binanceus.js +3 -1
- package/js/src/pro/binanceusdm.js +3 -1
- package/js/src/pro/bybit.d.ts +11 -1
- package/js/src/pro/bybit.js +33 -0
- package/package.json +1 -2
package/js/src/bitget.js
CHANGED
|
@@ -3915,6 +3915,10 @@ export default class bitget extends Exchange {
|
|
|
3915
3915
|
response = await this.publicSpotGetV2SpotMarketHistoryCandles(this.extend(request, params));
|
|
3916
3916
|
}
|
|
3917
3917
|
else {
|
|
3918
|
+
if (!limitDefined) {
|
|
3919
|
+
request['limit'] = 1000;
|
|
3920
|
+
limit = 1000;
|
|
3921
|
+
}
|
|
3918
3922
|
response = await this.publicSpotGetV2SpotMarketCandles(this.extend(request, params));
|
|
3919
3923
|
}
|
|
3920
3924
|
}
|
|
@@ -3925,8 +3929,16 @@ export default class bitget extends Exchange {
|
|
|
3925
3929
|
[productType, params] = this.handleProductTypeAndParams(market, params);
|
|
3926
3930
|
request['productType'] = productType;
|
|
3927
3931
|
const extended = this.extend(request, params);
|
|
3928
|
-
|
|
3929
|
-
|
|
3932
|
+
if (!historicalEndpointNeeded && (priceType === 'mark' || priceType === 'index')) {
|
|
3933
|
+
if (!limitDefined) {
|
|
3934
|
+
extended['limit'] = 1000;
|
|
3935
|
+
limit = 1000;
|
|
3936
|
+
}
|
|
3937
|
+
// Recent endpoint for mark/index prices
|
|
3938
|
+
// https://www.bitget.com/api-doc/contract/market/Get-Candle-Data
|
|
3939
|
+
response = await this.publicMixGetV2MixMarketCandles(this.extend({ 'kLineType': priceType }, extended));
|
|
3940
|
+
}
|
|
3941
|
+
else if (priceType === 'mark') {
|
|
3930
3942
|
response = await this.publicMixGetV2MixMarketHistoryMarkCandles(extended);
|
|
3931
3943
|
}
|
|
3932
3944
|
else if (priceType === 'index') {
|
|
@@ -3937,6 +3949,10 @@ export default class bitget extends Exchange {
|
|
|
3937
3949
|
response = await this.publicMixGetV2MixMarketHistoryCandles(extended);
|
|
3938
3950
|
}
|
|
3939
3951
|
else {
|
|
3952
|
+
if (!limitDefined) {
|
|
3953
|
+
extended['limit'] = 1000;
|
|
3954
|
+
limit = 1000;
|
|
3955
|
+
}
|
|
3940
3956
|
response = await this.publicMixGetV2MixMarketCandles(extended);
|
|
3941
3957
|
}
|
|
3942
3958
|
}
|
package/js/src/coinmetro.js
CHANGED
|
@@ -213,7 +213,6 @@ export default class coinmetro extends Exchange {
|
|
|
213
213
|
'options': {
|
|
214
214
|
'currenciesByIdForParseMarket': undefined,
|
|
215
215
|
'currencyIdsListForParseMarket': ['QRDO'],
|
|
216
|
-
'skippedMarkets': ['VXVUSDT'], // broken markets which do not have enough info in API
|
|
217
216
|
},
|
|
218
217
|
'features': {
|
|
219
218
|
'spot': {
|
|
@@ -461,11 +460,11 @@ export default class coinmetro extends Exchange {
|
|
|
461
460
|
// ...
|
|
462
461
|
// ]
|
|
463
462
|
//
|
|
464
|
-
const skippedMarkets = this.safeList(this.options, 'skippedMarkets', []);
|
|
465
463
|
const result = [];
|
|
466
464
|
for (let i = 0; i < response.length; i++) {
|
|
467
465
|
const market = this.parseMarket(response[i]);
|
|
468
|
-
|
|
466
|
+
// there are several broken (unavailable info) markets
|
|
467
|
+
if (market['base'] === undefined || market['quote'] === undefined) {
|
|
469
468
|
continue;
|
|
470
469
|
}
|
|
471
470
|
result.push(market);
|
package/js/src/cryptocom.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/cryptocom.js';
|
|
2
|
-
import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, Str, Ticker, OrderRequest, Balances, Transaction, OrderBook, Tickers, Strings, Currency, Currencies, Market, Num, Account, CancellationRequest, Dict, int, TradingFeeInterface, TradingFees, LedgerEntry, DepositAddress, Position } from './base/types.js';
|
|
2
|
+
import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, Str, Ticker, OrderRequest, Balances, Transaction, OrderBook, Tickers, Strings, Currency, Currencies, Market, Num, Account, CancellationRequest, Dict, int, TradingFeeInterface, TradingFees, LedgerEntry, DepositAddress, Position, FundingRate } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class cryptocom
|
|
5
5
|
* @augments Exchange
|
|
@@ -369,6 +369,17 @@ export default class cryptocom extends Exchange {
|
|
|
369
369
|
datetime: string;
|
|
370
370
|
};
|
|
371
371
|
parseSettlements(settlements: any, market: any): any[];
|
|
372
|
+
/**
|
|
373
|
+
* @method
|
|
374
|
+
* @name cryptocom#fetchFundingRate
|
|
375
|
+
* @description fetches historical funding rates
|
|
376
|
+
* @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#public-get-valuations
|
|
377
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
378
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
379
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
380
|
+
*/
|
|
381
|
+
fetchFundingRate(symbol: string, params?: {}): Promise<FundingRate>;
|
|
382
|
+
parseFundingRate(contract: any, market?: Market): FundingRate;
|
|
372
383
|
/**
|
|
373
384
|
* @method
|
|
374
385
|
* @name cryptocom#fetchFundingRateHistory
|
package/js/src/cryptocom.js
CHANGED
|
@@ -64,7 +64,7 @@ export default class cryptocom extends Exchange {
|
|
|
64
64
|
'fetchDepositWithdrawFee': 'emulated',
|
|
65
65
|
'fetchDepositWithdrawFees': true,
|
|
66
66
|
'fetchFundingHistory': false,
|
|
67
|
-
'fetchFundingRate':
|
|
67
|
+
'fetchFundingRate': true,
|
|
68
68
|
'fetchFundingRateHistory': true,
|
|
69
69
|
'fetchFundingRates': false,
|
|
70
70
|
'fetchGreeks': false,
|
|
@@ -465,6 +465,7 @@ export default class cryptocom extends Exchange {
|
|
|
465
465
|
'exceptions': {
|
|
466
466
|
'exact': {
|
|
467
467
|
'219': InvalidOrder,
|
|
468
|
+
'306': InsufficientFunds,
|
|
468
469
|
'314': InvalidOrder,
|
|
469
470
|
'325': InvalidOrder,
|
|
470
471
|
'415': InvalidOrder,
|
|
@@ -2994,6 +2995,81 @@ export default class cryptocom extends Exchange {
|
|
|
2994
2995
|
}
|
|
2995
2996
|
return result;
|
|
2996
2997
|
}
|
|
2998
|
+
/**
|
|
2999
|
+
* @method
|
|
3000
|
+
* @name cryptocom#fetchFundingRate
|
|
3001
|
+
* @description fetches historical funding rates
|
|
3002
|
+
* @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#public-get-valuations
|
|
3003
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
3004
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3005
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
3006
|
+
*/
|
|
3007
|
+
async fetchFundingRate(symbol, params = {}) {
|
|
3008
|
+
await this.loadMarkets();
|
|
3009
|
+
const market = this.market(symbol);
|
|
3010
|
+
if (!market['swap']) {
|
|
3011
|
+
throw new BadSymbol(this.id + ' fetchFundingRate() supports swap contracts only');
|
|
3012
|
+
}
|
|
3013
|
+
const request = {
|
|
3014
|
+
'instrument_name': market['id'],
|
|
3015
|
+
'valuation_type': 'estimated_funding_rate',
|
|
3016
|
+
'count': 1,
|
|
3017
|
+
};
|
|
3018
|
+
const response = await this.v1PublicGetPublicGetValuations(this.extend(request, params));
|
|
3019
|
+
//
|
|
3020
|
+
// {
|
|
3021
|
+
// "id": -1,
|
|
3022
|
+
// "method": "public/get-valuations",
|
|
3023
|
+
// "code": 0,
|
|
3024
|
+
// "result": {
|
|
3025
|
+
// "data": [
|
|
3026
|
+
// {
|
|
3027
|
+
// "v": "-0.000001884",
|
|
3028
|
+
// "t": 1687892400000
|
|
3029
|
+
// },
|
|
3030
|
+
// ],
|
|
3031
|
+
// "instrument_name": "BTCUSD-PERP"
|
|
3032
|
+
// }
|
|
3033
|
+
// }
|
|
3034
|
+
//
|
|
3035
|
+
const result = this.safeDict(response, 'result', {});
|
|
3036
|
+
const data = this.safeList(result, 'data', []);
|
|
3037
|
+
const entry = this.safeDict(data, 0, {});
|
|
3038
|
+
return this.parseFundingRate(entry, market);
|
|
3039
|
+
}
|
|
3040
|
+
parseFundingRate(contract, market = undefined) {
|
|
3041
|
+
//
|
|
3042
|
+
// {
|
|
3043
|
+
// "v": "-0.000001884",
|
|
3044
|
+
// "t": 1687892400000
|
|
3045
|
+
// },
|
|
3046
|
+
//
|
|
3047
|
+
const timestamp = this.safeInteger(contract, 't');
|
|
3048
|
+
let fundingTimestamp = undefined;
|
|
3049
|
+
if (timestamp !== undefined) {
|
|
3050
|
+
fundingTimestamp = Math.ceil(timestamp / 3600000) * 3600000; // end of the next hour
|
|
3051
|
+
}
|
|
3052
|
+
return {
|
|
3053
|
+
'info': contract,
|
|
3054
|
+
'symbol': this.safeSymbol(undefined, market),
|
|
3055
|
+
'markPrice': undefined,
|
|
3056
|
+
'indexPrice': undefined,
|
|
3057
|
+
'interestRate': undefined,
|
|
3058
|
+
'estimatedSettlePrice': undefined,
|
|
3059
|
+
'timestamp': timestamp,
|
|
3060
|
+
'datetime': this.iso8601(timestamp),
|
|
3061
|
+
'fundingRate': this.safeNumber(contract, 'v'),
|
|
3062
|
+
'fundingTimestamp': fundingTimestamp,
|
|
3063
|
+
'fundingDatetime': this.iso8601(fundingTimestamp),
|
|
3064
|
+
'nextFundingRate': undefined,
|
|
3065
|
+
'nextFundingTimestamp': undefined,
|
|
3066
|
+
'nextFundingDatetime': undefined,
|
|
3067
|
+
'previousFundingRate': undefined,
|
|
3068
|
+
'previousFundingTimestamp': undefined,
|
|
3069
|
+
'previousFundingDatetime': undefined,
|
|
3070
|
+
'interval': '1h',
|
|
3071
|
+
};
|
|
3072
|
+
}
|
|
2997
3073
|
/**
|
|
2998
3074
|
* @method
|
|
2999
3075
|
* @name cryptocom#fetchFundingRateHistory
|
package/js/src/exmo.js
CHANGED
|
@@ -976,7 +976,7 @@ export default class exmo extends Exchange {
|
|
|
976
976
|
request['to'] = to;
|
|
977
977
|
}
|
|
978
978
|
else {
|
|
979
|
-
request['from'] = this.parseToInt(since / 1000)
|
|
979
|
+
request['from'] = this.parseToInt(since / 1000);
|
|
980
980
|
if (untilIsDefined) {
|
|
981
981
|
request['to'] = Math.min(until, now);
|
|
982
982
|
}
|
package/js/src/foxbit.js
CHANGED
|
@@ -85,7 +85,7 @@ export default class foxbit extends Exchange {
|
|
|
85
85
|
'1M': '1M',
|
|
86
86
|
},
|
|
87
87
|
'urls': {
|
|
88
|
-
'logo': 'https://github.com/user-attachments/assets/
|
|
88
|
+
'logo': 'https://github.com/user-attachments/assets/ba1435eb-1d59-4393-8de7-0db10a002fb3',
|
|
89
89
|
'api': {
|
|
90
90
|
'public': 'https://api.foxbit.com.br',
|
|
91
91
|
'private': 'https://api.foxbit.com.br',
|
package/js/src/gate.js
CHANGED
|
@@ -672,7 +672,6 @@ export default class gate extends Exchange {
|
|
|
672
672
|
'SOL': 'SOL',
|
|
673
673
|
'POLYGON': 'POL',
|
|
674
674
|
'MATIC': 'POL',
|
|
675
|
-
'OP': 'OPETH',
|
|
676
675
|
'OPTIMISM': 'OPETH',
|
|
677
676
|
'ADA': 'ADA',
|
|
678
677
|
'AVAXC': 'AVAX_C',
|
|
@@ -3949,7 +3948,7 @@ export default class gate extends Exchange {
|
|
|
3949
3948
|
request['from'] = start;
|
|
3950
3949
|
request['to'] = this.sum(start, 30 * 24 * 60 * 60);
|
|
3951
3950
|
}
|
|
3952
|
-
[request, params] = this.handleUntilOption('to', request, params);
|
|
3951
|
+
[request, params] = this.handleUntilOption('to', request, params, 0.001);
|
|
3953
3952
|
const response = await this.privateWalletGetWithdrawals(this.extend(request, params));
|
|
3954
3953
|
return this.parseTransactions(response, currency);
|
|
3955
3954
|
}
|
package/js/src/hashkey.js
CHANGED
|
@@ -33,11 +33,15 @@ export default class hashkey extends Exchange {
|
|
|
33
33
|
'future': false,
|
|
34
34
|
'option': false,
|
|
35
35
|
'addMargin': false,
|
|
36
|
+
'borrowCrossMargin': false,
|
|
37
|
+
'borrowIsolatedMargin': false,
|
|
38
|
+
'borrowMargin': false,
|
|
36
39
|
'cancelAllOrders': true,
|
|
37
40
|
'cancelAllOrdersAfter': false,
|
|
38
41
|
'cancelOrder': true,
|
|
39
42
|
'cancelOrders': true,
|
|
40
43
|
'cancelWithdraw': false,
|
|
44
|
+
'closeAllPositions': false,
|
|
41
45
|
'closePosition': false,
|
|
42
46
|
'createConvertTrade': false,
|
|
43
47
|
'createDepositAddress': false,
|
|
@@ -57,7 +61,14 @@ export default class hashkey extends Exchange {
|
|
|
57
61
|
'createTrailingPercentOrder': false,
|
|
58
62
|
'createTriggerOrder': true,
|
|
59
63
|
'fetchAccounts': true,
|
|
64
|
+
'fetchAllGreeks': false,
|
|
60
65
|
'fetchBalance': true,
|
|
66
|
+
'fetchBorrowInterest': false,
|
|
67
|
+
'fetchBorrowRate': false,
|
|
68
|
+
'fetchBorrowRateHistories': false,
|
|
69
|
+
'fetchBorrowRateHistory': false,
|
|
70
|
+
'fetchBorrowRates': false,
|
|
71
|
+
'fetchBorrowRatesPerSymbol': false,
|
|
61
72
|
'fetchCanceledAndClosedOrders': true,
|
|
62
73
|
'fetchCanceledOrders': true,
|
|
63
74
|
'fetchClosedOrder': true,
|
|
@@ -66,6 +77,8 @@ export default class hashkey extends Exchange {
|
|
|
66
77
|
'fetchConvertQuote': false,
|
|
67
78
|
'fetchConvertTrade': false,
|
|
68
79
|
'fetchConvertTradeHistory': false,
|
|
80
|
+
'fetchCrossBorrowRate': false,
|
|
81
|
+
'fetchCrossBorrowRates': false,
|
|
69
82
|
'fetchCurrencies': true,
|
|
70
83
|
'fetchDepositAddress': true,
|
|
71
84
|
'fetchDepositAddresses': false,
|
|
@@ -73,23 +86,42 @@ export default class hashkey extends Exchange {
|
|
|
73
86
|
'fetchDeposits': true,
|
|
74
87
|
'fetchDepositsWithdrawals': false,
|
|
75
88
|
'fetchFundingHistory': false,
|
|
89
|
+
'fetchFundingInterval': false,
|
|
90
|
+
'fetchFundingIntervals': false,
|
|
76
91
|
'fetchFundingRate': true,
|
|
77
92
|
'fetchFundingRateHistory': true,
|
|
78
93
|
'fetchFundingRates': true,
|
|
94
|
+
'fetchGreeks': false,
|
|
79
95
|
'fetchIndexOHLCV': false,
|
|
96
|
+
'fetchIsolatedBorrowRate': false,
|
|
97
|
+
'fetchIsolatedBorrowRates': false,
|
|
98
|
+
'fetchIsolatedPositions': false,
|
|
80
99
|
'fetchLedger': true,
|
|
81
100
|
'fetchLeverage': true,
|
|
101
|
+
'fetchLeverages': false,
|
|
82
102
|
'fetchLeverageTiers': true,
|
|
103
|
+
'fetchLiquidations': false,
|
|
104
|
+
'fetchLongShortRatio': false,
|
|
105
|
+
'fetchLongShortRatioHistory': false,
|
|
83
106
|
'fetchMarginAdjustmentHistory': false,
|
|
84
107
|
'fetchMarginMode': false,
|
|
108
|
+
'fetchMarginModes': false,
|
|
85
109
|
'fetchMarketLeverageTiers': 'emulated',
|
|
86
110
|
'fetchMarkets': true,
|
|
87
111
|
'fetchMarkOHLCV': false,
|
|
112
|
+
'fetchMarkPrice': false,
|
|
113
|
+
'fetchMarkPrices': false,
|
|
114
|
+
'fetchMyLiquidations': false,
|
|
115
|
+
'fetchMySettlementHistory': false,
|
|
88
116
|
'fetchMyTrades': true,
|
|
89
117
|
'fetchOHLCV': true,
|
|
118
|
+
'fetchOpenInterest': false,
|
|
90
119
|
'fetchOpenInterestHistory': false,
|
|
120
|
+
'fetchOpenInterests': false,
|
|
91
121
|
'fetchOpenOrder': false,
|
|
92
122
|
'fetchOpenOrders': true,
|
|
123
|
+
'fetchOption': false,
|
|
124
|
+
'fetchOptionChain': false,
|
|
93
125
|
'fetchOrder': true,
|
|
94
126
|
'fetchOrderBook': true,
|
|
95
127
|
'fetchOrders': false,
|
|
@@ -100,7 +132,9 @@ export default class hashkey extends Exchange {
|
|
|
100
132
|
'fetchPositions': true,
|
|
101
133
|
'fetchPositionsForSymbol': true,
|
|
102
134
|
'fetchPositionsHistory': false,
|
|
135
|
+
'fetchPositionsRisk': false,
|
|
103
136
|
'fetchPremiumIndexOHLCV': false,
|
|
137
|
+
'fetchSettlementHistory': false,
|
|
104
138
|
'fetchStatus': true,
|
|
105
139
|
'fetchTicker': true,
|
|
106
140
|
'fetchTickers': true,
|
|
@@ -110,11 +144,16 @@ export default class hashkey extends Exchange {
|
|
|
110
144
|
'fetchTradingFees': true,
|
|
111
145
|
'fetchTransactions': false,
|
|
112
146
|
'fetchTransfers': false,
|
|
147
|
+
'fetchUnderlyingAssets': false,
|
|
148
|
+
'fetchVolatilityHistory': false,
|
|
113
149
|
'fetchWithdrawals': true,
|
|
114
150
|
'reduceMargin': false,
|
|
151
|
+
'repayCrossMargin': false,
|
|
152
|
+
'repayIsolatedMargin': false,
|
|
115
153
|
'sandbox': false,
|
|
116
154
|
'setLeverage': true,
|
|
117
155
|
'setMargin': false,
|
|
156
|
+
'setMarginMode': false,
|
|
118
157
|
'setPositionMode': false,
|
|
119
158
|
'transfer': true,
|
|
120
159
|
'withdraw': true,
|
package/js/src/hyperliquid.js
CHANGED
|
@@ -3089,10 +3089,9 @@ export default class hyperliquid extends Exchange {
|
|
|
3089
3089
|
throw new NotSupported(this.id + ' transfer() only support spot <> swap transfer');
|
|
3090
3090
|
}
|
|
3091
3091
|
let strAmount = this.numberToString(amount);
|
|
3092
|
-
let vaultAddress =
|
|
3093
|
-
[vaultAddress, params] = this.handleOptionAndParams(params, 'transfer', 'vaultAddress');
|
|
3094
|
-
vaultAddress = this.formatVaultAddress(vaultAddress);
|
|
3092
|
+
let vaultAddress = this.safeString2(params, 'vaultAddress', 'subAccountAddress');
|
|
3095
3093
|
if (vaultAddress !== undefined) {
|
|
3094
|
+
vaultAddress = this.formatVaultAddress(vaultAddress);
|
|
3096
3095
|
strAmount = strAmount + ' subaccount:' + vaultAddress;
|
|
3097
3096
|
}
|
|
3098
3097
|
const toPerp = (toAccount === 'perp') || (toAccount === 'swap');
|
|
@@ -3122,12 +3121,6 @@ export default class hyperliquid extends Exchange {
|
|
|
3122
3121
|
return transferResponse;
|
|
3123
3122
|
}
|
|
3124
3123
|
// transfer between main account and subaccount
|
|
3125
|
-
if (code !== undefined) {
|
|
3126
|
-
code = code.toUpperCase();
|
|
3127
|
-
if (code !== 'USDC') {
|
|
3128
|
-
throw new NotSupported(this.id + ' transfer() only support USDC');
|
|
3129
|
-
}
|
|
3130
|
-
}
|
|
3131
3124
|
let isDeposit = false;
|
|
3132
3125
|
let subAccountAddress = undefined;
|
|
3133
3126
|
if (fromAccount === 'main') {
|
|
@@ -3141,24 +3134,46 @@ export default class hyperliquid extends Exchange {
|
|
|
3141
3134
|
throw new NotSupported(this.id + ' transfer() only support main <> subaccount transfer');
|
|
3142
3135
|
}
|
|
3143
3136
|
this.checkAddress(subAccountAddress);
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3137
|
+
if (code === undefined || code.toUpperCase() === 'USDC') {
|
|
3138
|
+
// Transfer USDC with subAccountTransfer
|
|
3139
|
+
const usd = this.parseToInt(Precise.stringMul(this.numberToString(amount), '1000000'));
|
|
3140
|
+
const action = {
|
|
3141
|
+
'type': 'subAccountTransfer',
|
|
3142
|
+
'subAccountUser': subAccountAddress,
|
|
3143
|
+
'isDeposit': isDeposit,
|
|
3144
|
+
'usd': usd,
|
|
3145
|
+
};
|
|
3146
|
+
const sig = this.signL1Action(action, nonce);
|
|
3147
|
+
const request = {
|
|
3148
|
+
'action': action,
|
|
3149
|
+
'nonce': nonce,
|
|
3150
|
+
'signature': sig,
|
|
3151
|
+
};
|
|
3152
|
+
const response = await this.privatePostExchange(request);
|
|
3153
|
+
//
|
|
3154
|
+
// {'response': {'type': 'default'}, 'status': 'ok'}
|
|
3155
|
+
//
|
|
3156
|
+
return this.parseTransfer(response);
|
|
3157
|
+
}
|
|
3158
|
+
else {
|
|
3159
|
+
// Transfer non-USDC with subAccountSpotTransfer
|
|
3160
|
+
const symbol = this.symbol(code);
|
|
3161
|
+
const action = {
|
|
3162
|
+
'type': 'subAccountSpotTransfer',
|
|
3163
|
+
'subAccountUser': subAccountAddress,
|
|
3164
|
+
'isDeposit': isDeposit,
|
|
3165
|
+
'token': symbol,
|
|
3166
|
+
'amount': this.numberToString(amount),
|
|
3167
|
+
};
|
|
3168
|
+
const sig = this.signL1Action(action, nonce);
|
|
3169
|
+
const request = {
|
|
3170
|
+
'action': action,
|
|
3171
|
+
'nonce': nonce,
|
|
3172
|
+
'signature': sig,
|
|
3173
|
+
};
|
|
3174
|
+
const response = await this.privatePostExchange(request);
|
|
3175
|
+
return this.parseTransfer(response);
|
|
3176
|
+
}
|
|
3162
3177
|
}
|
|
3163
3178
|
parseTransfer(transfer, currency = undefined) {
|
|
3164
3179
|
//
|
|
@@ -31,6 +31,9 @@ export default class independentreserve extends Exchange {
|
|
|
31
31
|
'future': false,
|
|
32
32
|
'option': false,
|
|
33
33
|
'addMargin': false,
|
|
34
|
+
'borrowCrossMargin': false,
|
|
35
|
+
'borrowIsolatedMargin': false,
|
|
36
|
+
'borrowMargin': false,
|
|
34
37
|
'cancelOrder': true,
|
|
35
38
|
'closeAllPositions': false,
|
|
36
39
|
'closePosition': false,
|
|
@@ -39,9 +42,14 @@ export default class independentreserve extends Exchange {
|
|
|
39
42
|
'createStopLimitOrder': false,
|
|
40
43
|
'createStopMarketOrder': false,
|
|
41
44
|
'createStopOrder': false,
|
|
45
|
+
'fetchAllGreeks': false,
|
|
42
46
|
'fetchBalance': true,
|
|
47
|
+
'fetchBorrowInterest': false,
|
|
48
|
+
'fetchBorrowRate': false,
|
|
43
49
|
'fetchBorrowRateHistories': false,
|
|
44
50
|
'fetchBorrowRateHistory': false,
|
|
51
|
+
'fetchBorrowRates': false,
|
|
52
|
+
'fetchBorrowRatesPerSymbol': false,
|
|
45
53
|
'fetchClosedOrders': true,
|
|
46
54
|
'fetchCrossBorrowRate': false,
|
|
47
55
|
'fetchCrossBorrowRates': false,
|
|
@@ -49,36 +57,63 @@ export default class independentreserve extends Exchange {
|
|
|
49
57
|
'fetchDepositAddresses': false,
|
|
50
58
|
'fetchDepositAddressesByNetwork': false,
|
|
51
59
|
'fetchFundingHistory': false,
|
|
60
|
+
'fetchFundingInterval': false,
|
|
61
|
+
'fetchFundingIntervals': false,
|
|
52
62
|
'fetchFundingRate': false,
|
|
53
63
|
'fetchFundingRateHistory': false,
|
|
54
64
|
'fetchFundingRates': false,
|
|
65
|
+
'fetchGreeks': false,
|
|
55
66
|
'fetchIndexOHLCV': false,
|
|
56
67
|
'fetchIsolatedBorrowRate': false,
|
|
57
68
|
'fetchIsolatedBorrowRates': false,
|
|
69
|
+
'fetchIsolatedPositions': false,
|
|
58
70
|
'fetchLeverage': false,
|
|
71
|
+
'fetchLeverages': false,
|
|
59
72
|
'fetchLeverageTiers': false,
|
|
73
|
+
'fetchLiquidations': false,
|
|
74
|
+
'fetchLongShortRatio': false,
|
|
75
|
+
'fetchLongShortRatioHistory': false,
|
|
76
|
+
'fetchMarginAdjustmentHistory': false,
|
|
60
77
|
'fetchMarginMode': false,
|
|
78
|
+
'fetchMarginModes': false,
|
|
79
|
+
'fetchMarketLeverageTiers': false,
|
|
61
80
|
'fetchMarkets': true,
|
|
62
81
|
'fetchMarkOHLCV': false,
|
|
82
|
+
'fetchMarkPrice': false,
|
|
83
|
+
'fetchMarkPrices': false,
|
|
84
|
+
'fetchMyLiquidations': false,
|
|
85
|
+
'fetchMySettlementHistory': false,
|
|
63
86
|
'fetchMyTrades': true,
|
|
87
|
+
'fetchOpenInterest': false,
|
|
64
88
|
'fetchOpenInterestHistory': false,
|
|
89
|
+
'fetchOpenInterests': false,
|
|
65
90
|
'fetchOpenOrders': true,
|
|
91
|
+
'fetchOption': false,
|
|
92
|
+
'fetchOptionChain': false,
|
|
66
93
|
'fetchOrder': true,
|
|
67
94
|
'fetchOrderBook': true,
|
|
68
95
|
'fetchPosition': false,
|
|
96
|
+
'fetchPositionForSymbolWs': false,
|
|
69
97
|
'fetchPositionHistory': false,
|
|
70
98
|
'fetchPositionMode': false,
|
|
71
99
|
'fetchPositions': false,
|
|
72
100
|
'fetchPositionsForSymbol': false,
|
|
101
|
+
'fetchPositionsForSymbolWs': false,
|
|
73
102
|
'fetchPositionsHistory': false,
|
|
74
103
|
'fetchPositionsRisk': false,
|
|
75
104
|
'fetchPremiumIndexOHLCV': false,
|
|
105
|
+
'fetchSettlementHistory': false,
|
|
76
106
|
'fetchTicker': true,
|
|
77
107
|
'fetchTrades': true,
|
|
78
108
|
'fetchTradingFee': false,
|
|
79
109
|
'fetchTradingFees': true,
|
|
110
|
+
'fetchUnderlyingAssets': false,
|
|
111
|
+
'fetchVolatilityHistory': false,
|
|
80
112
|
'reduceMargin': false,
|
|
113
|
+
'repayCrossMargin': false,
|
|
114
|
+
'repayIsolatedMargin': false,
|
|
81
115
|
'setLeverage': false,
|
|
116
|
+
'setMargin': false,
|
|
82
117
|
'setMarginMode': false,
|
|
83
118
|
'setPositionMode': false,
|
|
84
119
|
'withdraw': true,
|
package/js/src/indodax.js
CHANGED
|
@@ -32,6 +32,9 @@ export default class indodax extends Exchange {
|
|
|
32
32
|
'future': false,
|
|
33
33
|
'option': false,
|
|
34
34
|
'addMargin': false,
|
|
35
|
+
'borrowCrossMargin': false,
|
|
36
|
+
'borrowIsolatedMargin': false,
|
|
37
|
+
'borrowMargin': false,
|
|
35
38
|
'cancelAllOrders': false,
|
|
36
39
|
'cancelOrder': true,
|
|
37
40
|
'cancelOrders': false,
|
|
@@ -43,9 +46,14 @@ export default class indodax extends Exchange {
|
|
|
43
46
|
'createStopLimitOrder': false,
|
|
44
47
|
'createStopMarketOrder': false,
|
|
45
48
|
'createStopOrder': false,
|
|
49
|
+
'fetchAllGreeks': false,
|
|
46
50
|
'fetchBalance': true,
|
|
51
|
+
'fetchBorrowInterest': false,
|
|
52
|
+
'fetchBorrowRate': false,
|
|
47
53
|
'fetchBorrowRateHistories': false,
|
|
48
54
|
'fetchBorrowRateHistory': false,
|
|
55
|
+
'fetchBorrowRates': false,
|
|
56
|
+
'fetchBorrowRatesPerSymbol': false,
|
|
49
57
|
'fetchClosedOrders': true,
|
|
50
58
|
'fetchCrossBorrowRate': false,
|
|
51
59
|
'fetchCrossBorrowRates': false,
|
|
@@ -56,30 +64,52 @@ export default class indodax extends Exchange {
|
|
|
56
64
|
'fetchDeposits': false,
|
|
57
65
|
'fetchDepositsWithdrawals': true,
|
|
58
66
|
'fetchFundingHistory': false,
|
|
67
|
+
'fetchFundingInterval': false,
|
|
68
|
+
'fetchFundingIntervals': false,
|
|
59
69
|
'fetchFundingRate': false,
|
|
60
70
|
'fetchFundingRateHistory': false,
|
|
61
71
|
'fetchFundingRates': false,
|
|
72
|
+
'fetchGreeks': false,
|
|
62
73
|
'fetchIndexOHLCV': false,
|
|
63
74
|
'fetchIsolatedBorrowRate': false,
|
|
64
75
|
'fetchIsolatedBorrowRates': false,
|
|
76
|
+
'fetchIsolatedPositions': false,
|
|
65
77
|
'fetchLeverage': false,
|
|
78
|
+
'fetchLeverages': false,
|
|
66
79
|
'fetchLeverageTiers': false,
|
|
80
|
+
'fetchLiquidations': false,
|
|
81
|
+
'fetchLongShortRatio': false,
|
|
82
|
+
'fetchLongShortRatioHistory': false,
|
|
83
|
+
'fetchMarginAdjustmentHistory': false,
|
|
67
84
|
'fetchMarginMode': false,
|
|
85
|
+
'fetchMarginModes': false,
|
|
86
|
+
'fetchMarketLeverageTiers': false,
|
|
68
87
|
'fetchMarkets': true,
|
|
69
88
|
'fetchMarkOHLCV': false,
|
|
89
|
+
'fetchMarkPrice': false,
|
|
90
|
+
'fetchMarkPrices': false,
|
|
91
|
+
'fetchMyLiquidations': false,
|
|
92
|
+
'fetchMySettlementHistory': false,
|
|
93
|
+
'fetchOpenInterest': false,
|
|
70
94
|
'fetchOpenInterestHistory': false,
|
|
95
|
+
'fetchOpenInterests': false,
|
|
71
96
|
'fetchOpenOrders': true,
|
|
97
|
+
'fetchOption': false,
|
|
98
|
+
'fetchOptionChain': false,
|
|
72
99
|
'fetchOrder': true,
|
|
73
100
|
'fetchOrderBook': true,
|
|
74
101
|
'fetchOrders': false,
|
|
75
102
|
'fetchPosition': false,
|
|
103
|
+
'fetchPositionForSymbolWs': false,
|
|
76
104
|
'fetchPositionHistory': false,
|
|
77
105
|
'fetchPositionMode': false,
|
|
78
106
|
'fetchPositions': false,
|
|
79
107
|
'fetchPositionsForSymbol': false,
|
|
108
|
+
'fetchPositionsForSymbolWs': false,
|
|
80
109
|
'fetchPositionsHistory': false,
|
|
81
110
|
'fetchPositionsRisk': false,
|
|
82
111
|
'fetchPremiumIndexOHLCV': false,
|
|
112
|
+
'fetchSettlementHistory': false,
|
|
83
113
|
'fetchTicker': true,
|
|
84
114
|
'fetchTime': true,
|
|
85
115
|
'fetchTrades': true,
|
|
@@ -90,9 +120,13 @@ export default class indodax extends Exchange {
|
|
|
90
120
|
'fetchTransactions': 'emulated',
|
|
91
121
|
'fetchTransfer': false,
|
|
92
122
|
'fetchTransfers': false,
|
|
123
|
+
'fetchUnderlyingAssets': false,
|
|
124
|
+
'fetchVolatilityHistory': false,
|
|
93
125
|
'fetchWithdrawal': false,
|
|
94
126
|
'fetchWithdrawals': false,
|
|
95
127
|
'reduceMargin': false,
|
|
128
|
+
'repayCrossMargin': false,
|
|
129
|
+
'repayIsolatedMargin': false,
|
|
96
130
|
'setLeverage': false,
|
|
97
131
|
'setMargin': false,
|
|
98
132
|
'setMarginMode': false,
|
package/js/src/kucoin.js
CHANGED
|
@@ -795,7 +795,7 @@ export default class kucoin extends Exchange {
|
|
|
795
795
|
'TLOS': 'tlos',
|
|
796
796
|
'CFX': 'cfx',
|
|
797
797
|
'ACA': 'aca',
|
|
798
|
-
'
|
|
798
|
+
'OPTIMISM': 'optimism',
|
|
799
799
|
'ONT': 'ont',
|
|
800
800
|
'GLMR': 'glmr',
|
|
801
801
|
'CSPR': 'cspr',
|
|
@@ -915,6 +915,7 @@ export default class kucoin extends Exchange {
|
|
|
915
915
|
'CS': 'cs',
|
|
916
916
|
'ORAI': 'orai',
|
|
917
917
|
'BASE': 'base',
|
|
918
|
+
'TARA': 'tara',
|
|
918
919
|
// below will be uncommented after consensus
|
|
919
920
|
// 'BITCOINDIAMON': 'bcd',
|
|
920
921
|
// 'BITCOINGOLD': 'btg',
|