@rango-dev/widget-embedded 0.41.0 → 0.41.1-next.1

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.41.0",
3
+ "version": "0.41.1-next.1",
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
+ }
@@ -28,28 +28,32 @@ export function useSubscribeToWidgetEvents() {
28
28
 
29
29
  if (shouldRefetchBalance) {
30
30
  const fromWallet = route.wallets[step?.fromBlockchain];
31
- const fromAccount = connectedWallets.find(
32
- (connectedWallet) =>
33
- connectedWallet.address?.toLocaleLowerCase() ===
34
- fromWallet.address?.toLocaleLowerCase() &&
35
- connectedWallet.walletType === fromWallet.walletType &&
36
- connectedWallet.chain === step?.fromBlockchain
37
- );
38
- if (fromAccount) {
39
- void fetchBalances([fromAccount]);
31
+ if (fromWallet) {
32
+ const fromAccount = connectedWallets.find(
33
+ (connectedWallet) =>
34
+ connectedWallet.address?.toLocaleLowerCase() ===
35
+ fromWallet.address?.toLocaleLowerCase() &&
36
+ connectedWallet.walletType === fromWallet.walletType &&
37
+ connectedWallet.chain === step?.fromBlockchain
38
+ );
39
+ if (fromAccount) {
40
+ void fetchBalances([fromAccount]);
41
+ }
40
42
  }
41
43
 
42
44
  if (step?.fromBlockchain !== step?.toBlockchain) {
43
45
  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]);
46
+ if (toWallet) {
47
+ const toAccount = connectedWallets.find(
48
+ (connectedWallet) =>
49
+ connectedWallet.address?.toLocaleLowerCase() ===
50
+ toWallet.address?.toLocaleLowerCase() &&
51
+ connectedWallet.walletType === toWallet.walletType &&
52
+ connectedWallet.chain === step?.toBlockchain
53
+ );
54
+ if (toAccount) {
55
+ void fetchBalances([toAccount]);
56
+ }
53
57
  }
54
58
  }
55
59
  }
@@ -641,7 +641,8 @@ export const createWalletsSlice = keepLastUpdated<AppStoreState, WalletsSlice>(
641
641
  response = await httpService().getWalletsDetails(addressesToFetch);
642
642
  } catch (e) {
643
643
  get().setConnectedWalletHasError(accounts);
644
- throw new Error(`Request for fetching balances failed.`, { cause: e });
644
+ console.error(`Request for fetching balances failed. cause: ${e}`);
645
+ return;
645
646
  }
646
647
 
647
648
  const walletsDetails = response.wallets;
@@ -720,8 +721,8 @@ export const createWalletsSlice = keepLastUpdated<AppStoreState, WalletsSlice>(
720
721
  get().setConnectedWalletRetrievedData(accounts, walletsDetails);
721
722
  } else {
722
723
  get().setConnectedWalletHasError(accounts);
723
- throw new Error(
724
- `We couldn't fetch your account balances. Seem there is no information on blockchain for them yet.`
724
+ console.error(
725
+ "We couldn't fetch your account balances. Seem there is no information on blockchain for them yet."
725
726
  );
726
727
  }
727
728
  },