@pioneer-platform/pioneer-caip 9.2.37 → 9.3.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @pioneer-platform/pioneer-caip
2
+
3
+ ## 9.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Release: minor version bump for all packages
package/lib/data.d.ts CHANGED
@@ -15,6 +15,7 @@ export declare const evmCaips: {
15
15
  'bittorrent-chain': string;
16
16
  celo: string;
17
17
  avalanche: string;
18
+ scroll: string;
18
19
  grli: string;
19
20
  eos: string;
20
21
  'ethereum-classic': string;
package/lib/data.js CHANGED
@@ -6,7 +6,8 @@
6
6
 
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.caipToRango = exports.caipToThorchain = exports.tokenToCaip = exports.thorchainToCaip = exports.NetworkIdToRangoName = exports.shortListRangoNameToNetworkId = exports.shortListNameToCaip = exports.shortListSymbolToCaip = exports.shortListSymbolToCoinGeckoPlatformId = exports.getChainEnumValue = exports.NetworkIdToChain = exports.ChainToNetworkId = exports.ChainToCaip = exports.Chain = exports.evmCaips = exports.caipToNetworkId = exports.networkIdToCaip = void 0;
9
+ exports.caipToRango = exports.caipToThorchain = exports.tokenToCaip = exports.thorchainToCaip = exports.NetworkIdToRangoName = exports.shortListRangoNameToNetworkId = exports.shortListNameToCaip = exports.shortListSymbolToCaip = exports.shortListSymbolToCoinGeckoPlatformId = exports.NetworkIdToChain = exports.ChainToNetworkId = exports.ChainToCaip = exports.Chain = exports.evmCaips = exports.caipToNetworkId = exports.networkIdToCaip = void 0;
10
+ exports.getChainEnumValue = getChainEnumValue;
10
11
  //networkIdToCaip
11
12
  var networkIdToCaip = function (networkId) {
12
13
  // Check if networkId includes 'eip155' and assume /slip44:60 if true
@@ -45,6 +46,7 @@ exports.evmCaips = {
45
46
  'bittorrent-chain': 'eip155:199/slip44:60',
46
47
  celo: 'eip155:42220/slip44:60',
47
48
  'avalanche': 'eip155:43114/slip44:60',
49
+ scroll: 'eip155:534352/slip44:60',
48
50
  grli: 'eip155:5/slip44:60',
49
51
  eos: 'eip155:59/slip44:60',
50
52
  'ethereum-classic': 'eip155:61/slip44:60',
@@ -180,7 +182,6 @@ function getChainEnumValue(chainStr) {
180
182
  return undefined;
181
183
  }
182
184
  }
183
- exports.getChainEnumValue = getChainEnumValue;
184
185
  exports.shortListSymbolToCoinGeckoPlatformId = {
185
186
  ARB: 'arbitrum',
186
187
  BASE: 'base',
@@ -393,9 +394,8 @@ exports.thorchainToCaip = thorchainToCaip;
393
394
  var caipToThorchain = function (caip, ticker) {
394
395
  try {
395
396
  var networkId = caip.split('/')[0]; // Splitting off the network ID from the CAIP
396
- // console.log("networkId: ", networkId);
397
397
  if (!networkId)
398
- throw Error("Invalid CAIP!");
398
+ throw new Error("Invalid CAIP!");
399
399
  var chain = exports.NetworkIdToChain[networkId];
400
400
  if (!chain) {
401
401
  console.error("No matching chain symbol found for network ID", networkId);
@@ -405,6 +405,10 @@ var caipToThorchain = function (caip, ticker) {
405
405
  if (networkId === 'cosmos:osmosis-1' && ticker === 'ATOM') {
406
406
  return 'OSMO.ATOM';
407
407
  }
408
+ // Special handling for 'THOR.THOR' to return 'THOR.RUNE'
409
+ if (chain === 'THOR' && ticker === 'THOR') {
410
+ return 'THOR.RUNE';
411
+ }
408
412
  // Handling contract tokens
409
413
  if (caip.includes('erc20')) {
410
414
  if (!ticker) {
@@ -423,7 +427,6 @@ var caipToThorchain = function (caip, ticker) {
423
427
  }
424
428
  else {
425
429
  // Handling native tokens
426
- // return chain + "." + chain;
427
430
  return ticker ? "".concat(chain, ".").concat(ticker) : "".concat(chain, ".").concat(chain);
428
431
  }
429
432
  }
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
1
  {
2
2
  "name": "@pioneer-platform/pioneer-caip",
3
- "version": "9.2.37",
3
+ "version": "9.3.0",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/main.d.ts",
6
6
  "_moduleAliases": {
7
7
  "@coins": "lib/coins"
8
8
  },
9
- "scripts": {
10
- "npm": "npm i",
11
- "build": "tsc -p .",
12
- "test": "npm run build && node __tests__/test-module.js",
13
- "test-suite": "npm run build && node __tests__/tests-common.js",
14
- "build:watch": "npm run build && onchange 'src/**/*.ts' -- npm run build",
15
- "prepublish": "npm run build"
16
- },
17
9
  "devDependencies": {
18
10
  "@types/express": "^4.17.6",
19
- "@types/node": "^13.13.50",
11
+ "@types/node": "^18.16.0",
20
12
  "nodemon": "^2.0.3",
21
- "typescript": "^5.0.2"
13
+ "typescript": "^5.0.4"
22
14
  },
23
- "gitHead": "a76012f6693a12181c4744e53e977a9eaeef0ed3"
24
- }
15
+ "gitHead": "a76012f6693a12181c4744e53e977a9eaeef0ed3",
16
+ "scripts": {
17
+ "npm": "pnpm i",
18
+ "build": "tsc -p .",
19
+ "test": "pnpm run build && node __tests__/test-module.js",
20
+ "test-suite": "pnpm run build && node __tests__/tests-common.js",
21
+ "build:watch": "pnpm run build && onchange 'src/**/*.ts' -- pnpm run build",
22
+ "prepublish": "pnpm run build"
23
+ }
24
+ }