ccxt 4.4.75 → 4.4.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +8 -4
- package/dist/cjs/src/abstract/apex.js +9 -0
- package/dist/cjs/src/apex.js +1949 -0
- package/dist/cjs/src/base/Exchange.js +49 -3
- package/dist/cjs/src/binance.js +44 -220
- package/dist/cjs/src/bitget.js +139 -71
- package/dist/cjs/src/bitmex.js +4 -4
- package/dist/cjs/src/bitrue.js +48 -0
- package/dist/cjs/src/cex.js +1 -1
- package/dist/cjs/src/coinbase.js +32 -3
- package/dist/cjs/src/coincatch.js +68 -0
- package/dist/cjs/src/coinex.js +3 -0
- package/dist/cjs/src/coinlist.js +85 -1
- package/dist/cjs/src/hitbtc.js +3 -0
- package/dist/cjs/src/hyperliquid.js +13 -4
- package/dist/cjs/src/mexc.js +50 -57
- package/dist/cjs/src/okx.js +23 -8
- package/dist/cjs/src/paradex.js +3 -12
- package/dist/cjs/src/phemex.js +2 -1
- package/dist/cjs/src/poloniex.js +1 -1
- package/dist/cjs/src/pro/apex.js +1043 -0
- package/dist/cjs/src/pro/coinbase.js +4 -8
- package/dist/cjs/src/pro/gate.js +27 -2
- package/dist/cjs/src/pro/hollaex.js +2 -2
- package/dist/cjs/src/pro/hyperliquid.js +1 -1
- package/dist/cjs/src/pro/p2b.js +2 -2
- package/dist/cjs/src/pro/tradeogre.js +283 -0
- package/dist/cjs/src/probit.js +1 -0
- package/dist/cjs/src/static_dependencies/zklink/zklink-sdk-web.js +2645 -0
- package/dist/cjs/src/tradeogre.js +2 -1
- package/dist/cjs/src/upbit.js +299 -93
- package/dist/cjs/src/whitebit.js +1 -0
- package/dist/cjs/src/woo.js +3 -1
- package/dist/cjs/src/xt.js +131 -4
- package/js/ccxt.d.ts +11 -5
- package/js/ccxt.js +8 -4
- package/js/src/abstract/apex.d.ts +34 -0
- package/js/src/abstract/myokx.d.ts +4 -0
- package/js/src/abstract/okx.d.ts +4 -0
- package/js/src/abstract/upbit.d.ts +15 -1
- package/js/src/abstract/xt.d.ts +3 -0
- package/js/src/apex.d.ts +333 -0
- package/js/src/apex.js +1951 -0
- package/js/src/ascendex.d.ts +3 -3
- package/js/src/base/Exchange.d.ts +3 -0
- package/js/src/base/Exchange.js +49 -2
- package/js/src/binance.d.ts +9 -7
- package/js/src/binance.js +44 -220
- package/js/src/bitfinex.d.ts +3 -3
- package/js/src/bitflyer.d.ts +2 -2
- package/js/src/bitget.d.ts +2 -0
- package/js/src/bitget.js +139 -71
- package/js/src/bitmart.d.ts +4 -4
- package/js/src/bitmex.d.ts +3 -3
- package/js/src/bitmex.js +4 -4
- package/js/src/bitrue.js +48 -0
- package/js/src/cex.js +1 -1
- package/js/src/coinbase.d.ts +6 -4
- package/js/src/coinbase.js +32 -3
- package/js/src/coinbaseexchange.d.ts +1 -1
- package/js/src/coincatch.d.ts +11 -0
- package/js/src/coincatch.js +68 -0
- package/js/src/coinex.js +3 -0
- package/js/src/coinlist.d.ts +12 -1
- package/js/src/coinlist.js +85 -1
- package/js/src/cryptocom.d.ts +4 -4
- package/js/src/deribit.d.ts +4 -4
- package/js/src/derive.d.ts +3 -3
- package/js/src/digifinex.d.ts +4 -4
- package/js/src/hitbtc.js +3 -0
- package/js/src/htx.d.ts +4 -4
- package/js/src/hyperliquid.d.ts +1 -0
- package/js/src/hyperliquid.js +13 -4
- package/js/src/kraken.d.ts +3 -3
- package/js/src/krakenfutures.d.ts +2 -2
- package/js/src/kucoinfutures.d.ts +5 -5
- package/js/src/mexc.d.ts +1 -0
- package/js/src/mexc.js +50 -57
- package/js/src/okx.js +23 -8
- package/js/src/oxfun.d.ts +3 -3
- package/js/src/paradex.js +3 -12
- package/js/src/phemex.d.ts +3 -3
- package/js/src/phemex.js +2 -1
- package/js/src/poloniex.d.ts +3 -3
- package/js/src/poloniex.js +1 -1
- package/js/src/pro/apex.d.ts +160 -0
- package/js/src/pro/apex.js +1044 -0
- package/js/src/pro/coinbase.js +4 -8
- package/js/src/pro/gate.js +27 -2
- package/js/src/pro/hollaex.js +2 -2
- package/js/src/pro/hyperliquid.js +1 -1
- package/js/src/pro/p2b.js +2 -2
- package/js/src/pro/tradeogre.d.ts +49 -0
- package/js/src/pro/tradeogre.js +284 -0
- package/js/src/probit.js +1 -0
- package/js/src/static_dependencies/zklink/zklink-sdk-web.d.ts +1279 -0
- package/js/src/static_dependencies/zklink/zklink-sdk-web.js +4282 -0
- package/js/src/tradeogre.js +2 -1
- package/js/src/upbit.d.ts +34 -4
- package/js/src/upbit.js +299 -93
- package/js/src/vertex.d.ts +3 -3
- package/js/src/whitebit.js +1 -0
- package/js/src/woo.d.ts +4 -4
- package/js/src/woo.js +3 -1
- package/js/src/woofipro.d.ts +4 -4
- package/js/src/xt.d.ts +23 -4
- package/js/src/xt.js +131 -4
- package/package.json +2 -2
- package/js/src/abstract/ace.d.ts +0 -18
- package/js/src/ace.d.ts +0 -158
- package/js/src/ace.js +0 -1181
- /package/js/src/abstract/{ace.js → apex.js} +0 -0
|
@@ -18,11 +18,12 @@ require('../static_dependencies/ethers/utils/fixednumber.js');
|
|
|
18
18
|
require('../static_dependencies/ethers/utils/maths.js');
|
|
19
19
|
require('../static_dependencies/ethers/utils/utf8.js');
|
|
20
20
|
require('../static_dependencies/noble-hashes/sha3.js');
|
|
21
|
-
require('../static_dependencies/noble-hashes/sha256.js');
|
|
21
|
+
var sha256 = require('../static_dependencies/noble-hashes/sha256.js');
|
|
22
22
|
require('../static_dependencies/ethers/address/address.js');
|
|
23
23
|
var typedData = require('../static_dependencies/ethers/hash/typed-data.js');
|
|
24
24
|
var rng = require('../static_dependencies/jsencrypt/lib/jsbn/rng.js');
|
|
25
25
|
var index$1 = require('../static_dependencies/scure-starknet/index.js');
|
|
26
|
+
var zklinkSdkWeb = require('../static_dependencies/zklink/zklink-sdk-web.js');
|
|
26
27
|
require('../static_dependencies/noble-curves/abstract/modular.js');
|
|
27
28
|
var selector = require('../static_dependencies/starknet/utils/selector.js');
|
|
28
29
|
var classHash = require('../static_dependencies/starknet/utils/hash/classHash.js');
|
|
@@ -572,7 +573,7 @@ class Exchange {
|
|
|
572
573
|
httpProxyAgent = this.httpAgent;
|
|
573
574
|
}
|
|
574
575
|
}
|
|
575
|
-
url = proxyUrl + url;
|
|
576
|
+
url = proxyUrl + this.urlEncoderForProxyUrl(url);
|
|
576
577
|
}
|
|
577
578
|
// proxy agents
|
|
578
579
|
const [httpProxy, httpsProxy, socksProxy] = this.checkProxySettings(url, method, headers, body);
|
|
@@ -1217,6 +1218,45 @@ class Exchange {
|
|
|
1217
1218
|
const signature = index$1.sign(hash.replace('0x', ''), pri.slice(-64));
|
|
1218
1219
|
return this.json([signature.r.toString(), signature.s.toString()]);
|
|
1219
1220
|
}
|
|
1221
|
+
async getZKContractSignatureObj(seed, params = {}) {
|
|
1222
|
+
const formattedSlotId = BigInt('0x' + this.remove0xPrefix(this.hash(this.encode(this.safeString(params, 'slotId')), sha256.sha256, 'hex'))).toString();
|
|
1223
|
+
const formattedNonce = BigInt('0x' + this.remove0xPrefix(this.hash(this.encode(this.safeString(params, 'nonce')), sha256.sha256, 'hex'))).toString();
|
|
1224
|
+
const formattedUint64 = '18446744073709551615';
|
|
1225
|
+
const formattedUint32 = '4294967295';
|
|
1226
|
+
const accountId = parseInt(Precise["default"].stringMod(this.safeString(params, 'accountId'), formattedUint32), 10);
|
|
1227
|
+
const slotId = parseInt(Precise["default"].stringDiv(Precise["default"].stringMod(formattedSlotId, formattedUint64), formattedUint32), 10);
|
|
1228
|
+
const nonce = parseInt(Precise["default"].stringMod(formattedNonce, formattedUint32), 10);
|
|
1229
|
+
await zklinkSdkWeb["default"]();
|
|
1230
|
+
const _signer = zklinkSdkWeb.newRpcSignerWithProvider({});
|
|
1231
|
+
await _signer.initZklinkSigner(seed);
|
|
1232
|
+
let tx_builder = new zklinkSdkWeb.ContractBuilder(accountId, 0, slotId, nonce, this.safeInteger(params, 'pairId'), Precise["default"].stringMul(this.safeString(params, 'size'), '1e18'), Precise["default"].stringMul(this.safeString(params, 'price'), '1e18'), this.safeString(params, 'direction') === 'BUY', parseInt(Precise["default"].stringMul(this.safeString(params, 'makerFeeRate'), '10000')), parseInt(Precise["default"].stringMul(this.safeString(params, 'takerFeeRate'), '10000')), false);
|
|
1233
|
+
let contractor = zklinkSdkWeb.newContract(tx_builder);
|
|
1234
|
+
//const signer = ZkLinkSigner.ethSig(seed);
|
|
1235
|
+
//const signer = new Signer(seed);
|
|
1236
|
+
contractor?.sign(_signer?.getZkLinkSigner());
|
|
1237
|
+
const tx = contractor.jsValue();
|
|
1238
|
+
const zkSign = tx?.signature?.signature;
|
|
1239
|
+
return zkSign;
|
|
1240
|
+
}
|
|
1241
|
+
async getZKTransferSignatureObj(seed, params = {}) {
|
|
1242
|
+
await zklinkSdkWeb["default"]();
|
|
1243
|
+
const _signer = zklinkSdkWeb.newRpcSignerWithProvider({});
|
|
1244
|
+
await _signer.initZklinkSigner(seed);
|
|
1245
|
+
let nonce = this.safeString(params, 'nonce', '0');
|
|
1246
|
+
if (this.safeBool(params, 'isContract') === true) {
|
|
1247
|
+
const formattedUint32 = '4294967295';
|
|
1248
|
+
const formattedNonce = BigInt('0x' + this.remove0xPrefix(this.hash(this.encode(nonce), sha256.sha256, 'hex'))).toString();
|
|
1249
|
+
nonce = Precise["default"].stringMod(formattedNonce, formattedUint32);
|
|
1250
|
+
}
|
|
1251
|
+
let tx_builder = new zklinkSdkWeb.TransferBuilder(this.safeNumber(params, 'zkAccountId', 0), this.safeString(params, 'receiverAddress'), this.safeNumber(params, 'subAccountId', 0), this.safeNumber(params, 'receiverSubAccountId', 0), this.safeNumber(params, 'tokenId', 0), this.safeString(params, 'fee', '0'), this.safeString(params, 'amount', '0'), this.parseToInt(nonce), this.safeNumber(params, 'timestampSeconds', 0));
|
|
1252
|
+
let contractor = zklinkSdkWeb.newTransfer(tx_builder);
|
|
1253
|
+
//const signer = ZkLinkSigner.ethSig(seed);
|
|
1254
|
+
//const signer = new Signer(seed);
|
|
1255
|
+
contractor?.sign(_signer?.getZkLinkSigner());
|
|
1256
|
+
const tx = contractor.jsValue();
|
|
1257
|
+
const zkSign = tx?.signature?.signature;
|
|
1258
|
+
return zkSign;
|
|
1259
|
+
}
|
|
1220
1260
|
intToBase16(elem) {
|
|
1221
1261
|
return elem.toString(16);
|
|
1222
1262
|
}
|
|
@@ -1774,6 +1814,12 @@ class Exchange {
|
|
|
1774
1814
|
}
|
|
1775
1815
|
return proxyUrl;
|
|
1776
1816
|
}
|
|
1817
|
+
urlEncoderForProxyUrl(targetUrl) {
|
|
1818
|
+
// to be overriden
|
|
1819
|
+
const includesQuery = targetUrl.indexOf('?') >= 0;
|
|
1820
|
+
const finalUrl = includesQuery ? this.encodeURIComponent(targetUrl) : targetUrl;
|
|
1821
|
+
return finalUrl;
|
|
1822
|
+
}
|
|
1777
1823
|
checkProxySettings(url = undefined, method = undefined, headers = undefined, body = undefined) {
|
|
1778
1824
|
const usedProxies = [];
|
|
1779
1825
|
let httpProxy = undefined;
|
|
@@ -2563,7 +2609,7 @@ class Exchange {
|
|
|
2563
2609
|
// find lowest precision (which is more desired)
|
|
2564
2610
|
const precision = this.safeString(network, 'precision');
|
|
2565
2611
|
const precisionMain = this.safeString(currency, 'precision');
|
|
2566
|
-
if (precisionMain === undefined || Precise["default"].
|
|
2612
|
+
if (precisionMain === undefined || Precise["default"].stringGt(precision, precisionMain)) {
|
|
2567
2613
|
currency['precision'] = this.parseNumber(precision);
|
|
2568
2614
|
}
|
|
2569
2615
|
// limits
|
package/dist/cjs/src/binance.js
CHANGED
|
@@ -20,7 +20,7 @@ class binance extends binance$1 {
|
|
|
20
20
|
return this.deepExtend(super.describe(), {
|
|
21
21
|
'id': 'binance',
|
|
22
22
|
'name': 'Binance',
|
|
23
|
-
'countries': [
|
|
23
|
+
'countries': [],
|
|
24
24
|
'rateLimit': 50,
|
|
25
25
|
'certified': true,
|
|
26
26
|
'pro': true,
|
|
@@ -1333,195 +1333,8 @@ class binance extends binance$1 {
|
|
|
1333
1333
|
'SPL': 'SOL',
|
|
1334
1334
|
'SOL': 'SOL', // we shouldn't rename SOL
|
|
1335
1335
|
},
|
|
1336
|
-
// keeping this object for backward-compatibility
|
|
1337
|
-
'reverseNetworks': {
|
|
1338
|
-
'tronscan.org': 'TRC20',
|
|
1339
|
-
'etherscan.io': 'ERC20',
|
|
1340
|
-
'bscscan.com': 'BSC',
|
|
1341
|
-
'explorer.binance.org': 'BEP2',
|
|
1342
|
-
'bithomp.com': 'XRP',
|
|
1343
|
-
'bloks.io': 'EOS',
|
|
1344
|
-
'stellar.expert': 'XLM',
|
|
1345
|
-
'blockchair.com/bitcoin': 'BTC',
|
|
1346
|
-
'blockchair.com/bitcoin-cash': 'BCH',
|
|
1347
|
-
'blockchair.com/ecash': 'XEC',
|
|
1348
|
-
'explorer.litecoin.net': 'LTC',
|
|
1349
|
-
'explorer.avax.network': 'AVAX',
|
|
1350
|
-
'solscan.io': 'SOL',
|
|
1351
|
-
'polkadot.subscan.io': 'DOT',
|
|
1352
|
-
'dashboard.internetcomputer.org': 'ICP',
|
|
1353
|
-
'explorer.chiliz.com': 'CHZ',
|
|
1354
|
-
'cardanoscan.io': 'ADA',
|
|
1355
|
-
'mainnet.theoan.com': 'AION',
|
|
1356
|
-
'algoexplorer.io': 'ALGO',
|
|
1357
|
-
'explorer.ambrosus.com': 'AMB',
|
|
1358
|
-
'viewblock.io/zilliqa': 'ZIL',
|
|
1359
|
-
'viewblock.io/arweave': 'AR',
|
|
1360
|
-
'explorer.ark.io': 'ARK',
|
|
1361
|
-
'atomscan.com': 'ATOM',
|
|
1362
|
-
'www.mintscan.io': 'CTK',
|
|
1363
|
-
'explorer.bitcoindiamond.org': 'BCD',
|
|
1364
|
-
'btgexplorer.com': 'BTG',
|
|
1365
|
-
'bts.ai': 'BTS',
|
|
1366
|
-
'explorer.celo.org': 'CELO',
|
|
1367
|
-
'explorer.nervos.org': 'CKB',
|
|
1368
|
-
'cerebro.cortexlabs.ai': 'CTXC',
|
|
1369
|
-
'chainz.cryptoid.info': 'VIA',
|
|
1370
|
-
'explorer.dcrdata.org': 'DCR',
|
|
1371
|
-
'digiexplorer.info': 'DGB',
|
|
1372
|
-
'dock.subscan.io': 'DOCK',
|
|
1373
|
-
'dogechain.info': 'DOGE',
|
|
1374
|
-
'explorer.elrond.com': 'EGLD',
|
|
1375
|
-
'blockscout.com': 'ETC',
|
|
1376
|
-
'explore-fetchhub.fetch.ai': 'FET',
|
|
1377
|
-
'filfox.info': 'FIL',
|
|
1378
|
-
'fio.bloks.io': 'FIO',
|
|
1379
|
-
'explorer.firo.org': 'FIRO',
|
|
1380
|
-
'neoscan.io': 'NEO',
|
|
1381
|
-
'ftmscan.com': 'FTM',
|
|
1382
|
-
'explorer.gochain.io': 'GO',
|
|
1383
|
-
'block.gxb.io': 'GXS',
|
|
1384
|
-
'hash-hash.info': 'HBAR',
|
|
1385
|
-
'www.hiveblockexplorer.com': 'HIVE',
|
|
1386
|
-
'explorer.helium.com': 'HNT',
|
|
1387
|
-
'tracker.icon.foundation': 'ICX',
|
|
1388
|
-
'www.iostabc.com': 'IOST',
|
|
1389
|
-
'explorer.iota.org': 'IOTA',
|
|
1390
|
-
'iotexscan.io': 'IOTX',
|
|
1391
|
-
'irishub.iobscan.io': 'IRIS',
|
|
1392
|
-
'kava.mintscan.io': 'KAVA',
|
|
1393
|
-
'scope.klaytn.com': 'KLAY',
|
|
1394
|
-
'kmdexplorer.io': 'KMD',
|
|
1395
|
-
'kusama.subscan.io': 'KSM',
|
|
1396
|
-
'explorer.lto.network': 'LTO',
|
|
1397
|
-
'polygonscan.com': 'POLYGON',
|
|
1398
|
-
'explorer.ont.io': 'ONT',
|
|
1399
|
-
'minaexplorer.com': 'MINA',
|
|
1400
|
-
'nanolooker.com': 'NANO',
|
|
1401
|
-
'explorer.nebulas.io': 'NAS',
|
|
1402
|
-
'explorer.nbs.plus': 'NBS',
|
|
1403
|
-
'explorer.nebl.io': 'NEBL',
|
|
1404
|
-
'nulscan.io': 'NULS',
|
|
1405
|
-
'nxscan.com': 'NXS',
|
|
1406
|
-
'explorer.harmony.one': 'ONE',
|
|
1407
|
-
'explorer.poa.network': 'POA',
|
|
1408
|
-
'qtum.info': 'QTUM',
|
|
1409
|
-
'explorer.rsk.co': 'RSK',
|
|
1410
|
-
'www.oasisscan.com': 'ROSE',
|
|
1411
|
-
'ravencoin.network': 'RVN',
|
|
1412
|
-
'sc.tokenview.com': 'SC',
|
|
1413
|
-
'secretnodes.com': 'SCRT',
|
|
1414
|
-
'explorer.skycoin.com': 'SKY',
|
|
1415
|
-
'steemscan.com': 'STEEM',
|
|
1416
|
-
'explorer.stacks.co': 'STX',
|
|
1417
|
-
'www.thetascan.io': 'THETA',
|
|
1418
|
-
'scan.tomochain.com': 'TOMO',
|
|
1419
|
-
'explore.vechain.org': 'VET',
|
|
1420
|
-
'explorer.vite.net': 'VITE',
|
|
1421
|
-
'www.wanscan.org': 'WAN',
|
|
1422
|
-
'wavesexplorer.com': 'WAVES',
|
|
1423
|
-
'wax.eosx.io': 'WAXP',
|
|
1424
|
-
'waltonchain.pro': 'WTC',
|
|
1425
|
-
'chain.nem.ninja': 'XEM',
|
|
1426
|
-
'verge-blockchain.info': 'XVG',
|
|
1427
|
-
'explorer.yoyow.org': 'YOYOW',
|
|
1428
|
-
'explorer.zcha.in': 'ZEC',
|
|
1429
|
-
'explorer.zensystem.io': 'ZEN',
|
|
1430
|
-
},
|
|
1431
1336
|
'networksById': {
|
|
1432
|
-
'SOL': 'SOL',
|
|
1433
|
-
'tronscan.org': 'TRC20',
|
|
1434
|
-
'etherscan.io': 'ERC20',
|
|
1435
|
-
'bscscan.com': 'BSC',
|
|
1436
|
-
'explorer.binance.org': 'BEP2',
|
|
1437
|
-
'bithomp.com': 'XRP',
|
|
1438
|
-
'bloks.io': 'EOS',
|
|
1439
|
-
'stellar.expert': 'XLM',
|
|
1440
|
-
'blockchair.com/bitcoin': 'BTC',
|
|
1441
|
-
'blockchair.com/bitcoin-cash': 'BCH',
|
|
1442
|
-
'blockchair.com/ecash': 'XEC',
|
|
1443
|
-
'explorer.litecoin.net': 'LTC',
|
|
1444
|
-
'explorer.avax.network': 'AVAX',
|
|
1445
|
-
'solscan.io': 'SOL',
|
|
1446
|
-
'polkadot.subscan.io': 'DOT',
|
|
1447
|
-
'dashboard.internetcomputer.org': 'ICP',
|
|
1448
|
-
'explorer.chiliz.com': 'CHZ',
|
|
1449
|
-
'cardanoscan.io': 'ADA',
|
|
1450
|
-
'mainnet.theoan.com': 'AION',
|
|
1451
|
-
'algoexplorer.io': 'ALGO',
|
|
1452
|
-
'explorer.ambrosus.com': 'AMB',
|
|
1453
|
-
'viewblock.io/zilliqa': 'ZIL',
|
|
1454
|
-
'viewblock.io/arweave': 'AR',
|
|
1455
|
-
'explorer.ark.io': 'ARK',
|
|
1456
|
-
'atomscan.com': 'ATOM',
|
|
1457
|
-
'www.mintscan.io': 'CTK',
|
|
1458
|
-
'explorer.bitcoindiamond.org': 'BCD',
|
|
1459
|
-
'btgexplorer.com': 'BTG',
|
|
1460
|
-
'bts.ai': 'BTS',
|
|
1461
|
-
'explorer.celo.org': 'CELO',
|
|
1462
|
-
'explorer.nervos.org': 'CKB',
|
|
1463
|
-
'cerebro.cortexlabs.ai': 'CTXC',
|
|
1464
|
-
'chainz.cryptoid.info': 'VIA',
|
|
1465
|
-
'explorer.dcrdata.org': 'DCR',
|
|
1466
|
-
'digiexplorer.info': 'DGB',
|
|
1467
|
-
'dock.subscan.io': 'DOCK',
|
|
1468
|
-
'dogechain.info': 'DOGE',
|
|
1469
|
-
'explorer.elrond.com': 'EGLD',
|
|
1470
|
-
'blockscout.com': 'ETC',
|
|
1471
|
-
'explore-fetchhub.fetch.ai': 'FET',
|
|
1472
|
-
'filfox.info': 'FIL',
|
|
1473
|
-
'fio.bloks.io': 'FIO',
|
|
1474
|
-
'explorer.firo.org': 'FIRO',
|
|
1475
|
-
'neoscan.io': 'NEO',
|
|
1476
|
-
'ftmscan.com': 'FTM',
|
|
1477
|
-
'explorer.gochain.io': 'GO',
|
|
1478
|
-
'block.gxb.io': 'GXS',
|
|
1479
|
-
'hash-hash.info': 'HBAR',
|
|
1480
|
-
'www.hiveblockexplorer.com': 'HIVE',
|
|
1481
|
-
'explorer.helium.com': 'HNT',
|
|
1482
|
-
'tracker.icon.foundation': 'ICX',
|
|
1483
|
-
'www.iostabc.com': 'IOST',
|
|
1484
|
-
'explorer.iota.org': 'IOTA',
|
|
1485
|
-
'iotexscan.io': 'IOTX',
|
|
1486
|
-
'irishub.iobscan.io': 'IRIS',
|
|
1487
|
-
'kava.mintscan.io': 'KAVA',
|
|
1488
|
-
'scope.klaytn.com': 'KLAY',
|
|
1489
|
-
'kmdexplorer.io': 'KMD',
|
|
1490
|
-
'kusama.subscan.io': 'KSM',
|
|
1491
|
-
'explorer.lto.network': 'LTO',
|
|
1492
|
-
'polygonscan.com': 'POLYGON',
|
|
1493
|
-
'explorer.ont.io': 'ONT',
|
|
1494
|
-
'minaexplorer.com': 'MINA',
|
|
1495
|
-
'nanolooker.com': 'NANO',
|
|
1496
|
-
'explorer.nebulas.io': 'NAS',
|
|
1497
|
-
'explorer.nbs.plus': 'NBS',
|
|
1498
|
-
'explorer.nebl.io': 'NEBL',
|
|
1499
|
-
'nulscan.io': 'NULS',
|
|
1500
|
-
'nxscan.com': 'NXS',
|
|
1501
|
-
'explorer.harmony.one': 'ONE',
|
|
1502
|
-
'explorer.poa.network': 'POA',
|
|
1503
|
-
'qtum.info': 'QTUM',
|
|
1504
|
-
'explorer.rsk.co': 'RSK',
|
|
1505
|
-
'www.oasisscan.com': 'ROSE',
|
|
1506
|
-
'ravencoin.network': 'RVN',
|
|
1507
|
-
'sc.tokenview.com': 'SC',
|
|
1508
|
-
'secretnodes.com': 'SCRT',
|
|
1509
|
-
'explorer.skycoin.com': 'SKY',
|
|
1510
|
-
'steemscan.com': 'STEEM',
|
|
1511
|
-
'explorer.stacks.co': 'STX',
|
|
1512
|
-
'www.thetascan.io': 'THETA',
|
|
1513
|
-
'scan.tomochain.com': 'TOMO',
|
|
1514
|
-
'explore.vechain.org': 'VET',
|
|
1515
|
-
'explorer.vite.net': 'VITE',
|
|
1516
|
-
'www.wanscan.org': 'WAN',
|
|
1517
|
-
'wavesexplorer.com': 'WAVES',
|
|
1518
|
-
'wax.eosx.io': 'WAXP',
|
|
1519
|
-
'waltonchain.pro': 'WTC',
|
|
1520
|
-
'chain.nem.ninja': 'XEM',
|
|
1521
|
-
'verge-blockchain.info': 'XVG',
|
|
1522
|
-
'explorer.yoyow.org': 'YOYOW',
|
|
1523
|
-
'explorer.zcha.in': 'ZEC',
|
|
1524
|
-
'explorer.zensystem.io': 'ZEN',
|
|
1337
|
+
'SOL': 'SOL', // temporary fix for SPL definition
|
|
1525
1338
|
},
|
|
1526
1339
|
'impliedNetworks': {
|
|
1527
1340
|
'ETH': { 'ERC20': 'ETH' },
|
|
@@ -9261,43 +9074,19 @@ class binance extends binance$1 {
|
|
|
9261
9074
|
parseDepositAddress(response, currency = undefined) {
|
|
9262
9075
|
//
|
|
9263
9076
|
// {
|
|
9264
|
-
// "
|
|
9077
|
+
// "coin": "XRP",
|
|
9265
9078
|
// "address": "rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh",
|
|
9266
9079
|
// "tag": "108618262",
|
|
9267
|
-
// "
|
|
9268
|
-
// "coin": "XRP",
|
|
9269
|
-
// "address": "rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh",
|
|
9270
|
-
// "tag": "108618262",
|
|
9271
|
-
// "url": "https://bithomp.com/explorer/rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh"
|
|
9272
|
-
// }
|
|
9080
|
+
// "url": "https://bithomp.com/explorer/rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh"
|
|
9273
9081
|
// }
|
|
9274
9082
|
//
|
|
9275
|
-
const
|
|
9276
|
-
const url = this.safeString(info, 'url');
|
|
9083
|
+
const url = this.safeString(response, 'url');
|
|
9277
9084
|
const address = this.safeString(response, 'address');
|
|
9278
9085
|
const currencyId = this.safeString(response, 'currency');
|
|
9279
9086
|
const code = this.safeCurrencyCode(currencyId, currency);
|
|
9280
|
-
|
|
9281
|
-
|
|
9282
|
-
|
|
9283
|
-
const parts = url.split('/');
|
|
9284
|
-
let topLevel = this.safeString(parts, 2);
|
|
9285
|
-
if ((topLevel === 'blockchair.com') || (topLevel === 'viewblock.io')) {
|
|
9286
|
-
const subLevel = this.safeString(parts, 3);
|
|
9287
|
-
if (subLevel !== undefined) {
|
|
9288
|
-
topLevel = topLevel + '/' + subLevel;
|
|
9289
|
-
}
|
|
9290
|
-
}
|
|
9291
|
-
impliedNetwork = this.safeString(reverseNetworks, topLevel);
|
|
9292
|
-
const impliedNetworks = this.safeDict(this.options, 'impliedNetworks', {
|
|
9293
|
-
'ETH': { 'ERC20': 'ETH' },
|
|
9294
|
-
'TRX': { 'TRC20': 'TRX' },
|
|
9295
|
-
});
|
|
9296
|
-
if (code in impliedNetworks) {
|
|
9297
|
-
const conversion = this.safeDict(impliedNetworks, code, {});
|
|
9298
|
-
impliedNetwork = this.safeString(conversion, impliedNetwork, impliedNetwork);
|
|
9299
|
-
}
|
|
9300
|
-
}
|
|
9087
|
+
// deposit-address endpoint provides only network url (not network ID/CODE)
|
|
9088
|
+
// so we should map the url to network (their data is inside currencies)
|
|
9089
|
+
const networkCode = this.getNetworkCodeByNetworkUrl(code, url);
|
|
9301
9090
|
let tag = this.safeString(response, 'tag', '');
|
|
9302
9091
|
if (tag.length === 0) {
|
|
9303
9092
|
tag = undefined;
|
|
@@ -9306,7 +9095,7 @@ class binance extends binance$1 {
|
|
|
9306
9095
|
return {
|
|
9307
9096
|
'info': response,
|
|
9308
9097
|
'currency': code,
|
|
9309
|
-
'network':
|
|
9098
|
+
'network': networkCode,
|
|
9310
9099
|
'address': address,
|
|
9311
9100
|
'tag': tag,
|
|
9312
9101
|
};
|
|
@@ -12076,6 +11865,41 @@ class binance extends binance$1 {
|
|
|
12076
11865
|
};
|
|
12077
11866
|
return this.safeString(ledgerType, type, type);
|
|
12078
11867
|
}
|
|
11868
|
+
getNetworkCodeByNetworkUrl(currencyCode, depositUrl = undefined) {
|
|
11869
|
+
// depositUrl is like : https://bscscan.com/address/0xEF238AB229342849..
|
|
11870
|
+
if (depositUrl === undefined) {
|
|
11871
|
+
return undefined;
|
|
11872
|
+
}
|
|
11873
|
+
let networkCode = undefined;
|
|
11874
|
+
const currency = this.currency(currencyCode);
|
|
11875
|
+
const networks = this.safeDict(currency, 'networks', {});
|
|
11876
|
+
const networkCodes = Object.keys(networks);
|
|
11877
|
+
for (let i = 0; i < networkCodes.length; i++) {
|
|
11878
|
+
const currentNetworkCode = networkCodes[i];
|
|
11879
|
+
const info = this.safeDict(networks[currentNetworkCode], 'info', {});
|
|
11880
|
+
const siteUrl = this.safeString(info, 'contractAddressUrl');
|
|
11881
|
+
// check if url matches the field's value
|
|
11882
|
+
if (siteUrl !== undefined && depositUrl.startsWith(this.getBaseDomainFromUrl(siteUrl))) {
|
|
11883
|
+
networkCode = currentNetworkCode;
|
|
11884
|
+
}
|
|
11885
|
+
}
|
|
11886
|
+
return networkCode;
|
|
11887
|
+
}
|
|
11888
|
+
getBaseDomainFromUrl(url) {
|
|
11889
|
+
if (url === undefined) {
|
|
11890
|
+
return undefined;
|
|
11891
|
+
}
|
|
11892
|
+
const urlParts = url.split('/');
|
|
11893
|
+
const scheme = this.safeString(urlParts, 0);
|
|
11894
|
+
if (scheme === undefined) {
|
|
11895
|
+
return undefined;
|
|
11896
|
+
}
|
|
11897
|
+
const domain = this.safeString(urlParts, 2);
|
|
11898
|
+
if (domain === undefined) {
|
|
11899
|
+
return undefined;
|
|
11900
|
+
}
|
|
11901
|
+
return scheme + '//' + domain + '/';
|
|
11902
|
+
}
|
|
12079
11903
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
12080
11904
|
const urls = this.urls;
|
|
12081
11905
|
if (!(api in urls['api'])) {
|