ccxt 4.3.95 → 4.3.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -7
- package/dist/cjs/src/base/Exchange.js +0 -4
- package/dist/cjs/src/bingx.js +2 -1
- package/dist/cjs/src/blofin.js +0 -1
- package/dist/cjs/src/bybit.js +8 -2
- package/dist/cjs/src/hyperliquid.js +262 -32
- package/dist/cjs/src/kucoin.js +12 -12
- package/dist/cjs/src/mexc.js +6 -0
- package/dist/cjs/src/okx.js +0 -1
- package/dist/cjs/src/p2b.js +0 -1
- package/dist/cjs/src/pro/binance.js +100 -2
- package/dist/cjs/src/pro/bybit.js +65 -4
- package/dist/cjs/src/pro/cryptocom.js +224 -0
- package/dist/cjs/src/pro/okx.js +264 -35
- package/dist/cjs/src/tradeogre.js +0 -1
- package/js/ccxt.d.ts +2 -8
- package/js/ccxt.js +2 -6
- package/js/src/base/Exchange.d.ts +0 -2
- package/js/src/base/Exchange.js +0 -4
- package/js/src/bingx.js +2 -1
- package/js/src/blofin.js +0 -1
- package/js/src/bybit.js +8 -2
- package/js/src/hyperliquid.d.ts +22 -0
- package/js/src/hyperliquid.js +262 -32
- package/js/src/kucoin.d.ts +1 -1
- package/js/src/kucoin.js +12 -12
- package/js/src/mexc.js +6 -0
- package/js/src/okx.js +0 -1
- package/js/src/p2b.js +0 -1
- package/js/src/pro/binance.d.ts +2 -0
- package/js/src/pro/binance.js +100 -2
- package/js/src/pro/bybit.d.ts +3 -1
- package/js/src/pro/bybit.js +65 -4
- package/js/src/pro/cryptocom.d.ts +10 -1
- package/js/src/pro/cryptocom.js +225 -1
- package/js/src/pro/okx.d.ts +10 -1
- package/js/src/pro/okx.js +264 -35
- package/js/src/tradeogre.js +0 -1
- package/package.json +1 -1
- package/js/src/abstract/bitbay.d.ts +0 -56
- package/js/src/abstract/bitbay.js +0 -11
- package/js/src/abstract/hitbtc3.d.ts +0 -118
- package/js/src/abstract/hitbtc3.js +0 -11
package/js/src/hyperliquid.js
CHANGED
|
@@ -57,15 +57,15 @@ export default class hyperliquid extends Exchange {
|
|
|
57
57
|
'fetchBorrowInterest': false,
|
|
58
58
|
'fetchBorrowRateHistories': false,
|
|
59
59
|
'fetchBorrowRateHistory': false,
|
|
60
|
+
'fetchCanceledAndClosedOrders': true,
|
|
60
61
|
'fetchCanceledOrders': true,
|
|
61
62
|
'fetchClosedOrders': true,
|
|
62
|
-
'fetchCanceledAndClosedOrders': true,
|
|
63
63
|
'fetchCrossBorrowRate': false,
|
|
64
64
|
'fetchCrossBorrowRates': false,
|
|
65
65
|
'fetchCurrencies': true,
|
|
66
66
|
'fetchDepositAddress': false,
|
|
67
67
|
'fetchDepositAddresses': false,
|
|
68
|
-
'fetchDeposits':
|
|
68
|
+
'fetchDeposits': true,
|
|
69
69
|
'fetchDepositWithdrawFee': 'emulated',
|
|
70
70
|
'fetchDepositWithdrawFees': false,
|
|
71
71
|
'fetchFundingHistory': false,
|
|
@@ -75,7 +75,7 @@ export default class hyperliquid extends Exchange {
|
|
|
75
75
|
'fetchIndexOHLCV': false,
|
|
76
76
|
'fetchIsolatedBorrowRate': false,
|
|
77
77
|
'fetchIsolatedBorrowRates': false,
|
|
78
|
-
'fetchLedger':
|
|
78
|
+
'fetchLedger': true,
|
|
79
79
|
'fetchLeverage': false,
|
|
80
80
|
'fetchLeverageTiers': false,
|
|
81
81
|
'fetchLiquidations': false,
|
|
@@ -107,7 +107,7 @@ export default class hyperliquid extends Exchange {
|
|
|
107
107
|
'fetchTransfer': false,
|
|
108
108
|
'fetchTransfers': false,
|
|
109
109
|
'fetchWithdrawal': false,
|
|
110
|
-
'fetchWithdrawals':
|
|
110
|
+
'fetchWithdrawals': true,
|
|
111
111
|
'reduceMargin': true,
|
|
112
112
|
'repayCrossMargin': false,
|
|
113
113
|
'repayIsolatedMargin': false,
|
|
@@ -1985,12 +1985,7 @@ export default class hyperliquid extends Exchange {
|
|
|
1985
1985
|
const coin = this.safeString(entry, 'coin');
|
|
1986
1986
|
let marketId = undefined;
|
|
1987
1987
|
if (coin !== undefined) {
|
|
1988
|
-
|
|
1989
|
-
marketId = coin;
|
|
1990
|
-
}
|
|
1991
|
-
else {
|
|
1992
|
-
marketId = coin + '/USDC:USDC';
|
|
1993
|
-
}
|
|
1988
|
+
marketId = this.coinToMarketId(coin);
|
|
1994
1989
|
}
|
|
1995
1990
|
if (this.safeString(entry, 'id') === undefined) {
|
|
1996
1991
|
market = this.safeMarket(marketId, undefined);
|
|
@@ -2127,7 +2122,7 @@ export default class hyperliquid extends Exchange {
|
|
|
2127
2122
|
const price = this.safeString(trade, 'px');
|
|
2128
2123
|
const amount = this.safeString(trade, 'sz');
|
|
2129
2124
|
const coin = this.safeString(trade, 'coin');
|
|
2130
|
-
const marketId = coin
|
|
2125
|
+
const marketId = this.coinToMarketId(coin);
|
|
2131
2126
|
market = this.safeMarket(marketId, undefined);
|
|
2132
2127
|
const symbol = market['symbol'];
|
|
2133
2128
|
const id = this.safeString(trade, 'tid');
|
|
@@ -2267,7 +2262,7 @@ export default class hyperliquid extends Exchange {
|
|
|
2267
2262
|
//
|
|
2268
2263
|
const entry = this.safeDict(position, 'position', {});
|
|
2269
2264
|
const coin = this.safeString(entry, 'coin');
|
|
2270
|
-
const marketId = coin
|
|
2265
|
+
const marketId = this.coinToMarketId(coin);
|
|
2271
2266
|
market = this.safeMarket(marketId, undefined);
|
|
2272
2267
|
const symbol = market['symbol'];
|
|
2273
2268
|
const leverage = this.safeDict(entry, 'leverage', {});
|
|
@@ -2580,11 +2575,13 @@ export default class hyperliquid extends Exchange {
|
|
|
2580
2575
|
* @name hyperliquid#withdraw
|
|
2581
2576
|
* @description make a withdrawal (only support USDC)
|
|
2582
2577
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#initiate-a-withdrawal-request
|
|
2578
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-or-withdraw-from-a-vault
|
|
2583
2579
|
* @param {string} code unified currency code
|
|
2584
2580
|
* @param {float} amount the amount to withdraw
|
|
2585
2581
|
* @param {string} address the address to withdraw to
|
|
2586
2582
|
* @param {string} tag
|
|
2587
2583
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2584
|
+
* @param {string} [params.vaultAddress] vault address withdraw from
|
|
2588
2585
|
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2589
2586
|
*/
|
|
2590
2587
|
this.checkRequiredCredentials();
|
|
@@ -2596,24 +2593,40 @@ export default class hyperliquid extends Exchange {
|
|
|
2596
2593
|
throw new NotSupported(this.id + 'withdraw() only support USDC');
|
|
2597
2594
|
}
|
|
2598
2595
|
}
|
|
2599
|
-
const
|
|
2596
|
+
const vaultAddress = this.formatVaultAddress(this.safeString(params, 'vaultAddress'));
|
|
2597
|
+
params = this.omit(params, 'vaultAddress');
|
|
2600
2598
|
const nonce = this.milliseconds();
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2599
|
+
let action = {};
|
|
2600
|
+
let sig = undefined;
|
|
2601
|
+
if (vaultAddress !== undefined) {
|
|
2602
|
+
action = {
|
|
2603
|
+
'type': 'vaultTransfer',
|
|
2604
|
+
'vaultAddress': '0x' + vaultAddress,
|
|
2605
|
+
'isDeposit': false,
|
|
2606
|
+
'usd': amount,
|
|
2607
|
+
};
|
|
2608
|
+
sig = this.signL1Action(action, nonce);
|
|
2609
|
+
}
|
|
2610
|
+
else {
|
|
2611
|
+
const isSandboxMode = this.safeBool(this.options, 'sandboxMode', false);
|
|
2612
|
+
const payload = {
|
|
2613
|
+
'hyperliquidChain': isSandboxMode ? 'Testnet' : 'Mainnet',
|
|
2614
|
+
'destination': address,
|
|
2615
|
+
'amount': amount.toString(),
|
|
2616
|
+
'time': nonce,
|
|
2617
|
+
};
|
|
2618
|
+
sig = this.buildWithdrawSig(payload);
|
|
2619
|
+
action = {
|
|
2610
2620
|
'hyperliquidChain': payload['hyperliquidChain'],
|
|
2611
2621
|
'signatureChainId': '0x66eee',
|
|
2612
2622
|
'destination': address,
|
|
2613
2623
|
'amount': amount.toString(),
|
|
2614
2624
|
'time': nonce,
|
|
2615
2625
|
'type': 'withdraw3',
|
|
2616
|
-
}
|
|
2626
|
+
};
|
|
2627
|
+
}
|
|
2628
|
+
const request = {
|
|
2629
|
+
'action': action,
|
|
2617
2630
|
'nonce': nonce,
|
|
2618
2631
|
'signature': sig,
|
|
2619
2632
|
};
|
|
@@ -2624,27 +2637,53 @@ export default class hyperliquid extends Exchange {
|
|
|
2624
2637
|
//
|
|
2625
2638
|
// { status: 'ok', response: { type: 'default' } }
|
|
2626
2639
|
//
|
|
2640
|
+
// fetchDeposits / fetchWithdrawals
|
|
2641
|
+
// {
|
|
2642
|
+
// "time":1724762307531,
|
|
2643
|
+
// "hash":"0x620a234a7e0eb7930575040f59482a01050058b0802163b4767bfd9033e77781",
|
|
2644
|
+
// "delta":{
|
|
2645
|
+
// "type":"accountClassTransfer",
|
|
2646
|
+
// "usdc":"50.0",
|
|
2647
|
+
// "toPerp":false
|
|
2648
|
+
// }
|
|
2649
|
+
// }
|
|
2650
|
+
//
|
|
2651
|
+
const timestamp = this.safeInteger(transaction, 'time');
|
|
2652
|
+
const delta = this.safeDict(transaction, 'delta', {});
|
|
2653
|
+
let fee = undefined;
|
|
2654
|
+
const feeCost = this.safeInteger(delta, 'fee');
|
|
2655
|
+
if (feeCost !== undefined) {
|
|
2656
|
+
fee = {
|
|
2657
|
+
'currency': 'USDC',
|
|
2658
|
+
'cost': feeCost,
|
|
2659
|
+
};
|
|
2660
|
+
}
|
|
2661
|
+
let internal = undefined;
|
|
2662
|
+
const type = this.safeString(delta, 'type');
|
|
2663
|
+
if (type !== undefined) {
|
|
2664
|
+
internal = (type === 'internalTransfer');
|
|
2665
|
+
}
|
|
2627
2666
|
return {
|
|
2628
2667
|
'info': transaction,
|
|
2629
2668
|
'id': undefined,
|
|
2630
|
-
'txid':
|
|
2631
|
-
'timestamp':
|
|
2632
|
-
'datetime':
|
|
2669
|
+
'txid': this.safeString(transaction, 'hash'),
|
|
2670
|
+
'timestamp': timestamp,
|
|
2671
|
+
'datetime': this.iso8601(timestamp),
|
|
2633
2672
|
'network': undefined,
|
|
2634
2673
|
'address': undefined,
|
|
2635
|
-
'addressTo':
|
|
2636
|
-
'addressFrom':
|
|
2674
|
+
'addressTo': this.safeString(delta, 'destination'),
|
|
2675
|
+
'addressFrom': this.safeString(delta, 'user'),
|
|
2637
2676
|
'tag': undefined,
|
|
2638
2677
|
'tagTo': undefined,
|
|
2639
2678
|
'tagFrom': undefined,
|
|
2640
2679
|
'type': undefined,
|
|
2641
|
-
'amount':
|
|
2680
|
+
'amount': this.safeInteger(delta, 'usdc'),
|
|
2642
2681
|
'currency': undefined,
|
|
2643
2682
|
'status': this.safeString(transaction, 'status'),
|
|
2644
2683
|
'updated': undefined,
|
|
2645
2684
|
'comment': undefined,
|
|
2646
|
-
'internal':
|
|
2647
|
-
'fee':
|
|
2685
|
+
'internal': internal,
|
|
2686
|
+
'fee': fee,
|
|
2648
2687
|
};
|
|
2649
2688
|
}
|
|
2650
2689
|
async fetchTradingFee(symbol, params = {}) {
|
|
@@ -2753,6 +2792,197 @@ export default class hyperliquid extends Exchange {
|
|
|
2753
2792
|
'tierBased': undefined,
|
|
2754
2793
|
};
|
|
2755
2794
|
}
|
|
2795
|
+
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2796
|
+
/**
|
|
2797
|
+
* @method
|
|
2798
|
+
* @name hyperliquid#fetchLedger
|
|
2799
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
2800
|
+
* @param {string} code unified currency code
|
|
2801
|
+
* @param {int} [since] timestamp in ms of the earliest ledger entry
|
|
2802
|
+
* @param {int} [limit] max number of ledger entrys to return
|
|
2803
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2804
|
+
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
2805
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
2806
|
+
*/
|
|
2807
|
+
await this.loadMarkets();
|
|
2808
|
+
let userAddress = undefined;
|
|
2809
|
+
[userAddress, params] = this.handlePublicAddress('fetchLedger', params);
|
|
2810
|
+
const request = {
|
|
2811
|
+
'type': 'userNonFundingLedgerUpdates',
|
|
2812
|
+
'user': userAddress,
|
|
2813
|
+
};
|
|
2814
|
+
if (since !== undefined) {
|
|
2815
|
+
request['startTime'] = since;
|
|
2816
|
+
}
|
|
2817
|
+
const until = this.safeInteger(params, 'until');
|
|
2818
|
+
if (until !== undefined) {
|
|
2819
|
+
request['endTime'] = until;
|
|
2820
|
+
params = this.omit(params, ['until']);
|
|
2821
|
+
}
|
|
2822
|
+
const response = await this.publicPostInfo(this.extend(request, params));
|
|
2823
|
+
//
|
|
2824
|
+
// [
|
|
2825
|
+
// {
|
|
2826
|
+
// "time":1724762307531,
|
|
2827
|
+
// "hash":"0x620a234a7e0eb7930575040f59482a01050058b0802163b4767bfd9033e77781",
|
|
2828
|
+
// "delta":{
|
|
2829
|
+
// "type":"accountClassTransfer",
|
|
2830
|
+
// "usdc":"50.0",
|
|
2831
|
+
// "toPerp":false
|
|
2832
|
+
// }
|
|
2833
|
+
// }
|
|
2834
|
+
// ]
|
|
2835
|
+
//
|
|
2836
|
+
return this.parseLedger(response, undefined, since, limit);
|
|
2837
|
+
}
|
|
2838
|
+
parseLedgerEntry(item, currency = undefined) {
|
|
2839
|
+
//
|
|
2840
|
+
// {
|
|
2841
|
+
// "time":1724762307531,
|
|
2842
|
+
// "hash":"0x620a234a7e0eb7930575040f59482a01050058b0802163b4767bfd9033e77781",
|
|
2843
|
+
// "delta":{
|
|
2844
|
+
// "type":"accountClassTransfer",
|
|
2845
|
+
// "usdc":"50.0",
|
|
2846
|
+
// "toPerp":false
|
|
2847
|
+
// }
|
|
2848
|
+
// }
|
|
2849
|
+
//
|
|
2850
|
+
const timestamp = this.safeInteger(item, 'time');
|
|
2851
|
+
const delta = this.safeDict(item, 'delta', {});
|
|
2852
|
+
let fee = undefined;
|
|
2853
|
+
const feeCost = this.safeInteger(delta, 'fee');
|
|
2854
|
+
if (feeCost !== undefined) {
|
|
2855
|
+
fee = {
|
|
2856
|
+
'currency': 'USDC',
|
|
2857
|
+
'cost': feeCost,
|
|
2858
|
+
};
|
|
2859
|
+
}
|
|
2860
|
+
const type = this.safeString(delta, 'type');
|
|
2861
|
+
const amount = this.safeString(delta, 'usdc');
|
|
2862
|
+
return {
|
|
2863
|
+
'id': this.safeString(item, 'hash'),
|
|
2864
|
+
'direction': undefined,
|
|
2865
|
+
'account': undefined,
|
|
2866
|
+
'referenceAccount': this.safeString(delta, 'user'),
|
|
2867
|
+
'referenceId': this.safeString(item, 'hash'),
|
|
2868
|
+
'type': this.parseLedgerEntryType(type),
|
|
2869
|
+
'currency': undefined,
|
|
2870
|
+
'amount': this.parseNumber(amount),
|
|
2871
|
+
'timestamp': timestamp,
|
|
2872
|
+
'datetime': this.iso8601(timestamp),
|
|
2873
|
+
'before': undefined,
|
|
2874
|
+
'after': undefined,
|
|
2875
|
+
'status': undefined,
|
|
2876
|
+
'fee': fee,
|
|
2877
|
+
'info': item,
|
|
2878
|
+
};
|
|
2879
|
+
}
|
|
2880
|
+
parseLedgerEntryType(type) {
|
|
2881
|
+
const ledgerType = {
|
|
2882
|
+
'internalTransfer': 'transfer',
|
|
2883
|
+
'accountClassTransfer': 'transfer',
|
|
2884
|
+
};
|
|
2885
|
+
return this.safeString(ledgerType, type, type);
|
|
2886
|
+
}
|
|
2887
|
+
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2888
|
+
/**
|
|
2889
|
+
* @method
|
|
2890
|
+
* @name hyperliquid#fetchDeposits
|
|
2891
|
+
* @description fetch all deposits made to an account
|
|
2892
|
+
* @param {string} code unified currency code
|
|
2893
|
+
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
2894
|
+
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
2895
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2896
|
+
* @param {int} [params.until] the latest time in ms to fetch withdrawals for
|
|
2897
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2898
|
+
*/
|
|
2899
|
+
await this.loadMarkets();
|
|
2900
|
+
let userAddress = undefined;
|
|
2901
|
+
[userAddress, params] = this.handlePublicAddress('fetchDepositsWithdrawals', params);
|
|
2902
|
+
const request = {
|
|
2903
|
+
'type': 'userNonFundingLedgerUpdates',
|
|
2904
|
+
'user': userAddress,
|
|
2905
|
+
};
|
|
2906
|
+
if (since !== undefined) {
|
|
2907
|
+
request['startTime'] = since;
|
|
2908
|
+
}
|
|
2909
|
+
const until = this.safeInteger(params, 'until');
|
|
2910
|
+
if (until !== undefined) {
|
|
2911
|
+
request['endTime'] = until;
|
|
2912
|
+
params = this.omit(params, ['until']);
|
|
2913
|
+
}
|
|
2914
|
+
const response = await this.publicPostInfo(this.extend(request, params));
|
|
2915
|
+
//
|
|
2916
|
+
// [
|
|
2917
|
+
// {
|
|
2918
|
+
// "time":1724762307531,
|
|
2919
|
+
// "hash":"0x620a234a7e0eb7930575040f59482a01050058b0802163b4767bfd9033e77781",
|
|
2920
|
+
// "delta":{
|
|
2921
|
+
// "type":"accountClassTransfer",
|
|
2922
|
+
// "usdc":"50.0",
|
|
2923
|
+
// "toPerp":false
|
|
2924
|
+
// }
|
|
2925
|
+
// }
|
|
2926
|
+
// ]
|
|
2927
|
+
//
|
|
2928
|
+
const records = this.extractTypeFromDelta(response);
|
|
2929
|
+
const deposits = this.filterByArray(records, 'type', ['deposit'], false);
|
|
2930
|
+
return this.parseTransactions(deposits, undefined, since, limit);
|
|
2931
|
+
}
|
|
2932
|
+
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2933
|
+
/**
|
|
2934
|
+
* @method
|
|
2935
|
+
* @name hyperliquid#fetchWithdrawals
|
|
2936
|
+
* @description fetch all withdrawals made from an account
|
|
2937
|
+
* @param {string} code unified currency code
|
|
2938
|
+
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
2939
|
+
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
2940
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2941
|
+
* @param {int} [params.until] the latest time in ms to fetch withdrawals for
|
|
2942
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2943
|
+
*/
|
|
2944
|
+
await this.loadMarkets();
|
|
2945
|
+
let userAddress = undefined;
|
|
2946
|
+
[userAddress, params] = this.handlePublicAddress('fetchDepositsWithdrawals', params);
|
|
2947
|
+
const request = {
|
|
2948
|
+
'type': 'userNonFundingLedgerUpdates',
|
|
2949
|
+
'user': userAddress,
|
|
2950
|
+
};
|
|
2951
|
+
if (since !== undefined) {
|
|
2952
|
+
request['startTime'] = since;
|
|
2953
|
+
}
|
|
2954
|
+
const until = this.safeInteger(params, 'until');
|
|
2955
|
+
if (until !== undefined) {
|
|
2956
|
+
request['endTime'] = until;
|
|
2957
|
+
params = this.omit(params, ['until']);
|
|
2958
|
+
}
|
|
2959
|
+
const response = await this.publicPostInfo(this.extend(request, params));
|
|
2960
|
+
//
|
|
2961
|
+
// [
|
|
2962
|
+
// {
|
|
2963
|
+
// "time":1724762307531,
|
|
2964
|
+
// "hash":"0x620a234a7e0eb7930575040f59482a01050058b0802163b4767bfd9033e77781",
|
|
2965
|
+
// "delta":{
|
|
2966
|
+
// "type":"accountClassTransfer",
|
|
2967
|
+
// "usdc":"50.0",
|
|
2968
|
+
// "toPerp":false
|
|
2969
|
+
// }
|
|
2970
|
+
// }
|
|
2971
|
+
// ]
|
|
2972
|
+
//
|
|
2973
|
+
const records = this.extractTypeFromDelta(response);
|
|
2974
|
+
const withdrawals = this.filterByArray(records, 'type', ['withdraw'], false);
|
|
2975
|
+
return this.parseTransactions(withdrawals, undefined, since, limit);
|
|
2976
|
+
}
|
|
2977
|
+
extractTypeFromDelta(data = []) {
|
|
2978
|
+
const records = [];
|
|
2979
|
+
for (let i = 0; i < data.length; i++) {
|
|
2980
|
+
const record = data[i];
|
|
2981
|
+
record['type'] = record['delta']['type'];
|
|
2982
|
+
records.push(record);
|
|
2983
|
+
}
|
|
2984
|
+
return records;
|
|
2985
|
+
}
|
|
2756
2986
|
formatVaultAddress(address = undefined) {
|
|
2757
2987
|
if (address === undefined) {
|
|
2758
2988
|
return undefined;
|
|
@@ -2776,7 +3006,7 @@ export default class hyperliquid extends Exchange {
|
|
|
2776
3006
|
throw new ArgumentsRequired(this.id + ' ' + methodName + '() requires a user parameter inside \'params\' or the wallet address set');
|
|
2777
3007
|
}
|
|
2778
3008
|
coinToMarketId(coin) {
|
|
2779
|
-
if (coin.indexOf('/') > -1) {
|
|
3009
|
+
if (coin.indexOf('/') > -1 || coin.indexOf('@') > -1) {
|
|
2780
3010
|
return coin; // spot
|
|
2781
3011
|
}
|
|
2782
3012
|
return coin + '/USDC:USDC';
|
package/js/src/kucoin.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export default class kucoin extends Exchange {
|
|
|
17
17
|
}>;
|
|
18
18
|
fetchMarkets(params?: {}): Promise<Market[]>;
|
|
19
19
|
loadMigrationStatus(force?: boolean): Promise<void>;
|
|
20
|
-
handleHfAndParams(params?: {}):
|
|
20
|
+
handleHfAndParams(params?: {}): {}[];
|
|
21
21
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
22
22
|
fetchAccounts(params?: {}): Promise<Account[]>;
|
|
23
23
|
fetchTransactionFee(code: string, params?: {}): Promise<{
|
package/js/src/kucoin.js
CHANGED
|
@@ -628,6 +628,7 @@ export default class kucoin extends Exchange {
|
|
|
628
628
|
'KALT': 'ALT', // ALTLAYER
|
|
629
629
|
},
|
|
630
630
|
'options': {
|
|
631
|
+
'hf': false,
|
|
631
632
|
'version': 'v1',
|
|
632
633
|
'symbolSeparator': '-',
|
|
633
634
|
'fetchMyTradesMethod': 'private_get_fills',
|
|
@@ -1221,9 +1222,8 @@ export default class kucoin extends Exchange {
|
|
|
1221
1222
|
this.options['hfMigrated'] = (status === 2);
|
|
1222
1223
|
}
|
|
1223
1224
|
}
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
const migrated = this.safeBool(this.options, 'hfMigrated');
|
|
1225
|
+
handleHfAndParams(params = {}) {
|
|
1226
|
+
const migrated = this.safeBool2(this.options, 'hfMigrated', 'hf', false);
|
|
1227
1227
|
let loadedHf = undefined;
|
|
1228
1228
|
if (migrated !== undefined) {
|
|
1229
1229
|
if (migrated) {
|
|
@@ -2122,7 +2122,7 @@ export default class kucoin extends Exchange {
|
|
|
2122
2122
|
const testOrder = this.safeBool(params, 'test', false);
|
|
2123
2123
|
params = this.omit(params, 'test');
|
|
2124
2124
|
let hf = undefined;
|
|
2125
|
-
[hf, params] =
|
|
2125
|
+
[hf, params] = this.handleHfAndParams(params);
|
|
2126
2126
|
let useSync = false;
|
|
2127
2127
|
[useSync, params] = this.handleOptionAndParams(params, 'createOrder', 'sync', false);
|
|
2128
2128
|
const [triggerPrice, stopLossPrice, takeProfitPrice] = this.handleTriggerPrices(params);
|
|
@@ -2260,7 +2260,7 @@ export default class kucoin extends Exchange {
|
|
|
2260
2260
|
'orderList': ordersRequests,
|
|
2261
2261
|
};
|
|
2262
2262
|
let hf = undefined;
|
|
2263
|
-
[hf, params] =
|
|
2263
|
+
[hf, params] = this.handleHfAndParams(params);
|
|
2264
2264
|
let useSync = false;
|
|
2265
2265
|
[useSync, params] = this.handleOptionAndParams(params, 'createOrders', 'sync', false);
|
|
2266
2266
|
let response = undefined;
|
|
@@ -2458,7 +2458,7 @@ export default class kucoin extends Exchange {
|
|
|
2458
2458
|
const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
|
|
2459
2459
|
const stop = this.safeBool2(params, 'stop', 'trigger', false);
|
|
2460
2460
|
let hf = undefined;
|
|
2461
|
-
[hf, params] =
|
|
2461
|
+
[hf, params] = this.handleHfAndParams(params);
|
|
2462
2462
|
let useSync = false;
|
|
2463
2463
|
[useSync, params] = this.handleOptionAndParams(params, 'cancelOrder', 'sync', false);
|
|
2464
2464
|
if (hf || useSync) {
|
|
@@ -2580,7 +2580,7 @@ export default class kucoin extends Exchange {
|
|
|
2580
2580
|
const request = {};
|
|
2581
2581
|
const stop = this.safeBool(params, 'stop', false);
|
|
2582
2582
|
let hf = undefined;
|
|
2583
|
-
[hf, params] =
|
|
2583
|
+
[hf, params] = this.handleHfAndParams(params);
|
|
2584
2584
|
params = this.omit(params, 'stop');
|
|
2585
2585
|
const [marginMode, query] = this.handleMarginModeAndParams('cancelAllOrders', params);
|
|
2586
2586
|
if (symbol !== undefined) {
|
|
@@ -2639,7 +2639,7 @@ export default class kucoin extends Exchange {
|
|
|
2639
2639
|
const until = this.safeInteger(params, 'until');
|
|
2640
2640
|
const stop = this.safeBool2(params, 'stop', 'trigger', false);
|
|
2641
2641
|
let hf = undefined;
|
|
2642
|
-
[hf, params] =
|
|
2642
|
+
[hf, params] = this.handleHfAndParams(params);
|
|
2643
2643
|
if (hf && (symbol === undefined)) {
|
|
2644
2644
|
throw new ArgumentsRequired(this.id + ' fetchOrdersByStatus() requires a symbol parameter for hf orders');
|
|
2645
2645
|
}
|
|
@@ -2822,7 +2822,7 @@ export default class kucoin extends Exchange {
|
|
|
2822
2822
|
const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
|
|
2823
2823
|
const stop = this.safeBool2(params, 'stop', 'trigger', false);
|
|
2824
2824
|
let hf = undefined;
|
|
2825
|
-
[hf, params] =
|
|
2825
|
+
[hf, params] = this.handleHfAndParams(params);
|
|
2826
2826
|
let market = undefined;
|
|
2827
2827
|
if (symbol !== undefined) {
|
|
2828
2828
|
market = this.market(symbol);
|
|
@@ -3100,7 +3100,7 @@ export default class kucoin extends Exchange {
|
|
|
3100
3100
|
}
|
|
3101
3101
|
let request = {};
|
|
3102
3102
|
let hf = undefined;
|
|
3103
|
-
[hf, params] =
|
|
3103
|
+
[hf, params] = this.handleHfAndParams(params);
|
|
3104
3104
|
if (hf && symbol === undefined) {
|
|
3105
3105
|
throw new ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol parameter for hf orders');
|
|
3106
3106
|
}
|
|
@@ -3830,7 +3830,7 @@ export default class kucoin extends Exchange {
|
|
|
3830
3830
|
let type = this.safeString(accountsByType, requestedType, requestedType);
|
|
3831
3831
|
params = this.omit(params, 'type');
|
|
3832
3832
|
let hf = undefined;
|
|
3833
|
-
[hf, params] =
|
|
3833
|
+
[hf, params] = this.handleHfAndParams(params);
|
|
3834
3834
|
if (hf) {
|
|
3835
3835
|
type = 'trade_hf';
|
|
3836
3836
|
}
|
|
@@ -4290,7 +4290,7 @@ export default class kucoin extends Exchange {
|
|
|
4290
4290
|
let paginate = false;
|
|
4291
4291
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchLedger', 'paginate');
|
|
4292
4292
|
let hf = undefined;
|
|
4293
|
-
[hf, params] =
|
|
4293
|
+
[hf, params] = this.handleHfAndParams(params);
|
|
4294
4294
|
if (paginate) {
|
|
4295
4295
|
return await this.fetchPaginatedCallDynamic('fetchLedger', code, since, limit, params);
|
|
4296
4296
|
}
|
package/js/src/mexc.js
CHANGED
|
@@ -800,6 +800,8 @@ export default class mexc extends Exchange {
|
|
|
800
800
|
* @method
|
|
801
801
|
* @name mexc#fetchStatus
|
|
802
802
|
* @description the latest known information on the availability of the exchange API
|
|
803
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#test-connectivity
|
|
804
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-server-time
|
|
803
805
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
804
806
|
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
805
807
|
*/
|
|
@@ -837,6 +839,8 @@ export default class mexc extends Exchange {
|
|
|
837
839
|
* @method
|
|
838
840
|
* @name mexc#fetchTime
|
|
839
841
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
842
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#check-server-time
|
|
843
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-server-time
|
|
840
844
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
841
845
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
842
846
|
*/
|
|
@@ -1008,6 +1012,8 @@ export default class mexc extends Exchange {
|
|
|
1008
1012
|
* @method
|
|
1009
1013
|
* @name mexc#fetchMarkets
|
|
1010
1014
|
* @description retrieves data on all markets for mexc
|
|
1015
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#exchange-information
|
|
1016
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-information
|
|
1011
1017
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1012
1018
|
* @returns {object[]} an array of objects representing market data
|
|
1013
1019
|
*/
|
package/js/src/okx.js
CHANGED
|
@@ -112,7 +112,6 @@ export default class okx extends Exchange {
|
|
|
112
112
|
'fetchOrderBooks': false,
|
|
113
113
|
'fetchOrders': false,
|
|
114
114
|
'fetchOrderTrades': true,
|
|
115
|
-
'fetchPermissions': undefined,
|
|
116
115
|
'fetchPosition': true,
|
|
117
116
|
'fetchPositionHistory': 'emulated',
|
|
118
117
|
'fetchPositions': true,
|
package/js/src/p2b.js
CHANGED
package/js/src/pro/binance.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ export default class binance extends binanceRest {
|
|
|
35
35
|
handleTrade(client: Client, message: any): void;
|
|
36
36
|
watchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
37
37
|
watchOHLCVForSymbols(symbolsAndTimeframes: string[][], since?: Int, limit?: Int, params?: {}): Promise<import("../base/types.js").Dictionary<import("../base/types.js").Dictionary<OHLCV[]>>>;
|
|
38
|
+
unWatchOHLCVForSymbols(symbolsAndTimeframes: string[][], params?: {}): Promise<any>;
|
|
39
|
+
unWatchOHLCV(symbol: string, timeframe?: string, params?: {}): Promise<any>;
|
|
38
40
|
handleOHLCV(client: Client, message: any): void;
|
|
39
41
|
fetchTickerWs(symbol: string, params?: {}): Promise<Ticker>;
|
|
40
42
|
fetchOHLCVWs(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|