@rango-dev/widget-embedded 0.39.1-next.11 → 0.39.1-next.13

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": "@rango-dev/widget-embedded",
3
- "version": "0.39.1-next.11",
3
+ "version": "0.39.1-next.13",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -54,4 +54,4 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  }
57
- }
57
+ }
@@ -480,6 +480,26 @@ export const createWalletsSlice: StateCreator<
480
480
  return;
481
481
  }
482
482
 
483
+ // Remove old balances for current wallet and blockchain
484
+ get().removeBalancesForWallet(walletType, {
485
+ chains: [wallet.blockChain],
486
+ });
487
+
488
+ /*
489
+ * Check if after fetching balance for an account, the account still exists.
490
+ * (It might get disconnected while fetching balances is pending)
491
+ */
492
+ if (
493
+ !get().connectedWallets.find(
494
+ (connectedWallet) =>
495
+ connectedWallet.walletType === walletType &&
496
+ connectedWallet.address === wallet.address &&
497
+ connectedWallet.chain === wallet.blockChain
498
+ )
499
+ ) {
500
+ return;
501
+ }
502
+
483
503
  const balancesForWallet = createBalanceStateForNewAccount(wallet, get);
484
504
 
485
505
  nextAggregatedBalances = updateAggregatedBalanceStateForNewAccount(