ccxt 4.3.45 → 4.3.46
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 +127 -127
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +1 -0
- package/dist/cjs/src/binance.js +2 -0
- package/dist/cjs/src/bingx.js +25 -17
- package/dist/cjs/src/bitmart.js +5 -0
- package/dist/cjs/src/bitteam.js +5 -7
- package/dist/cjs/src/coinmetro.js +8 -17
- package/dist/cjs/src/hyperliquid.js +29 -21
- package/dist/cjs/src/idex.js +1 -0
- package/dist/cjs/src/mexc.js +8 -6
- package/dist/cjs/src/okx.js +1 -0
- package/dist/cjs/src/oxfun.js +2 -2
- package/dist/cjs/src/pro/binanceus.js +0 -8
- package/dist/cjs/src/tokocrypto.js +8 -10
- package/dist/cjs/src/wavesexchange.js +1 -0
- package/dist/cjs/src/woofipro.js +1 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/binance.d.ts +2 -0
- package/js/src/abstract/binancecoinm.d.ts +2 -0
- package/js/src/abstract/binanceus.d.ts +2 -0
- package/js/src/abstract/binanceusdm.d.ts +2 -0
- package/js/src/abstract/mexc.d.ts +2 -0
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +1 -0
- package/js/src/binance.js +2 -0
- package/js/src/bingx.js +26 -18
- package/js/src/bitmart.js +5 -0
- package/js/src/bitteam.js +6 -8
- package/js/src/coinmetro.js +9 -18
- package/js/src/hyperliquid.d.ts +3 -3
- package/js/src/hyperliquid.js +29 -21
- package/js/src/idex.js +1 -0
- package/js/src/mexc.js +8 -6
- package/js/src/okx.js +1 -0
- package/js/src/oxfun.js +2 -2
- package/js/src/pro/binanceus.js +0 -8
- package/js/src/tokocrypto.js +9 -11
- package/js/src/wavesexchange.js +1 -0
- package/js/src/woofipro.js +1 -0
- package/package.json +1 -1
package/js/src/binance.js
CHANGED
package/js/src/bingx.js
CHANGED
|
@@ -9,7 +9,7 @@ import Exchange from './abstract/bingx.js';
|
|
|
9
9
|
import { AuthenticationError, PermissionDenied, AccountSuspended, ExchangeError, InsufficientFunds, BadRequest, OrderNotFound, DDoSProtection, BadSymbol, ArgumentsRequired, NotSupported, OperationFailed } from './base/errors.js';
|
|
10
10
|
import { Precise } from './base/Precise.js';
|
|
11
11
|
import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
|
|
12
|
-
import {
|
|
12
|
+
import { TICK_SIZE } from './base/functions/number.js';
|
|
13
13
|
// ---------------------------------------------------------------------------
|
|
14
14
|
/**
|
|
15
15
|
* @class bingx
|
|
@@ -388,7 +388,7 @@ export default class bingx extends Exchange {
|
|
|
388
388
|
'1w': '1w',
|
|
389
389
|
'1M': '1M',
|
|
390
390
|
},
|
|
391
|
-
'precisionMode':
|
|
391
|
+
'precisionMode': TICK_SIZE,
|
|
392
392
|
'exceptions': {
|
|
393
393
|
'exact': {
|
|
394
394
|
'400': BadRequest,
|
|
@@ -613,18 +613,26 @@ export default class bingx extends Exchange {
|
|
|
613
613
|
// "msg": "",
|
|
614
614
|
// "data": [
|
|
615
615
|
// {
|
|
616
|
-
//
|
|
617
|
-
//
|
|
618
|
-
//
|
|
619
|
-
//
|
|
620
|
-
//
|
|
621
|
-
//
|
|
622
|
-
//
|
|
623
|
-
//
|
|
624
|
-
//
|
|
625
|
-
//
|
|
626
|
-
//
|
|
627
|
-
//
|
|
616
|
+
// "contractId": "100",
|
|
617
|
+
// "symbol": "BTC-USDT",
|
|
618
|
+
// "size": "0.0001",
|
|
619
|
+
// "quantityPrecision": "4",
|
|
620
|
+
// "pricePrecision": "1",
|
|
621
|
+
// "feeRate": "0.0005",
|
|
622
|
+
// "makerFeeRate": "0.0002",
|
|
623
|
+
// "takerFeeRate": "0.0005",
|
|
624
|
+
// "tradeMinLimit": "0",
|
|
625
|
+
// "tradeMinQuantity": "0.0001",
|
|
626
|
+
// "tradeMinUSDT": "2",
|
|
627
|
+
// "maxLongLeverage": "125",
|
|
628
|
+
// "maxShortLeverage": "125",
|
|
629
|
+
// "currency": "USDT",
|
|
630
|
+
// "asset": "BTC",
|
|
631
|
+
// "status": "1",
|
|
632
|
+
// "apiStateOpen": "true",
|
|
633
|
+
// "apiStateClose": "true",
|
|
634
|
+
// "ensureTrigger": true,
|
|
635
|
+
// "triggerFeeRate": "0.00020000"
|
|
628
636
|
// },
|
|
629
637
|
// ...
|
|
630
638
|
// ]
|
|
@@ -642,13 +650,13 @@ export default class bingx extends Exchange {
|
|
|
642
650
|
const quote = this.safeCurrencyCode(quoteId);
|
|
643
651
|
const currency = this.safeString(market, 'currency');
|
|
644
652
|
const settle = this.safeCurrencyCode(currency);
|
|
645
|
-
let pricePrecision = this.
|
|
653
|
+
let pricePrecision = this.safeNumber(market, 'tickSize');
|
|
646
654
|
if (pricePrecision === undefined) {
|
|
647
|
-
pricePrecision = this.
|
|
655
|
+
pricePrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'pricePrecision')));
|
|
648
656
|
}
|
|
649
|
-
let quantityPrecision = this.
|
|
657
|
+
let quantityPrecision = this.safeNumber(market, 'stepSize');
|
|
650
658
|
if (quantityPrecision === undefined) {
|
|
651
|
-
quantityPrecision = this.
|
|
659
|
+
quantityPrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'quantityPrecision')));
|
|
652
660
|
}
|
|
653
661
|
const type = (settle !== undefined) ? 'swap' : 'spot';
|
|
654
662
|
const spot = type === 'spot';
|
package/js/src/bitmart.js
CHANGED
|
@@ -2743,6 +2743,11 @@ export default class bitmart extends Exchange {
|
|
|
2743
2743
|
if (ioc) {
|
|
2744
2744
|
request['type'] = 'ioc';
|
|
2745
2745
|
}
|
|
2746
|
+
const clientOrderId = this.safeString(params, 'clientOrderId');
|
|
2747
|
+
if (clientOrderId !== undefined) {
|
|
2748
|
+
params = this.omit(params, 'clientOrderId');
|
|
2749
|
+
request['client_order_id'] = clientOrderId;
|
|
2750
|
+
}
|
|
2746
2751
|
return this.extend(request, params);
|
|
2747
2752
|
}
|
|
2748
2753
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
package/js/src/bitteam.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
import Exchange from './abstract/bitteam.js';
|
|
9
9
|
import { ArgumentsRequired, AuthenticationError, BadRequest, BadSymbol, ExchangeError, ExchangeNotAvailable, InsufficientFunds, OrderNotFound } from './base/errors.js';
|
|
10
|
-
import {
|
|
10
|
+
import { TICK_SIZE } from './base/functions/number.js';
|
|
11
11
|
import { Precise } from './base/Precise.js';
|
|
12
12
|
// ---------------------------------------------------------------------------
|
|
13
13
|
/**
|
|
@@ -193,7 +193,7 @@ export default class bitteam extends Exchange {
|
|
|
193
193
|
'maker': this.parseNumber('0.002'),
|
|
194
194
|
},
|
|
195
195
|
},
|
|
196
|
-
'precisionMode':
|
|
196
|
+
'precisionMode': TICK_SIZE,
|
|
197
197
|
// exchange-specific options
|
|
198
198
|
'options': {
|
|
199
199
|
'networksById': {
|
|
@@ -354,8 +354,6 @@ export default class bitteam extends Exchange {
|
|
|
354
354
|
const base = this.safeCurrencyCode(baseId);
|
|
355
355
|
const quote = this.safeCurrencyCode(quoteId);
|
|
356
356
|
const active = this.safeValue(market, 'active');
|
|
357
|
-
const amountPrecision = this.safeInteger(market, 'baseStep');
|
|
358
|
-
const pricePrecision = this.safeInteger(market, 'quoteStep');
|
|
359
357
|
const timeStart = this.safeString(market, 'timeStart');
|
|
360
358
|
const created = this.parse8601(timeStart);
|
|
361
359
|
let minCost = undefined;
|
|
@@ -391,8 +389,8 @@ export default class bitteam extends Exchange {
|
|
|
391
389
|
'strike': undefined,
|
|
392
390
|
'optionType': undefined,
|
|
393
391
|
'precision': {
|
|
394
|
-
'amount':
|
|
395
|
-
'price':
|
|
392
|
+
'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'baseStep'))),
|
|
393
|
+
'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'quoteStep'))),
|
|
396
394
|
},
|
|
397
395
|
'limits': {
|
|
398
396
|
'leverage': {
|
|
@@ -548,7 +546,7 @@ export default class bitteam extends Exchange {
|
|
|
548
546
|
const numericId = this.safeInteger(currency, 'id');
|
|
549
547
|
const code = this.safeCurrencyCode(id);
|
|
550
548
|
const active = this.safeBool(currency, 'active', false);
|
|
551
|
-
const precision = this.
|
|
549
|
+
const precision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'precision')));
|
|
552
550
|
const txLimits = this.safeValue(currency, 'txLimits', {});
|
|
553
551
|
const minWithdraw = this.safeString(txLimits, 'minWithdraw');
|
|
554
552
|
const maxWithdraw = this.safeString(txLimits, 'maxWithdraw');
|
|
@@ -570,7 +568,7 @@ export default class bitteam extends Exchange {
|
|
|
570
568
|
const withdraw = this.safeValue(statuses, 'withdrawStatus');
|
|
571
569
|
const networkIds = Object.keys(feesByNetworkId);
|
|
572
570
|
const networks = {};
|
|
573
|
-
const networkPrecision = this.
|
|
571
|
+
const networkPrecision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals')));
|
|
574
572
|
for (let j = 0; j < networkIds.length; j++) {
|
|
575
573
|
const networkId = networkIds[j];
|
|
576
574
|
const networkCode = this.networkIdToCode(networkId, code);
|
package/js/src/coinmetro.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
import Exchange from './abstract/coinmetro.js';
|
|
9
9
|
import { ArgumentsRequired, BadRequest, BadSymbol, InsufficientFunds, InvalidOrder, ExchangeError, OrderNotFound, PermissionDenied, RateLimitExceeded } from './base/errors.js';
|
|
10
|
-
import {
|
|
10
|
+
import { TICK_SIZE } from './base/functions/number.js';
|
|
11
11
|
import { Precise } from './base/Precise.js';
|
|
12
12
|
// ---------------------------------------------------------------------------
|
|
13
13
|
/**
|
|
@@ -208,7 +208,7 @@ export default class coinmetro extends Exchange {
|
|
|
208
208
|
'maker': this.parseNumber('0'),
|
|
209
209
|
},
|
|
210
210
|
},
|
|
211
|
-
'precisionMode':
|
|
211
|
+
'precisionMode': TICK_SIZE,
|
|
212
212
|
// exchange-specific options
|
|
213
213
|
'options': {
|
|
214
214
|
'currenciesByIdForParseMarket': undefined,
|
|
@@ -312,7 +312,6 @@ export default class coinmetro extends Exchange {
|
|
|
312
312
|
const deposit = this.safeValue(currency, 'canDeposit');
|
|
313
313
|
const canTrade = this.safeValue(currency, 'canTrade');
|
|
314
314
|
const active = canTrade ? withdraw : true;
|
|
315
|
-
const precision = this.safeInteger(currency, 'digits');
|
|
316
315
|
const minAmount = this.safeNumber(currency, 'minQty');
|
|
317
316
|
result[code] = this.safeCurrencyStructure({
|
|
318
317
|
'id': id,
|
|
@@ -323,7 +322,7 @@ export default class coinmetro extends Exchange {
|
|
|
323
322
|
'deposit': deposit,
|
|
324
323
|
'withdraw': withdraw,
|
|
325
324
|
'fee': undefined,
|
|
326
|
-
'precision':
|
|
325
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'digits'))),
|
|
327
326
|
'limits': {
|
|
328
327
|
'amount': { 'min': minAmount, 'max': undefined },
|
|
329
328
|
'withdraw': { 'min': undefined, 'max': undefined },
|
|
@@ -354,19 +353,14 @@ export default class coinmetro extends Exchange {
|
|
|
354
353
|
//
|
|
355
354
|
// [
|
|
356
355
|
// {
|
|
357
|
-
// "pair": "
|
|
358
|
-
// "precision": 5,
|
|
359
|
-
// "margin": false
|
|
360
|
-
// },
|
|
361
|
-
// {
|
|
362
|
-
// "pair": "PERPUSD",
|
|
356
|
+
// "pair": "YFIEUR",
|
|
363
357
|
// "precision": 5,
|
|
364
358
|
// "margin": false
|
|
365
359
|
// },
|
|
366
360
|
// {
|
|
367
|
-
// "pair": "
|
|
368
|
-
// "precision":
|
|
369
|
-
// "margin":
|
|
361
|
+
// "pair": "BTCEUR",
|
|
362
|
+
// "precision": 2,
|
|
363
|
+
// "margin": true
|
|
370
364
|
// },
|
|
371
365
|
// ...
|
|
372
366
|
// ]
|
|
@@ -412,9 +406,7 @@ export default class coinmetro extends Exchange {
|
|
|
412
406
|
'optionType': undefined,
|
|
413
407
|
'precision': {
|
|
414
408
|
'amount': basePrecisionAndLimits['precision'],
|
|
415
|
-
'price':
|
|
416
|
-
'base': basePrecisionAndLimits['precision'],
|
|
417
|
-
'quote': quotePrecisionAndLimits['precision'],
|
|
409
|
+
'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'precision'))),
|
|
418
410
|
},
|
|
419
411
|
'limits': {
|
|
420
412
|
'leverage': {
|
|
@@ -469,12 +461,11 @@ export default class coinmetro extends Exchange {
|
|
|
469
461
|
parseMarketPrecisionAndLimits(currencyId) {
|
|
470
462
|
const currencies = this.safeValue(this.options, 'currenciesByIdForParseMarket', {});
|
|
471
463
|
const currency = this.safeValue(currencies, currencyId, {});
|
|
472
|
-
const precision = this.safeInteger(currency, 'precision');
|
|
473
464
|
const limits = this.safeValue(currency, 'limits', {});
|
|
474
465
|
const amountLimits = this.safeValue(limits, 'amount', {});
|
|
475
466
|
const minLimit = this.safeNumber(amountLimits, 'min');
|
|
476
467
|
const result = {
|
|
477
|
-
'precision': precision,
|
|
468
|
+
'precision': this.safeNumber(currency, 'precision'),
|
|
478
469
|
'minLimit': minLimit,
|
|
479
470
|
};
|
|
480
471
|
return result;
|
package/js/src/hyperliquid.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/hyperliquid.js';
|
|
2
|
-
import type { Market, TransferEntry, Balances, Int, OrderBook, OHLCV, Str, FundingRateHistory, Order, OrderType, OrderSide, Trade, Strings, Position, OrderRequest, Dict, Num, MarginModification, Currencies, CancellationRequest, int } from './base/types.js';
|
|
2
|
+
import type { Market, TransferEntry, Balances, Int, OrderBook, OHLCV, Str, FundingRateHistory, Order, OrderType, OrderSide, Trade, Strings, Position, OrderRequest, Dict, Num, MarginModification, Currencies, CancellationRequest, int, Transaction } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class hyperliquid
|
|
5
5
|
* @augments Exchange
|
|
@@ -36,7 +36,7 @@ export default class hyperliquid extends Exchange {
|
|
|
36
36
|
};
|
|
37
37
|
actionHash(action: any, vaultAddress: any, nonce: any): any;
|
|
38
38
|
signL1Action(action: any, nonce: any, vaultAdress?: any): object;
|
|
39
|
-
|
|
39
|
+
signUserSignedAction(messageTypes: any, message: any): {
|
|
40
40
|
r: string;
|
|
41
41
|
s: string;
|
|
42
42
|
v: any;
|
|
@@ -77,7 +77,7 @@ export default class hyperliquid extends Exchange {
|
|
|
77
77
|
modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<MarginModification>;
|
|
78
78
|
parseMarginModification(data: Dict, market?: Market): MarginModification;
|
|
79
79
|
transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
|
|
80
|
-
withdraw(code: string, amount:
|
|
80
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
81
81
|
formatVaultAddress(address?: Str): string;
|
|
82
82
|
handlePublicAddress(methodName: string, params: Dict): any[];
|
|
83
83
|
coinToMarketId(coin: Str): string;
|
package/js/src/hyperliquid.js
CHANGED
|
@@ -27,6 +27,7 @@ export default class hyperliquid extends Exchange {
|
|
|
27
27
|
'rateLimit': 50,
|
|
28
28
|
'certified': false,
|
|
29
29
|
'pro': true,
|
|
30
|
+
'dex': true,
|
|
30
31
|
'has': {
|
|
31
32
|
'CORS': undefined,
|
|
32
33
|
'spot': true,
|
|
@@ -971,11 +972,12 @@ export default class hyperliquid extends Exchange {
|
|
|
971
972
|
const signature = this.signMessage(msg, this.privateKey);
|
|
972
973
|
return signature;
|
|
973
974
|
}
|
|
974
|
-
|
|
975
|
+
signUserSignedAction(messageTypes, message) {
|
|
975
976
|
const zeroAddress = this.safeString(this.options, 'zeroAddress');
|
|
977
|
+
const chainId = 421614; // check this out
|
|
976
978
|
const domain = {
|
|
977
979
|
'chainId': chainId,
|
|
978
|
-
'name': '
|
|
980
|
+
'name': 'HyperliquidSignTransaction',
|
|
979
981
|
'verifyingContract': zeroAddress,
|
|
980
982
|
'version': '1',
|
|
981
983
|
};
|
|
@@ -984,28 +986,26 @@ export default class hyperliquid extends Exchange {
|
|
|
984
986
|
return signature;
|
|
985
987
|
}
|
|
986
988
|
buildTransferSig(message) {
|
|
987
|
-
const isSandboxMode = this.safeBool(this.options, 'sandboxMode');
|
|
988
|
-
const chainId = (isSandboxMode) ? 421614 : 42161;
|
|
989
989
|
const messageTypes = {
|
|
990
|
-
'
|
|
990
|
+
'HyperliquidTransaction:UsdSend': [
|
|
991
|
+
{ 'name': 'hyperliquidChain', 'type': 'string' },
|
|
991
992
|
{ 'name': 'destination', 'type': 'string' },
|
|
992
993
|
{ 'name': 'amount', 'type': 'string' },
|
|
993
994
|
{ 'name': 'time', 'type': 'uint64' },
|
|
994
995
|
],
|
|
995
996
|
};
|
|
996
|
-
return this.
|
|
997
|
+
return this.signUserSignedAction(messageTypes, message);
|
|
997
998
|
}
|
|
998
999
|
buildWithdrawSig(message) {
|
|
999
|
-
const isSandboxMode = this.safeBool(this.options, 'sandboxMode');
|
|
1000
|
-
const chainId = (isSandboxMode) ? 421614 : 42161;
|
|
1001
1000
|
const messageTypes = {
|
|
1002
|
-
'
|
|
1001
|
+
'HyperliquidTransaction:Withdraw': [
|
|
1002
|
+
{ 'name': 'hyperliquidChain', 'type': 'string' },
|
|
1003
1003
|
{ 'name': 'destination', 'type': 'string' },
|
|
1004
|
-
{ 'name': '
|
|
1004
|
+
{ 'name': 'amount', 'type': 'string' },
|
|
1005
1005
|
{ 'name': 'time', 'type': 'uint64' },
|
|
1006
1006
|
],
|
|
1007
1007
|
};
|
|
1008
|
-
return this.
|
|
1008
|
+
return this.signUserSignedAction(messageTypes, message);
|
|
1009
1009
|
}
|
|
1010
1010
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
1011
1011
|
/**
|
|
@@ -2408,10 +2408,11 @@ export default class hyperliquid extends Exchange {
|
|
|
2408
2408
|
if (code !== undefined) {
|
|
2409
2409
|
code = code.toUpperCase();
|
|
2410
2410
|
if (code !== 'USDC') {
|
|
2411
|
-
throw new NotSupported(this.id + '
|
|
2411
|
+
throw new NotSupported(this.id + 'transfer() only support USDC');
|
|
2412
2412
|
}
|
|
2413
2413
|
}
|
|
2414
2414
|
const payload = {
|
|
2415
|
+
'hyperliquidChain': isSandboxMode ? 'Testnet' : 'Mainnet',
|
|
2415
2416
|
'destination': toAccount,
|
|
2416
2417
|
'amount': this.numberToString(amount),
|
|
2417
2418
|
'time': nonce,
|
|
@@ -2419,9 +2420,12 @@ export default class hyperliquid extends Exchange {
|
|
|
2419
2420
|
const sig = this.buildTransferSig(payload);
|
|
2420
2421
|
const request = {
|
|
2421
2422
|
'action': {
|
|
2422
|
-
'
|
|
2423
|
-
'
|
|
2424
|
-
'
|
|
2423
|
+
'hyperliquidChain': payload['hyperliquidChain'],
|
|
2424
|
+
'signatureChainId': '0x66eee',
|
|
2425
|
+
'destination': toAccount,
|
|
2426
|
+
'amount': amount.toString(),
|
|
2427
|
+
'time': nonce,
|
|
2428
|
+
'type': 'usdSend',
|
|
2425
2429
|
},
|
|
2426
2430
|
'nonce': nonce,
|
|
2427
2431
|
'signature': sig,
|
|
@@ -2451,25 +2455,29 @@ export default class hyperliquid extends Exchange {
|
|
|
2451
2455
|
throw new NotSupported(this.id + 'withdraw() only support USDC');
|
|
2452
2456
|
}
|
|
2453
2457
|
}
|
|
2454
|
-
const isSandboxMode = this.safeBool(this.options, 'sandboxMode');
|
|
2458
|
+
const isSandboxMode = this.safeBool(this.options, 'sandboxMode', false);
|
|
2455
2459
|
const nonce = this.milliseconds();
|
|
2456
2460
|
const payload = {
|
|
2461
|
+
'hyperliquidChain': isSandboxMode ? 'Testnet' : 'Mainnet',
|
|
2457
2462
|
'destination': address,
|
|
2458
|
-
'
|
|
2463
|
+
'amount': amount.toString(),
|
|
2459
2464
|
'time': nonce,
|
|
2460
2465
|
};
|
|
2461
2466
|
const sig = this.buildWithdrawSig(payload);
|
|
2462
2467
|
const request = {
|
|
2463
2468
|
'action': {
|
|
2464
|
-
'
|
|
2465
|
-
'
|
|
2466
|
-
'
|
|
2469
|
+
'hyperliquidChain': payload['hyperliquidChain'],
|
|
2470
|
+
'signatureChainId': '0x66eee',
|
|
2471
|
+
'destination': address,
|
|
2472
|
+
'amount': amount.toString(),
|
|
2473
|
+
'time': nonce,
|
|
2474
|
+
'type': 'withdraw3',
|
|
2467
2475
|
},
|
|
2468
2476
|
'nonce': nonce,
|
|
2469
2477
|
'signature': sig,
|
|
2470
2478
|
};
|
|
2471
2479
|
const response = await this.privatePostExchange(this.extend(request, params));
|
|
2472
|
-
return response;
|
|
2480
|
+
return this.parseTransaction(response);
|
|
2473
2481
|
}
|
|
2474
2482
|
formatVaultAddress(address = undefined) {
|
|
2475
2483
|
if (address === undefined) {
|
package/js/src/idex.js
CHANGED
package/js/src/mexc.js
CHANGED
|
@@ -224,6 +224,7 @@ export default class mexc extends Exchange {
|
|
|
224
224
|
'sub-account/margin': 1,
|
|
225
225
|
'batchOrders': 10,
|
|
226
226
|
'capital/withdraw/apply': 1,
|
|
227
|
+
'capital/withdraw': 1,
|
|
227
228
|
'capital/transfer': 1,
|
|
228
229
|
'capital/transfer/internal': 1,
|
|
229
230
|
'capital/deposit/address': 1,
|
|
@@ -242,6 +243,7 @@ export default class mexc extends Exchange {
|
|
|
242
243
|
'margin/order': 1,
|
|
243
244
|
'margin/openOrders': 1,
|
|
244
245
|
'userDataStream': 1,
|
|
246
|
+
'capital/withdraw': 1,
|
|
245
247
|
},
|
|
246
248
|
},
|
|
247
249
|
},
|
|
@@ -1069,7 +1071,7 @@ export default class mexc extends Exchange {
|
|
|
1069
1071
|
const chains = this.safeValue(currency, 'networkList', []);
|
|
1070
1072
|
for (let j = 0; j < chains.length; j++) {
|
|
1071
1073
|
const chain = chains[j];
|
|
1072
|
-
const networkId = this.
|
|
1074
|
+
const networkId = this.safeString2(chain, 'network', 'netWork');
|
|
1073
1075
|
const network = this.networkIdToCode(networkId);
|
|
1074
1076
|
const isDepositEnabled = this.safeBool(chain, 'depositEnable', false);
|
|
1075
1077
|
const isWithdrawEnabled = this.safeBool(chain, 'withdrawEnable', false);
|
|
@@ -5225,7 +5227,7 @@ export default class mexc extends Exchange {
|
|
|
5225
5227
|
* @method
|
|
5226
5228
|
* @name mexc#withdraw
|
|
5227
5229
|
* @description make a withdrawal
|
|
5228
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw
|
|
5230
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-new
|
|
5229
5231
|
* @param {string} code unified currency code
|
|
5230
5232
|
* @param {float} amount the amount to withdraw
|
|
5231
5233
|
* @param {string} address the address to withdraw to
|
|
@@ -5235,7 +5237,7 @@ export default class mexc extends Exchange {
|
|
|
5235
5237
|
*/
|
|
5236
5238
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
5237
5239
|
const networks = this.safeValue(this.options, 'networks', {});
|
|
5238
|
-
let network = this.safeString2(params, 'network', '
|
|
5240
|
+
let network = this.safeString2(params, 'network', 'netWork'); // this line allows the user to specify either ERC20 or ETH
|
|
5239
5241
|
network = this.safeString(networks, network, network); // handle ETH > ERC-20 alias
|
|
5240
5242
|
this.checkAddress(address);
|
|
5241
5243
|
await this.loadMarkets();
|
|
@@ -5249,10 +5251,10 @@ export default class mexc extends Exchange {
|
|
|
5249
5251
|
request['memo'] = tag;
|
|
5250
5252
|
}
|
|
5251
5253
|
if (network !== undefined) {
|
|
5252
|
-
request['
|
|
5253
|
-
params = this.omit(params, ['network', '
|
|
5254
|
+
request['netWork'] = network;
|
|
5255
|
+
params = this.omit(params, ['network', 'netWork']);
|
|
5254
5256
|
}
|
|
5255
|
-
const response = await this.
|
|
5257
|
+
const response = await this.spotPrivatePostCapitalWithdraw(this.extend(request, params));
|
|
5256
5258
|
//
|
|
5257
5259
|
// {
|
|
5258
5260
|
// "id":"7213fea8e94b4a5593d507237e5a555b"
|
package/js/src/okx.js
CHANGED
|
@@ -2461,6 +2461,7 @@ export default class okx extends Exchange {
|
|
|
2461
2461
|
* @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-balance
|
|
2462
2462
|
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-balance
|
|
2463
2463
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2464
|
+
* @param {string} [params.type] wallet type, ['funding' or 'trading'] default is 'trading'
|
|
2464
2465
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
2465
2466
|
*/
|
|
2466
2467
|
await this.loadMarkets();
|
package/js/src/oxfun.js
CHANGED
|
@@ -19,7 +19,7 @@ export default class oxfun extends Exchange {
|
|
|
19
19
|
describe() {
|
|
20
20
|
return this.deepExtend(super.describe(), {
|
|
21
21
|
'id': 'oxfun',
|
|
22
|
-
'name': '
|
|
22
|
+
'name': 'OXFUN',
|
|
23
23
|
'countries': ['PA'],
|
|
24
24
|
'version': 'v3',
|
|
25
25
|
'rateLimit': 120,
|
|
@@ -139,7 +139,7 @@ export default class oxfun extends Exchange {
|
|
|
139
139
|
'1d': '86400s',
|
|
140
140
|
},
|
|
141
141
|
'urls': {
|
|
142
|
-
'logo': 'https://github.com/ccxt/ccxt/assets/43336371/
|
|
142
|
+
'logo': 'https://github.com/ccxt/ccxt/assets/43336371/6a196124-c1ee-4fae-8573-962071b61a85',
|
|
143
143
|
'referral': 'https://ox.fun/register?shareAccountId=5ZUD4a7G',
|
|
144
144
|
'api': {
|
|
145
145
|
'public': 'https://api.ox.fun',
|
package/js/src/pro/binanceus.js
CHANGED
|
@@ -44,14 +44,6 @@ export default class binanceus extends binance {
|
|
|
44
44
|
'defaultType': 'spot',
|
|
45
45
|
'fetchMarkets': ['spot'],
|
|
46
46
|
},
|
|
47
|
-
'fees': {
|
|
48
|
-
'trading': {
|
|
49
|
-
'tierBased': false,
|
|
50
|
-
'percentage': true,
|
|
51
|
-
'taker': 0.0,
|
|
52
|
-
'maker': 0.0, // 0.1% trading fee, zero fees for all trading pairs before November 1
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
47
|
});
|
|
56
48
|
}
|
|
57
49
|
}
|
package/js/src/tokocrypto.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
import Exchange from './abstract/tokocrypto.js';
|
|
9
|
-
import { TRUNCATE,
|
|
9
|
+
import { TRUNCATE, TICK_SIZE } from './base/functions/number.js';
|
|
10
10
|
import { ExchangeError, ExchangeNotAvailable, InsufficientFunds, OrderNotFound, InvalidOrder, DDoSProtection, InvalidNonce, AuthenticationError, RateLimitExceeded, PermissionDenied, NotSupported, BadRequest, BadSymbol, AccountSuspended, OrderImmediatelyFillable, OnMaintenance, BadResponse, RequestTimeout, OrderNotFillable, MarginModeAlreadySet, ArgumentsRequired } from './base/errors.js';
|
|
11
11
|
import { Precise } from './base/Precise.js';
|
|
12
12
|
import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
|
|
@@ -213,7 +213,7 @@ export default class tokocrypto extends Exchange {
|
|
|
213
213
|
'maker': this.parseNumber('0.0075'), // 0.1% trading fee, zero fees for all trading pairs before November 1
|
|
214
214
|
},
|
|
215
215
|
},
|
|
216
|
-
'precisionMode':
|
|
216
|
+
'precisionMode': TICK_SIZE,
|
|
217
217
|
'options': {
|
|
218
218
|
// 'fetchTradesMethod': 'binanceGetTrades', // binanceGetTrades, binanceGetAggTrades
|
|
219
219
|
'createMarketBuyOrderRequiresPrice': true,
|
|
@@ -720,10 +720,10 @@ export default class tokocrypto extends Exchange {
|
|
|
720
720
|
'strike': undefined,
|
|
721
721
|
'optionType': undefined,
|
|
722
722
|
'precision': {
|
|
723
|
-
'amount': this.
|
|
724
|
-
'price': this.
|
|
725
|
-
'base': this.
|
|
726
|
-
'quote': this.
|
|
723
|
+
'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'quantityPrecision'))),
|
|
724
|
+
'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'pricePrecision'))),
|
|
725
|
+
'base': this.parseNumber(this.parsePrecision(this.safeString(market, 'baseAssetPrecision'))),
|
|
726
|
+
'quote': this.parseNumber(this.parsePrecision(this.safeString(market, 'quotePrecision'))),
|
|
727
727
|
},
|
|
728
728
|
'limits': {
|
|
729
729
|
'leverage': {
|
|
@@ -748,8 +748,7 @@ export default class tokocrypto extends Exchange {
|
|
|
748
748
|
};
|
|
749
749
|
if ('PRICE_FILTER' in filtersByType) {
|
|
750
750
|
const filter = this.safeValue(filtersByType, 'PRICE_FILTER', {});
|
|
751
|
-
|
|
752
|
-
entry['precision']['price'] = this.precisionFromString(tickSize);
|
|
751
|
+
entry['precision']['price'] = this.safeNumber(filter, 'tickSize');
|
|
753
752
|
// PRICE_FILTER reports zero values for maxPrice
|
|
754
753
|
// since they updated filter types in November 2018
|
|
755
754
|
// https://github.com/ccxt/ccxt/issues/4286
|
|
@@ -758,12 +757,11 @@ export default class tokocrypto extends Exchange {
|
|
|
758
757
|
'min': this.safeNumber(filter, 'minPrice'),
|
|
759
758
|
'max': this.safeNumber(filter, 'maxPrice'),
|
|
760
759
|
};
|
|
761
|
-
entry['precision']['price'] =
|
|
760
|
+
entry['precision']['price'] = filter['tickSize'];
|
|
762
761
|
}
|
|
763
762
|
if ('LOT_SIZE' in filtersByType) {
|
|
764
763
|
const filter = this.safeValue(filtersByType, 'LOT_SIZE', {});
|
|
765
|
-
|
|
766
|
-
entry['precision']['amount'] = this.precisionFromString(stepSize);
|
|
764
|
+
entry['precision']['amount'] = this.safeNumber(filter, 'stepSize');
|
|
767
765
|
entry['limits']['amount'] = {
|
|
768
766
|
'min': this.safeNumber(filter, 'minQty'),
|
|
769
767
|
'max': this.safeNumber(filter, 'maxQty'),
|
package/js/src/wavesexchange.js
CHANGED
package/js/src/woofipro.js
CHANGED
package/package.json
CHANGED