@ethereansos/interfaces-core 0.4.79 → 0.4.83

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.cjs.js CHANGED
@@ -34714,8 +34714,8 @@ function toEthereumSymbol(decimals) {
34714
34714
  function toDecimals(number, decimals) {
34715
34715
  var _number, _decimals;
34716
34716
 
34717
- number = Number(!isNaN((_number = number) === null || _number === void 0 ? void 0 : _number.value) ? number.value : number);
34718
- decimals = Number(!isNaN((_decimals = decimals) === null || _decimals === void 0 ? void 0 : _decimals.value) ? decimals.value : decimals) || 18;
34717
+ number = numberToString(((_number = number) === null || _number === void 0 ? void 0 : _number.value) || number || 0);
34718
+ decimals = numberToString(((_decimals = decimals) === null || _decimals === void 0 ? void 0 : _decimals.value) || decimals || 0);
34719
34719
 
34720
34720
  if (!number) {
34721
34721
  number = '0';
@@ -48317,6 +48317,19 @@ const gBase64 = {
48317
48317
  extendBuiltins: extendBuiltins,
48318
48318
  };
48319
48319
 
48320
+ function cleanLink(linkToClean) {
48321
+ var cleanedLink = linkToClean;
48322
+
48323
+ if (cleanedLink.indexOf('data:') === 0 || cleanedLink.indexOf('ipfs') === -1) {
48324
+ return cleanedLink;
48325
+ }
48326
+
48327
+ var split = cleanedLink.split('/ipfs/');
48328
+ var ipfsLink = split[split.length - 1];
48329
+ cleanedLink = '//gateway.ipfs.io/ipfs/' + ipfsLink;
48330
+ return cleanedLink;
48331
+ }
48332
+
48320
48333
  function tryRetrieveMetadata(_x, _x2) {
48321
48334
  return _tryRetrieveMetadata.apply(this, arguments);
48322
48335
  }
@@ -48383,9 +48396,9 @@ function _tryRetrieveMetadata() {
48383
48396
  break;
48384
48397
  }
48385
48398
 
48386
- item.image = formatLink({
48399
+ item.image = cleanLink(formatLink({
48387
48400
  context: context
48388
- }, item.metadataLink);
48401
+ }, item.metadataLink));
48389
48402
  _context.prev = 23;
48390
48403
 
48391
48404
  if (!item.metadataLink.startsWith('data:application/json;base64,')) {
@@ -48399,9 +48412,9 @@ function _tryRetrieveMetadata() {
48399
48412
 
48400
48413
  case 28:
48401
48414
  _context.next = 30;
48402
- return fetch(formatLink({
48415
+ return fetch(cleanLink(formatLink({
48403
48416
  context: context
48404
- }, item.metadataLink));
48417
+ }, item.metadataLink)));
48405
48418
 
48406
48419
  case 30:
48407
48420
  _context.next = 32;