@pioneer-platform/pioneer-coins 9.0.2 → 9.0.4
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/lib/address.js +7 -0
- package/lib/paths.js +24 -1
- package/package.json +1 -1
package/lib/address.js
CHANGED
|
@@ -29,17 +29,22 @@ var Coin;
|
|
|
29
29
|
Coin["EOS"] = "Eos";
|
|
30
30
|
Coin["FIO"] = "Fio";
|
|
31
31
|
})(Coin || (exports.Coin = Coin = {}));
|
|
32
|
+
var EVM_COINS = ["AVAX", "ARB", "MATIC", "AVAX", "BASE"];
|
|
32
33
|
var addressInfoForCoin = function (symbol, isTestnet, scriptType, showDisplay, path) {
|
|
33
34
|
if (!isTestnet)
|
|
34
35
|
isTestnet = false;
|
|
35
36
|
if (!showDisplay)
|
|
36
37
|
showDisplay = false;
|
|
37
38
|
var paths = (0, paths_1.getPaths)(paths_1.blockchains);
|
|
39
|
+
console.log("paths: ", paths);
|
|
38
40
|
//thorswap hack
|
|
39
41
|
if (symbol === "THOR")
|
|
40
42
|
symbol = "RUNE";
|
|
41
43
|
if (symbol === "GAIA")
|
|
42
44
|
symbol = "ATOM";
|
|
45
|
+
//if any EVM
|
|
46
|
+
if (EVM_COINS.includes(symbol))
|
|
47
|
+
symbol = "ETH";
|
|
43
48
|
// log.info('paths', paths)
|
|
44
49
|
symbol = symbol.toUpperCase();
|
|
45
50
|
var blockchainEntries = paths.filter(function (entry) { return entry.symbol === symbol.toUpperCase(); });
|
|
@@ -56,6 +61,8 @@ var addressInfoForCoin = function (symbol, isTestnet, scriptType, showDisplay, p
|
|
|
56
61
|
entry = blockchainEntries[0];
|
|
57
62
|
}
|
|
58
63
|
//validate script type options
|
|
64
|
+
if (!entry)
|
|
65
|
+
throw new Error("Blockchain symbol '".concat(symbol, "' not found."));
|
|
59
66
|
var addressInfo = {
|
|
60
67
|
address_n: entry.addressNListMaster,
|
|
61
68
|
path: (0, coins_1.addressNListToBIP32)(entry.addressNListMaster),
|
package/lib/paths.js
CHANGED
|
@@ -2,7 +2,30 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getPaths = exports.blockchains = void 0;
|
|
4
4
|
var log = require('@pioneer-platform/loggerdog')();
|
|
5
|
-
exports.blockchains = [
|
|
5
|
+
exports.blockchains = [
|
|
6
|
+
'eip155:42161',
|
|
7
|
+
'eip155:43114',
|
|
8
|
+
'eip155:56',
|
|
9
|
+
'binance:bnb-beacon-chain',
|
|
10
|
+
'bip122:000000000000000000651ef99cb9fcbe',
|
|
11
|
+
'bip122:000000000019d6689c085ae165831e93',
|
|
12
|
+
'eip155:8453',
|
|
13
|
+
'cosmos:cosmoshub-4',
|
|
14
|
+
'bip122:dash-hash',
|
|
15
|
+
'bip122:digibytes-hash',
|
|
16
|
+
'bip122:00000000001a91e3dace36e2be3bf030',
|
|
17
|
+
'cosmos:kaiyo-1',
|
|
18
|
+
'eos:cf057bbfb72640471fd910bcb67639c2',
|
|
19
|
+
'eip155:1',
|
|
20
|
+
'bip122:12a765e31ffd4059bada1e25190f6e98',
|
|
21
|
+
'cosmos:maya-mainnet-v1',
|
|
22
|
+
'eip155:10',
|
|
23
|
+
'cosmos:osmosis-1',
|
|
24
|
+
'eip155:137',
|
|
25
|
+
'ripple:unknown',
|
|
26
|
+
'cosmos:thorchain-mainnet-v1',
|
|
27
|
+
'bip122:0000000000196a45'
|
|
28
|
+
];
|
|
6
29
|
function getPaths(blockchains, isTestnet) {
|
|
7
30
|
var output = [];
|
|
8
31
|
if (!blockchains)
|