@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.
- package/lib/data.js +7 -3
- 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
|
-
//
|
17
|
-
var
|
18
|
-
|
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
|
}
|