@getpara/react-sdk-lite 2.17.0 → 2.18.0

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/cli/cli.mjs CHANGED
File without changes
@@ -99,7 +99,7 @@ const ParaModal = forwardRef((props, ref) => {
99
99
  onClose,
100
100
  defaultAuthIdentifier
101
101
  }), rest),
102
- reactSdkVersion: "2.16.0"
102
+ reactSdkVersion: "2.18.0"
103
103
  });
104
104
  } catch (e) {
105
105
  }
@@ -218,8 +218,10 @@ const ParaModal = forwardRef((props, ref) => {
218
218
  setIsModalMounted(true);
219
219
  };
220
220
  const handleModalExited = () => __async(void 0, null, function* () {
221
- setIsModalMounted(false);
222
- goBack();
221
+ if (isModalMounted) {
222
+ setIsModalMounted(false);
223
+ goBack();
224
+ }
223
225
  });
224
226
  useEffect(() => {
225
227
  var _a2;
@@ -12,7 +12,7 @@ import { useGoBack } from "../../../../hooks/useGoBack.js";
12
12
  import { useWalletState } from "../../../../../provider/index.js";
13
13
  import { DEFAULTS } from "../../../../constants/defaults.js";
14
14
  const AccountProvider = ({ children }) => {
15
- const { switchWallets: mutateSwitchWallets } = useSwitchWallets();
15
+ const { switchWalletsAsync: mutateSwitchWalletsAsync } = useSwitchWallets();
16
16
  const { goBack } = useGoBack();
17
17
  const { updateSelectedWallet } = useWalletState();
18
18
  const refs = useStore((state) => state.refs);
@@ -42,55 +42,48 @@ const AccountProvider = ({ children }) => {
42
42
  refs.poll.current = {
43
43
  action: "login",
44
44
  timeout: window == null ? void 0 : window.setTimeout(() => __async(void 0, null, function* () {
45
- mutateSwitchWallets(
46
- {
47
- isCanceled: () => {
48
- var _a, _b;
49
- const currentView = store.getState().accountView;
50
- const exitedSteps = !!currentView && !["ACCOUNT_SWITCH_WALLETS", "ACCOUNT_SWITCH_WALLETS_IFRAME"].includes(currentView);
51
- const popupClosed = (_b = (_a = refs.popupWindow.current) == null ? void 0 : _a.closed) != null ? _b : false;
52
- const isCanceled = exitedSteps || popupClosed;
53
- if (isCanceled) {
54
- if (popupClosed && (currentView === "ACCOUNT_SWITCH_WALLETS" || currentView === "ACCOUNT_SWITCH_WALLETS_IFRAME")) {
55
- goBack();
56
- }
57
- }
58
- return isCanceled;
59
- },
60
- onPoll: () => {
61
- var _a;
62
- const currentView = store.getState().accountView;
63
- if (currentView === "ACCOUNT_SWITCH_WALLETS" || currentView === "ACCOUNT_SWITCH_WALLETS_IFRAME") {
64
- if (((_a = refs.popupWindow.current) == null ? void 0 : _a.closed) && ["ACCOUNT_SWITCH_WALLETS", "ACCOUNT_SWITCH_WALLETS_IFRAME"].includes(currentView)) {
65
- refs.popupWindow.current = null;
66
- goBack();
67
- }
45
+ mutateSwitchWalletsAsync({
46
+ isCanceled: () => {
47
+ var _a, _b;
48
+ const currentView = store.getState().accountView;
49
+ const exitedSteps = !!currentView && !["ACCOUNT_SWITCH_WALLETS", "ACCOUNT_SWITCH_WALLETS_IFRAME"].includes(currentView);
50
+ const popupClosed = (_b = (_a = refs.popupWindow.current) == null ? void 0 : _a.closed) != null ? _b : false;
51
+ const isCanceled = exitedSteps || popupClosed;
52
+ if (isCanceled) {
53
+ if (popupClosed && (currentView === "ACCOUNT_SWITCH_WALLETS" || currentView === "ACCOUNT_SWITCH_WALLETS_IFRAME")) {
54
+ goBack();
68
55
  }
69
56
  }
57
+ return isCanceled;
70
58
  },
71
- {
72
- onSuccess: () => __async(void 0, null, function* () {
73
- yield updateSelectedWallet();
74
- setTimeout(() => {
75
- setAccountView("ACCOUNT_PROFILE");
59
+ onPoll: () => {
60
+ var _a;
61
+ const currentView = store.getState().accountView;
62
+ if (currentView === "ACCOUNT_SWITCH_WALLETS" || currentView === "ACCOUNT_SWITCH_WALLETS_IFRAME") {
63
+ if (((_a = refs.popupWindow.current) == null ? void 0 : _a.closed) && ["ACCOUNT_SWITCH_WALLETS", "ACCOUNT_SWITCH_WALLETS_IFRAME"].includes(currentView)) {
76
64
  refs.popupWindow.current = null;
77
- }, 500);
78
- }),
79
- onError: () => {
80
- const currentView = store.getState().accountView;
81
- if (currentView === "ACCOUNT_SWITCH_WALLETS") {
82
65
  goBack();
83
66
  }
84
- },
85
- onSettled: () => {
86
- var _a;
87
- setIsSwitchWalletsPending(false);
88
- window == null ? void 0 : window.clearTimeout((_a = refs.poll.current) == null ? void 0 : _a.timeout);
89
- refs.poll.current = null;
90
- refs.popupWindow.current = null;
91
67
  }
92
68
  }
93
- );
69
+ }).then(() => __async(void 0, null, function* () {
70
+ yield updateSelectedWallet();
71
+ setTimeout(() => {
72
+ setAccountView("ACCOUNT_PROFILE");
73
+ refs.popupWindow.current = null;
74
+ }, 500);
75
+ })).catch(() => {
76
+ const currentView = store.getState().accountView;
77
+ if (currentView === "ACCOUNT_SWITCH_WALLETS") {
78
+ goBack();
79
+ }
80
+ }).finally(() => {
81
+ var _a;
82
+ setIsSwitchWalletsPending(false);
83
+ window == null ? void 0 : window.clearTimeout((_a = refs.poll.current) == null ? void 0 : _a.timeout);
84
+ refs.poll.current = null;
85
+ refs.popupWindow.current = null;
86
+ });
94
87
  }), DEFAULTS.LOGGIN_POLLING_DELAY_MS)
95
88
  };
96
89
  }
@@ -574,6 +574,8 @@ function ExternalWalletProvider({ children }) {
574
574
  case "COSMOS":
575
575
  yield cosmosSwitchConnection == null ? void 0 : cosmosSwitchConnection(id);
576
576
  break;
577
+ case "SOLANA":
578
+ break;
577
579
  default:
578
580
  break;
579
581
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@getpara/react-sdk-lite",
3
- "version": "2.17.0",
3
+ "version": "2.18.0",
4
4
  "bin": {
5
5
  "setup-para": "dist/cli/cli.mjs"
6
6
  },
7
7
  "dependencies": {
8
- "@getpara/react-common": "2.17.0",
9
- "@getpara/react-components": "2.17.0",
10
- "@getpara/web-sdk": "2.17.0",
8
+ "@getpara/react-common": "2.18.0",
9
+ "@getpara/react-components": "2.18.0",
10
+ "@getpara/web-sdk": "2.18.0",
11
11
  "date-fns": "^3.6.0",
12
12
  "detect-browser": "^5.3.0",
13
13
  "framer-motion": "^11.3.31",
@@ -18,19 +18,19 @@
18
18
  "zustand-sync-tabs": "^0.2.2"
19
19
  },
20
20
  "devDependencies": {
21
- "@getpara/aa-alchemy": "2.17.0",
22
- "@getpara/aa-biconomy": "2.17.0",
23
- "@getpara/aa-cdp": "2.17.0",
24
- "@getpara/aa-gelato": "2.17.0",
25
- "@getpara/aa-pimlico": "2.17.0",
26
- "@getpara/aa-porto": "2.17.0",
27
- "@getpara/aa-rhinestone": "2.17.0",
28
- "@getpara/aa-safe": "2.17.0",
29
- "@getpara/aa-thirdweb": "2.17.0",
30
- "@getpara/aa-zerodev": "2.17.0",
31
- "@getpara/cosmos-wallet-connectors": "2.17.0",
32
- "@getpara/evm-wallet-connectors": "2.17.0",
33
- "@getpara/solana-wallet-connectors": "2.17.0",
21
+ "@getpara/aa-alchemy": "2.18.0",
22
+ "@getpara/aa-biconomy": "2.18.0",
23
+ "@getpara/aa-cdp": "2.18.0",
24
+ "@getpara/aa-gelato": "2.18.0",
25
+ "@getpara/aa-pimlico": "2.18.0",
26
+ "@getpara/aa-porto": "2.18.0",
27
+ "@getpara/aa-rhinestone": "2.18.0",
28
+ "@getpara/aa-safe": "2.18.0",
29
+ "@getpara/aa-thirdweb": "2.18.0",
30
+ "@getpara/aa-zerodev": "2.18.0",
31
+ "@getpara/cosmos-wallet-connectors": "2.18.0",
32
+ "@getpara/evm-wallet-connectors": "2.18.0",
33
+ "@getpara/solana-wallet-connectors": "2.18.0",
34
34
  "@tanstack/react-query": "^5.74.0",
35
35
  "@testing-library/dom": "^10.4.0",
36
36
  "@testing-library/react": "^16.3.0",
@@ -50,7 +50,7 @@
50
50
  "package.json",
51
51
  "styles.css"
52
52
  ],
53
- "gitHead": "3ed1f835b97ae720f1ac747611296e3b86f61138",
53
+ "gitHead": "4481f6f4e108e682d14c74d4433696141c47fc58",
54
54
  "main": "dist/index.js",
55
55
  "peerDependencies": {
56
56
  "@getpara/aa-alchemy": ">=2.15.0",