@pioneer-platform/pioneer-caip 9.2.36 → 9.2.37

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/data.js +7 -3
  2. package/package.json +1 -1
package/lib/data.js CHANGED
@@ -13,9 +13,13 @@ var networkIdToCaip = function (networkId) {
13
13
  if (networkId.includes('eip155')) {
14
14
  return "".concat(networkId, "/slip44:60");
15
15
  }
16
- // Otherwise, attempt to get CAIP from ChainToCaip using the networkId
17
- var caip = exports.ChainToCaip[networkId] || exports.ChainToNetworkId[networkId];
18
- // Throw an error if no valid CAIP identifier was found
16
+ // Get the chain symbol from NetworkIdToChain using the networkId
17
+ var chainSymbol = exports.NetworkIdToChain[networkId];
18
+ if (!chainSymbol) {
19
+ throw new Error("Unable to find chain symbol for networkId ".concat(networkId, "."));
20
+ }
21
+ // Now get the CAIP from ChainToCaip using the chain symbol
22
+ var caip = exports.ChainToCaip[chainSymbol];
19
23
  if (!caip) {
20
24
  throw new Error("Unable to convert networkId ".concat(networkId, " to CAIP."));
21
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/pioneer-caip",
3
- "version": "9.2.36",
3
+ "version": "9.2.37",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/main.d.ts",
6
6
  "_moduleAliases": {