ccxt 4.4.24 → 4.4.26
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 +6 -6
- package/dist/ccxt.browser.min.js +4 -4
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/alpaca.js +257 -11
- package/dist/cjs/src/base/Exchange.js +14 -1
- package/dist/cjs/src/binance.js +2 -3
- package/dist/cjs/src/bingx.js +7 -1
- package/dist/cjs/src/bitget.js +2 -2
- package/dist/cjs/src/bitmart.js +3 -3
- package/dist/cjs/src/bitmex.js +8 -7
- package/dist/cjs/src/bybit.js +3 -14
- package/dist/cjs/src/cex.js +40 -0
- package/dist/cjs/src/coinex.js +48 -29
- package/dist/cjs/src/digifinex.js +2 -2
- package/dist/cjs/src/exmo.js +1 -0
- package/dist/cjs/src/gate.js +3 -3
- package/dist/cjs/src/hitbtc.js +6 -12
- package/dist/cjs/src/htx.js +18 -19
- package/dist/cjs/src/hyperliquid.js +14 -4
- package/dist/cjs/src/kucoin.js +2 -2
- package/dist/cjs/src/okx.js +3 -2
- package/dist/cjs/src/phemex.js +4 -2
- package/dist/cjs/src/pro/exmo.js +216 -3
- package/dist/cjs/src/whitebit.js +2 -2
- package/dist/cjs/src/woofipro.js +1 -1
- package/dist/cjs/src/xt.js +44 -28
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/alpaca.d.ts +1 -0
- package/js/src/abstract/bingx.d.ts +1 -0
- package/js/src/abstract/okx.d.ts +1 -0
- package/js/src/abstract/phemex.d.ts +1 -0
- package/js/src/alpaca.d.ts +6 -1
- package/js/src/alpaca.js +258 -12
- package/js/src/base/Exchange.d.ts +7 -6
- package/js/src/base/Exchange.js +14 -1
- package/js/src/base/types.d.ts +3 -3
- package/js/src/binance.d.ts +3 -14
- package/js/src/binance.js +2 -3
- package/js/src/bingx.js +7 -1
- package/js/src/bitget.d.ts +3 -13
- package/js/src/bitget.js +2 -2
- package/js/src/bitmart.d.ts +3 -13
- package/js/src/bitmart.js +3 -3
- package/js/src/bitmex.js +8 -7
- package/js/src/bybit.d.ts +3 -14
- package/js/src/bybit.js +3 -14
- package/js/src/cex.d.ts +2 -0
- package/js/src/cex.js +40 -0
- package/js/src/coinex.d.ts +3 -15
- package/js/src/coinex.js +48 -29
- package/js/src/digifinex.d.ts +3 -13
- package/js/src/digifinex.js +2 -2
- package/js/src/exmo.js +1 -0
- package/js/src/gate.d.ts +3 -13
- package/js/src/gate.js +3 -3
- package/js/src/hitbtc.d.ts +0 -1
- package/js/src/hitbtc.js +6 -12
- package/js/src/htx.d.ts +3 -14
- package/js/src/htx.js +18 -19
- package/js/src/hyperliquid.js +14 -4
- package/js/src/kucoin.d.ts +3 -13
- package/js/src/kucoin.js +2 -2
- package/js/src/okx.d.ts +3 -13
- package/js/src/okx.js +3 -2
- package/js/src/phemex.js +4 -2
- package/js/src/pro/exmo.d.ts +5 -1
- package/js/src/pro/exmo.js +216 -3
- package/js/src/whitebit.d.ts +3 -13
- package/js/src/whitebit.js +2 -2
- package/js/src/woo.d.ts +1 -1
- package/js/src/woofipro.js +1 -1
- package/js/src/xt.js +44 -28
- package/package.json +1 -1
package/js/src/bitmex.js
CHANGED
|
@@ -1156,19 +1156,20 @@ export default class bitmex extends Exchange {
|
|
|
1156
1156
|
// for unrealized pnl and other transactions without a timestamp
|
|
1157
1157
|
timestamp = 0; // see comments above
|
|
1158
1158
|
}
|
|
1159
|
+
let fee = undefined;
|
|
1159
1160
|
let feeCost = this.safeString(item, 'fee');
|
|
1160
1161
|
if (feeCost !== undefined) {
|
|
1161
1162
|
feeCost = this.convertToRealAmount(code, feeCost);
|
|
1163
|
+
fee = {
|
|
1164
|
+
'cost': this.parseNumber(feeCost),
|
|
1165
|
+
'currency': code,
|
|
1166
|
+
};
|
|
1162
1167
|
}
|
|
1163
|
-
const fee = {
|
|
1164
|
-
'cost': this.parseToNumeric(feeCost),
|
|
1165
|
-
'currency': code,
|
|
1166
|
-
};
|
|
1167
1168
|
let after = this.safeString(item, 'walletBalance');
|
|
1168
1169
|
if (after !== undefined) {
|
|
1169
1170
|
after = this.convertToRealAmount(code, after);
|
|
1170
1171
|
}
|
|
1171
|
-
const before = this.
|
|
1172
|
+
const before = this.parseNumber(Precise.stringSub(this.numberToString(after), this.numberToString(amount)));
|
|
1172
1173
|
let direction = undefined;
|
|
1173
1174
|
if (Precise.stringLt(amountString, '0')) {
|
|
1174
1175
|
direction = 'out';
|
|
@@ -1189,9 +1190,9 @@ export default class bitmex extends Exchange {
|
|
|
1189
1190
|
'referenceAccount': referenceAccount,
|
|
1190
1191
|
'type': type,
|
|
1191
1192
|
'currency': code,
|
|
1192
|
-
'amount': this.
|
|
1193
|
+
'amount': this.parseNumber(amount),
|
|
1193
1194
|
'before': before,
|
|
1194
|
-
'after': this.
|
|
1195
|
+
'after': this.parseNumber(after),
|
|
1195
1196
|
'status': status,
|
|
1196
1197
|
'fee': fee,
|
|
1197
1198
|
}, currency);
|
package/js/src/bybit.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import Exchange from './abstract/bybit.js';
|
|
2
|
-
import type { Int, OrderSide, OrderType, Trade, Order, OHLCV, FundingRateHistory, OpenInterest, OrderRequest, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry, Liquidation, Leverage, Num, FundingHistory, Option, OptionChain, TradingFeeInterface, Currencies, TradingFees, CancellationRequest, Position, CrossBorrowRate, Dict, LeverageTier, LeverageTiers, int, LedgerEntry, Conversion, FundingRate, FundingRates, DepositAddress, LongShortRatio } from './base/types.js';
|
|
2
|
+
import type { Int, OrderSide, OrderType, Trade, Order, OHLCV, FundingRateHistory, OpenInterest, OrderRequest, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry, Liquidation, Leverage, Num, FundingHistory, Option, OptionChain, TradingFeeInterface, Currencies, TradingFees, CancellationRequest, Position, CrossBorrowRate, Dict, LeverageTier, LeverageTiers, int, LedgerEntry, Conversion, FundingRate, FundingRates, DepositAddress, LongShortRatio, BorrowInterest } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class bybit
|
|
5
5
|
* @augments Exchange
|
|
6
6
|
*/
|
|
7
7
|
export default class bybit extends Exchange {
|
|
8
8
|
describe(): any;
|
|
9
|
-
setSandboxMode(enable: boolean): void;
|
|
10
9
|
enableDemoTrading(enable: boolean): void;
|
|
11
10
|
nonce(): number;
|
|
12
11
|
addPaginationCursorToResult(response: any): any;
|
|
@@ -105,19 +104,9 @@ export default class bybit extends Exchange {
|
|
|
105
104
|
datetime: string;
|
|
106
105
|
info: any;
|
|
107
106
|
};
|
|
108
|
-
fetchBorrowInterest(code?: Str, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<
|
|
107
|
+
fetchBorrowInterest(code?: Str, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<BorrowInterest[]>;
|
|
109
108
|
fetchBorrowRateHistory(code: string, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
110
|
-
parseBorrowInterest(info: Dict, market?: Market):
|
|
111
|
-
symbol: any;
|
|
112
|
-
marginMode: string;
|
|
113
|
-
currency: string;
|
|
114
|
-
interest: number;
|
|
115
|
-
interestRate: any;
|
|
116
|
-
amountBorrowed: number;
|
|
117
|
-
timestamp: any;
|
|
118
|
-
datetime: any;
|
|
119
|
-
info: Dict;
|
|
120
|
-
};
|
|
109
|
+
parseBorrowInterest(info: Dict, market?: Market): BorrowInterest;
|
|
121
110
|
transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
|
|
122
111
|
fetchTransfers(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<TransferEntry[]>;
|
|
123
112
|
borrowCrossMargin(code: string, amount: number, params?: {}): Promise<any>;
|
package/js/src/bybit.js
CHANGED
|
@@ -1005,7 +1005,6 @@ export default class bybit extends Exchange {
|
|
|
1005
1005
|
'precisionMode': TICK_SIZE,
|
|
1006
1006
|
'options': {
|
|
1007
1007
|
'usePrivateInstrumentsInfo': false,
|
|
1008
|
-
'sandboxMode': false,
|
|
1009
1008
|
'enableDemoTrading': false,
|
|
1010
1009
|
'fetchMarkets': ['spot', 'linear', 'inverse', 'option'],
|
|
1011
1010
|
'createOrder': {
|
|
@@ -1091,16 +1090,6 @@ export default class bybit extends Exchange {
|
|
|
1091
1090
|
},
|
|
1092
1091
|
});
|
|
1093
1092
|
}
|
|
1094
|
-
setSandboxMode(enable) {
|
|
1095
|
-
/**
|
|
1096
|
-
* @method
|
|
1097
|
-
* @name bybit#setSandboxMode
|
|
1098
|
-
* @description enables or disables sandbox mode
|
|
1099
|
-
* @param {boolean} [enable] true if demo trading should be enabled, false otherwise
|
|
1100
|
-
*/
|
|
1101
|
-
super.setSandboxMode(enable);
|
|
1102
|
-
this.options['sandboxMode'] = enable;
|
|
1103
|
-
}
|
|
1104
1093
|
enableDemoTrading(enable) {
|
|
1105
1094
|
/**
|
|
1106
1095
|
* @method
|
|
@@ -1109,7 +1098,7 @@ export default class bybit extends Exchange {
|
|
|
1109
1098
|
* @see https://bybit-exchange.github.io/docs/v5/demo
|
|
1110
1099
|
* @param {boolean} [enable] true if demo trading should be enabled, false otherwise
|
|
1111
1100
|
*/
|
|
1112
|
-
if (this.
|
|
1101
|
+
if (this.isSandboxModeEnabled) {
|
|
1113
1102
|
throw new NotSupported(this.id + ' demo trading does not support in sandbox environment');
|
|
1114
1103
|
}
|
|
1115
1104
|
// enable demo trading in bybit, see: https://bybit-exchange.github.io/docs/v5/demo
|
|
@@ -7490,15 +7479,15 @@ export default class bybit extends Exchange {
|
|
|
7490
7479
|
// },
|
|
7491
7480
|
//
|
|
7492
7481
|
return {
|
|
7482
|
+
'info': info,
|
|
7493
7483
|
'symbol': undefined,
|
|
7494
|
-
'marginMode': 'cross',
|
|
7495
7484
|
'currency': this.safeCurrencyCode(this.safeString(info, 'tokenId')),
|
|
7496
7485
|
'interest': this.safeNumber(info, 'interest'),
|
|
7497
7486
|
'interestRate': undefined,
|
|
7498
7487
|
'amountBorrowed': this.safeNumber(info, 'loan'),
|
|
7488
|
+
'marginMode': 'cross',
|
|
7499
7489
|
'timestamp': undefined,
|
|
7500
7490
|
'datetime': undefined,
|
|
7501
|
-
'info': info,
|
|
7502
7491
|
};
|
|
7503
7492
|
}
|
|
7504
7493
|
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
package/js/src/cex.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ export default class cex extends Exchange {
|
|
|
29
29
|
fetchOrdersByStatus(status: string, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
30
30
|
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
31
31
|
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
32
|
+
fetchOpenOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
33
|
+
fetchClosedOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
32
34
|
parseOrderStatus(status: Str): string;
|
|
33
35
|
parseOrder(order: Dict, market?: Market): Order;
|
|
34
36
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
package/js/src/cex.js
CHANGED
|
@@ -35,6 +35,7 @@ export default class cex extends Exchange {
|
|
|
35
35
|
'createOrder': true,
|
|
36
36
|
'fetchAccounts': true,
|
|
37
37
|
'fetchBalance': true,
|
|
38
|
+
'fetchClosedOrder': true,
|
|
38
39
|
'fetchClosedOrders': true,
|
|
39
40
|
'fetchCurrencies': true,
|
|
40
41
|
'fetchDepositAddress': true,
|
|
@@ -46,6 +47,7 @@ export default class cex extends Exchange {
|
|
|
46
47
|
'fetchLedger': true,
|
|
47
48
|
'fetchMarkets': true,
|
|
48
49
|
'fetchOHLCV': true,
|
|
50
|
+
'fetchOpenOrder': true,
|
|
49
51
|
'fetchOpenOrders': true,
|
|
50
52
|
'fetchOrderBook': true,
|
|
51
53
|
'fetchTicker': true,
|
|
@@ -943,6 +945,7 @@ export default class cex extends Exchange {
|
|
|
943
945
|
/**
|
|
944
946
|
* @method
|
|
945
947
|
* @name cex#fetchClosedOrders
|
|
948
|
+
* @see https://trade.cex.io/docs/#rest-private-api-calls-orders
|
|
946
949
|
* @description fetches information on multiple canceled orders made by the user
|
|
947
950
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
948
951
|
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
@@ -956,6 +959,7 @@ export default class cex extends Exchange {
|
|
|
956
959
|
/**
|
|
957
960
|
* @method
|
|
958
961
|
* @name cex#fetchOpenOrders
|
|
962
|
+
* @see https://trade.cex.io/docs/#rest-private-api-calls-orders
|
|
959
963
|
* @description fetches information on multiple canceled orders made by the user
|
|
960
964
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
961
965
|
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
@@ -965,6 +969,42 @@ export default class cex extends Exchange {
|
|
|
965
969
|
*/
|
|
966
970
|
return await this.fetchOrdersByStatus('open', symbol, since, limit, params);
|
|
967
971
|
}
|
|
972
|
+
async fetchOpenOrder(id, symbol = undefined, params = {}) {
|
|
973
|
+
/**
|
|
974
|
+
* @method
|
|
975
|
+
* @name cex#fetchOpenOrder
|
|
976
|
+
* @description fetches information on an open order made by the user
|
|
977
|
+
* @see https://trade.cex.io/docs/#rest-private-api-calls-orders
|
|
978
|
+
* @param {string} id order id
|
|
979
|
+
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
980
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
981
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
982
|
+
*/
|
|
983
|
+
await this.loadMarkets();
|
|
984
|
+
const request = {
|
|
985
|
+
'orderId': parseInt(id),
|
|
986
|
+
};
|
|
987
|
+
const result = await this.fetchOpenOrders(symbol, undefined, undefined, this.extend(request, params));
|
|
988
|
+
return result[0];
|
|
989
|
+
}
|
|
990
|
+
async fetchClosedOrder(id, symbol = undefined, params = {}) {
|
|
991
|
+
/**
|
|
992
|
+
* @method
|
|
993
|
+
* @name cex#fetchClosedOrder
|
|
994
|
+
* @description fetches information on an closed order made by the user
|
|
995
|
+
* @see https://trade.cex.io/docs/#rest-private-api-calls-orders
|
|
996
|
+
* @param {string} id order id
|
|
997
|
+
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
998
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
999
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1000
|
+
*/
|
|
1001
|
+
await this.loadMarkets();
|
|
1002
|
+
const request = {
|
|
1003
|
+
'orderId': parseInt(id),
|
|
1004
|
+
};
|
|
1005
|
+
const result = await this.fetchClosedOrders(symbol, undefined, undefined, this.extend(request, params));
|
|
1006
|
+
return result[0];
|
|
1007
|
+
}
|
|
968
1008
|
parseOrderStatus(status) {
|
|
969
1009
|
const statuses = {
|
|
970
1010
|
'FILLED': 'closed',
|
package/js/src/coinex.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/coinex.js';
|
|
2
|
-
import type { Balances, Currency, FundingHistory, FundingRateHistory, Int, Market, OHLCV, Order, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, OrderRequest, TransferEntry, Leverage, Num, MarginModification, TradingFeeInterface, Currencies, TradingFees, Position, IsolatedBorrowRate, Dict, LeverageTiers, LeverageTier, int, FundingRate, FundingRates, DepositAddress } from './base/types.js';
|
|
2
|
+
import type { Balances, Currency, FundingHistory, FundingRateHistory, Int, Market, OHLCV, Order, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, OrderRequest, TransferEntry, Leverage, Num, MarginModification, TradingFeeInterface, Currencies, TradingFees, Position, IsolatedBorrowRate, Dict, LeverageTiers, LeverageTier, int, FundingRate, FundingRates, DepositAddress, BorrowInterest } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class coinex
|
|
5
5
|
* @augments Exchange
|
|
@@ -74,20 +74,8 @@ export default class coinex extends Exchange {
|
|
|
74
74
|
fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
75
75
|
parseIsolatedBorrowRate(info: Dict, market?: Market): IsolatedBorrowRate;
|
|
76
76
|
fetchIsolatedBorrowRate(symbol: string, params?: {}): Promise<IsolatedBorrowRate>;
|
|
77
|
-
fetchBorrowInterest(code?: Str, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<
|
|
78
|
-
parseBorrowInterest(info: Dict, market?: Market):
|
|
79
|
-
account: any;
|
|
80
|
-
symbol: string;
|
|
81
|
-
marginMode: string;
|
|
82
|
-
marginType: any;
|
|
83
|
-
currency: string;
|
|
84
|
-
interest: number;
|
|
85
|
-
interestRate: number;
|
|
86
|
-
amountBorrowed: number;
|
|
87
|
-
timestamp: number;
|
|
88
|
-
datetime: string;
|
|
89
|
-
info: Dict;
|
|
90
|
-
};
|
|
77
|
+
fetchBorrowInterest(code?: Str, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<BorrowInterest[]>;
|
|
78
|
+
parseBorrowInterest(info: Dict, market?: Market): BorrowInterest;
|
|
91
79
|
borrowIsolatedMargin(symbol: string, code: string, amount: number, params?: {}): Promise<any>;
|
|
92
80
|
repayIsolatedMargin(symbol: string, code: string, amount: any, params?: {}): Promise<any>;
|
|
93
81
|
parseMarginLoan(info: any, currency?: Currency): {
|
package/js/src/coinex.js
CHANGED
|
@@ -463,9 +463,43 @@ export default class coinex extends Exchange {
|
|
|
463
463
|
'FUTURES': 'swap',
|
|
464
464
|
},
|
|
465
465
|
'networks': {
|
|
466
|
+
'BTC': 'BTC',
|
|
466
467
|
'BEP20': 'BSC',
|
|
467
|
-
'
|
|
468
|
-
'
|
|
468
|
+
'TRC20': 'TRC20',
|
|
469
|
+
'ERC20': 'ERC20',
|
|
470
|
+
'BRC20': 'BRC20',
|
|
471
|
+
'SOL': 'SOL',
|
|
472
|
+
'TON': 'SOL',
|
|
473
|
+
'BSV': 'BSV',
|
|
474
|
+
'AVAXC': 'AVA_C',
|
|
475
|
+
'AVAXX': 'AVA',
|
|
476
|
+
'SUI': 'SUI',
|
|
477
|
+
'ACA': 'ACA',
|
|
478
|
+
'CHZ': 'CHILIZ',
|
|
479
|
+
'ADA': 'ADA',
|
|
480
|
+
'ARB': 'ARBITRUM',
|
|
481
|
+
'ARBNOVA': 'ARBITRUM_NOVA',
|
|
482
|
+
'OP': 'OPTIMISM',
|
|
483
|
+
'APT': 'APTOS',
|
|
484
|
+
'ATOM': 'ATOM',
|
|
485
|
+
'FTM': 'FTM',
|
|
486
|
+
'BCH': 'BCH',
|
|
487
|
+
'ASTR': 'ASTR',
|
|
488
|
+
'LTC': 'LTC',
|
|
489
|
+
'MATIC': 'MATIC',
|
|
490
|
+
'CRONOS': 'CRONOS',
|
|
491
|
+
'DASH': 'DASH',
|
|
492
|
+
'DOT': 'DOT',
|
|
493
|
+
'ETC': 'ETC',
|
|
494
|
+
'ETHW': 'ETHPOW',
|
|
495
|
+
'FIL': 'FIL',
|
|
496
|
+
'ZIL': 'ZIL',
|
|
497
|
+
'DOGE': 'DOGE',
|
|
498
|
+
'TIA': 'CELESTIA',
|
|
499
|
+
'SEI': 'SEI',
|
|
500
|
+
'XRP': 'XRP',
|
|
501
|
+
'XMR': 'XMR',
|
|
502
|
+
// CSC, AE, BASE, AIPG, AKASH, POLKADOTASSETHUB ?, ALEO, STX, ALGO, ALPH, BLAST, AR, ARCH, ARDR, ARK, ARRR, MANTA, NTRN, LUNA, AURORA, AVAIL, ASC20, AVA, AYA, AZERO, BAN, BAND, BB, RUNES, BEAM, BELLSCOIN, BITCI, NEAR, AGORIC, BLOCX, BNC, BOBA, BRISE, KRC20, CANTO, CAPS, CCD, CELO, CFX, CHI, CKB, CLORE, CLV, CORE, CSPR, CTXC, DAG, DCR, DERO, DESO, DEFI, DGB, DNX, DOCK, DOGECHAIN, DYDX, DYMENSION, EGLD, ELA, ELF, ENJIN, EOSIO, ERG, ETN_SC, EVMOS, EWC, SGB, FACT, FB, FET, FIO, FIRO, NEO3, FLOW, FLARE, FLUX, LINEA, FREN, FSN, FB_BRC20, GLMR, GRIN, GRS, HACASH, HBAR, HERB, HIVE, MAPO, HMND, HNS, ZKSYNC, HTR, HUAHUA, MERLIN, ICP, ICX, INJ, IOST, IOTA, IOTX, IRIS, IRON, ONE, JOYSTREAM, KAI, KAR, KAS, KAVA, KCN, KDA, KLAY, KLY, KMD, KSM, KUB, KUJIRA, LAT, LBC, LUNC, LUKSO, MARS, METIS, MINA, MANTLE, MOB, MODE, MONA, MOVR, MTL, NEOX, NEXA, NIBI, NIMIQ, NMC, ONOMY, NRG, WAVES, NULS, OAS, OCTA, OLT, ONT, OORT, ORAI, OSMO, P3D, COMPOSABLE, PIVX, RON, POKT, POLYMESH, PRE_MARKET, PYI, QKC, QTUM, QUBIC, RSK, ROSE, ROUTE, RTM, THORCHAIN, RVN, RADIANT, SAGA, SALVIUM, SATOX, SC, SCP, _NULL, SCRT, SDN, RGBPP, SELF, SMH, SPACE, STARGAZE, STC, STEEM, STRATISEVM, STRD, STARKNET, SXP, SYS, TAIKO, TAO, TARA, TENET, THETA, TT, VENOM, VECHAIN, TOMO, VITE, VLX, VSYS, VTC, WAN, WAXP, WEMIX, XCH, XDC, XEC, XELIS, NEM, XHV, XLM, XNA, NANO, XPLA, XPR, XPRT, XRD, XTZ, XVG, XYM, ZANO, ZEC, ZEN, ZEPH, ZETA
|
|
469
503
|
},
|
|
470
504
|
},
|
|
471
505
|
'commonCurrencies': {
|
|
@@ -3755,23 +3789,15 @@ export default class coinex extends Exchange {
|
|
|
3755
3789
|
*/
|
|
3756
3790
|
await this.loadMarkets();
|
|
3757
3791
|
const currency = this.currency(code);
|
|
3758
|
-
const networks = this.safeDict(currency, 'networks', {});
|
|
3759
|
-
const network = this.safeString2(params, 'network', 'chain');
|
|
3760
|
-
params = this.omit(params, 'network');
|
|
3761
|
-
const networksKeys = Object.keys(networks);
|
|
3762
|
-
const numOfNetworks = networksKeys.length;
|
|
3763
|
-
if (networks !== undefined && numOfNetworks > 1) {
|
|
3764
|
-
if (network === undefined) {
|
|
3765
|
-
throw new ArgumentsRequired(this.id + ' fetchDepositAddress() ' + code + ' requires a network parameter');
|
|
3766
|
-
}
|
|
3767
|
-
if (!(network in networks)) {
|
|
3768
|
-
throw new ExchangeError(this.id + ' fetchDepositAddress() ' + network + ' network not supported for ' + code);
|
|
3769
|
-
}
|
|
3770
|
-
}
|
|
3771
3792
|
const request = {
|
|
3772
3793
|
'ccy': currency['id'],
|
|
3773
|
-
'chain': network,
|
|
3774
3794
|
};
|
|
3795
|
+
let networkCode = undefined;
|
|
3796
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
3797
|
+
if (networkCode === undefined) {
|
|
3798
|
+
throw new ArgumentsRequired(this.id + ' fetchDepositAddress() requires a "network" parameter');
|
|
3799
|
+
}
|
|
3800
|
+
request['chain'] = this.networkCodeToId(networkCode); // required for on-chain, not required for inter-user transfer
|
|
3775
3801
|
const response = await this.v2PrivateGetAssetsDepositAddress(this.extend(request, params));
|
|
3776
3802
|
//
|
|
3777
3803
|
// {
|
|
@@ -3784,13 +3810,7 @@ export default class coinex extends Exchange {
|
|
|
3784
3810
|
// }
|
|
3785
3811
|
//
|
|
3786
3812
|
const data = this.safeDict(response, 'data', {});
|
|
3787
|
-
|
|
3788
|
-
const options = this.safeDict(this.options, 'fetchDepositAddress', {});
|
|
3789
|
-
const fillResponseFromRequest = this.safeBool(options, 'fillResponseFromRequest', true);
|
|
3790
|
-
if (fillResponseFromRequest) {
|
|
3791
|
-
depositAddress['network'] = this.networkIdToCode(network, currency).toUpperCase();
|
|
3792
|
-
}
|
|
3793
|
-
return depositAddress;
|
|
3813
|
+
return this.parseDepositAddress(data, currency);
|
|
3794
3814
|
}
|
|
3795
3815
|
parseDepositAddress(depositAddress, currency = undefined) {
|
|
3796
3816
|
//
|
|
@@ -4690,8 +4710,6 @@ export default class coinex extends Exchange {
|
|
|
4690
4710
|
this.checkAddress(address);
|
|
4691
4711
|
await this.loadMarkets();
|
|
4692
4712
|
const currency = this.currency(code);
|
|
4693
|
-
const networkCode = this.safeStringUpper2(params, 'network', 'chain');
|
|
4694
|
-
params = this.omit(params, 'network');
|
|
4695
4713
|
if (tag) {
|
|
4696
4714
|
address = address + ':' + tag;
|
|
4697
4715
|
}
|
|
@@ -4700,6 +4718,8 @@ export default class coinex extends Exchange {
|
|
|
4700
4718
|
'to_address': address,
|
|
4701
4719
|
'amount': this.numberToString(amount), // the actual amount without fees, https://www.coinex.com/fees
|
|
4702
4720
|
};
|
|
4721
|
+
let networkCode = undefined;
|
|
4722
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
4703
4723
|
if (networkCode !== undefined) {
|
|
4704
4724
|
request['chain'] = this.networkCodeToId(networkCode); // required for on-chain, not required for inter-user transfer
|
|
4705
4725
|
}
|
|
@@ -4737,6 +4757,7 @@ export default class coinex extends Exchange {
|
|
|
4737
4757
|
const statuses = {
|
|
4738
4758
|
'audit': 'pending',
|
|
4739
4759
|
'pass': 'pending',
|
|
4760
|
+
'audit_required': 'pending',
|
|
4740
4761
|
'processing': 'pending',
|
|
4741
4762
|
'confirming': 'pending',
|
|
4742
4763
|
'not_pass': 'failed',
|
|
@@ -5321,17 +5342,15 @@ export default class coinex extends Exchange {
|
|
|
5321
5342
|
market = this.safeMarket(marketId, market, undefined, 'spot');
|
|
5322
5343
|
const timestamp = this.safeInteger(info, 'expired_at');
|
|
5323
5344
|
return {
|
|
5324
|
-
'
|
|
5345
|
+
'info': info,
|
|
5325
5346
|
'symbol': market['symbol'],
|
|
5326
|
-
'marginMode': 'isolated',
|
|
5327
|
-
'marginType': undefined,
|
|
5328
5347
|
'currency': this.safeCurrencyCode(this.safeString(info, 'ccy')),
|
|
5329
5348
|
'interest': this.safeNumber(info, 'to_repaied_amount'),
|
|
5330
5349
|
'interestRate': this.safeNumber(info, 'daily_interest_rate'),
|
|
5331
5350
|
'amountBorrowed': this.safeNumber(info, 'borrow_amount'),
|
|
5351
|
+
'marginMode': 'isolated',
|
|
5332
5352
|
'timestamp': timestamp,
|
|
5333
5353
|
'datetime': this.iso8601(timestamp),
|
|
5334
|
-
'info': info,
|
|
5335
5354
|
};
|
|
5336
5355
|
}
|
|
5337
5356
|
async borrowIsolatedMargin(symbol, code, amount, params = {}) {
|
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 } 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 } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class digifinex
|
|
5
5
|
* @augments Exchange
|
|
@@ -55,18 +55,8 @@ export default class digifinex extends Exchange {
|
|
|
55
55
|
parseTransfer(transfer: Dict, currency?: Currency): TransferEntry;
|
|
56
56
|
transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
|
|
57
57
|
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
58
|
-
fetchBorrowInterest(code?: Str, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<
|
|
59
|
-
parseBorrowInterest(info: Dict, market?: Market):
|
|
60
|
-
account: string;
|
|
61
|
-
symbol: string;
|
|
62
|
-
currency: string;
|
|
63
|
-
interest: any;
|
|
64
|
-
interestRate: number;
|
|
65
|
-
amountBorrowed: number;
|
|
66
|
-
timestamp: any;
|
|
67
|
-
datetime: any;
|
|
68
|
-
info: Dict;
|
|
69
|
-
};
|
|
58
|
+
fetchBorrowInterest(code?: Str, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<BorrowInterest[]>;
|
|
59
|
+
parseBorrowInterest(info: Dict, market?: Market): BorrowInterest;
|
|
70
60
|
fetchCrossBorrowRate(code: string, params?: {}): Promise<CrossBorrowRate>;
|
|
71
61
|
fetchCrossBorrowRates(params?: {}): Promise<CrossBorrowRates>;
|
|
72
62
|
parseBorrowRate(info: any, currency?: Currency): {
|
package/js/src/digifinex.js
CHANGED
|
@@ -3103,15 +3103,15 @@ export default class digifinex extends Exchange {
|
|
|
3103
3103
|
const currency = (market === undefined) ? undefined : market['base'];
|
|
3104
3104
|
const symbol = this.safeSymbol(marketId, market);
|
|
3105
3105
|
return {
|
|
3106
|
-
'
|
|
3106
|
+
'info': info,
|
|
3107
3107
|
'symbol': symbol,
|
|
3108
3108
|
'currency': currency,
|
|
3109
3109
|
'interest': undefined,
|
|
3110
3110
|
'interestRate': 0.001,
|
|
3111
3111
|
'amountBorrowed': this.parseNumber(amountBorrowed),
|
|
3112
|
+
'marginMode': undefined,
|
|
3112
3113
|
'timestamp': undefined,
|
|
3113
3114
|
'datetime': undefined,
|
|
3114
|
-
'info': info,
|
|
3115
3115
|
};
|
|
3116
3116
|
}
|
|
3117
3117
|
async fetchCrossBorrowRate(code, params = {}) {
|
package/js/src/exmo.js
CHANGED
package/js/src/gate.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/gate.js';
|
|
2
|
-
import type { Int, OrderSide, OrderType, OHLCV, Trade, FundingRateHistory, OpenInterest, Order, Balances, OrderRequest, FundingHistory, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry, Leverage, Leverages, Num, OptionChain, Option, MarginModification, TradingFeeInterface, Currencies, TradingFees, Position, Dict, LeverageTier, LeverageTiers, int, CancellationRequest, LedgerEntry, FundingRate, FundingRates, DepositAddress } from './base/types.js';
|
|
2
|
+
import type { Int, OrderSide, OrderType, OHLCV, Trade, FundingRateHistory, OpenInterest, Order, Balances, OrderRequest, FundingHistory, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry, Leverage, Leverages, Num, OptionChain, Option, MarginModification, TradingFeeInterface, Currencies, TradingFees, Position, Dict, LeverageTier, LeverageTiers, int, CancellationRequest, LedgerEntry, FundingRate, FundingRates, DepositAddress, BorrowInterest } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class gate
|
|
5
5
|
* @augments Exchange
|
|
@@ -198,18 +198,8 @@ export default class gate extends Exchange {
|
|
|
198
198
|
datetime: string;
|
|
199
199
|
info: any;
|
|
200
200
|
};
|
|
201
|
-
fetchBorrowInterest(code?: Str, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<
|
|
202
|
-
parseBorrowInterest(info: Dict, market?: Market):
|
|
203
|
-
info: Dict;
|
|
204
|
-
timestamp: number;
|
|
205
|
-
datetime: string;
|
|
206
|
-
symbol: string;
|
|
207
|
-
currency: string;
|
|
208
|
-
marginMode: string;
|
|
209
|
-
interest: number;
|
|
210
|
-
interestRate: number;
|
|
211
|
-
amountBorrowed: any;
|
|
212
|
-
};
|
|
201
|
+
fetchBorrowInterest(code?: Str, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<BorrowInterest[]>;
|
|
202
|
+
parseBorrowInterest(info: Dict, market?: Market): BorrowInterest;
|
|
213
203
|
sign(path: any, api?: any[], method?: string, params?: {}, headers?: any, body?: any): {
|
|
214
204
|
url: any;
|
|
215
205
|
method: string;
|
package/js/src/gate.js
CHANGED
|
@@ -6491,14 +6491,14 @@ export default class gate extends Exchange {
|
|
|
6491
6491
|
const timestamp = this.safeInteger(info, 'create_time');
|
|
6492
6492
|
return {
|
|
6493
6493
|
'info': info,
|
|
6494
|
-
'timestamp': timestamp,
|
|
6495
|
-
'datetime': this.iso8601(timestamp),
|
|
6496
6494
|
'symbol': this.safeString(market, 'symbol'),
|
|
6497
6495
|
'currency': this.safeCurrencyCode(this.safeString(info, 'currency')),
|
|
6498
|
-
'marginMode': marginMode,
|
|
6499
6496
|
'interest': this.safeNumber(info, 'interest'),
|
|
6500
6497
|
'interestRate': this.safeNumber(info, 'actual_rate'),
|
|
6501
6498
|
'amountBorrowed': undefined,
|
|
6499
|
+
'marginMode': marginMode,
|
|
6500
|
+
'timestamp': timestamp,
|
|
6501
|
+
'datetime': this.iso8601(timestamp),
|
|
6502
6502
|
};
|
|
6503
6503
|
}
|
|
6504
6504
|
sign(path, api = [], method = 'GET', params = {}, headers = undefined, body = undefined) {
|
package/js/src/hitbtc.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ export default class hitbtc extends Exchange {
|
|
|
9
9
|
nonce(): number;
|
|
10
10
|
fetchMarkets(params?: {}): Promise<Market[]>;
|
|
11
11
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
12
|
-
safeNetwork(networkId: any): any;
|
|
13
12
|
createDepositAddress(code: string, params?: {}): Promise<{
|
|
14
13
|
currency: string;
|
|
15
14
|
address: string;
|
package/js/src/hitbtc.js
CHANGED
|
@@ -854,7 +854,8 @@ export default class hitbtc extends Exchange {
|
|
|
854
854
|
for (let j = 0; j < rawNetworks.length; j++) {
|
|
855
855
|
const rawNetwork = rawNetworks[j];
|
|
856
856
|
const networkId = this.safeString2(rawNetwork, 'protocol', 'network');
|
|
857
|
-
|
|
857
|
+
let networkCode = this.networkIdToCode(networkId);
|
|
858
|
+
networkCode = (networkCode !== undefined) ? networkCode.toUpperCase() : undefined;
|
|
858
859
|
fee = this.safeNumber(rawNetwork, 'payout_fee');
|
|
859
860
|
const networkPrecision = this.safeNumber(rawNetwork, 'precision_payout');
|
|
860
861
|
const payinEnabledNetwork = this.safeBool(rawNetwork, 'payin_enabled', false);
|
|
@@ -872,10 +873,10 @@ export default class hitbtc extends Exchange {
|
|
|
872
873
|
else if (!payoutEnabledNetwork) {
|
|
873
874
|
withdrawEnabled = false;
|
|
874
875
|
}
|
|
875
|
-
networks[
|
|
876
|
+
networks[networkCode] = {
|
|
876
877
|
'info': rawNetwork,
|
|
877
878
|
'id': networkId,
|
|
878
|
-
'network':
|
|
879
|
+
'network': networkCode,
|
|
879
880
|
'fee': fee,
|
|
880
881
|
'active': activeNetwork,
|
|
881
882
|
'deposit': payinEnabledNetwork,
|
|
@@ -912,14 +913,6 @@ export default class hitbtc extends Exchange {
|
|
|
912
913
|
}
|
|
913
914
|
return result;
|
|
914
915
|
}
|
|
915
|
-
safeNetwork(networkId) {
|
|
916
|
-
if (networkId === undefined) {
|
|
917
|
-
return undefined;
|
|
918
|
-
}
|
|
919
|
-
else {
|
|
920
|
-
return networkId.toUpperCase();
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
916
|
async createDepositAddress(code, params = {}) {
|
|
924
917
|
/**
|
|
925
918
|
* @method
|
|
@@ -3560,7 +3553,8 @@ export default class hitbtc extends Exchange {
|
|
|
3560
3553
|
for (let j = 0; j < networks.length; j++) {
|
|
3561
3554
|
const networkEntry = networks[j];
|
|
3562
3555
|
const networkId = this.safeString(networkEntry, 'network');
|
|
3563
|
-
|
|
3556
|
+
let networkCode = this.networkIdToCode(networkId);
|
|
3557
|
+
networkCode = (networkCode !== undefined) ? networkCode.toUpperCase() : undefined;
|
|
3564
3558
|
const withdrawFee = this.safeNumber(networkEntry, 'payout_fee');
|
|
3565
3559
|
const isDefault = this.safeValue(networkEntry, 'default');
|
|
3566
3560
|
const withdrawResult = {
|
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 } 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 } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class huobi
|
|
5
5
|
* @augments Exchange
|
|
@@ -119,19 +119,8 @@ export default class htx extends Exchange {
|
|
|
119
119
|
parseFundingInterval(interval: any): string;
|
|
120
120
|
fetchFundingRate(symbol: string, params?: {}): Promise<FundingRate>;
|
|
121
121
|
fetchFundingRates(symbols?: Strings, params?: {}): Promise<FundingRates>;
|
|
122
|
-
fetchBorrowInterest(code?: Str, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<
|
|
123
|
-
parseBorrowInterest(info: Dict, market?: Market):
|
|
124
|
-
account: string;
|
|
125
|
-
symbol: string;
|
|
126
|
-
marginMode: string;
|
|
127
|
-
currency: string;
|
|
128
|
-
interest: number;
|
|
129
|
-
interestRate: number;
|
|
130
|
-
amountBorrowed: number;
|
|
131
|
-
timestamp: number;
|
|
132
|
-
datetime: string;
|
|
133
|
-
info: Dict;
|
|
134
|
-
};
|
|
122
|
+
fetchBorrowInterest(code?: Str, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<BorrowInterest[]>;
|
|
123
|
+
parseBorrowInterest(info: Dict, market?: Market): BorrowInterest;
|
|
135
124
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
136
125
|
url: string;
|
|
137
126
|
method: string;
|