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.js CHANGED
@@ -573,7 +573,7 @@ const env = {
573
573
  isNative: false,
574
574
  isWeb,
575
575
  };
576
- const currentPackageVersion = "3.0.1" ;
576
+ const currentPackageVersion = "3.0.2" ;
577
577
 
578
578
  /**
579
579
  * Storage keys adapter for Storage interface across different platforms.
@@ -10556,6 +10556,13 @@ class WalletDataService extends Base {
10556
10556
  });
10557
10557
  const addressInfoIsPresentForBlockchain = this.validateWalletAddressInfo(addressInfo.walletAddressesInfo, blockchainName);
10558
10558
  if (addressInfoIsPresentForBlockchain) {
10559
+ // Check if the asset already exists in the wallet before attempting to add it,
10560
+ // to prevent 409 errors on native assets that are added by default when the address is generated
10561
+ const walletAssets = await this.getWalletAssets({ walletId });
10562
+ const existingAsset = walletAssets.assets.find((asset) => asset.configId === assetConfigId);
10563
+ if (existingAsset) {
10564
+ return { asset: existingAsset };
10565
+ }
10559
10566
  const response = await this.addTokenToWallet({
10560
10567
  assetConfigId: assetConfigId,
10561
10568
  walletId: walletId,