ccxt 4.4.75 → 4.4.78
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 +7 -7
- package/dist/cjs/ccxt.js +8 -4
- package/dist/cjs/src/abstract/apex.js +9 -0
- package/dist/cjs/src/apex.js +1949 -0
- package/dist/cjs/src/base/Exchange.js +49 -3
- package/dist/cjs/src/binance.js +44 -220
- package/dist/cjs/src/bitget.js +139 -71
- package/dist/cjs/src/bitmex.js +4 -4
- package/dist/cjs/src/bitrue.js +48 -0
- package/dist/cjs/src/cex.js +1 -1
- package/dist/cjs/src/coinbase.js +32 -3
- package/dist/cjs/src/coincatch.js +68 -0
- package/dist/cjs/src/coinex.js +3 -0
- package/dist/cjs/src/coinlist.js +85 -1
- package/dist/cjs/src/hitbtc.js +3 -0
- package/dist/cjs/src/hyperliquid.js +13 -4
- package/dist/cjs/src/mexc.js +50 -57
- package/dist/cjs/src/okx.js +23 -8
- package/dist/cjs/src/paradex.js +3 -12
- package/dist/cjs/src/phemex.js +2 -1
- package/dist/cjs/src/poloniex.js +1 -1
- package/dist/cjs/src/pro/apex.js +1043 -0
- package/dist/cjs/src/pro/coinbase.js +4 -8
- package/dist/cjs/src/pro/gate.js +27 -2
- package/dist/cjs/src/pro/hollaex.js +2 -2
- package/dist/cjs/src/pro/hyperliquid.js +1 -1
- package/dist/cjs/src/pro/p2b.js +2 -2
- package/dist/cjs/src/pro/tradeogre.js +283 -0
- package/dist/cjs/src/probit.js +1 -0
- package/dist/cjs/src/static_dependencies/zklink/zklink-sdk-web.js +2645 -0
- package/dist/cjs/src/tradeogre.js +2 -1
- package/dist/cjs/src/upbit.js +299 -93
- package/dist/cjs/src/whitebit.js +1 -0
- package/dist/cjs/src/woo.js +3 -1
- package/dist/cjs/src/xt.js +131 -4
- package/js/ccxt.d.ts +11 -5
- package/js/ccxt.js +8 -4
- package/js/src/abstract/apex.d.ts +34 -0
- package/js/src/abstract/myokx.d.ts +4 -0
- package/js/src/abstract/okx.d.ts +4 -0
- package/js/src/abstract/upbit.d.ts +15 -1
- package/js/src/abstract/xt.d.ts +3 -0
- package/js/src/apex.d.ts +333 -0
- package/js/src/apex.js +1951 -0
- package/js/src/ascendex.d.ts +3 -3
- package/js/src/base/Exchange.d.ts +3 -0
- package/js/src/base/Exchange.js +49 -2
- package/js/src/binance.d.ts +9 -7
- package/js/src/binance.js +44 -220
- package/js/src/bitfinex.d.ts +3 -3
- package/js/src/bitflyer.d.ts +2 -2
- package/js/src/bitget.d.ts +2 -0
- package/js/src/bitget.js +139 -71
- package/js/src/bitmart.d.ts +4 -4
- package/js/src/bitmex.d.ts +3 -3
- package/js/src/bitmex.js +4 -4
- package/js/src/bitrue.js +48 -0
- package/js/src/cex.js +1 -1
- package/js/src/coinbase.d.ts +6 -4
- package/js/src/coinbase.js +32 -3
- package/js/src/coinbaseexchange.d.ts +1 -1
- package/js/src/coincatch.d.ts +11 -0
- package/js/src/coincatch.js +68 -0
- package/js/src/coinex.js +3 -0
- package/js/src/coinlist.d.ts +12 -1
- package/js/src/coinlist.js +85 -1
- package/js/src/cryptocom.d.ts +4 -4
- package/js/src/deribit.d.ts +4 -4
- package/js/src/derive.d.ts +3 -3
- package/js/src/digifinex.d.ts +4 -4
- package/js/src/hitbtc.js +3 -0
- package/js/src/htx.d.ts +4 -4
- package/js/src/hyperliquid.d.ts +1 -0
- package/js/src/hyperliquid.js +13 -4
- package/js/src/kraken.d.ts +3 -3
- package/js/src/krakenfutures.d.ts +2 -2
- package/js/src/kucoinfutures.d.ts +5 -5
- package/js/src/mexc.d.ts +1 -0
- package/js/src/mexc.js +50 -57
- package/js/src/okx.js +23 -8
- package/js/src/oxfun.d.ts +3 -3
- package/js/src/paradex.js +3 -12
- package/js/src/phemex.d.ts +3 -3
- package/js/src/phemex.js +2 -1
- package/js/src/poloniex.d.ts +3 -3
- package/js/src/poloniex.js +1 -1
- package/js/src/pro/apex.d.ts +160 -0
- package/js/src/pro/apex.js +1044 -0
- package/js/src/pro/coinbase.js +4 -8
- package/js/src/pro/gate.js +27 -2
- package/js/src/pro/hollaex.js +2 -2
- package/js/src/pro/hyperliquid.js +1 -1
- package/js/src/pro/p2b.js +2 -2
- package/js/src/pro/tradeogre.d.ts +49 -0
- package/js/src/pro/tradeogre.js +284 -0
- package/js/src/probit.js +1 -0
- package/js/src/static_dependencies/zklink/zklink-sdk-web.d.ts +1279 -0
- package/js/src/static_dependencies/zklink/zklink-sdk-web.js +4282 -0
- package/js/src/tradeogre.js +2 -1
- package/js/src/upbit.d.ts +34 -4
- package/js/src/upbit.js +299 -93
- package/js/src/vertex.d.ts +3 -3
- package/js/src/whitebit.js +1 -0
- package/js/src/woo.d.ts +4 -4
- package/js/src/woo.js +3 -1
- package/js/src/woofipro.d.ts +4 -4
- package/js/src/xt.d.ts +23 -4
- package/js/src/xt.js +131 -4
- package/package.json +2 -2
- package/js/src/abstract/ace.d.ts +0 -18
- package/js/src/ace.d.ts +0 -158
- package/js/src/ace.js +0 -1181
- /package/js/src/abstract/{ace.js → apex.js} +0 -0
package/js/src/coincatch.d.ts
CHANGED
|
@@ -25,6 +25,17 @@ export default class coincatch extends Exchange {
|
|
|
25
25
|
* @returns {object} an associative dictionary of currencies
|
|
26
26
|
*/
|
|
27
27
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
28
|
+
/**
|
|
29
|
+
* @method
|
|
30
|
+
* @name coincatch#fetchDepositWithdrawFees
|
|
31
|
+
* @description fetch deposit and withdraw fees
|
|
32
|
+
* @see https://coincatch.github.io/github.io/en/spot/#get-coin-list
|
|
33
|
+
* @param {string[]} [codes] list of unified currency codes
|
|
34
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
35
|
+
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
36
|
+
*/
|
|
37
|
+
fetchDepositWithdrawFees(codes?: Strings, params?: {}): Promise<any>;
|
|
38
|
+
parseDepositWithdrawFee(fee: any, currency?: Currency): Dict;
|
|
28
39
|
/**
|
|
29
40
|
* @method
|
|
30
41
|
* @name coincatch#fetchMarkets
|
package/js/src/coincatch.js
CHANGED
|
@@ -76,6 +76,7 @@ export default class coincatch extends Exchange {
|
|
|
76
76
|
'fetchDepositAddress': true,
|
|
77
77
|
'fetchDeposits': true,
|
|
78
78
|
'fetchDepositsWithdrawals': false,
|
|
79
|
+
'fetchDepositWithdrawFees': true,
|
|
79
80
|
'fetchFundingHistory': false,
|
|
80
81
|
'fetchFundingRate': true,
|
|
81
82
|
'fetchFundingRateHistory': true,
|
|
@@ -715,6 +716,73 @@ export default class coincatch extends Exchange {
|
|
|
715
716
|
}
|
|
716
717
|
return result;
|
|
717
718
|
}
|
|
719
|
+
/**
|
|
720
|
+
* @method
|
|
721
|
+
* @name coincatch#fetchDepositWithdrawFees
|
|
722
|
+
* @description fetch deposit and withdraw fees
|
|
723
|
+
* @see https://coincatch.github.io/github.io/en/spot/#get-coin-list
|
|
724
|
+
* @param {string[]} [codes] list of unified currency codes
|
|
725
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
726
|
+
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
727
|
+
*/
|
|
728
|
+
async fetchDepositWithdrawFees(codes = undefined, params = {}) {
|
|
729
|
+
await this.loadMarkets();
|
|
730
|
+
const response = await this.publicGetApiSpotV1PublicCurrencies(params);
|
|
731
|
+
const data = this.safeList(response, 'data', []);
|
|
732
|
+
return this.parseDepositWithdrawFees(data, codes, 'coinName');
|
|
733
|
+
}
|
|
734
|
+
parseDepositWithdrawFee(fee, currency = undefined) {
|
|
735
|
+
//
|
|
736
|
+
// {
|
|
737
|
+
// "coinId":"1",
|
|
738
|
+
// "coinName":"BTC",
|
|
739
|
+
// "transfer":"true",
|
|
740
|
+
// "chains":[
|
|
741
|
+
// {
|
|
742
|
+
// "chain":null,
|
|
743
|
+
// "needTag":"false",
|
|
744
|
+
// "withdrawable":"true",
|
|
745
|
+
// "rechargeAble":"true",
|
|
746
|
+
// "withdrawFee":"0.005",
|
|
747
|
+
// "depositConfirm":"1",
|
|
748
|
+
// "withdrawConfirm":"1",
|
|
749
|
+
// "minDepositAmount":"0.001",
|
|
750
|
+
// "minWithdrawAmount":"0.001",
|
|
751
|
+
// "browserUrl":"https://blockchair.com/bitcoin/testnet/transaction/"
|
|
752
|
+
// }
|
|
753
|
+
// ]
|
|
754
|
+
// }
|
|
755
|
+
//
|
|
756
|
+
const chains = this.safeList(fee, 'chains', []);
|
|
757
|
+
const chainsLength = chains.length;
|
|
758
|
+
const result = {
|
|
759
|
+
'info': fee,
|
|
760
|
+
'withdraw': {
|
|
761
|
+
'fee': undefined,
|
|
762
|
+
'percentage': undefined,
|
|
763
|
+
},
|
|
764
|
+
'deposit': {
|
|
765
|
+
'fee': undefined,
|
|
766
|
+
'percentage': undefined,
|
|
767
|
+
},
|
|
768
|
+
'networks': {},
|
|
769
|
+
};
|
|
770
|
+
for (let i = 0; i < chainsLength; i++) {
|
|
771
|
+
const chain = chains[i];
|
|
772
|
+
const networkId = this.safeString(chain, 'chain');
|
|
773
|
+
const currencyCode = this.safeString(currency, 'code');
|
|
774
|
+
const networkCode = this.networkIdToCode(networkId, currencyCode);
|
|
775
|
+
result['networks'][networkCode] = {
|
|
776
|
+
'deposit': { 'fee': undefined, 'percentage': undefined },
|
|
777
|
+
'withdraw': { 'fee': this.safeNumber(chain, 'withdrawFee'), 'percentage': false },
|
|
778
|
+
};
|
|
779
|
+
if (chainsLength === 1) {
|
|
780
|
+
result['withdraw']['fee'] = this.safeNumber(chain, 'withdrawFee');
|
|
781
|
+
result['withdraw']['percentage'] = false;
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
return result;
|
|
785
|
+
}
|
|
718
786
|
/**
|
|
719
787
|
* @method
|
|
720
788
|
* @name coincatch#fetchMarkets
|
package/js/src/coinex.js
CHANGED
|
@@ -753,6 +753,9 @@ export default class coinex extends Exchange {
|
|
|
753
753
|
for (let j = 0; j < chains.length; j++) {
|
|
754
754
|
const chain = chains[j];
|
|
755
755
|
const networkId = this.safeString(chain, 'chain');
|
|
756
|
+
if (networkId === undefined) {
|
|
757
|
+
continue;
|
|
758
|
+
}
|
|
756
759
|
const precisionString = this.parsePrecision(this.safeString(chain, 'withdrawal_precision'));
|
|
757
760
|
const feeString = this.safeString(chain, 'withdrawal_fee');
|
|
758
761
|
const minNetworkDepositString = this.safeString(chain, 'min_deposit_amount');
|
package/js/src/coinlist.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/coinlist.js';
|
|
2
|
-
import type { Account, Balances, Currencies, Currency, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry, int, LedgerEntry } from './base/types.js';
|
|
2
|
+
import type { Account, Balances, Currencies, Currency, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry, int, LedgerEntry, FundingRate } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class coinlist
|
|
5
5
|
* @augments Exchange
|
|
@@ -363,6 +363,17 @@ export default class coinlist extends Exchange {
|
|
|
363
363
|
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
364
364
|
parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
|
|
365
365
|
parseLedgerEntryType(type: any): string;
|
|
366
|
+
/**
|
|
367
|
+
* @method
|
|
368
|
+
* @name coinlist#fetchFundingRate
|
|
369
|
+
* @description fetch the current funding rate
|
|
370
|
+
* @see https://trade-docs.coinlist.co/#coinlist-pro-api-Funding-Rates
|
|
371
|
+
* @param {string} symbol unified market symbol
|
|
372
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
373
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
374
|
+
*/
|
|
375
|
+
fetchFundingRate(symbol: string, params?: {}): Promise<FundingRate>;
|
|
376
|
+
parseFundingRate(contract: any, market?: Market): FundingRate;
|
|
366
377
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
367
378
|
url: string;
|
|
368
379
|
method: string;
|
package/js/src/coinlist.js
CHANGED
|
@@ -66,7 +66,7 @@ export default class coinlist extends Exchange {
|
|
|
66
66
|
'fetchDepositWithdrawFee': false,
|
|
67
67
|
'fetchDepositWithdrawFees': false,
|
|
68
68
|
'fetchFundingHistory': false,
|
|
69
|
-
'fetchFundingRate':
|
|
69
|
+
'fetchFundingRate': true,
|
|
70
70
|
'fetchFundingRateHistory': false,
|
|
71
71
|
'fetchFundingRates': false,
|
|
72
72
|
'fetchIndexOHLCV': false,
|
|
@@ -2462,6 +2462,90 @@ export default class coinlist extends Exchange {
|
|
|
2462
2462
|
};
|
|
2463
2463
|
return this.safeString(types, type, type);
|
|
2464
2464
|
}
|
|
2465
|
+
/**
|
|
2466
|
+
* @method
|
|
2467
|
+
* @name coinlist#fetchFundingRate
|
|
2468
|
+
* @description fetch the current funding rate
|
|
2469
|
+
* @see https://trade-docs.coinlist.co/#coinlist-pro-api-Funding-Rates
|
|
2470
|
+
* @param {string} symbol unified market symbol
|
|
2471
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2472
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
2473
|
+
*/
|
|
2474
|
+
async fetchFundingRate(symbol, params = {}) {
|
|
2475
|
+
await this.loadMarkets();
|
|
2476
|
+
const market = this.market(symbol);
|
|
2477
|
+
if (!market['swap']) {
|
|
2478
|
+
throw new BadSymbol(this.id + ' fetchFundingRate() supports swap contracts only');
|
|
2479
|
+
}
|
|
2480
|
+
const request = {
|
|
2481
|
+
'symbol': market['id'],
|
|
2482
|
+
};
|
|
2483
|
+
const response = await this.publicGetV1SymbolsSymbolFunding(this.extend(request, params));
|
|
2484
|
+
//
|
|
2485
|
+
// {
|
|
2486
|
+
// "last": {
|
|
2487
|
+
// "funding_rate": "-0.00043841",
|
|
2488
|
+
// "funding_time": "2025-04-15T04:00:00.000Z"
|
|
2489
|
+
// },
|
|
2490
|
+
// "next": {
|
|
2491
|
+
// "funding_rate": "-0.00046952",
|
|
2492
|
+
// "funding_time": "2025-04-15T12:00:00.000Z"
|
|
2493
|
+
// },
|
|
2494
|
+
// "indicative": {
|
|
2495
|
+
// "funding_rate": "-0.00042517",
|
|
2496
|
+
// "funding_time": "2025-04-15T20:00:00.000Z"
|
|
2497
|
+
// },
|
|
2498
|
+
// "timestamp": "2025-04-15T07:01:15.219Z"
|
|
2499
|
+
// }
|
|
2500
|
+
//
|
|
2501
|
+
return this.parseFundingRate(response, market);
|
|
2502
|
+
}
|
|
2503
|
+
parseFundingRate(contract, market = undefined) {
|
|
2504
|
+
//
|
|
2505
|
+
// {
|
|
2506
|
+
// "last": {
|
|
2507
|
+
// "funding_rate": "-0.00043841",
|
|
2508
|
+
// "funding_time": "2025-04-15T04:00:00.000Z"
|
|
2509
|
+
// },
|
|
2510
|
+
// "next": {
|
|
2511
|
+
// "funding_rate": "-0.00046952",
|
|
2512
|
+
// "funding_time": "2025-04-15T12:00:00.000Z"
|
|
2513
|
+
// },
|
|
2514
|
+
// "indicative": {
|
|
2515
|
+
// "funding_rate": "-0.00042517",
|
|
2516
|
+
// "funding_time": "2025-04-15T20:00:00.000Z"
|
|
2517
|
+
// },
|
|
2518
|
+
// "timestamp": "2025-04-15T07:01:15.219Z"
|
|
2519
|
+
// }
|
|
2520
|
+
//
|
|
2521
|
+
const previous = this.safeDict(contract, 'last', {});
|
|
2522
|
+
const current = this.safeDict(contract, 'next', {});
|
|
2523
|
+
const next = this.safeDict(contract, 'indicative', {});
|
|
2524
|
+
const previousDatetime = this.safeString(previous, 'funding_time');
|
|
2525
|
+
const currentDatetime = this.safeString(current, 'funding_time');
|
|
2526
|
+
const nextDatetime = this.safeString(next, 'funding_time');
|
|
2527
|
+
const datetime = this.safeString(contract, 'timestamp');
|
|
2528
|
+
return {
|
|
2529
|
+
'info': contract,
|
|
2530
|
+
'symbol': this.safeSymbol(undefined, market),
|
|
2531
|
+
'markPrice': undefined,
|
|
2532
|
+
'indexPrice': undefined,
|
|
2533
|
+
'interestRate': undefined,
|
|
2534
|
+
'estimatedSettlePrice': undefined,
|
|
2535
|
+
'timestamp': this.parse8601(datetime),
|
|
2536
|
+
'datetime': datetime,
|
|
2537
|
+
'fundingRate': this.safeNumber(current, 'funding_rate'),
|
|
2538
|
+
'fundingTimestamp': this.parse8601(currentDatetime),
|
|
2539
|
+
'fundingDatetime': currentDatetime,
|
|
2540
|
+
'nextFundingRate': this.safeNumber(next, 'funding_rate'),
|
|
2541
|
+
'nextFundingTimestamp': this.parse8601(nextDatetime),
|
|
2542
|
+
'nextFundingDatetime': nextDatetime,
|
|
2543
|
+
'previousFundingRate': this.safeNumber(previous, 'funding_rate'),
|
|
2544
|
+
'previousFundingTimestamp': this.parse8601(previousDatetime),
|
|
2545
|
+
'previousFundingDatetime': previousDatetime,
|
|
2546
|
+
'interval': '8h',
|
|
2547
|
+
};
|
|
2548
|
+
}
|
|
2465
2549
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
2466
2550
|
const request = this.omit(params, this.extractParams(path));
|
|
2467
2551
|
const endpoint = '/' + this.implodeParams(path, params);
|
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, Market, Num, Account, CancellationRequest, Dict, int, TradingFeeInterface, TradingFees, LedgerEntry, DepositAddress } from './base/types.js';
|
|
2
|
+
import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, Str, Ticker, OrderRequest, Balances, Transaction, OrderBook, Tickers, Strings, Currency, Market, Num, Account, CancellationRequest, Dict, int, TradingFeeInterface, TradingFees, LedgerEntry, DepositAddress, Position } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class cryptocom
|
|
5
5
|
* @augments Exchange
|
|
@@ -366,7 +366,7 @@ export default class cryptocom extends Exchange {
|
|
|
366
366
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
367
367
|
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
368
368
|
*/
|
|
369
|
-
fetchPosition(symbol: string, params?: {}): Promise<
|
|
369
|
+
fetchPosition(symbol: string, params?: {}): Promise<Position>;
|
|
370
370
|
/**
|
|
371
371
|
* @method
|
|
372
372
|
* @name cryptocom#fetchPositions
|
|
@@ -376,8 +376,8 @@ export default class cryptocom extends Exchange {
|
|
|
376
376
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
377
377
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
378
378
|
*/
|
|
379
|
-
fetchPositions(symbols?: Strings, params?: {}): Promise<
|
|
380
|
-
parsePosition(position: Dict, market?: Market):
|
|
379
|
+
fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
380
|
+
parsePosition(position: Dict, market?: Market): Position;
|
|
381
381
|
nonce(): number;
|
|
382
382
|
paramsToString(object: any, level: any): any;
|
|
383
383
|
/**
|
package/js/src/deribit.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/deribit.js';
|
|
2
|
-
import type { Balances, Currency, FundingRateHistory, Greeks, Int, Liquidation, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry, MarketInterface, Num, Account, Option, OptionChain, Currencies, TradingFees, Dict, int, FundingRate, DepositAddress } from './base/types.js';
|
|
2
|
+
import type { Balances, Currency, FundingRateHistory, Greeks, Int, Liquidation, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry, MarketInterface, Num, Account, Option, OptionChain, Currencies, TradingFees, Dict, int, FundingRate, DepositAddress, Position } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class deribit
|
|
5
5
|
* @augments Exchange
|
|
@@ -321,7 +321,7 @@ export default class deribit extends Exchange {
|
|
|
321
321
|
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
322
322
|
parseTransactionStatus(status: Str): string;
|
|
323
323
|
parseTransaction(transaction: Dict, currency?: Currency): Transaction;
|
|
324
|
-
parsePosition(position: Dict, market?: Market):
|
|
324
|
+
parsePosition(position: Dict, market?: Market): Position;
|
|
325
325
|
/**
|
|
326
326
|
* @method
|
|
327
327
|
* @name deribit#fetchPosition
|
|
@@ -331,7 +331,7 @@ export default class deribit extends Exchange {
|
|
|
331
331
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
332
332
|
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
333
333
|
*/
|
|
334
|
-
fetchPosition(symbol: string, params?: {}): Promise<
|
|
334
|
+
fetchPosition(symbol: string, params?: {}): Promise<Position>;
|
|
335
335
|
/**
|
|
336
336
|
* @method
|
|
337
337
|
* @name deribit#fetchPositions
|
|
@@ -344,7 +344,7 @@ export default class deribit extends Exchange {
|
|
|
344
344
|
* @param {int} [params.subaccount_id] the user id for the subaccount
|
|
345
345
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
346
346
|
*/
|
|
347
|
-
fetchPositions(symbols?: Strings, params?: {}): Promise<
|
|
347
|
+
fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
348
348
|
/**
|
|
349
349
|
* @method
|
|
350
350
|
* @name deribit#fetchVolatilityHistory
|
package/js/src/derive.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/derive.js';
|
|
2
|
-
import type { Dict, Currencies, Transaction, Currency, FundingHistory, Market, Str, Strings, Ticker, Int, int, Trade, OrderType, OrderSide, Num, FundingRateHistory, FundingRate, Balances, Order } from './base/types.js';
|
|
2
|
+
import type { Dict, Currencies, Transaction, Currency, FundingHistory, Market, Str, Strings, Ticker, Int, int, Trade, OrderType, OrderSide, Num, FundingRateHistory, FundingRate, Balances, Order, Position } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class derive
|
|
5
5
|
* @augments Exchange
|
|
@@ -249,8 +249,8 @@ export default class derive extends Exchange {
|
|
|
249
249
|
* @param {string} [params.subaccount_id] *required* the subaccount id
|
|
250
250
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
251
251
|
*/
|
|
252
|
-
fetchPositions(symbols?: Strings, params?: {}): Promise<
|
|
253
|
-
parsePosition(position: Dict, market?: Market):
|
|
252
|
+
fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
253
|
+
parsePosition(position: Dict, market?: Market): Position;
|
|
254
254
|
/**
|
|
255
255
|
* @method
|
|
256
256
|
* @name derive#fetchFundingHistory
|
package/js/src/digifinex.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/digifinex.js';
|
|
2
|
-
import type { FundingRateHistory, Int, OHLCV, Order, OrderSide, OrderType, OrderRequest, Trade, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Strings, Market, Currency, TransferEntry, Num, MarginModification, TradingFeeInterface, Currencies, CrossBorrowRate, CrossBorrowRates, Dict, LeverageTier, LeverageTiers, int, LedgerEntry, FundingRate, DepositAddress, BorrowInterest } from './base/types.js';
|
|
2
|
+
import type { FundingRateHistory, Int, OHLCV, Order, OrderSide, OrderType, OrderRequest, Trade, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Strings, Market, Currency, TransferEntry, Num, MarginModification, TradingFeeInterface, Currencies, CrossBorrowRate, CrossBorrowRates, Dict, LeverageTier, LeverageTiers, int, LedgerEntry, FundingRate, DepositAddress, BorrowInterest, Position } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class digifinex
|
|
5
5
|
* @augments Exchange
|
|
@@ -404,7 +404,7 @@ export default class digifinex extends Exchange {
|
|
|
404
404
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
405
405
|
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
406
406
|
*/
|
|
407
|
-
fetchPositions(symbols?: Strings, params?: {}): Promise<
|
|
407
|
+
fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
408
408
|
/**
|
|
409
409
|
* @method
|
|
410
410
|
* @name digifinex#fetchPosition
|
|
@@ -415,8 +415,8 @@ export default class digifinex extends Exchange {
|
|
|
415
415
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
416
416
|
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
417
417
|
*/
|
|
418
|
-
fetchPosition(symbol: string, params?: {}): Promise<
|
|
419
|
-
parsePosition(position: Dict, market?: Market):
|
|
418
|
+
fetchPosition(symbol: string, params?: {}): Promise<Position>;
|
|
419
|
+
parsePosition(position: Dict, market?: Market): Position;
|
|
420
420
|
/**
|
|
421
421
|
* @method
|
|
422
422
|
* @name digifinex#setLeverage
|
package/js/src/hitbtc.js
CHANGED
|
@@ -957,6 +957,8 @@ export default class hitbtc extends Exchange {
|
|
|
957
957
|
const transferEnabled = this.safeBool(entry, 'transfer_enabled', false);
|
|
958
958
|
const active = payinEnabled && payoutEnabled && transferEnabled;
|
|
959
959
|
const rawNetworks = this.safeValue(entry, 'networks', []);
|
|
960
|
+
const isCrypto = this.safeBool(entry, 'crypto');
|
|
961
|
+
const type = isCrypto ? 'crypto' : 'fiat';
|
|
960
962
|
const networks = {};
|
|
961
963
|
let fee = undefined;
|
|
962
964
|
let depositEnabled = undefined;
|
|
@@ -1019,6 +1021,7 @@ export default class hitbtc extends Exchange {
|
|
|
1019
1021
|
'max': undefined,
|
|
1020
1022
|
},
|
|
1021
1023
|
},
|
|
1024
|
+
'type': type,
|
|
1022
1025
|
};
|
|
1023
1026
|
}
|
|
1024
1027
|
return result;
|
package/js/src/htx.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/htx.js';
|
|
2
|
-
import type { TransferEntry, Int, OrderSide, OrderType, Order, OHLCV, Trade, FundingRateHistory, Balances, Str, Dict, Transaction, Ticker, OrderBook, Tickers, OrderRequest, Strings, Market, Currency, Num, Account, TradingFeeInterface, Currencies, IsolatedBorrowRates, IsolatedBorrowRate, LeverageTiers, LeverageTier, int, LedgerEntry, FundingRate, FundingRates, DepositAddress, BorrowInterest, OpenInterests } from './base/types.js';
|
|
2
|
+
import type { TransferEntry, Int, OrderSide, OrderType, Order, OHLCV, Trade, FundingRateHistory, Balances, Str, Dict, Transaction, Ticker, OrderBook, Tickers, OrderRequest, Strings, Market, Currency, Num, Account, TradingFeeInterface, Currencies, IsolatedBorrowRates, IsolatedBorrowRate, LeverageTiers, LeverageTier, int, LedgerEntry, FundingRate, FundingRates, DepositAddress, BorrowInterest, OpenInterests, Position } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class htx
|
|
5
5
|
* @augments Exchange
|
|
@@ -717,7 +717,7 @@ export default class htx extends Exchange {
|
|
|
717
717
|
id: string;
|
|
718
718
|
amount: number;
|
|
719
719
|
};
|
|
720
|
-
parsePosition(position: Dict, market?: Market):
|
|
720
|
+
parsePosition(position: Dict, market?: Market): Position;
|
|
721
721
|
/**
|
|
722
722
|
* @method
|
|
723
723
|
* @name htx#fetchPositions
|
|
@@ -733,7 +733,7 @@ export default class htx extends Exchange {
|
|
|
733
733
|
* @param {string} [params.marginMode] *linear only* 'cross' or 'isolated'
|
|
734
734
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
735
735
|
*/
|
|
736
|
-
fetchPositions(symbols?: Strings, params?: {}): Promise<
|
|
736
|
+
fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
737
737
|
/**
|
|
738
738
|
* @method
|
|
739
739
|
* @name htx#fetchPosition
|
|
@@ -746,7 +746,7 @@ export default class htx extends Exchange {
|
|
|
746
746
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
747
747
|
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
748
748
|
*/
|
|
749
|
-
fetchPosition(symbol: string, params?: {}): Promise<
|
|
749
|
+
fetchPosition(symbol: string, params?: {}): Promise<Position>;
|
|
750
750
|
parseLedgerEntryType(type: any): string;
|
|
751
751
|
parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
|
|
752
752
|
/**
|
package/js/src/hyperliquid.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ export default class hyperliquid extends Exchange {
|
|
|
64
64
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
65
65
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
66
66
|
* @param {string} [params.type] wallet type, ['spot', 'swap'], defaults to swap
|
|
67
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null
|
|
67
68
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
68
69
|
*/
|
|
69
70
|
fetchBalance(params?: {}): Promise<Balances>;
|
package/js/src/hyperliquid.js
CHANGED
|
@@ -774,6 +774,7 @@ export default class hyperliquid extends Exchange {
|
|
|
774
774
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
775
775
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
776
776
|
* @param {string} [params.type] wallet type, ['spot', 'swap'], defaults to swap
|
|
777
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null
|
|
777
778
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
778
779
|
*/
|
|
779
780
|
async fetchBalance(params = {}) {
|
|
@@ -781,6 +782,8 @@ export default class hyperliquid extends Exchange {
|
|
|
781
782
|
[userAddress, params] = this.handlePublicAddress('fetchBalance', params);
|
|
782
783
|
let type = undefined;
|
|
783
784
|
[type, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
|
|
785
|
+
let marginMode = undefined;
|
|
786
|
+
[marginMode, params] = this.handleMarginModeAndParams('fetchBalance', params);
|
|
784
787
|
const isSpot = (type === 'spot');
|
|
785
788
|
const reqType = (isSpot) ? 'spotClearinghouseState' : 'clearinghouseState';
|
|
786
789
|
const request = {
|
|
@@ -839,12 +842,18 @@ export default class hyperliquid extends Exchange {
|
|
|
839
842
|
return this.safeBalance(spotBalances);
|
|
840
843
|
}
|
|
841
844
|
const data = this.safeDict(response, 'marginSummary', {});
|
|
845
|
+
const usdcBalance = {
|
|
846
|
+
'total': this.safeNumber(data, 'accountValue'),
|
|
847
|
+
};
|
|
848
|
+
if ((marginMode !== undefined) && (marginMode === 'isolated')) {
|
|
849
|
+
usdcBalance['free'] = this.safeNumber(response, 'withdrawable');
|
|
850
|
+
}
|
|
851
|
+
else {
|
|
852
|
+
usdcBalance['used'] = this.safeNumber(data, 'totalMarginUsed');
|
|
853
|
+
}
|
|
842
854
|
const result = {
|
|
843
855
|
'info': response,
|
|
844
|
-
'USDC':
|
|
845
|
-
'total': this.safeNumber(data, 'accountValue'),
|
|
846
|
-
'used': this.safeNumber(data, 'totalMarginUsed'),
|
|
847
|
-
},
|
|
856
|
+
'USDC': usdcBalance,
|
|
848
857
|
};
|
|
849
858
|
const timestamp = this.safeInteger(response, 'time');
|
|
850
859
|
result['timestamp'] = timestamp;
|
package/js/src/kraken.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/kraken.js';
|
|
2
|
-
import type { IndexType, Int, OrderSide, OrderType, OHLCV, Trade, Order, Balances, Str, Dict, Transaction, Ticker, OrderBook, Tickers, Strings, Currency, Market, TransferEntry, Num, TradingFeeInterface, Currencies, int, LedgerEntry, DepositAddress } from './base/types.js';
|
|
2
|
+
import type { IndexType, Int, OrderSide, OrderType, OHLCV, Trade, Order, Balances, Str, Dict, Transaction, Ticker, OrderBook, Tickers, Strings, Currency, Market, TransferEntry, Num, TradingFeeInterface, Currencies, int, LedgerEntry, DepositAddress, Position } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class kraken
|
|
5
5
|
* @augments Exchange
|
|
@@ -446,8 +446,8 @@ export default class kraken extends Exchange {
|
|
|
446
446
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
447
447
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
448
448
|
*/
|
|
449
|
-
fetchPositions(symbols?: Strings, params?: {}): Promise<
|
|
450
|
-
parsePosition(position: Dict, market?: Market):
|
|
449
|
+
fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
450
|
+
parsePosition(position: Dict, market?: Market): Position;
|
|
451
451
|
parseAccountType(account: any): string;
|
|
452
452
|
/**
|
|
453
453
|
* @method
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/krakenfutures.js';
|
|
2
|
-
import type { TransferEntry, Int, OrderSide, OrderType, OHLCV, Trade, FundingRateHistory, OrderRequest, Order, Balances, Str, Dict, Ticker, OrderBook, Tickers, Strings, Market, Currency, Leverage, Leverages, Num, LeverageTier, LeverageTiers, int, FundingRate, FundingRates } from './base/types.js';
|
|
2
|
+
import type { TransferEntry, Int, OrderSide, OrderType, OHLCV, Trade, FundingRateHistory, OrderRequest, Order, Balances, Str, Dict, Ticker, OrderBook, Tickers, Strings, Market, Currency, Leverage, Leverages, Num, LeverageTier, LeverageTiers, int, FundingRate, FundingRates, Position } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class krakenfutures
|
|
5
5
|
* @augments Exchange
|
|
@@ -258,7 +258,7 @@ export default class krakenfutures extends Exchange {
|
|
|
258
258
|
* @param {object} [params] Not used by krakenfutures
|
|
259
259
|
* @returns Parsed exchange response for positions
|
|
260
260
|
*/
|
|
261
|
-
fetchPositions(symbols?: Strings, params?: {}): Promise<
|
|
261
|
+
fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
262
262
|
parsePositions(response: any, symbols?: Strings, params?: {}): any[];
|
|
263
263
|
parsePosition(position: Dict, market?: Market): {
|
|
264
264
|
info: Dict;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import kucoin from './abstract/kucoinfutures.js';
|
|
2
|
-
import type { TransferEntry, Int, OrderSide, OrderType, OHLCV, Order, Trade, OrderRequest, FundingHistory, Balances, Str, Ticker, Tickers, OrderBook, Transaction, Strings, Market, Currency, Num, MarginModification, TradingFeeInterface, Dict, LeverageTier, MarginMode, Leverage, FundingRate, DepositAddress } from './base/types.js';
|
|
2
|
+
import type { TransferEntry, Int, OrderSide, OrderType, OHLCV, Order, Trade, OrderRequest, FundingHistory, Balances, Str, Ticker, Tickers, OrderBook, Transaction, Strings, Market, Currency, Num, MarginModification, TradingFeeInterface, Dict, LeverageTier, MarginMode, Leverage, FundingRate, DepositAddress, Position } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class kucoinfutures
|
|
5
5
|
* @augments Exchange
|
|
@@ -137,7 +137,7 @@ export default class kucoinfutures extends kucoin {
|
|
|
137
137
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
138
138
|
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
139
139
|
*/
|
|
140
|
-
fetchPosition(symbol: string, params?: {}): Promise<
|
|
140
|
+
fetchPosition(symbol: string, params?: {}): Promise<Position>;
|
|
141
141
|
/**
|
|
142
142
|
* @method
|
|
143
143
|
* @name kucoinfutures#fetchPositions
|
|
@@ -147,7 +147,7 @@ export default class kucoinfutures extends kucoin {
|
|
|
147
147
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
148
148
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
149
149
|
*/
|
|
150
|
-
fetchPositions(symbols?: Strings, params?: {}): Promise<
|
|
150
|
+
fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
151
151
|
/**
|
|
152
152
|
* @method
|
|
153
153
|
* @name kucoinfutures#fetchPositionsHistory
|
|
@@ -161,8 +161,8 @@ export default class kucoinfutures extends kucoin {
|
|
|
161
161
|
* @param {int} [params.pageId] page id
|
|
162
162
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
163
163
|
*/
|
|
164
|
-
fetchPositionsHistory(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<
|
|
165
|
-
parsePosition(position: Dict, market?: Market):
|
|
164
|
+
fetchPositionsHistory(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
|
|
165
|
+
parsePosition(position: Dict, market?: Market): Position;
|
|
166
166
|
/**
|
|
167
167
|
* @method
|
|
168
168
|
* @name kucoinfutures#createOrder
|
package/js/src/mexc.d.ts
CHANGED
|
@@ -374,6 +374,7 @@ export default class mexc extends Exchange {
|
|
|
374
374
|
parseOrderType(status: any): string;
|
|
375
375
|
parseOrderStatus(status: Str): string;
|
|
376
376
|
parseOrderTimeInForce(status: any): string;
|
|
377
|
+
getTifFromRawOrderType(orderType?: Str): string;
|
|
377
378
|
fetchAccountHelper(type: any, params: any): Promise<any>;
|
|
378
379
|
/**
|
|
379
380
|
* @method
|