@pioneer-platform/pioneer-coins 9.0.3 → 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.
Files changed (2) hide show
  1. package/lib/address.js +7 -0
  2. 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/pioneer-coins",
3
- "version": "9.0.3",
3
+ "version": "9.0.4",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/main.d.ts",
6
6
  "_moduleAliases": {