@getpara/evm-wallet-connectors 2.1.0 → 2.2.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.
|
@@ -70,13 +70,14 @@ function EvmExternalWalletProvider({
|
|
|
70
70
|
const [verificationStage, setVerificationStage] = useState("verifying");
|
|
71
71
|
const isLocalConnecting = useExternalWalletStore((state) => state.isConnecting);
|
|
72
72
|
const updateExternalWalletState = useExternalWalletStore((state) => state.updateState);
|
|
73
|
-
const
|
|
73
|
+
const hasStoredExternalWallets = () => {
|
|
74
|
+
var _a;
|
|
74
75
|
const storedExternalWalletsString = localStorage.getItem("@CAPSULE/externalWallets");
|
|
75
76
|
let storedExternalWallets = {};
|
|
76
77
|
if (storedExternalWalletsString) {
|
|
77
78
|
storedExternalWallets = JSON.parse(storedExternalWalletsString);
|
|
78
79
|
}
|
|
79
|
-
return storedExternalWallets;
|
|
80
|
+
return ((_a = Object.values(storedExternalWallets)) == null ? void 0 : _a.length) > 0;
|
|
80
81
|
};
|
|
81
82
|
const switchAccount = useCallback(
|
|
82
83
|
(connectorName) => {
|
|
@@ -118,11 +119,11 @@ function EvmExternalWalletProvider({
|
|
|
118
119
|
[chainId, wagmiAddress, getBalance]
|
|
119
120
|
);
|
|
120
121
|
useEffect(() => {
|
|
121
|
-
const storedExternalWallet = getStoredExternalWallets()[wagmiAddress != null ? wagmiAddress : ""];
|
|
122
122
|
if ((connectedConnector == null ? void 0 : connectedConnector.id) === "para") {
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
|
-
if (!isConnecting && !isReconnecting && !isLocalConnecting && !!wagmiAddress &&
|
|
125
|
+
if (!isConnecting && !isReconnecting && !isLocalConnecting && !!wagmiAddress && // If the user has no stored wallets we want to reset, if they do we should assuming this is being triggered from a wagmi account switch
|
|
126
|
+
!hasStoredExternalWallets() && !disconnectTypeRef.current && para.isReady && !para.isFarcasterMiniApp) {
|
|
126
127
|
reset();
|
|
127
128
|
}
|
|
128
129
|
}, [isConnected, isLocalConnecting, wagmiAddress, connectedConnector, para.isReady, para.isFarcasterMiniApp]);
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/evm-wallet-connectors",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@coinbase/wallet-sdk": "4.3.0",
|
|
6
|
-
"@getpara/wagmi-v2-connector": "2.
|
|
7
|
-
"@getpara/web-sdk": "2.
|
|
6
|
+
"@getpara/wagmi-v2-connector": "2.2.0",
|
|
7
|
+
"@getpara/web-sdk": "2.2.0",
|
|
8
8
|
"@walletconnect/ethereum-provider": "2.23.0",
|
|
9
9
|
"zustand": "^4.5.2",
|
|
10
10
|
"zustand-sync-tabs": "^0.2.2"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@getpara/react-common": "2.
|
|
13
|
+
"@getpara/react-common": "2.2.0",
|
|
14
14
|
"@tanstack/react-query": "^5.74.0",
|
|
15
15
|
"@types/react": "^18.0.31",
|
|
16
16
|
"@types/react-dom": "^18.2.7",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dist",
|
|
27
27
|
"package.json"
|
|
28
28
|
],
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "51765cf39b1667e0283b3906a8f8ef91e447e347",
|
|
30
30
|
"main": "dist/index.js",
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@farcaster/miniapp-wagmi-connector": "^1.0.0",
|