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.cjs.js CHANGED
@@ -597,7 +597,7 @@ const MASTER_ENCRYPTION_KEY = '9fa9d3f3c77c20d3a50a08e5299644be29f6e6206ef3479fe
597
597
  { type: 'public-key', alg: exports.PublicKeyCredentialAlgorithm.ES256 },
598
598
  ];
599
599
  const isWeb = typeof window !== 'undefined' && typeof document !== 'undefined';
600
- const currentPackageVersion = "3.0.1" ;
600
+ const currentPackageVersion = "3.0.2" ;
601
601
 
602
602
  /**
603
603
  * Storage keys adapter for Storage interface across different platforms.
@@ -10463,6 +10463,13 @@ class WalletDataService extends Base {
10463
10463
  });
10464
10464
  const addressInfoIsPresentForBlockchain = this.validateWalletAddressInfo(addressInfo.walletAddressesInfo, blockchainName);
10465
10465
  if (addressInfoIsPresentForBlockchain) {
10466
+ // Check if the asset already exists in the wallet before attempting to add it,
10467
+ // to prevent 409 errors on native assets that are added by default when the address is generated
10468
+ const walletAssets = await this.getWalletAssets({ walletId });
10469
+ const existingAsset = walletAssets.assets.find((asset) => asset.configId === assetConfigId);
10470
+ if (existingAsset) {
10471
+ return { asset: existingAsset };
10472
+ }
10466
10473
  const response = await this.addTokenToWallet({
10467
10474
  assetConfigId: assetConfigId,
10468
10475
  walletId: walletId,