@ethereansos/interfaces-core 0.4.79 → 0.4.80

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/dist/index.esm.js CHANGED
@@ -48306,6 +48306,19 @@ const gBase64 = {
48306
48306
  extendBuiltins: extendBuiltins,
48307
48307
  };
48308
48308
 
48309
+ function cleanLink(linkToClean) {
48310
+ var cleanedLink = linkToClean;
48311
+
48312
+ if (cleanedLink.indexOf('data:') === 0 || cleanedLink.indexOf('ipfs') === -1) {
48313
+ return cleanedLink;
48314
+ }
48315
+
48316
+ var split = cleanedLink.split('/ipfs/');
48317
+ var ipfsLink = split[split.length - 1];
48318
+ cleanedLink = '//gateway.ipfs.io/ipfs/' + ipfsLink;
48319
+ return cleanedLink;
48320
+ }
48321
+
48309
48322
  function tryRetrieveMetadata(_x, _x2) {
48310
48323
  return _tryRetrieveMetadata.apply(this, arguments);
48311
48324
  }
@@ -48372,9 +48385,9 @@ function _tryRetrieveMetadata() {
48372
48385
  break;
48373
48386
  }
48374
48387
 
48375
- item.image = formatLink({
48388
+ item.image = cleanLink(formatLink({
48376
48389
  context: context
48377
- }, item.metadataLink);
48390
+ }, item.metadataLink));
48378
48391
  _context.prev = 23;
48379
48392
 
48380
48393
  if (!item.metadataLink.startsWith('data:application/json;base64,')) {
@@ -48388,9 +48401,9 @@ function _tryRetrieveMetadata() {
48388
48401
 
48389
48402
  case 28:
48390
48403
  _context.next = 30;
48391
- return fetch(formatLink({
48404
+ return fetch(cleanLink(formatLink({
48392
48405
  context: context
48393
- }, item.metadataLink));
48406
+ }, item.metadataLink)));
48394
48407
 
48395
48408
  case 30:
48396
48409
  _context.next = 32;