@pioneer-platform/pioneer-caip 9.2.37 → 9.2.38

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 +5 -3
  2. package/package.json +1 -1
package/lib/data.js CHANGED
@@ -393,9 +393,8 @@ exports.thorchainToCaip = thorchainToCaip;
393
393
  var caipToThorchain = function (caip, ticker) {
394
394
  try {
395
395
  var networkId = caip.split('/')[0]; // Splitting off the network ID from the CAIP
396
- // console.log("networkId: ", networkId);
397
396
  if (!networkId)
398
- throw Error("Invalid CAIP!");
397
+ throw new Error("Invalid CAIP!");
399
398
  var chain = exports.NetworkIdToChain[networkId];
400
399
  if (!chain) {
401
400
  console.error("No matching chain symbol found for network ID", networkId);
@@ -405,6 +404,10 @@ var caipToThorchain = function (caip, ticker) {
405
404
  if (networkId === 'cosmos:osmosis-1' && ticker === 'ATOM') {
406
405
  return 'OSMO.ATOM';
407
406
  }
407
+ // Special handling for 'THOR.THOR' to return 'THOR.RUNE'
408
+ if (chain === 'THOR' && ticker === 'THOR') {
409
+ return 'THOR.RUNE';
410
+ }
408
411
  // Handling contract tokens
409
412
  if (caip.includes('erc20')) {
410
413
  if (!ticker) {
@@ -423,7 +426,6 @@ var caipToThorchain = function (caip, ticker) {
423
426
  }
424
427
  else {
425
428
  // Handling native tokens
426
- // return chain + "." + chain;
427
429
  return ticker ? "".concat(chain, ".").concat(ticker) : "".concat(chain, ".").concat(chain);
428
430
  }
429
431
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/pioneer-caip",
3
- "version": "9.2.37",
3
+ "version": "9.2.38",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/main.d.ts",
6
6
  "_moduleAliases": {