@getpara/evm-wallet-connectors 2.0.0-alpha.66 → 2.0.0-alpha.67
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.
|
@@ -53,14 +53,14 @@ function EvmExternalWalletProvider({
|
|
|
53
53
|
} = useAccount();
|
|
54
54
|
const { switchAccount: wagmiSwitchAccount } = useSwitchAccount();
|
|
55
55
|
const { chains, switchChainAsync } = useSwitchChain();
|
|
56
|
-
const { disconnectAsync } = useDisconnect();
|
|
56
|
+
const { disconnectAsync, status: disconnectStatus } = useDisconnect();
|
|
57
57
|
const { data: ensName, refetch: refetchEnsName } = useEnsName({ address: wagmiAddress });
|
|
58
58
|
const { data: ensAvatar, refetch: refetchEnsAvatar } = useEnsAvatar({
|
|
59
59
|
name: normalize(ensName)
|
|
60
60
|
});
|
|
61
61
|
const { signMessageAsync } = useSignMessage();
|
|
62
62
|
const connectedWallet = connectedWalletProp ? para.findWallet(connectedWalletProp.id, connectedWalletProp.type) : null;
|
|
63
|
-
const
|
|
63
|
+
const disconnectTypeRef = useRef();
|
|
64
64
|
const verificationMessage = useRef();
|
|
65
65
|
const { refetch: getBalance } = useBalance({ address: wagmiAddress });
|
|
66
66
|
const connectors = untypedConnectors;
|
|
@@ -121,13 +121,13 @@ function EvmExternalWalletProvider({
|
|
|
121
121
|
if ((connectedConnector == null ? void 0 : connectedConnector.id) === "para") {
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
if (!isConnecting && !isReconnecting && !isLocalConnecting && !!wagmiAddress && !storedExternalWallet && !
|
|
124
|
+
if (!isConnecting && !isReconnecting && !isLocalConnecting && !!wagmiAddress && !storedExternalWallet && !disconnectTypeRef.current && para.isReady && !para.isFarcasterMiniApp) {
|
|
125
125
|
reset();
|
|
126
126
|
}
|
|
127
127
|
}, [isConnected, isLocalConnecting, wagmiAddress, connectedConnector, para.isReady, para.isFarcasterMiniApp]);
|
|
128
128
|
useEffect(() => {
|
|
129
129
|
const storedExternalWallet = Object.values(para.externalWallets || {})[0];
|
|
130
|
-
if (!isLocalConnecting && isConnected && (storedExternalWallet == null ? void 0 : storedExternalWallet.type) === "EVM" && (storedExternalWallet == null ? void 0 : storedExternalWallet.address) !== wagmiAddress && (connectedConnector == null ? void 0 : connectedConnector.id) !== "para" && !
|
|
130
|
+
if (!isLocalConnecting && isConnected && (storedExternalWallet == null ? void 0 : storedExternalWallet.type) === "EVM" && (storedExternalWallet == null ? void 0 : storedExternalWallet.address) !== wagmiAddress && (connectedConnector == null ? void 0 : connectedConnector.id) !== "para" && !disconnectTypeRef.current) {
|
|
131
131
|
switchWallet(wagmiAddress);
|
|
132
132
|
}
|
|
133
133
|
}, [isLocalConnecting, wagmiAddress, isConnected]);
|
|
@@ -368,7 +368,7 @@ function EvmExternalWalletProvider({
|
|
|
368
368
|
const requestInfo = (providerId) => __async(this, null, function* () {
|
|
369
369
|
var _a, _b, _c, _d;
|
|
370
370
|
const connector = findConnector(providerId);
|
|
371
|
-
|
|
371
|
+
disconnectTypeRef.current = "ACCOUNT_LINKING";
|
|
372
372
|
try {
|
|
373
373
|
let address;
|
|
374
374
|
if (connector.connected && ((_a = connector.accounts) == null ? void 0 : _a[0])) {
|
|
@@ -393,17 +393,21 @@ function EvmExternalWalletProvider({
|
|
|
393
393
|
throw new Error((_d = e == null ? void 0 : e.message) != null ? _d : e);
|
|
394
394
|
}
|
|
395
395
|
});
|
|
396
|
-
const disconnectBase = (
|
|
396
|
+
const disconnectBase = (_0, ..._1) => __async(this, [_0, ..._1], function* (providerId, { disconnectType } = {}) {
|
|
397
397
|
var _a;
|
|
398
398
|
if (!providerId) {
|
|
399
399
|
throw new Error("Provider ID is required to disconnect");
|
|
400
400
|
}
|
|
401
401
|
const connector = findConnector(providerId);
|
|
402
|
-
|
|
402
|
+
if (disconnectType) {
|
|
403
|
+
disconnectTypeRef.current = disconnectType;
|
|
404
|
+
}
|
|
403
405
|
try {
|
|
404
406
|
yield connector == null ? void 0 : connector.disconnect();
|
|
405
407
|
} catch (e) {
|
|
406
408
|
throw new Error((_a = e == null ? void 0 : e.message) != null ? _a : e);
|
|
409
|
+
} finally {
|
|
410
|
+
disconnectTypeRef.current = void 0;
|
|
407
411
|
}
|
|
408
412
|
});
|
|
409
413
|
const nonEip6963ConnectorsByRdns = {};
|
|
@@ -520,6 +524,7 @@ function EvmExternalWalletProvider({
|
|
|
520
524
|
username,
|
|
521
525
|
avatar: ensAvatar,
|
|
522
526
|
disconnect: disconnectAsync,
|
|
527
|
+
disconnectStatus,
|
|
523
528
|
switchChain,
|
|
524
529
|
connectParaEmbedded,
|
|
525
530
|
signMessage,
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/evm-wallet-connectors",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.67",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@coinbase/wallet-sdk": "4.3.0",
|
|
6
|
-
"@getpara/wagmi-v2-connector": "2.0.0-alpha.
|
|
7
|
-
"@getpara/web-sdk": "2.0.0-alpha.
|
|
6
|
+
"@getpara/wagmi-v2-connector": "2.0.0-alpha.67",
|
|
7
|
+
"@getpara/web-sdk": "2.0.0-alpha.67",
|
|
8
8
|
"zustand": "^4.5.2",
|
|
9
9
|
"zustand-sync-tabs": "^0.2.2"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@getpara/react-common": "2.0.0-alpha.
|
|
12
|
+
"@getpara/react-common": "2.0.0-alpha.67",
|
|
13
13
|
"@tanstack/react-query": "^5.74.0",
|
|
14
14
|
"@types/react": "^18.0.31",
|
|
15
15
|
"@types/react-dom": "^18.2.7",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist",
|
|
26
26
|
"package.json"
|
|
27
27
|
],
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "0266cc49e978575fed0b12c9bb0c832651e140eb",
|
|
29
29
|
"main": "dist/index.js",
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@farcaster/miniapp-wagmi-connector": "^1.0.0",
|