ccxt 4.4.24 → 4.4.25
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 +5 -5
- package/dist/ccxt.browser.min.js +4 -4
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/bitmex.js +8 -7
- package/dist/cjs/src/coinex.js +46 -25
- package/dist/cjs/src/hitbtc.js +6 -12
- package/dist/cjs/src/htx.js +16 -16
- package/dist/cjs/src/woofipro.js +1 -1
- package/dist/cjs/src/xt.js +5 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/bitmex.js +8 -7
- package/js/src/coinex.js +46 -25
- package/js/src/hitbtc.d.ts +0 -1
- package/js/src/hitbtc.js +6 -12
- package/js/src/htx.js +16 -16
- package/js/src/woofipro.js +1 -1
- package/js/src/xt.js +5 -1
- package/package.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -197,7 +197,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
197
197
|
|
|
198
198
|
//-----------------------------------------------------------------------------
|
|
199
199
|
// this is updated by vss.js when building
|
|
200
|
-
const version = '4.4.
|
|
200
|
+
const version = '4.4.25';
|
|
201
201
|
Exchange["default"].ccxtVersion = version;
|
|
202
202
|
const exchanges = {
|
|
203
203
|
'ace': ace,
|
package/dist/cjs/src/bitmex.js
CHANGED
|
@@ -1153,19 +1153,20 @@ class bitmex extends bitmex$1 {
|
|
|
1153
1153
|
// for unrealized pnl and other transactions without a timestamp
|
|
1154
1154
|
timestamp = 0; // see comments above
|
|
1155
1155
|
}
|
|
1156
|
+
let fee = undefined;
|
|
1156
1157
|
let feeCost = this.safeString(item, 'fee');
|
|
1157
1158
|
if (feeCost !== undefined) {
|
|
1158
1159
|
feeCost = this.convertToRealAmount(code, feeCost);
|
|
1160
|
+
fee = {
|
|
1161
|
+
'cost': this.parseNumber(feeCost),
|
|
1162
|
+
'currency': code,
|
|
1163
|
+
};
|
|
1159
1164
|
}
|
|
1160
|
-
const fee = {
|
|
1161
|
-
'cost': this.parseToNumeric(feeCost),
|
|
1162
|
-
'currency': code,
|
|
1163
|
-
};
|
|
1164
1165
|
let after = this.safeString(item, 'walletBalance');
|
|
1165
1166
|
if (after !== undefined) {
|
|
1166
1167
|
after = this.convertToRealAmount(code, after);
|
|
1167
1168
|
}
|
|
1168
|
-
const before = this.
|
|
1169
|
+
const before = this.parseNumber(Precise["default"].stringSub(this.numberToString(after), this.numberToString(amount)));
|
|
1169
1170
|
let direction = undefined;
|
|
1170
1171
|
if (Precise["default"].stringLt(amountString, '0')) {
|
|
1171
1172
|
direction = 'out';
|
|
@@ -1186,9 +1187,9 @@ class bitmex extends bitmex$1 {
|
|
|
1186
1187
|
'referenceAccount': referenceAccount,
|
|
1187
1188
|
'type': type,
|
|
1188
1189
|
'currency': code,
|
|
1189
|
-
'amount': this.
|
|
1190
|
+
'amount': this.parseNumber(amount),
|
|
1190
1191
|
'before': before,
|
|
1191
|
-
'after': this.
|
|
1192
|
+
'after': this.parseNumber(after),
|
|
1192
1193
|
'status': status,
|
|
1193
1194
|
'fee': fee,
|
|
1194
1195
|
}, currency);
|
package/dist/cjs/src/coinex.js
CHANGED
|
@@ -460,9 +460,43 @@ class coinex extends coinex$1 {
|
|
|
460
460
|
'FUTURES': 'swap',
|
|
461
461
|
},
|
|
462
462
|
'networks': {
|
|
463
|
+
'BTC': 'BTC',
|
|
463
464
|
'BEP20': 'BSC',
|
|
464
|
-
'
|
|
465
|
-
'
|
|
465
|
+
'TRC20': 'TRC20',
|
|
466
|
+
'ERC20': 'ERC20',
|
|
467
|
+
'BRC20': 'BRC20',
|
|
468
|
+
'SOL': 'SOL',
|
|
469
|
+
'TON': 'SOL',
|
|
470
|
+
'BSV': 'BSV',
|
|
471
|
+
'AVAXC': 'AVA_C',
|
|
472
|
+
'AVAXX': 'AVA',
|
|
473
|
+
'SUI': 'SUI',
|
|
474
|
+
'ACA': 'ACA',
|
|
475
|
+
'CHZ': 'CHILIZ',
|
|
476
|
+
'ADA': 'ADA',
|
|
477
|
+
'ARB': 'ARBITRUM',
|
|
478
|
+
'ARBNOVA': 'ARBITRUM_NOVA',
|
|
479
|
+
'OP': 'OPTIMISM',
|
|
480
|
+
'APT': 'APTOS',
|
|
481
|
+
'ATOM': 'ATOM',
|
|
482
|
+
'FTM': 'FTM',
|
|
483
|
+
'BCH': 'BCH',
|
|
484
|
+
'ASTR': 'ASTR',
|
|
485
|
+
'LTC': 'LTC',
|
|
486
|
+
'MATIC': 'MATIC',
|
|
487
|
+
'CRONOS': 'CRONOS',
|
|
488
|
+
'DASH': 'DASH',
|
|
489
|
+
'DOT': 'DOT',
|
|
490
|
+
'ETC': 'ETC',
|
|
491
|
+
'ETHW': 'ETHPOW',
|
|
492
|
+
'FIL': 'FIL',
|
|
493
|
+
'ZIL': 'ZIL',
|
|
494
|
+
'DOGE': 'DOGE',
|
|
495
|
+
'TIA': 'CELESTIA',
|
|
496
|
+
'SEI': 'SEI',
|
|
497
|
+
'XRP': 'XRP',
|
|
498
|
+
'XMR': 'XMR',
|
|
499
|
+
// 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
|
|
466
500
|
},
|
|
467
501
|
},
|
|
468
502
|
'commonCurrencies': {
|
|
@@ -3752,23 +3786,15 @@ class coinex extends coinex$1 {
|
|
|
3752
3786
|
*/
|
|
3753
3787
|
await this.loadMarkets();
|
|
3754
3788
|
const currency = this.currency(code);
|
|
3755
|
-
const networks = this.safeDict(currency, 'networks', {});
|
|
3756
|
-
const network = this.safeString2(params, 'network', 'chain');
|
|
3757
|
-
params = this.omit(params, 'network');
|
|
3758
|
-
const networksKeys = Object.keys(networks);
|
|
3759
|
-
const numOfNetworks = networksKeys.length;
|
|
3760
|
-
if (networks !== undefined && numOfNetworks > 1) {
|
|
3761
|
-
if (network === undefined) {
|
|
3762
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchDepositAddress() ' + code + ' requires a network parameter');
|
|
3763
|
-
}
|
|
3764
|
-
if (!(network in networks)) {
|
|
3765
|
-
throw new errors.ExchangeError(this.id + ' fetchDepositAddress() ' + network + ' network not supported for ' + code);
|
|
3766
|
-
}
|
|
3767
|
-
}
|
|
3768
3789
|
const request = {
|
|
3769
3790
|
'ccy': currency['id'],
|
|
3770
|
-
'chain': network,
|
|
3771
3791
|
};
|
|
3792
|
+
let networkCode = undefined;
|
|
3793
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
3794
|
+
if (networkCode === undefined) {
|
|
3795
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchDepositAddress() requires a "network" parameter');
|
|
3796
|
+
}
|
|
3797
|
+
request['chain'] = this.networkCodeToId(networkCode); // required for on-chain, not required for inter-user transfer
|
|
3772
3798
|
const response = await this.v2PrivateGetAssetsDepositAddress(this.extend(request, params));
|
|
3773
3799
|
//
|
|
3774
3800
|
// {
|
|
@@ -3781,13 +3807,7 @@ class coinex extends coinex$1 {
|
|
|
3781
3807
|
// }
|
|
3782
3808
|
//
|
|
3783
3809
|
const data = this.safeDict(response, 'data', {});
|
|
3784
|
-
|
|
3785
|
-
const options = this.safeDict(this.options, 'fetchDepositAddress', {});
|
|
3786
|
-
const fillResponseFromRequest = this.safeBool(options, 'fillResponseFromRequest', true);
|
|
3787
|
-
if (fillResponseFromRequest) {
|
|
3788
|
-
depositAddress['network'] = this.networkIdToCode(network, currency).toUpperCase();
|
|
3789
|
-
}
|
|
3790
|
-
return depositAddress;
|
|
3810
|
+
return this.parseDepositAddress(data, currency);
|
|
3791
3811
|
}
|
|
3792
3812
|
parseDepositAddress(depositAddress, currency = undefined) {
|
|
3793
3813
|
//
|
|
@@ -4687,8 +4707,6 @@ class coinex extends coinex$1 {
|
|
|
4687
4707
|
this.checkAddress(address);
|
|
4688
4708
|
await this.loadMarkets();
|
|
4689
4709
|
const currency = this.currency(code);
|
|
4690
|
-
const networkCode = this.safeStringUpper2(params, 'network', 'chain');
|
|
4691
|
-
params = this.omit(params, 'network');
|
|
4692
4710
|
if (tag) {
|
|
4693
4711
|
address = address + ':' + tag;
|
|
4694
4712
|
}
|
|
@@ -4697,6 +4715,8 @@ class coinex extends coinex$1 {
|
|
|
4697
4715
|
'to_address': address,
|
|
4698
4716
|
'amount': this.numberToString(amount), // the actual amount without fees, https://www.coinex.com/fees
|
|
4699
4717
|
};
|
|
4718
|
+
let networkCode = undefined;
|
|
4719
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
4700
4720
|
if (networkCode !== undefined) {
|
|
4701
4721
|
request['chain'] = this.networkCodeToId(networkCode); // required for on-chain, not required for inter-user transfer
|
|
4702
4722
|
}
|
|
@@ -4734,6 +4754,7 @@ class coinex extends coinex$1 {
|
|
|
4734
4754
|
const statuses = {
|
|
4735
4755
|
'audit': 'pending',
|
|
4736
4756
|
'pass': 'pending',
|
|
4757
|
+
'audit_required': 'pending',
|
|
4737
4758
|
'processing': 'pending',
|
|
4738
4759
|
'confirming': 'pending',
|
|
4739
4760
|
'not_pass': 'failed',
|
package/dist/cjs/src/hitbtc.js
CHANGED
|
@@ -851,7 +851,8 @@ class hitbtc extends hitbtc$1 {
|
|
|
851
851
|
for (let j = 0; j < rawNetworks.length; j++) {
|
|
852
852
|
const rawNetwork = rawNetworks[j];
|
|
853
853
|
const networkId = this.safeString2(rawNetwork, 'protocol', 'network');
|
|
854
|
-
|
|
854
|
+
let networkCode = this.networkIdToCode(networkId);
|
|
855
|
+
networkCode = (networkCode !== undefined) ? networkCode.toUpperCase() : undefined;
|
|
855
856
|
fee = this.safeNumber(rawNetwork, 'payout_fee');
|
|
856
857
|
const networkPrecision = this.safeNumber(rawNetwork, 'precision_payout');
|
|
857
858
|
const payinEnabledNetwork = this.safeBool(rawNetwork, 'payin_enabled', false);
|
|
@@ -869,10 +870,10 @@ class hitbtc extends hitbtc$1 {
|
|
|
869
870
|
else if (!payoutEnabledNetwork) {
|
|
870
871
|
withdrawEnabled = false;
|
|
871
872
|
}
|
|
872
|
-
networks[
|
|
873
|
+
networks[networkCode] = {
|
|
873
874
|
'info': rawNetwork,
|
|
874
875
|
'id': networkId,
|
|
875
|
-
'network':
|
|
876
|
+
'network': networkCode,
|
|
876
877
|
'fee': fee,
|
|
877
878
|
'active': activeNetwork,
|
|
878
879
|
'deposit': payinEnabledNetwork,
|
|
@@ -909,14 +910,6 @@ class hitbtc extends hitbtc$1 {
|
|
|
909
910
|
}
|
|
910
911
|
return result;
|
|
911
912
|
}
|
|
912
|
-
safeNetwork(networkId) {
|
|
913
|
-
if (networkId === undefined) {
|
|
914
|
-
return undefined;
|
|
915
|
-
}
|
|
916
|
-
else {
|
|
917
|
-
return networkId.toUpperCase();
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
913
|
async createDepositAddress(code, params = {}) {
|
|
921
914
|
/**
|
|
922
915
|
* @method
|
|
@@ -3557,7 +3550,8 @@ class hitbtc extends hitbtc$1 {
|
|
|
3557
3550
|
for (let j = 0; j < networks.length; j++) {
|
|
3558
3551
|
const networkEntry = networks[j];
|
|
3559
3552
|
const networkId = this.safeString(networkEntry, 'network');
|
|
3560
|
-
|
|
3553
|
+
let networkCode = this.networkIdToCode(networkId);
|
|
3554
|
+
networkCode = (networkCode !== undefined) ? networkCode.toUpperCase() : undefined;
|
|
3561
3555
|
const withdrawFee = this.safeNumber(networkEntry, 'payout_fee');
|
|
3562
3556
|
const isDefault = this.safeValue(networkEntry, 'default');
|
|
3563
3557
|
const withdrawResult = {
|
package/dist/cjs/src/htx.js
CHANGED
|
@@ -5253,17 +5253,17 @@ class htx extends htx$1 {
|
|
|
5253
5253
|
let orderType = type.replace('buy-', '');
|
|
5254
5254
|
orderType = orderType.replace('sell-', '');
|
|
5255
5255
|
const options = this.safeValue(this.options, market['type'], {});
|
|
5256
|
-
const
|
|
5257
|
-
if (
|
|
5256
|
+
const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'stop-price']);
|
|
5257
|
+
if (triggerPrice === undefined) {
|
|
5258
5258
|
const stopOrderTypes = this.safeValue(options, 'stopOrderTypes', {});
|
|
5259
5259
|
if (orderType in stopOrderTypes) {
|
|
5260
|
-
throw new errors.ArgumentsRequired(this.id + ' createOrder() requires a
|
|
5260
|
+
throw new errors.ArgumentsRequired(this.id + ' createOrder() requires a triggerPrice for a stop order');
|
|
5261
5261
|
}
|
|
5262
5262
|
}
|
|
5263
5263
|
else {
|
|
5264
5264
|
const defaultOperator = (side === 'sell') ? 'lte' : 'gte';
|
|
5265
5265
|
const stopOperator = this.safeString(params, 'operator', defaultOperator);
|
|
5266
|
-
request['stop-price'] = this.priceToPrecision(symbol,
|
|
5266
|
+
request['stop-price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
5267
5267
|
request['operator'] = stopOperator;
|
|
5268
5268
|
if ((orderType === 'limit') || (orderType === 'limit-fok')) {
|
|
5269
5269
|
orderType = 'stop-' + orderType;
|
|
@@ -5340,7 +5340,7 @@ class htx extends htx$1 {
|
|
|
5340
5340
|
if (orderType in limitOrderTypes) {
|
|
5341
5341
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
5342
5342
|
}
|
|
5343
|
-
params = this.omit(params, ['stopPrice', 'stop-price', 'clientOrderId', 'client-order-id', 'operator', 'timeInForce']);
|
|
5343
|
+
params = this.omit(params, ['triggerPrice', 'stopPrice', 'stop-price', 'clientOrderId', 'client-order-id', 'operator', 'timeInForce']);
|
|
5344
5344
|
return this.extend(request, params);
|
|
5345
5345
|
}
|
|
5346
5346
|
createContractOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
|
|
@@ -5378,16 +5378,16 @@ class htx extends htx$1 {
|
|
|
5378
5378
|
else if (timeInForce === 'IOC') {
|
|
5379
5379
|
type = 'ioc';
|
|
5380
5380
|
}
|
|
5381
|
-
const triggerPrice = this.
|
|
5381
|
+
const triggerPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'trigger_price']);
|
|
5382
5382
|
const stopLossTriggerPrice = this.safeNumber2(params, 'stopLossPrice', 'sl_trigger_price');
|
|
5383
5383
|
const takeProfitTriggerPrice = this.safeNumber2(params, 'takeProfitPrice', 'tp_trigger_price');
|
|
5384
5384
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callback_rate');
|
|
5385
5385
|
const trailingTriggerPrice = this.safeNumber(params, 'trailingTriggerPrice', price);
|
|
5386
5386
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
5387
|
-
const
|
|
5387
|
+
const isTrigger = triggerPrice !== undefined;
|
|
5388
5388
|
const isStopLossTriggerOrder = stopLossTriggerPrice !== undefined;
|
|
5389
5389
|
const isTakeProfitTriggerOrder = takeProfitTriggerPrice !== undefined;
|
|
5390
|
-
if (
|
|
5390
|
+
if (isTrigger) {
|
|
5391
5391
|
const triggerType = this.safeString2(params, 'triggerType', 'trigger_type', 'le');
|
|
5392
5392
|
request['trigger_type'] = triggerType;
|
|
5393
5393
|
request['trigger_price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
@@ -5440,7 +5440,7 @@ class htx extends htx$1 {
|
|
|
5440
5440
|
const broker = this.safeValue(this.options, 'broker', {});
|
|
5441
5441
|
const brokerId = this.safeString(broker, 'id');
|
|
5442
5442
|
request['channel_code'] = brokerId;
|
|
5443
|
-
params = this.omit(params, ['reduceOnly', 'stopPrice', 'stopLossPrice', 'takeProfitPrice', 'triggerType', 'leverRate', 'timeInForce', 'leverage', 'trailingPercent', 'trailingTriggerPrice']);
|
|
5443
|
+
params = this.omit(params, ['reduceOnly', 'triggerPrice', 'stopPrice', 'stopLossPrice', 'takeProfitPrice', 'triggerType', 'leverRate', 'timeInForce', 'leverage', 'trailingPercent', 'trailingTriggerPrice']);
|
|
5444
5444
|
return this.extend(request, params);
|
|
5445
5445
|
}
|
|
5446
5446
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
@@ -5463,7 +5463,7 @@ class htx extends htx$1 {
|
|
|
5463
5463
|
* @param {float} amount how much you want to trade in units of the base currency
|
|
5464
5464
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5465
5465
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5466
|
-
* @param {float} [params.
|
|
5466
|
+
* @param {float} [params.triggerPrice] the price a trigger order is triggered at
|
|
5467
5467
|
* @param {string} [params.triggerType] *contract trigger orders only* ge: greater than or equal to, le: less than or equal to
|
|
5468
5468
|
* @param {float} [params.stopLossPrice] *contract only* the price a stop-loss order is triggered at
|
|
5469
5469
|
* @param {float} [params.takeProfitPrice] *contract only* the price a take-profit order is triggered at
|
|
@@ -5479,12 +5479,12 @@ class htx extends htx$1 {
|
|
|
5479
5479
|
*/
|
|
5480
5480
|
await this.loadMarkets();
|
|
5481
5481
|
const market = this.market(symbol);
|
|
5482
|
-
const triggerPrice = this.
|
|
5482
|
+
const triggerPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'trigger_price']);
|
|
5483
5483
|
const stopLossTriggerPrice = this.safeNumber2(params, 'stopLossPrice', 'sl_trigger_price');
|
|
5484
5484
|
const takeProfitTriggerPrice = this.safeNumber2(params, 'takeProfitPrice', 'tp_trigger_price');
|
|
5485
5485
|
const trailingPercent = this.safeNumber(params, 'trailingPercent');
|
|
5486
5486
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
5487
|
-
const
|
|
5487
|
+
const isTrigger = triggerPrice !== undefined;
|
|
5488
5488
|
const isStopLossTriggerOrder = stopLossTriggerPrice !== undefined;
|
|
5489
5489
|
const isTakeProfitTriggerOrder = takeProfitTriggerPrice !== undefined;
|
|
5490
5490
|
let response = undefined;
|
|
@@ -5502,7 +5502,7 @@ class htx extends htx$1 {
|
|
|
5502
5502
|
[marginMode, contractRequest] = this.handleMarginModeAndParams('createOrder', contractRequest);
|
|
5503
5503
|
marginMode = (marginMode === undefined) ? 'cross' : marginMode;
|
|
5504
5504
|
if (marginMode === 'isolated') {
|
|
5505
|
-
if (
|
|
5505
|
+
if (isTrigger) {
|
|
5506
5506
|
response = await this.contractPrivatePostLinearSwapApiV1SwapTriggerOrder(contractRequest);
|
|
5507
5507
|
}
|
|
5508
5508
|
else if (isStopLossTriggerOrder || isTakeProfitTriggerOrder) {
|
|
@@ -5516,7 +5516,7 @@ class htx extends htx$1 {
|
|
|
5516
5516
|
}
|
|
5517
5517
|
}
|
|
5518
5518
|
else if (marginMode === 'cross') {
|
|
5519
|
-
if (
|
|
5519
|
+
if (isTrigger) {
|
|
5520
5520
|
response = await this.contractPrivatePostLinearSwapApiV1SwapCrossTriggerOrder(contractRequest);
|
|
5521
5521
|
}
|
|
5522
5522
|
else if (isStopLossTriggerOrder || isTakeProfitTriggerOrder) {
|
|
@@ -5536,7 +5536,7 @@ class htx extends htx$1 {
|
|
|
5536
5536
|
throw new errors.ArgumentsRequired(this.id + ' createOrder () requires an extra parameter params["offset"] to be set to "open" or "close" when placing orders in inverse markets');
|
|
5537
5537
|
}
|
|
5538
5538
|
if (market['swap']) {
|
|
5539
|
-
if (
|
|
5539
|
+
if (isTrigger) {
|
|
5540
5540
|
response = await this.contractPrivatePostSwapApiV1SwapTriggerOrder(contractRequest);
|
|
5541
5541
|
}
|
|
5542
5542
|
else if (isStopLossTriggerOrder || isTakeProfitTriggerOrder) {
|
|
@@ -5550,7 +5550,7 @@ class htx extends htx$1 {
|
|
|
5550
5550
|
}
|
|
5551
5551
|
}
|
|
5552
5552
|
else if (market['future']) {
|
|
5553
|
-
if (
|
|
5553
|
+
if (isTrigger) {
|
|
5554
5554
|
response = await this.contractPrivatePostApiV1ContractTriggerOrder(contractRequest);
|
|
5555
5555
|
}
|
|
5556
5556
|
else if (isStopLossTriggerOrder || isTakeProfitTriggerOrder) {
|
package/dist/cjs/src/woofipro.js
CHANGED
|
@@ -126,7 +126,7 @@ class woofipro extends woofipro$1 {
|
|
|
126
126
|
'1y': '1y',
|
|
127
127
|
},
|
|
128
128
|
'urls': {
|
|
129
|
-
'logo': 'https://github.com/
|
|
129
|
+
'logo': 'https://github.com/user-attachments/assets/9ba21b8a-a9c7-4770-b7f1-ce3bcbde68c1',
|
|
130
130
|
'api': {
|
|
131
131
|
'public': 'https://api-evm.orderly.org',
|
|
132
132
|
'private': 'https://api-evm.orderly.org',
|
package/dist/cjs/src/xt.js
CHANGED
|
@@ -1744,6 +1744,10 @@ class xt extends xt$1 {
|
|
|
1744
1744
|
market = this.safeMarket(marketId, market, '_', marketType);
|
|
1745
1745
|
const symbol = market['symbol'];
|
|
1746
1746
|
const timestamp = this.safeInteger(ticker, 't');
|
|
1747
|
+
let percentage = this.safeString2(ticker, 'cr', 'r');
|
|
1748
|
+
if (percentage !== undefined) {
|
|
1749
|
+
percentage = Precise["default"].stringMul(percentage, '100');
|
|
1750
|
+
}
|
|
1747
1751
|
return this.safeTicker({
|
|
1748
1752
|
'symbol': symbol,
|
|
1749
1753
|
'timestamp': timestamp,
|
|
@@ -1760,7 +1764,7 @@ class xt extends xt$1 {
|
|
|
1760
1764
|
'last': this.safeString(ticker, 'c'),
|
|
1761
1765
|
'previousClose': undefined,
|
|
1762
1766
|
'change': this.safeNumber(ticker, 'cv'),
|
|
1763
|
-
'percentage': this.
|
|
1767
|
+
'percentage': this.parseNumber(percentage),
|
|
1764
1768
|
'average': undefined,
|
|
1765
1769
|
'baseVolume': undefined,
|
|
1766
1770
|
'quoteVolume': this.safeNumber2(ticker, 'a', 'v'),
|
package/js/ccxt.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
|
|
|
4
4
|
import * as errors from './src/base/errors.js';
|
|
5
5
|
import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarketMarginModes, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, LongShortRatio } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.4.
|
|
7
|
+
declare const version = "4.4.24";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
package/js/ccxt.js
CHANGED
|
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
|
|
|
38
38
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.4.
|
|
41
|
+
const version = '4.4.25';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
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/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',
|
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 = {
|