@pioneer-platform/pioneer-caip 9.2.5 → 9.2.6

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 +14 -6
  2. package/package.json +1 -1
package/lib/data.js CHANGED
@@ -207,11 +207,19 @@ exports.shortListNameToCaip = {
207
207
  };
208
208
  var tokenToCaip = function (token) {
209
209
  try {
210
- //get caip from identifier ie. BTC.BTC -> 'bip122:000000000019d6689c085ae165831e93/slip44:0'
211
- var chain = token.identifier.split('.')[0];
212
- var symbol = token.identifier.split('.')[1];
213
- var type = void 0;
214
- var ticker = void 0;
210
+ // Handle identifiers with an extra period
211
+ var parts = token.identifier.split('.');
212
+ var chain = void 0, symbol = void 0;
213
+ if (parts.length >= 2) {
214
+ chain = parts[0];
215
+ symbol = parts.slice(1).join('.'); // Re-join the remaining parts excluding the first
216
+ }
217
+ else {
218
+ // Fallback to the original method if there's only one or no period
219
+ chain = token.identifier.split('.')[0];
220
+ symbol = token.identifier.split('.')[1];
221
+ }
222
+ var type = void 0, ticker = void 0;
215
223
  if (token.address) {
216
224
  ticker = symbol.split('-')[0];
217
225
  type = 'token';
@@ -224,7 +232,7 @@ var tokenToCaip = function (token) {
224
232
  token.caip = caip;
225
233
  token.symbol = symbol;
226
234
  token.ticker = ticker;
227
- //get pubkey for chain
235
+ // Get pubkey for chain
228
236
  return token;
229
237
  }
230
238
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/pioneer-caip",
3
- "version": "9.2.5",
3
+ "version": "9.2.6",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/main.d.ts",
6
6
  "_moduleAliases": {