wallaby-cash 3.0.1 → 3.0.2

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
@@ -568,7 +568,7 @@ const MASTER_ENCRYPTION_KEY = '9fa9d3f3c77c20d3a50a08e5299644be29f6e6206ef3479fe
568
568
  { type: 'public-key', alg: PublicKeyCredentialAlgorithm.ES256 },
569
569
  ];
570
570
  const isWeb = typeof window !== 'undefined' && typeof document !== 'undefined';
571
- const currentPackageVersion = "3.0.1" ;
571
+ const currentPackageVersion = "3.0.2" ;
572
572
 
573
573
  /**
574
574
  * Storage keys adapter for Storage interface across different platforms.
@@ -10434,6 +10434,13 @@ class WalletDataService extends Base {
10434
10434
  });
10435
10435
  const addressInfoIsPresentForBlockchain = this.validateWalletAddressInfo(addressInfo.walletAddressesInfo, blockchainName);
10436
10436
  if (addressInfoIsPresentForBlockchain) {
10437
+ // Check if the asset already exists in the wallet before attempting to add it,
10438
+ // to prevent 409 errors on native assets that are added by default when the address is generated
10439
+ const walletAssets = await this.getWalletAssets({ walletId });
10440
+ const existingAsset = walletAssets.assets.find((asset) => asset.configId === assetConfigId);
10441
+ if (existingAsset) {
10442
+ return { asset: existingAsset };
10443
+ }
10437
10444
  const response = await this.addTokenToWallet({
10438
10445
  assetConfigId: assetConfigId,
10439
10446
  walletId: walletId,