@rango-dev/widget-embedded 0.39.1-next.18 → 0.39.1-next.19

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.18",
3
+ "version": "0.39.1-next.19",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -27,20 +27,30 @@ export function useSubscribeToWidgetEvents() {
27
27
  event.type === StepEventType.SUCCEEDED;
28
28
 
29
29
  if (shouldRefetchBalance) {
30
+ const fromWallet = route.wallets[step?.fromBlockchain];
30
31
  const fromAccount = connectedWallets.find(
31
- (account) => account.chain === step?.fromBlockchain
32
+ (connectedWallet) =>
33
+ connectedWallet.address?.toLocaleLowerCase() ===
34
+ fromWallet.address?.toLocaleLowerCase() &&
35
+ connectedWallet.walletType === fromWallet.walletType &&
36
+ connectedWallet.chain === step?.fromBlockchain
32
37
  );
33
- const toAccount =
34
- step?.fromBlockchain !== step?.toBlockchain &&
35
- connectedWallets.find(
36
- (wallet) => wallet.chain === step?.toBlockchain
37
- );
38
-
39
38
  if (fromAccount) {
40
39
  void fetchBalances([fromAccount]);
41
40
  }
42
- if (toAccount) {
43
- void fetchBalances([toAccount]);
41
+
42
+ if (step?.fromBlockchain !== step?.toBlockchain) {
43
+ const toWallet = route.wallets[step?.toBlockchain];
44
+ const toAccount = connectedWallets.find(
45
+ (connectedWallet) =>
46
+ connectedWallet.address?.toLocaleLowerCase() ===
47
+ toWallet.address?.toLocaleLowerCase() &&
48
+ connectedWallet.walletType === toWallet.walletType &&
49
+ connectedWallet.chain === step?.toBlockchain
50
+ );
51
+ if (toAccount) {
52
+ void fetchBalances([toAccount]);
53
+ }
44
54
  }
45
55
  }
46
56