@sundaeswap/wallet-lite 0.0.22 → 0.0.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sundaeswap/wallet-lite",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -570,11 +570,28 @@ export class WalletObserver<
570
570
  }
571
571
  }
572
572
 
573
- const newMetadata = await this._options.metadataResolver(
574
- assetIds.map(normalizeAssetIdWithDot),
575
- normalizeAssetIdWithDot,
576
- isAdaAsset
577
- );
573
+ let attempts = 0;
574
+ let newMetadata: Map<string, AssetMetadata> | undefined;
575
+ while (attempts <= 3 && !newMetadata) {
576
+ try {
577
+ newMetadata = await this._options.metadataResolver(
578
+ assetIds.map(normalizeAssetIdWithDot),
579
+ normalizeAssetIdWithDot,
580
+ isAdaAsset
581
+ );
582
+ } catch (e) {
583
+ attempts++;
584
+ }
585
+ }
586
+
587
+ if (!newMetadata) {
588
+ newMetadata = await this.fallbackMetadataResolver(
589
+ assetIds.map(normalizeAssetIdWithDot),
590
+ normalizeAssetIdWithDot,
591
+ isAdaAsset
592
+ );
593
+ }
594
+
578
595
  this._cachedMetadata = newMetadata;
579
596
  return newMetadata;
580
597
  };