@getpara/evm-wallet-connectors 2.0.0-alpha.59 → 2.0.0-alpha.60
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.
|
@@ -9,4 +9,4 @@ export type EvmExternalWalletContextType = ExternalWalletContextType & ChainMana
|
|
|
9
9
|
};
|
|
10
10
|
export declare const EvmExternalWalletContext: import("react").Context<EvmExternalWalletContextType>;
|
|
11
11
|
export type EvmExternalWalletProviderConfig = ExternalWalletProviderConfigBase;
|
|
12
|
-
export declare function EvmExternalWalletProvider({ children, onSwitchWallet, para, walletsWithFullAuth, connectedWallet, includeWalletVerification, connectionOnly, }: EvmExternalWalletProviderConfig & PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function EvmExternalWalletProvider({ children, onSwitchWallet, para, walletsWithFullAuth, connectedWallet: connectedWalletProp, includeWalletVerification, connectionOnly, }: EvmExternalWalletProviderConfig & PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
@@ -37,7 +37,7 @@ function EvmExternalWalletProvider({
|
|
|
37
37
|
onSwitchWallet,
|
|
38
38
|
para,
|
|
39
39
|
walletsWithFullAuth,
|
|
40
|
-
connectedWallet,
|
|
40
|
+
connectedWallet: connectedWalletProp,
|
|
41
41
|
includeWalletVerification,
|
|
42
42
|
connectionOnly
|
|
43
43
|
}) {
|
|
@@ -59,6 +59,7 @@ function EvmExternalWalletProvider({
|
|
|
59
59
|
name: normalize(ensName)
|
|
60
60
|
});
|
|
61
61
|
const { signMessageAsync } = useSignMessage();
|
|
62
|
+
const connectedWallet = connectedWalletProp ? para.findWallet(connectedWalletProp.id, connectedWalletProp.type) : null;
|
|
62
63
|
const isLinkingAccount = useRef(false);
|
|
63
64
|
const verificationMessage = useRef();
|
|
64
65
|
const { refetch: getBalance } = useBalance({ address: wagmiAddress });
|
|
@@ -117,7 +118,10 @@ function EvmExternalWalletProvider({
|
|
|
117
118
|
);
|
|
118
119
|
useEffect(() => {
|
|
119
120
|
const storedExternalWallet = getStoredExternalWallets()[wagmiAddress != null ? wagmiAddress : ""];
|
|
120
|
-
if (
|
|
121
|
+
if ((connectedConnector == null ? void 0 : connectedConnector.id) === "para") {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (!isConnecting && !isReconnecting && !isLocalConnecting && !!wagmiAddress && !storedExternalWallet && !isLinkingAccount.current && para.isReady && !para.isFarcasterMiniApp) {
|
|
121
125
|
reset();
|
|
122
126
|
}
|
|
123
127
|
}, [isConnected, isLocalConnecting, wagmiAddress, connectedConnector, para.isReady, para.isFarcasterMiniApp]);
|
|
@@ -362,15 +366,20 @@ function EvmExternalWalletProvider({
|
|
|
362
366
|
);
|
|
363
367
|
};
|
|
364
368
|
const requestInfo = (providerId) => __async(this, null, function* () {
|
|
365
|
-
var _a, _b, _c;
|
|
369
|
+
var _a, _b, _c, _d;
|
|
366
370
|
const connector = findConnector(providerId);
|
|
367
371
|
isLinkingAccount.current = true;
|
|
368
372
|
try {
|
|
369
|
-
|
|
370
|
-
|
|
373
|
+
let address;
|
|
374
|
+
if (connector.connected && ((_a = connector.accounts) == null ? void 0 : _a[0])) {
|
|
375
|
+
address = connector.accounts[0];
|
|
376
|
+
} else {
|
|
377
|
+
address = yield connectBase(connector);
|
|
378
|
+
}
|
|
379
|
+
const providerId2 = (_c = (_b = wallets.find((w) => {
|
|
371
380
|
var _a2, _b2;
|
|
372
381
|
return (w == null ? void 0 : w.name) === ((_b2 = (_a2 = connector == null ? void 0 : connector.paraDetails) == null ? void 0 : _a2.name) != null ? _b2 : "");
|
|
373
|
-
})) == null ? void 0 :
|
|
382
|
+
})) == null ? void 0 : _b.name) != null ? _c : connector == null ? void 0 : connector.name;
|
|
374
383
|
return {
|
|
375
384
|
partnerId: para.partnerId,
|
|
376
385
|
address,
|
|
@@ -381,7 +390,7 @@ function EvmExternalWalletProvider({
|
|
|
381
390
|
ensAvatar
|
|
382
391
|
};
|
|
383
392
|
} catch (e) {
|
|
384
|
-
throw new Error((
|
|
393
|
+
throw new Error((_d = e == null ? void 0 : e.message) != null ? _d : e);
|
|
385
394
|
}
|
|
386
395
|
});
|
|
387
396
|
const disconnectBase = (providerId) => __async(this, null, function* () {
|
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.60",
|
|
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.60",
|
|
7
|
+
"@getpara/web-sdk": "2.0.0-alpha.60",
|
|
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.60",
|
|
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": "b445d9dcf909a9bfa72d4f21b825fcf7c643be0c",
|
|
29
29
|
"main": "dist/index.js",
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@farcaster/miniapp-wagmi-connector": "^1.0.0",
|