@dynamic-labs/ethereum 1.0.0-alpha.6 → 1.0.0-alpha.7
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/CHANGELOG.md +20 -0
- package/package.json +8 -8
- package/src/EthWalletConnector.cjs +1 -0
- package/src/EthWalletConnector.d.ts +8 -8
- package/src/EthWalletConnector.js +1 -0
- package/src/walletConnect/walletConnect.cjs +6 -1
- package/src/walletConnect/walletConnect.js +6 -1
- package/src/walletConnect/walletConnectV2.cjs +1 -1
- package/src/walletConnect/walletConnectV2.d.ts +6 -6
- package/src/walletConnect/walletConnectV2.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
|
|
2
|
+
## [1.0.0-alpha.7](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2023-12-05)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add support for Turnkey HD wallets and backwards compatiblity for private key wallets ([#4011](https://github.com/dynamic-labs/DynamicAuth/issues/4011)) ([75c5258](https://github.com/dynamic-labs/DynamicAuth/commit/75c5258da494d5d4dfa8b96655303dd9645f2269))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* add close button to wallets list ([#4036](https://github.com/dynamic-labs/DynamicAuth/issues/4036)) ([a2b988b](https://github.com/dynamic-labs/DynamicAuth/commit/a2b988bdfc662af6f85d37a79ed6666c483aa447))
|
|
13
|
+
* add support for embedded wallets in connect-only ([#4041](https://github.com/dynamic-labs/DynamicAuth/issues/4041)) ([ceea635](https://github.com/dynamic-labs/DynamicAuth/commit/ceea635b69e2a0c2636b47fbd30639d69dba7a1c))
|
|
14
|
+
* embedded wallet invalid stored chain breaking network picker ([#4050](https://github.com/dynamic-labs/DynamicAuth/issues/4050)) ([2e2384b](https://github.com/dynamic-labs/DynamicAuth/commit/2e2384ba37407d9164cce47e23f5d5f469f7e062))
|
|
15
|
+
* handle insufficient funds from AA provider ([#4027](https://github.com/dynamic-labs/DynamicAuth/issues/4027)) ([6b9cc88](https://github.com/dynamic-labs/DynamicAuth/commit/6b9cc886f4f2590094bd50aba195c07a5532dfa4))
|
|
16
|
+
* prevent double logout caused by wagmi sync ([#4048](https://github.com/dynamic-labs/DynamicAuth/issues/4048)) ([c66c81c](https://github.com/dynamic-labs/DynamicAuth/commit/c66c81c80839aa9ce1cfae76f4afce12e34f3513))
|
|
17
|
+
* properly detect network switch for secondary wallets ([#4038](https://github.com/dynamic-labs/DynamicAuth/issues/4038)) ([f87174d](https://github.com/dynamic-labs/DynamicAuth/commit/f87174de0892dd057401eaf3c0bc68d974add0fc))
|
|
18
|
+
* **use-wallets-connected-state:** update state on wallet id change ([#4045](https://github.com/dynamic-labs/DynamicAuth/issues/4045)) ([ca3a835](https://github.com/dynamic-labs/DynamicAuth/commit/ca3a8359eae386bffa758ed646ac14af8360a7f8))
|
|
19
|
+
* user should be able to see the full passkey name on management view ([#4043](https://github.com/dynamic-labs/DynamicAuth/issues/4043)) ([7bc1b70](https://github.com/dynamic-labs/DynamicAuth/commit/7bc1b7043cbc9f0e21df78a57efc3e6938a99db2))
|
|
20
|
+
* users should be able to easily find passkey recovery ([#4058](https://github.com/dynamic-labs/DynamicAuth/issues/4058)) ([0202ae9](https://github.com/dynamic-labs/DynamicAuth/commit/0202ae98c96544dec5ac357dc77000996e32ad33))
|
|
21
|
+
|
|
2
22
|
## [1.0.0-alpha.6](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2023-11-29)
|
|
3
23
|
|
|
4
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/ethereum",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.7",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
"@coinbase/wallet-sdk": "3.7.2",
|
|
30
30
|
"@walletconnect/client": "1.8.0",
|
|
31
31
|
"@walletconnect/ethereum-provider": "1.8.0",
|
|
32
|
-
"@walletconnect/universal-provider": "2.10.
|
|
32
|
+
"@walletconnect/universal-provider": "2.10.6",
|
|
33
33
|
"eventemitter3": "5.0.1",
|
|
34
34
|
"buffer": "6.0.3",
|
|
35
|
-
"@dynamic-labs/rpc-providers": "1.0.0-alpha.
|
|
36
|
-
"@dynamic-labs/turnkey": "1.0.0-alpha.
|
|
37
|
-
"@dynamic-labs/types": "1.0.0-alpha.
|
|
38
|
-
"@dynamic-labs/utils": "1.0.0-alpha.
|
|
39
|
-
"@dynamic-labs/wallet-book": "1.0.0-alpha.
|
|
40
|
-
"@dynamic-labs/wallet-connector-core": "1.0.0-alpha.
|
|
35
|
+
"@dynamic-labs/rpc-providers": "1.0.0-alpha.7",
|
|
36
|
+
"@dynamic-labs/turnkey": "1.0.0-alpha.7",
|
|
37
|
+
"@dynamic-labs/types": "1.0.0-alpha.7",
|
|
38
|
+
"@dynamic-labs/utils": "1.0.0-alpha.7",
|
|
39
|
+
"@dynamic-labs/wallet-book": "1.0.0-alpha.7",
|
|
40
|
+
"@dynamic-labs/wallet-connector-core": "1.0.0-alpha.7",
|
|
41
41
|
"stream": "0.0.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
@@ -41,20 +41,20 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
41
41
|
type: string;
|
|
42
42
|
uid: string;
|
|
43
43
|
addChain: (args: import("viem").AddChainParameters) => Promise<void>;
|
|
44
|
-
deployContract: <const TAbi extends import("viem").Abi | readonly unknown[], TChainOverride extends import("viem").Chain | undefined>(args: import("viem").DeployContractParameters<TAbi, import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride>) => Promise<`0x${string}`>;
|
|
44
|
+
deployContract: <const TAbi extends import("viem").Abi | readonly unknown[], TChainOverride extends import("viem").Chain | undefined = undefined>(args: import("viem").DeployContractParameters<TAbi, import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride>) => Promise<`0x${string}`>;
|
|
45
45
|
getAddresses: () => Promise<import("viem").GetAddressesReturnType>;
|
|
46
46
|
getChainId: () => Promise<number>;
|
|
47
47
|
getPermissions: () => Promise<import("viem").GetPermissionsReturnType>;
|
|
48
|
-
prepareTransactionRequest: <TChainOverride_1 extends import("viem").Chain | undefined>(args: import("viem").PrepareTransactionRequestParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_1>) => Promise<import("viem").PrepareTransactionRequestReturnType>;
|
|
48
|
+
prepareTransactionRequest: <TChainOverride_1 extends import("viem").Chain | undefined = undefined>(args: import("viem").PrepareTransactionRequestParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_1>) => Promise<import("viem").PrepareTransactionRequestReturnType>;
|
|
49
49
|
requestAddresses: () => Promise<import("viem").RequestAddressesReturnType>;
|
|
50
50
|
requestPermissions: (args: {
|
|
51
51
|
[x: string]: Record<string, any>;
|
|
52
52
|
eth_accounts: Record<string, any>;
|
|
53
53
|
}) => Promise<import("viem").RequestPermissionsReturnType>;
|
|
54
54
|
sendRawTransaction: (args: import("viem/_types/actions/wallet/sendRawTransaction").SendRawTransactionParameters) => Promise<`0x${string}`>;
|
|
55
|
-
sendTransaction: <TChainOverride_2 extends import("viem").Chain | undefined>(args: import("viem").SendTransactionParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_2>) => Promise<`0x${string}`>;
|
|
55
|
+
sendTransaction: <TChainOverride_2 extends import("viem").Chain | undefined = undefined>(args: import("viem").SendTransactionParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_2>) => Promise<`0x${string}`>;
|
|
56
56
|
signMessage: (args: import("viem").SignMessageParameters<import("viem").Account | undefined>) => Promise<`0x${string}`>;
|
|
57
|
-
signTransaction: <TChainOverride_3 extends import("viem").Chain | undefined>(args: import("viem/_types/actions/wallet/signTransaction").SignTransactionParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_3>) => Promise<`0x${string}`>;
|
|
57
|
+
signTransaction: <TChainOverride_3 extends import("viem").Chain | undefined = undefined>(args: import("viem/_types/actions/wallet/signTransaction").SignTransactionParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_3>) => Promise<`0x${string}`>;
|
|
58
58
|
signTypedData: <const TTypedData extends {
|
|
59
59
|
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
60
60
|
[x: `string[${string}]`]: undefined;
|
|
@@ -77,8 +77,8 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
77
77
|
[x: `bytes21[${string}]`]: undefined;
|
|
78
78
|
[x: `bytes20[${string}]`]: undefined;
|
|
79
79
|
[x: `bytes19[${string}]`]: undefined;
|
|
80
|
-
[x: `bytes18[${string}]`]: undefined;
|
|
81
80
|
[x: `bytes2[${string}]`]: undefined;
|
|
81
|
+
[x: `bytes18[${string}]`]: undefined;
|
|
82
82
|
[x: `bytes17[${string}]`]: undefined;
|
|
83
83
|
[x: `bytes16[${string}]`]: undefined;
|
|
84
84
|
[x: `bytes15[${string}]`]: undefined;
|
|
@@ -179,8 +179,8 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
179
179
|
bytes21?: undefined;
|
|
180
180
|
bytes20?: undefined;
|
|
181
181
|
bytes19?: undefined;
|
|
182
|
-
bytes18?: undefined;
|
|
183
182
|
bytes2?: undefined;
|
|
183
|
+
bytes18?: undefined;
|
|
184
184
|
bytes17?: undefined;
|
|
185
185
|
bytes16?: undefined;
|
|
186
186
|
bytes15?: undefined;
|
|
@@ -265,7 +265,7 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
265
265
|
}, TPrimaryType extends string>(args: import("viem").SignTypedDataParameters<TTypedData, TPrimaryType, import("viem").Account | undefined>) => Promise<`0x${string}`>;
|
|
266
266
|
switchChain: (args: import("viem").SwitchChainParameters) => Promise<void>;
|
|
267
267
|
watchAsset: (args: import("viem").WatchAssetParams) => Promise<boolean>;
|
|
268
|
-
writeContract: <const TAbi_1 extends import("viem").Abi | readonly unknown[], TFunctionName extends string, TChainOverride_4 extends import("viem").Chain | undefined>(args: import("viem").WriteContractParameters<TAbi_1, TFunctionName, import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_4>) => Promise<`0x${string}`>;
|
|
268
|
+
writeContract: <const TAbi_1 extends import("viem").Abi | readonly unknown[], TFunctionName extends string, TChainOverride_4 extends import("viem").Chain | undefined = undefined>(args: import("viem").WriteContractParameters<TAbi_1, TFunctionName, import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_4>) => Promise<`0x${string}`>;
|
|
269
269
|
extend: <const client extends {
|
|
270
270
|
[x: string]: unknown;
|
|
271
271
|
account?: undefined;
|
|
@@ -279,7 +279,7 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
279
279
|
transport?: undefined;
|
|
280
280
|
type?: undefined;
|
|
281
281
|
uid?: undefined;
|
|
282
|
-
}>(fn: (client: import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined, import("viem").WalletRpcSchema, import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>>) => client) => import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined, import("viem").WalletRpcSchema, { [K in keyof client]: client[K]; } & import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>>;
|
|
282
|
+
} & Partial<Pick<import("viem").PublicActions, "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getChainId" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "prepareTransactionRequest" | "readContract" | "sendRawTransaction" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<import("viem").WalletActions, "sendTransaction" | "writeContract">>>(fn: (client: import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined, import("viem").WalletRpcSchema, import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>>) => client) => import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined, import("viem").WalletRpcSchema, { [K in keyof client]: client[K]; } & import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>>;
|
|
283
283
|
} | undefined>;
|
|
284
284
|
getBalance(): Promise<string | undefined>;
|
|
285
285
|
supportsNetworkSwitching(): boolean;
|
|
@@ -69,9 +69,14 @@ class WalletConnect extends EthWalletConnector.EthWalletConnector {
|
|
|
69
69
|
fetchPublicAddress(opts) {
|
|
70
70
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
71
71
|
return client.fetchWalletConnectEVMPublicAddress(walletBook.getWalletBookWallet(this.walletBook, this.key), this.getClient(), this.deepLinkPreference, Object.assign(Object.assign({}, opts), { onConnect: (payload) => {
|
|
72
|
-
var _a;
|
|
72
|
+
var _a, _b;
|
|
73
73
|
(_a = opts === null || opts === void 0 ? void 0 : opts.onConnect) === null || _a === void 0 ? void 0 : _a.call(opts, payload);
|
|
74
74
|
this.connectedChain = payload.params[0].chainId ? 'EVM' : 'SOL';
|
|
75
|
+
if ((_b = payload.params[0].accounts) === null || _b === void 0 ? void 0 : _b.length) {
|
|
76
|
+
this.emit('accountChange', {
|
|
77
|
+
accounts: payload.params[0].accounts,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
75
80
|
} }));
|
|
76
81
|
});
|
|
77
82
|
}
|
|
@@ -61,9 +61,14 @@ class WalletConnect extends EthWalletConnector {
|
|
|
61
61
|
fetchPublicAddress(opts) {
|
|
62
62
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63
63
|
return fetchWalletConnectEVMPublicAddress(getWalletBookWallet(this.walletBook, this.key), this.getClient(), this.deepLinkPreference, Object.assign(Object.assign({}, opts), { onConnect: (payload) => {
|
|
64
|
-
var _a;
|
|
64
|
+
var _a, _b;
|
|
65
65
|
(_a = opts === null || opts === void 0 ? void 0 : opts.onConnect) === null || _a === void 0 ? void 0 : _a.call(opts, payload);
|
|
66
66
|
this.connectedChain = payload.params[0].chainId ? 'EVM' : 'SOL';
|
|
67
|
+
if ((_b = payload.params[0].accounts) === null || _b === void 0 ? void 0 : _b.length) {
|
|
68
|
+
this.emit('accountChange', {
|
|
69
|
+
accounts: payload.params[0].accounts,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
67
72
|
} }));
|
|
68
73
|
});
|
|
69
74
|
}
|
|
@@ -193,7 +193,6 @@ class WalletConnectV2 extends EthWalletConnector.EthWalletConnector {
|
|
|
193
193
|
// eslint-disable-next-line prefer-destructuring
|
|
194
194
|
const account = data[0].split(':')[2];
|
|
195
195
|
this.setActiveAccount(account);
|
|
196
|
-
this.emit('accountChange', { accounts: [account] });
|
|
197
196
|
}
|
|
198
197
|
});
|
|
199
198
|
WalletConnectV2.provider.client.on('session_delete', () => _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -348,6 +347,7 @@ class WalletConnectV2 extends EthWalletConnector.EthWalletConnector {
|
|
|
348
347
|
setActiveAccount(account) {
|
|
349
348
|
localStorage.setItem(this.activeAccountKey, account);
|
|
350
349
|
this.activeAccount = account;
|
|
350
|
+
this.emit('accountChange', { accounts: [account] });
|
|
351
351
|
}
|
|
352
352
|
setSession(session) {
|
|
353
353
|
localStorage.setItem(this.sessionTopicKey, session.topic);
|
|
@@ -56,20 +56,20 @@ export declare class WalletConnectV2 extends EthWalletConnector {
|
|
|
56
56
|
type: string;
|
|
57
57
|
uid: string;
|
|
58
58
|
addChain: (args: import("viem").AddChainParameters) => Promise<void>;
|
|
59
|
-
deployContract: <const TAbi extends import("viem").Abi | readonly unknown[], TChainOverride extends import("viem").Chain | undefined>(args: import("viem").DeployContractParameters<TAbi, undefined, undefined, TChainOverride>) => Promise<`0x${string}`>;
|
|
59
|
+
deployContract: <const TAbi extends import("viem").Abi | readonly unknown[], TChainOverride extends import("viem").Chain | undefined = undefined>(args: import("viem").DeployContractParameters<TAbi, undefined, undefined, TChainOverride>) => Promise<`0x${string}`>;
|
|
60
60
|
getAddresses: () => Promise<import("viem").GetAddressesReturnType>;
|
|
61
61
|
getChainId: () => Promise<number>;
|
|
62
62
|
getPermissions: () => Promise<import("viem").GetPermissionsReturnType>;
|
|
63
|
-
prepareTransactionRequest: <TChainOverride_1 extends import("viem").Chain | undefined>(args: import("viem").PrepareTransactionRequestParameters<undefined, undefined, TChainOverride_1>) => Promise<import("viem").PrepareTransactionRequestReturnType>;
|
|
63
|
+
prepareTransactionRequest: <TChainOverride_1 extends import("viem").Chain | undefined = undefined>(args: import("viem").PrepareTransactionRequestParameters<undefined, undefined, TChainOverride_1>) => Promise<import("viem").PrepareTransactionRequestReturnType>;
|
|
64
64
|
requestAddresses: () => Promise<import("viem").RequestAddressesReturnType>;
|
|
65
65
|
requestPermissions: (args: {
|
|
66
66
|
[x: string]: Record<string, any>;
|
|
67
67
|
eth_accounts: Record<string, any>;
|
|
68
68
|
}) => Promise<import("viem").RequestPermissionsReturnType>;
|
|
69
69
|
sendRawTransaction: (args: import("viem/_types/actions/wallet/sendRawTransaction").SendRawTransactionParameters) => Promise<`0x${string}`>;
|
|
70
|
-
sendTransaction: <TChainOverride_2 extends import("viem").Chain | undefined>(args: import("viem").SendTransactionParameters<undefined, undefined, TChainOverride_2>) => Promise<`0x${string}`>;
|
|
70
|
+
sendTransaction: <TChainOverride_2 extends import("viem").Chain | undefined = undefined>(args: import("viem").SendTransactionParameters<undefined, undefined, TChainOverride_2>) => Promise<`0x${string}`>;
|
|
71
71
|
signMessage: (args: import("viem").SignMessageParameters<undefined>) => Promise<`0x${string}`>;
|
|
72
|
-
signTransaction: <TChainOverride_3 extends import("viem").Chain | undefined>(args: import("viem/_types/actions/wallet/signTransaction").SignTransactionParameters<undefined, undefined, TChainOverride_3>) => Promise<`0x${string}`>;
|
|
72
|
+
signTransaction: <TChainOverride_3 extends import("viem").Chain | undefined = undefined>(args: import("viem/_types/actions/wallet/signTransaction").SignTransactionParameters<undefined, undefined, TChainOverride_3>) => Promise<`0x${string}`>;
|
|
73
73
|
signTypedData: <const TTypedData extends {
|
|
74
74
|
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
75
75
|
[x: `string[${string}]`]: undefined;
|
|
@@ -280,7 +280,7 @@ export declare class WalletConnectV2 extends EthWalletConnector {
|
|
|
280
280
|
}, TPrimaryType extends string>(args: import("viem").SignTypedDataParameters<TTypedData, TPrimaryType, undefined>) => Promise<`0x${string}`>;
|
|
281
281
|
switchChain: (args: import("viem").SwitchChainParameters) => Promise<void>;
|
|
282
282
|
watchAsset: (args: import("viem").WatchAssetParams) => Promise<boolean>;
|
|
283
|
-
writeContract: <const TAbi_1 extends import("viem").Abi | readonly unknown[], TFunctionName extends string, TChainOverride_4 extends import("viem").Chain | undefined>(args: import("viem").WriteContractParameters<TAbi_1, TFunctionName, undefined, undefined, TChainOverride_4>) => Promise<`0x${string}`>;
|
|
283
|
+
writeContract: <const TAbi_1 extends import("viem").Abi | readonly unknown[], TFunctionName extends string, TChainOverride_4 extends import("viem").Chain | undefined = undefined>(args: import("viem").WriteContractParameters<TAbi_1, TFunctionName, undefined, undefined, TChainOverride_4>) => Promise<`0x${string}`>;
|
|
284
284
|
extend: <const client extends {
|
|
285
285
|
[x: string]: unknown;
|
|
286
286
|
account?: undefined;
|
|
@@ -294,7 +294,7 @@ export declare class WalletConnectV2 extends EthWalletConnector {
|
|
|
294
294
|
transport?: undefined;
|
|
295
295
|
type?: undefined;
|
|
296
296
|
uid?: undefined;
|
|
297
|
-
}>(fn: (client: import("viem").Client<import("viem").CustomTransport, undefined, undefined, import("viem").WalletRpcSchema, import("viem").WalletActions<undefined, undefined>>) => client) => import("viem").Client<import("viem").CustomTransport, undefined, undefined, import("viem").WalletRpcSchema, { [K in keyof client]: client[K]; } & import("viem").WalletActions<undefined, undefined>>;
|
|
297
|
+
} & Partial<Pick<import("viem").PublicActions, "getChainId" | "prepareTransactionRequest" | "sendRawTransaction" | "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "readContract" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<import("viem").WalletActions, "sendTransaction" | "writeContract">>>(fn: (client: import("viem").Client<import("viem").CustomTransport, undefined, undefined, import("viem").WalletRpcSchema, import("viem").WalletActions<undefined, undefined>>) => client) => import("viem").Client<import("viem").CustomTransport, undefined, undefined, import("viem").WalletRpcSchema, { [K in keyof client]: client[K]; } & import("viem").WalletActions<undefined, undefined>>;
|
|
298
298
|
} | undefined;
|
|
299
299
|
fetchPublicAddress(opts?: FetchPublicAddressOpts): Promise<string | undefined>;
|
|
300
300
|
/**
|
|
@@ -184,7 +184,6 @@ class WalletConnectV2 extends EthWalletConnector {
|
|
|
184
184
|
// eslint-disable-next-line prefer-destructuring
|
|
185
185
|
const account = data[0].split(':')[2];
|
|
186
186
|
this.setActiveAccount(account);
|
|
187
|
-
this.emit('accountChange', { accounts: [account] });
|
|
188
187
|
}
|
|
189
188
|
});
|
|
190
189
|
WalletConnectV2.provider.client.on('session_delete', () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -339,6 +338,7 @@ class WalletConnectV2 extends EthWalletConnector {
|
|
|
339
338
|
setActiveAccount(account) {
|
|
340
339
|
localStorage.setItem(this.activeAccountKey, account);
|
|
341
340
|
this.activeAccount = account;
|
|
341
|
+
this.emit('accountChange', { accounts: [account] });
|
|
342
342
|
}
|
|
343
343
|
setSession(session) {
|
|
344
344
|
localStorage.setItem(this.sessionTopicKey, session.topic);
|