@web3auth/no-modal 11.0.2 → 11.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.
- package/dist/lib.cjs/account-linking/react.js +1 -0
- package/dist/lib.cjs/account-linking/vue.js +1 -0
- package/dist/lib.cjs/base/connector/baseConnector.js +42 -11
- package/dist/lib.cjs/base/errors/index.js +5 -1
- package/dist/lib.cjs/base/utils.js +1 -1
- package/dist/lib.cjs/connectors/auth-connector/authConnector.js +23 -16
- package/dist/lib.cjs/connectors/coinbase-connector/coinbaseConnector.js +5 -5
- package/dist/lib.cjs/connectors/injected-evm-connector/injectedEvmConnector.js +6 -5
- package/dist/lib.cjs/connectors/injected-solana-connector/walletStandardConnector.js +6 -5
- package/dist/lib.cjs/connectors/metamask-connector/metamaskConnector.js +82 -31
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/config.js +0 -3
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/index.js +0 -1
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/walletConnectV2Connector.js +8 -6
- package/dist/lib.cjs/index.js +8 -8
- package/dist/lib.cjs/noModal.js +48 -22
- package/dist/lib.cjs/providers/account-abstraction-provider/providers/AccountAbstractionProvider.js +9 -2
- package/dist/lib.cjs/providers/account-abstraction-provider/rpc/ethRpcMiddlewares.js +1 -43
- package/dist/lib.cjs/react/context/useWeb3AuthInnerContextValue.js +10 -0
- package/dist/lib.cjs/react/solana/provider.js +65 -32
- package/dist/lib.cjs/types/base/connector/baseConnector.d.ts +2 -1
- package/dist/lib.cjs/types/base/connector/interfaces.d.ts +1 -0
- package/dist/lib.cjs/types/base/errors/index.d.ts +1 -0
- package/dist/lib.cjs/types/base/interfaces.d.ts +2 -1
- package/dist/lib.cjs/types/connectors/metamask-connector/metamaskConnector.d.ts +1 -0
- package/dist/lib.cjs/types/connectors/wallet-connect-v2-connector/config.d.ts +0 -1
- package/dist/lib.cjs/types/vue/solana/provider.d.ts +2 -2
- package/dist/lib.cjs/vue/solana/provider.js +55 -21
- package/dist/lib.cjs/vue/useWeb3AuthInnerContextValue.js +12 -2
- package/dist/lib.esm/base/connector/baseConnector.js +42 -11
- package/dist/lib.esm/base/errors/index.js +5 -1
- package/dist/lib.esm/base/utils.js +1 -1
- package/dist/lib.esm/connectors/auth-connector/authConnector.js +21 -15
- package/dist/lib.esm/connectors/coinbase-connector/coinbaseConnector.js +5 -5
- package/dist/lib.esm/connectors/injected-evm-connector/injectedEvmConnector.js +6 -5
- package/dist/lib.esm/connectors/injected-solana-connector/walletStandardConnector.js +6 -5
- package/dist/lib.esm/connectors/metamask-connector/metamaskConnector.js +86 -31
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/config.js +1 -4
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/index.js +1 -1
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/walletConnectV2Connector.js +8 -7
- package/dist/lib.esm/index.js +2 -2
- package/dist/lib.esm/noModal.js +48 -22
- package/dist/lib.esm/providers/account-abstraction-provider/providers/AccountAbstractionProvider.js +9 -2
- package/dist/lib.esm/providers/account-abstraction-provider/rpc/ethRpcMiddlewares.js +1 -9
- package/dist/lib.esm/react/context/useWeb3AuthInnerContextValue.js +10 -0
- package/dist/lib.esm/react/solana/provider.js +64 -30
- package/dist/lib.esm/vue/solana/provider.js +55 -19
- package/dist/lib.esm/vue/useWeb3AuthInnerContextValue.js +10 -0
- package/package.json +7 -7
|
@@ -15,6 +15,7 @@ import { getCaipChainId, citadelServerUrl } from '../../base/utils.js';
|
|
|
15
15
|
import { WalletLoginError, isUserRejectedError, WalletOperationsError, Web3AuthError } from '../../base/errors/index.js';
|
|
16
16
|
import { ANALYTICS_EVENTS } from '../../base/analytics.js';
|
|
17
17
|
import { getSolanaChainByChainConfig, walletSignMessage } from '../../base/wallet/solana.js';
|
|
18
|
+
import { log } from '../../base/loglevel.js';
|
|
18
19
|
import { BaseConnector } from '../../base/connector/baseConnector.js';
|
|
19
20
|
import { CONNECTOR_CATEGORY, CONNECTOR_STATUS, CONNECTOR_EVENTS } from '../../base/connector/constants.js';
|
|
20
21
|
|
|
@@ -22,6 +23,11 @@ import { CONNECTOR_CATEGORY, CONNECTOR_STATUS, CONNECTOR_EVENTS } from '../../ba
|
|
|
22
23
|
* Configuration options for the MetaMask connector using \@metamask/connect-evm
|
|
23
24
|
*/
|
|
24
25
|
|
|
26
|
+
// `@metamask/connect-evm` announces its SDK-backed provider over EIP-6963 with this
|
|
27
|
+
// RDNS value. Web3Auth uses the dedicated `metaMaskConnector` for MetaMask, so MIPD
|
|
28
|
+
// discovery should ignore this provider to avoid treating the QR/deeplink transport
|
|
29
|
+
// as a native injected wallet.
|
|
30
|
+
const METAMASK_ERC_6963_PROVIDER_RDNS = "io.metamask.mmc";
|
|
25
31
|
class MetaMaskConnector extends BaseConnector {
|
|
26
32
|
constructor(connectorOptions) {
|
|
27
33
|
super(connectorOptions);
|
|
@@ -197,13 +203,25 @@ class MetaMaskConnector extends BaseConnector {
|
|
|
197
203
|
if (coreStatus === "connected" && options.autoConnect) {
|
|
198
204
|
this.status = CONNECTOR_STATUS.CONNECTED;
|
|
199
205
|
this.rehydrated = true;
|
|
206
|
+
|
|
207
|
+
// Force sync the chain state before connect with rehydrated state.
|
|
208
|
+
// during rehydration, `createEVMClient` (from above) cause re-creating session for connected the evm provider,
|
|
209
|
+
// triggering `switchChain` internally and unintentionally update the connector data with the new chain id.
|
|
210
|
+
// This creates issue in rehydration flow, where Web3Auth connects to the incorrect chain id, not the rehydrated chain id.
|
|
211
|
+
// Force sync the chain state with the rehydrated chain id to avoid this issue.
|
|
212
|
+
await this.forceSyncChainState(chainConfig);
|
|
200
213
|
this.emit(CONNECTOR_EVENTS.CONNECTED, {
|
|
201
214
|
connectorName: WALLET_CONNECTORS.METAMASK,
|
|
202
215
|
reconnected: true,
|
|
203
216
|
ethereumProvider: this.evmProvider,
|
|
204
|
-
solanaWallet: this.solanaProvider
|
|
217
|
+
solanaWallet: this.solanaProvider,
|
|
218
|
+
connectorNamespace: this.connectorNamespace
|
|
205
219
|
});
|
|
206
|
-
|
|
220
|
+
try {
|
|
221
|
+
await this.authorizeOrDisconnect(options.getAuthTokenInfo, options.chainId);
|
|
222
|
+
} catch (error) {
|
|
223
|
+
this.emit(CONNECTOR_EVENTS.REHYDRATION_ERROR, error);
|
|
224
|
+
}
|
|
207
225
|
} else if (coreStatus === "connected" || coreStatus === "loaded" || coreStatus === "disconnected" || coreStatus === "pending") {
|
|
208
226
|
this.status = CONNECTOR_STATUS.READY;
|
|
209
227
|
this.emit(CONNECTOR_EVENTS.READY, WALLET_CONNECTORS.METAMASK);
|
|
@@ -273,7 +291,7 @@ class MetaMaskConnector extends BaseConnector {
|
|
|
273
291
|
|
|
274
292
|
// sync the chain state after connect
|
|
275
293
|
// metamask might not be connected to the requested chain, so we need to sync the chain state to/from Web3Auth state after connect.
|
|
276
|
-
await this.
|
|
294
|
+
await this.forceSyncChainState(chainConfig);
|
|
277
295
|
|
|
278
296
|
// check if connected
|
|
279
297
|
if (this.multichainClient.status !== "connected") {
|
|
@@ -293,15 +311,15 @@ class MetaMaskConnector extends BaseConnector {
|
|
|
293
311
|
connectorName: WALLET_CONNECTORS.METAMASK,
|
|
294
312
|
reconnected: this.rehydrated,
|
|
295
313
|
ethereumProvider: this.evmProvider,
|
|
296
|
-
solanaWallet: this.solanaProvider
|
|
314
|
+
solanaWallet: this.solanaProvider,
|
|
315
|
+
connectorNamespace: this.connectorNamespace
|
|
297
316
|
});
|
|
298
|
-
|
|
299
|
-
await this.getAuthTokenInfo(chainId);
|
|
300
|
-
}
|
|
317
|
+
await this.authorizeOrDisconnect(getAuthTokenInfo, chainId);
|
|
301
318
|
return {
|
|
302
319
|
ethereumProvider: this.evmProvider,
|
|
303
320
|
solanaWallet: this.solanaProvider,
|
|
304
|
-
connectorName: this.name
|
|
321
|
+
connectorName: this.name,
|
|
322
|
+
connectorNamespace: this.connectorNamespace
|
|
305
323
|
};
|
|
306
324
|
} catch (error) {
|
|
307
325
|
// Ready again to be connected
|
|
@@ -327,10 +345,12 @@ class MetaMaskConnector extends BaseConnector {
|
|
|
327
345
|
}) {
|
|
328
346
|
if (!this.multichainClient) throw WalletLoginError.connectionError("Multichain client is not available");
|
|
329
347
|
this.checkDisconnectionRequirements();
|
|
330
|
-
await this.
|
|
348
|
+
await this.clearMultichainWalletSessions();
|
|
331
349
|
|
|
332
350
|
// Disconnect using the multichain client
|
|
333
|
-
|
|
351
|
+
if (this.multichainClient.status === "connected") {
|
|
352
|
+
await this.multichainClient.disconnect();
|
|
353
|
+
}
|
|
334
354
|
if (options.cleanup) {
|
|
335
355
|
this.status = CONNECTOR_STATUS.NOT_READY;
|
|
336
356
|
this.initializationPromise = null;
|
|
@@ -386,32 +406,41 @@ class MetaMaskConnector extends BaseConnector {
|
|
|
386
406
|
}
|
|
387
407
|
async switchChain(params, init = false) {
|
|
388
408
|
super.checkSwitchChainRequirements(params, init);
|
|
409
|
+
await this.ensureInitialized();
|
|
389
410
|
const targetChainConfig = this.coreOptions.chains.find(c => c.chainId === params.chainId);
|
|
390
|
-
if (
|
|
391
|
-
|
|
411
|
+
if (!targetChainConfig) throw WalletLoginError.connectionError("Chain config is not available");
|
|
412
|
+
if (targetChainConfig.chainNamespace === CHAIN_NAMESPACES.SOLANA) {
|
|
413
|
+
if (!this.solanaWallet) {
|
|
414
|
+
throw WalletLoginError.unsupportedOperation("switchChain requires a Solana client, but no Solana chains are configured.");
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// For solana case, we don't have the `switchChain` method like `evmClient`.
|
|
418
|
+
// So, we just need to sync with the connected solana chain to the Web3Auth state.
|
|
419
|
+
await this.forceSyncChainState(targetChainConfig);
|
|
392
420
|
return;
|
|
393
421
|
}
|
|
394
|
-
await this.ensureInitialized();
|
|
395
422
|
if (!this.evmClient) {
|
|
396
423
|
throw WalletLoginError.unsupportedOperation("switchChain requires an EVM client, but no EVM chains are configured.");
|
|
397
424
|
}
|
|
398
|
-
const
|
|
399
|
-
const chainConfiguration = chainConfig ? {
|
|
425
|
+
const chainConfiguration = targetChainConfig ? {
|
|
400
426
|
chainId: params.chainId,
|
|
401
|
-
chainName:
|
|
402
|
-
rpcUrls: [
|
|
403
|
-
blockExplorerUrls:
|
|
427
|
+
chainName: targetChainConfig.displayName,
|
|
428
|
+
rpcUrls: [targetChainConfig.rpcTarget],
|
|
429
|
+
blockExplorerUrls: targetChainConfig.blockExplorerUrl ? [targetChainConfig.blockExplorerUrl] : undefined,
|
|
404
430
|
nativeCurrency: {
|
|
405
|
-
name:
|
|
406
|
-
symbol:
|
|
407
|
-
decimals:
|
|
431
|
+
name: targetChainConfig.tickerName,
|
|
432
|
+
symbol: targetChainConfig.ticker,
|
|
433
|
+
decimals: targetChainConfig.decimals || 18
|
|
408
434
|
},
|
|
409
|
-
iconUrls:
|
|
435
|
+
iconUrls: targetChainConfig.logo ? [targetChainConfig.logo] : undefined
|
|
410
436
|
} : undefined;
|
|
411
437
|
await this.evmClient.switchChain({
|
|
412
438
|
chainId: params.chainId,
|
|
413
439
|
chainConfiguration
|
|
414
440
|
});
|
|
441
|
+
this.updateConnectorData({
|
|
442
|
+
chainId: params.chainId
|
|
443
|
+
});
|
|
415
444
|
}
|
|
416
445
|
async generateChallengeAndSign(authServerUrl, accounts, chainId) {
|
|
417
446
|
const activeChainConfig = this.resolveAuthChainConfig(chainId);
|
|
@@ -470,7 +499,12 @@ class MetaMaskConnector extends BaseConnector {
|
|
|
470
499
|
}
|
|
471
500
|
await this.initializationPromise;
|
|
472
501
|
}
|
|
473
|
-
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Syncs the chain state with the Web3Auth state.
|
|
505
|
+
* @param chainConfig - The chain config to sync.
|
|
506
|
+
*/
|
|
507
|
+
async forceSyncChainState(chainConfig) {
|
|
474
508
|
var _this$evmProvider2;
|
|
475
509
|
// EVM connectors can switch chains, so align the wallet with the requested chain
|
|
476
510
|
// before Web3Auth persists the active chain in controller state.
|
|
@@ -491,13 +525,9 @@ class MetaMaskConnector extends BaseConnector {
|
|
|
491
525
|
if (!connectedChainConfig) {
|
|
492
526
|
throw WalletLoginError.connectionError("Connected chain is not available in the chains config");
|
|
493
527
|
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
this.updateConnectorData({
|
|
498
|
-
chainId: connectedChainConfig.chainId
|
|
499
|
-
});
|
|
500
|
-
}
|
|
528
|
+
this.updateConnectorData({
|
|
529
|
+
chainId: chainConfig.chainId
|
|
530
|
+
});
|
|
501
531
|
}
|
|
502
532
|
}
|
|
503
533
|
}
|
|
@@ -512,6 +542,31 @@ class MetaMaskConnector extends BaseConnector {
|
|
|
512
542
|
// Keep the old fallback for callers that do not pass a chainId yet.
|
|
513
543
|
return isSolanaOnly ? this.coreOptions.chains.find(x => x.chainNamespace === CHAIN_NAMESPACES.SOLANA) : this.evmProvider ? this.coreOptions.chains.find(x => x.chainId === evmChainId) : undefined;
|
|
514
544
|
}
|
|
545
|
+
async clearMultichainWalletSessions() {
|
|
546
|
+
const addresses = new Set();
|
|
547
|
+
if (this.evmProvider) {
|
|
548
|
+
const evmAccounts = await this.evmProvider.request({
|
|
549
|
+
method: EVM_METHOD_TYPES.GET_ACCOUNTS
|
|
550
|
+
});
|
|
551
|
+
evmAccounts.forEach(account => addresses.add(account));
|
|
552
|
+
}
|
|
553
|
+
if (this.solanaProvider) {
|
|
554
|
+
this.solanaProvider.accounts.forEach(account => addresses.add(account.address));
|
|
555
|
+
}
|
|
556
|
+
if (addresses.size === 0) {
|
|
557
|
+
await this.clearWalletSession();
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
// MetaMask can authorize both EVM and Solana accounts in one session, but BaseConnector
|
|
562
|
+
// caches SIWW tokens under one address at a time. Clear every connected address on disconnect.
|
|
563
|
+
for (const address of addresses) {
|
|
564
|
+
this.initSessionManager(address);
|
|
565
|
+
await this.clearWalletSession().catch(error => {
|
|
566
|
+
log.error("Failed to clear multichain wallet session", error);
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
}
|
|
515
570
|
}
|
|
516
571
|
|
|
517
572
|
/**
|
|
@@ -541,4 +596,4 @@ const metaMaskConnector = params => {
|
|
|
541
596
|
};
|
|
542
597
|
};
|
|
543
598
|
|
|
544
|
-
export { metaMaskConnector };
|
|
599
|
+
export { METAMASK_ERC_6963_PROVIDER_RDNS, metaMaskConnector };
|
|
@@ -14,9 +14,6 @@ let DEFAULT_EIP155_METHODS = /*#__PURE__*/function (DEFAULT_EIP155_METHODS) {
|
|
|
14
14
|
DEFAULT_EIP155_METHODS["SWITCH_ETHEREUM_CHAIN"] = "wallet_switchEthereumChain";
|
|
15
15
|
return DEFAULT_EIP155_METHODS;
|
|
16
16
|
}({});
|
|
17
|
-
|
|
18
|
-
// methods that return `null` on success
|
|
19
|
-
const NULL_ON_SUCCESS_METHODS = [DEFAULT_EIP155_METHODS.SWITCH_ETHEREUM_CHAIN, DEFAULT_EIP155_METHODS.ADD_ETHEREUM_CHAIN];
|
|
20
17
|
let DEFAULT_SOLANA_METHODS = /*#__PURE__*/function (DEFAULT_SOLANA_METHODS) {
|
|
21
18
|
DEFAULT_SOLANA_METHODS["SIGN_TRANSACTION"] = "solana_signTransaction";
|
|
22
19
|
DEFAULT_SOLANA_METHODS["SIGN_MESSAGE"] = "solana_signMessage";
|
|
@@ -110,4 +107,4 @@ const getWalletConnectV2Settings = async (chains, projectID) => {
|
|
|
110
107
|
};
|
|
111
108
|
};
|
|
112
109
|
|
|
113
|
-
export { DEFAULT_EIP155_METHODS, DEFAULT_EIP_155_EVENTS, DEFAULT_SOLANA_EVENTS, DEFAULT_SOLANA_METHODS,
|
|
110
|
+
export { DEFAULT_EIP155_METHODS, DEFAULT_EIP_155_EVENTS, DEFAULT_SOLANA_EVENTS, DEFAULT_SOLANA_METHODS, getNamespacesFromChains, getRequiredNamespaces, getSupportedEventsByNamespace, getSupportedMethodsByNamespace, getWalletConnectV2Settings };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DEFAULT_EIP155_METHODS, DEFAULT_EIP_155_EVENTS, DEFAULT_SOLANA_EVENTS, DEFAULT_SOLANA_METHODS,
|
|
1
|
+
export { DEFAULT_EIP155_METHODS, DEFAULT_EIP_155_EVENTS, DEFAULT_SOLANA_EVENTS, DEFAULT_SOLANA_METHODS, getNamespacesFromChains, getRequiredNamespaces, getSupportedEventsByNamespace, getSupportedMethodsByNamespace, getWalletConnectV2Settings } from './config.js';
|
|
2
2
|
import { walletConnectV2Connector } from './walletConnectV2Connector.js';
|
|
3
3
|
export { WalletConnectV2Provider } from './WalletConnectV2Provider.js';
|
|
4
4
|
|
|
@@ -169,7 +169,7 @@ class WalletConnectV2Connector extends BaseConnector {
|
|
|
169
169
|
}));
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
|
-
|
|
172
|
+
const connectorNamespace = this.connectorNamespace;
|
|
173
173
|
// if already connected
|
|
174
174
|
if (this.connected) {
|
|
175
175
|
await this.onConnectHandler({
|
|
@@ -179,7 +179,8 @@ class WalletConnectV2Connector extends BaseConnector {
|
|
|
179
179
|
return {
|
|
180
180
|
ethereumProvider: this.provider,
|
|
181
181
|
solanaWallet: this._solanaWallet,
|
|
182
|
-
connectorName: this.name
|
|
182
|
+
connectorName: this.name,
|
|
183
|
+
connectorNamespace
|
|
183
184
|
};
|
|
184
185
|
}
|
|
185
186
|
if (this.status !== CONNECTOR_STATUS.CONNECTING) {
|
|
@@ -192,7 +193,8 @@ class WalletConnectV2Connector extends BaseConnector {
|
|
|
192
193
|
return {
|
|
193
194
|
ethereumProvider: this.provider,
|
|
194
195
|
solanaWallet: this._solanaWallet,
|
|
195
|
-
connectorName: this.name
|
|
196
|
+
connectorName: this.name,
|
|
197
|
+
connectorNamespace
|
|
196
198
|
};
|
|
197
199
|
} catch (error) {
|
|
198
200
|
log.error("Wallet connect v2 connector error while connecting", error);
|
|
@@ -473,11 +475,10 @@ class WalletConnectV2Connector extends BaseConnector {
|
|
|
473
475
|
connectorName: WALLET_CONNECTORS.WALLET_CONNECT_V2,
|
|
474
476
|
reconnected: this.rehydrated,
|
|
475
477
|
ethereumProvider: this.provider,
|
|
476
|
-
solanaWallet: this._solanaWallet
|
|
478
|
+
solanaWallet: this._solanaWallet,
|
|
479
|
+
connectorNamespace: this.connectorNamespace
|
|
477
480
|
});
|
|
478
|
-
|
|
479
|
-
await this.getAuthTokenInfo();
|
|
480
|
-
}
|
|
481
|
+
await this.authorizeOrDisconnect(getAuthTokenInfo);
|
|
481
482
|
}
|
|
482
483
|
subscribeEvents() {
|
|
483
484
|
if (!this.connector) throw WalletInitializationError.notReady("Wallet connector is not ready yet");
|
package/dist/lib.esm/index.js
CHANGED
|
@@ -15,10 +15,11 @@ export { CONNECTOR_NAMES, EVM_CONNECTORS, MULTI_CHAIN_CONNECTORS, SOLANA_CONNECT
|
|
|
15
15
|
export { CONNECTOR_NAMESPACES } from './base/chain/IChainInterface.js';
|
|
16
16
|
export { CommonJRPCProvider } from './providers/base-provider/CommonJRPCProvider.js';
|
|
17
17
|
export { CommonPrivateKeyProvider } from './providers/base-provider/commonPrivateKeyProvider.js';
|
|
18
|
-
export { DEFAULT_EIP155_METHODS, DEFAULT_EIP_155_EVENTS, DEFAULT_SOLANA_EVENTS, DEFAULT_SOLANA_METHODS,
|
|
18
|
+
export { DEFAULT_EIP155_METHODS, DEFAULT_EIP_155_EVENTS, DEFAULT_SOLANA_EVENTS, DEFAULT_SOLANA_METHODS, getNamespacesFromChains, getRequiredNamespaces, getSupportedEventsByNamespace, getSupportedMethodsByNamespace, getWalletConnectV2Settings } from './connectors/wallet-connect-v2-connector/config.js';
|
|
19
19
|
export { EIP1193_EVENTS } from './providers/base-provider/utils.js';
|
|
20
20
|
export { EIP_7702_SUPPORTED_SMART_ACCOUNTS, LOGIN_MODE, MODAL_SIGN_IN_METHODS, SMART_ACCOUNT_WALLET_SCOPE, SOLANA_CAIP_CHAIN_MAP, WALLET_REGISTRY_URL, WEB3AUTH_STATE_STORAGE_KEY, WIDGET_TYPE } from './base/constants.js';
|
|
21
21
|
export { EVM_PLUGINS, PLUGIN_EVENTS, PLUGIN_NAMESPACES, PLUGIN_STATUS, SOLANA_PLUGINS, WALLET_PLUGINS } from './base/plugin/IPlugin.js';
|
|
22
|
+
export { METAMASK_ERC_6963_PROVIDER_RDNS, metaMaskConnector } from './connectors/metamask-connector/metamaskConnector.js';
|
|
22
23
|
export { PROVIDER_EVENTS } from './base/provider/IProvider.js';
|
|
23
24
|
export { WalletConnectV2Provider } from './connectors/wallet-connect-v2-connector/WalletConnectV2Provider.js';
|
|
24
25
|
export { WalletInitializationError, WalletLoginError, WalletOperationsError, WalletProviderError, Web3AuthError, isUserRejectedError } from './base/errors/index.js';
|
|
@@ -39,7 +40,6 @@ export { hasSolanaWalletStandardFeatures } from './connectors/injected-solana-co
|
|
|
39
40
|
export { injectedEvmConnector } from './connectors/injected-evm-connector/injectedEvmConnector.js';
|
|
40
41
|
export { log } from './base/loglevel.js';
|
|
41
42
|
export { makeAccountLinkingRequest, makeAccountUnlinkingRequest } from './account-linking/rest.js';
|
|
42
|
-
export { metaMaskConnector } from './connectors/metamask-connector/metamaskConnector.js';
|
|
43
43
|
export { walletConnectV2Connector } from './connectors/wallet-connect-v2-connector/walletConnectV2Connector.js';
|
|
44
44
|
export { walletServicesPlugin } from './plugins/wallet-services-plugin/plugin.js';
|
|
45
45
|
export { walletStandardConnector } from './connectors/injected-solana-connector/walletStandardConnector.js';
|
package/dist/lib.esm/noModal.js
CHANGED
|
@@ -19,7 +19,7 @@ import { assertAuthConnector, authConnector, isAuthConnector } from './connector
|
|
|
19
19
|
import { AccountLinkingError } from './account-linking/errors.js';
|
|
20
20
|
import { CommonJRPCProvider } from './providers/base-provider/CommonJRPCProvider.js';
|
|
21
21
|
import { walletServicesPlugin } from './plugins/wallet-services-plugin/plugin.js';
|
|
22
|
-
import { metaMaskConnector } from './connectors/metamask-connector/metamaskConnector.js';
|
|
22
|
+
import { metaMaskConnector, METAMASK_ERC_6963_PROVIDER_RDNS } from './connectors/metamask-connector/metamaskConnector.js';
|
|
23
23
|
import { storageAvailable } from './base/connector/utils.js';
|
|
24
24
|
import { PLUGIN_STATUS, PLUGIN_NAMESPACES } from './base/plugin/IPlugin.js';
|
|
25
25
|
|
|
@@ -50,7 +50,8 @@ class Web3AuthNoModal extends SafeEventEmitter {
|
|
|
50
50
|
idToken: null,
|
|
51
51
|
accessToken: null,
|
|
52
52
|
refreshToken: null,
|
|
53
|
-
activeAccount: null
|
|
53
|
+
activeAccount: null,
|
|
54
|
+
cachedConnectorNamespace: null
|
|
54
55
|
});
|
|
55
56
|
if (!options.clientId) throw WalletInitializationError.invalidParams("Please provide a valid clientId in constructor");
|
|
56
57
|
if (options.enableLogging) log.enableAll();else log.setLevel("error");
|
|
@@ -251,6 +252,7 @@ class Web3AuthNoModal extends SafeEventEmitter {
|
|
|
251
252
|
await this.setState({
|
|
252
253
|
primaryConnectorName: null,
|
|
253
254
|
cachedConnector: null,
|
|
255
|
+
cachedConnectorNamespace: null,
|
|
254
256
|
currentChainId: null,
|
|
255
257
|
idToken: null,
|
|
256
258
|
accessToken: null,
|
|
@@ -261,7 +263,10 @@ class Web3AuthNoModal extends SafeEventEmitter {
|
|
|
261
263
|
}
|
|
262
264
|
async cleanup() {
|
|
263
265
|
for (const connector of this.connectors) {
|
|
264
|
-
if
|
|
266
|
+
// if the connector is not ready, we don't need to cleanup
|
|
267
|
+
// this means that we load the connector (coz of the dashboard config) but the clients did not use it (i.e. with `showOnModal` set to false)
|
|
268
|
+
// example use case: external wallet **ONLY** login mode but the ClientID has enabled Auth connection in dashboard.
|
|
269
|
+
if (connector.cleanup && connector.status !== CONNECTOR_STATUS.NOT_READY) await connector.cleanup();
|
|
265
270
|
}
|
|
266
271
|
}
|
|
267
272
|
async switchChain(params) {
|
|
@@ -794,7 +799,9 @@ class Web3AuthNoModal extends SafeEventEmitter {
|
|
|
794
799
|
});
|
|
795
800
|
|
|
796
801
|
// sync chainId
|
|
797
|
-
this.commonJRPCProvider.on("chainChanged", async chainId =>
|
|
802
|
+
this.commonJRPCProvider.on("chainChanged", async chainId => {
|
|
803
|
+
await this.setCurrentChain(chainId);
|
|
804
|
+
});
|
|
798
805
|
}
|
|
799
806
|
async setupConnector(connector) {
|
|
800
807
|
this.subscribeToConnectorEvents(connector);
|
|
@@ -860,12 +867,19 @@ class Web3AuthNoModal extends SafeEventEmitter {
|
|
|
860
867
|
injectedEvmConnector
|
|
861
868
|
} = await import('./connectors/injected-evm-connector/index.js');
|
|
862
869
|
const evmMipd = createMipd();
|
|
870
|
+
// `@metamask/connect-evm` SDK announces its own EIP-6963 provider (`io.metamask.mmc`) so
|
|
871
|
+
// it can be discovered by generic wallet pickers. We already register MetaMask via
|
|
872
|
+
// `metaMaskConnector`, so we must exclude the SDK-announced provider here; otherwise
|
|
873
|
+
// it is misclassified as an injected wallet and the modal shows MetaMask as installed,
|
|
874
|
+
// even when the user does not have the extension installed.
|
|
875
|
+
const isNonSdkAnnouncedProvider = providerDetail => providerDetail.info.rdns !== METAMASK_ERC_6963_PROVIDER_RDNS;
|
|
863
876
|
// subscribe to new injected connectors
|
|
864
877
|
evmMipd.subscribe(providerDetails => {
|
|
865
|
-
const
|
|
878
|
+
const filteredProviderDetails = providerDetails.filter(isNonSdkAnnouncedProvider);
|
|
879
|
+
const newConnectors = filteredProviderDetails.map(providerDetail => injectedEvmConnector(providerDetail)(config));
|
|
866
880
|
this.setConnectors(newConnectors);
|
|
867
881
|
});
|
|
868
|
-
connectorFns.push(...evmMipd.getProviders().map(injectedEvmConnector));
|
|
882
|
+
connectorFns.push(...evmMipd.getProviders().filter(isNonSdkAnnouncedProvider).map(injectedEvmConnector));
|
|
869
883
|
}
|
|
870
884
|
}
|
|
871
885
|
|
|
@@ -1000,7 +1014,7 @@ class Web3AuthNoModal extends SafeEventEmitter {
|
|
|
1000
1014
|
await this.setState({
|
|
1001
1015
|
primaryConnectorName: data.connectorName
|
|
1002
1016
|
});
|
|
1003
|
-
this.cacheWallet(data.connectorName);
|
|
1017
|
+
this.cacheWallet(data.connectorName, data.connectorNamespace);
|
|
1004
1018
|
const isConnectAndSign = this.coreOptions.initialAuthenticationMode === CONNECTOR_INITIAL_AUTHENTICATION_MODE.CONNECT_AND_SIGN;
|
|
1005
1019
|
const pendingUserConsent = this.consentRequired && !this.state.hasUserConsent;
|
|
1006
1020
|
if (pendingUserConsent && !isConnectAndSign) {
|
|
@@ -1015,7 +1029,6 @@ class Web3AuthNoModal extends SafeEventEmitter {
|
|
|
1015
1029
|
if (this.status !== CONNECTOR_STATUS.CONSENT_REQUIRING && this.status !== CONNECTOR_STATUS.AUTHORIZED) {
|
|
1016
1030
|
this.status = CONNECTOR_STATUS.CONNECTED;
|
|
1017
1031
|
}
|
|
1018
|
-
log.debug("connected", this.status, this.primaryConnectorName);
|
|
1019
1032
|
// Defer plugin connection until consent is accepted; otherwise plugins would start before the consent step completes.
|
|
1020
1033
|
// `completeConsentAcceptance` connects the plugins once the user accepts the consent.
|
|
1021
1034
|
if (!pendingUserConsent) {
|
|
@@ -1133,7 +1146,14 @@ class Web3AuthNoModal extends SafeEventEmitter {
|
|
|
1133
1146
|
// External wallets can resolve to a different active chain than the requested one,
|
|
1134
1147
|
// so let connector-reported chain updates reconcile Web3Auth state after connect.
|
|
1135
1148
|
if (typeof (data === null || data === void 0 ? void 0 : data.data) === "object" && (data === null || data === void 0 ? void 0 : data.data) !== null && "chainId" in data.data && typeof data.data.chainId === "string") {
|
|
1149
|
+
const previousChain = this.currentChain;
|
|
1136
1150
|
await this.setCurrentChain(data.data.chainId);
|
|
1151
|
+
const currentChain = this.currentChain;
|
|
1152
|
+
const connectorEthereumProvider = connector.provider;
|
|
1153
|
+
if ((previousChain === null || previousChain === void 0 ? void 0 : previousChain.chainNamespace) !== (currentChain === null || currentChain === void 0 ? void 0 : currentChain.chainNamespace) && (currentChain === null || currentChain === void 0 ? void 0 : currentChain.chainNamespace) === CHAIN_NAMESPACES.EIP155 && connectorEthereumProvider) {
|
|
1154
|
+
// from sol -> evm namespace switch, we need to re-create AccountAbstractionProvider
|
|
1155
|
+
await this.bindPrimaryEthereumSigningProxy(connectorEthereumProvider, connector.name);
|
|
1156
|
+
}
|
|
1137
1157
|
}
|
|
1138
1158
|
log.debug("connector data updated", data);
|
|
1139
1159
|
this.emit(CONNECTOR_EVENTS.CONNECTOR_DATA_UPDATED, data);
|
|
@@ -1188,7 +1208,7 @@ class Web3AuthNoModal extends SafeEventEmitter {
|
|
|
1188
1208
|
}
|
|
1189
1209
|
checkIfAutoConnect(connector) {
|
|
1190
1210
|
var _this$currentChain3;
|
|
1191
|
-
let autoConnect = this.cachedConnector === connector.name;
|
|
1211
|
+
let autoConnect = this.cachedConnector === connector.name && this.state.cachedConnectorNamespace === connector.connectorNamespace;
|
|
1192
1212
|
if (autoConnect && (_this$currentChain3 = this.currentChain) !== null && _this$currentChain3 !== void 0 && _this$currentChain3.chainNamespace) {
|
|
1193
1213
|
if (connector.connectorNamespace === CONNECTOR_NAMESPACES.MULTICHAIN) autoConnect = true;else autoConnect = connector.connectorNamespace === this.currentChain.chainNamespace;
|
|
1194
1214
|
}
|
|
@@ -1202,10 +1222,16 @@ class Web3AuthNoModal extends SafeEventEmitter {
|
|
|
1202
1222
|
getInitialChainIdForConnector(connector) {
|
|
1203
1223
|
var _initialChain;
|
|
1204
1224
|
let initialChain = this.currentChain;
|
|
1205
|
-
|
|
1225
|
+
const defaultChainId = this.coreOptions.defaultChainId;
|
|
1226
|
+
const isMultiChainConnector = connector.connectorNamespace === CONNECTOR_NAMESPACES.MULTICHAIN;
|
|
1227
|
+
|
|
1228
|
+
// if the connector is a multi-chain connector and a default chain id is set, use the default chain id
|
|
1229
|
+
if (isMultiChainConnector && defaultChainId) {
|
|
1230
|
+
initialChain = this.coreOptions.chains.find(chain => chain.chainId === defaultChainId) || this.currentChain;
|
|
1231
|
+
} else if (((_initialChain = initialChain) === null || _initialChain === void 0 ? void 0 : _initialChain.chainNamespace) !== connector.connectorNamespace && connector.connectorNamespace !== CONNECTOR_NAMESPACES.MULTICHAIN) {
|
|
1206
1232
|
initialChain = this.coreOptions.chains.find(x => x.chainNamespace === connector.connectorNamespace);
|
|
1207
|
-
if (!initialChain) throw WalletInitializationError.invalidParams(`No chain found for ${connector.connectorNamespace}`);
|
|
1208
1233
|
}
|
|
1234
|
+
if (!initialChain) throw WalletInitializationError.invalidParams(`No chain found for ${connector.connectorNamespace}`);
|
|
1209
1235
|
return initialChain;
|
|
1210
1236
|
}
|
|
1211
1237
|
async completeConsentAcceptance() {
|
|
@@ -1391,7 +1417,8 @@ class Web3AuthNoModal extends SafeEventEmitter {
|
|
|
1391
1417
|
return {
|
|
1392
1418
|
ethereumProvider: connectedWallet.signingProvider,
|
|
1393
1419
|
solanaWallet: (_connectedWallet$sola = connectedWallet.solanaWallet) !== null && _connectedWallet$sola !== void 0 ? _connectedWallet$sola : null,
|
|
1394
|
-
connectorName: connectedWallet.connector.name
|
|
1420
|
+
connectorName: connectedWallet.connector.name,
|
|
1421
|
+
connectorNamespace: connectedWallet.connector.connectorNamespace
|
|
1395
1422
|
};
|
|
1396
1423
|
}
|
|
1397
1424
|
buildImmediateConnectedWalletConnectorState(params) {
|
|
@@ -1529,11 +1556,7 @@ class Web3AuthNoModal extends SafeEventEmitter {
|
|
|
1529
1556
|
if (!connection) {
|
|
1530
1557
|
throw WalletLoginError.connectionError("Failed to resolve the active connection after switching accounts.");
|
|
1531
1558
|
}
|
|
1532
|
-
this.emit(CONNECTOR_EVENTS.CONNECTION_UPDATED,
|
|
1533
|
-
ethereumProvider: connection.ethereumProvider,
|
|
1534
|
-
solanaWallet: connection.solanaWallet,
|
|
1535
|
-
connectorName: connection.connectorName
|
|
1536
|
-
});
|
|
1559
|
+
this.emit(CONNECTOR_EVENTS.CONNECTION_UPDATED, connection);
|
|
1537
1560
|
}
|
|
1538
1561
|
isActiveConnectorEventSource(connector) {
|
|
1539
1562
|
if (!this.primaryConnectorName) return true;
|
|
@@ -1616,9 +1639,10 @@ class Web3AuthNoModal extends SafeEventEmitter {
|
|
|
1616
1639
|
log.debug("Failed to cache connected linked wallet connector", error);
|
|
1617
1640
|
}
|
|
1618
1641
|
}
|
|
1619
|
-
async cacheWallet(walletName) {
|
|
1642
|
+
async cacheWallet(walletName, connectorNamespace) {
|
|
1620
1643
|
await this.setState({
|
|
1621
|
-
cachedConnector: walletName
|
|
1644
|
+
cachedConnector: walletName,
|
|
1645
|
+
cachedConnectorNamespace: connectorNamespace
|
|
1622
1646
|
});
|
|
1623
1647
|
}
|
|
1624
1648
|
async setCurrentChain(chainId) {
|
|
@@ -1654,9 +1678,11 @@ class Web3AuthNoModal extends SafeEventEmitter {
|
|
|
1654
1678
|
});
|
|
1655
1679
|
}
|
|
1656
1680
|
async bindPrimaryEthereumSigningProxy(ethereumProvider, connectorName) {
|
|
1657
|
-
var _this$currentChain5, _accountAbstractionCo;
|
|
1681
|
+
var _this$primaryConnecto2, _this$currentChain5, _accountAbstractionCo;
|
|
1658
1682
|
if (!this.commonJRPCProvider) throw WalletInitializationError.notFound(`CommonJrpcProvider not found`);
|
|
1659
|
-
|
|
1683
|
+
const primaryConnectorProvider = connectorName === this.primaryConnectorName ? (_this$primaryConnecto2 = this.primaryConnector) === null || _this$primaryConnecto2 === void 0 ? void 0 : _this$primaryConnecto2.provider : null;
|
|
1684
|
+
const baseEthereumProvider = ethereumProvider === this.commonJRPCProvider || ethereumProvider === this.aaProvider ? primaryConnectorProvider !== null && primaryConnectorProvider !== void 0 ? primaryConnectorProvider : ethereumProvider : ethereumProvider;
|
|
1685
|
+
let finalProvider = (baseEthereumProvider === null || baseEthereumProvider === void 0 ? void 0 : baseEthereumProvider.provider) || baseEthereumProvider;
|
|
1660
1686
|
const {
|
|
1661
1687
|
accountAbstractionConfig
|
|
1662
1688
|
} = this.coreOptions;
|
|
@@ -1673,7 +1699,7 @@ class Web3AuthNoModal extends SafeEventEmitter {
|
|
|
1673
1699
|
accountAbstractionProvider,
|
|
1674
1700
|
toEoaProvider
|
|
1675
1701
|
} = await import('./providers/account-abstraction-provider/index.js');
|
|
1676
|
-
const eoaProvider = connectorName === WALLET_CONNECTORS.AUTH ? await toEoaProvider(
|
|
1702
|
+
const eoaProvider = connectorName === WALLET_CONNECTORS.AUTH ? await toEoaProvider(baseEthereumProvider) : baseEthereumProvider;
|
|
1677
1703
|
const aaChainIds = new Set((accountAbstractionConfig === null || accountAbstractionConfig === void 0 || (_accountAbstractionCo2 = accountAbstractionConfig.chains) === null || _accountAbstractionCo2 === void 0 ? void 0 : _accountAbstractionCo2.map(chain => chain.chainId)) || []);
|
|
1678
1704
|
const aaProvider = await accountAbstractionProvider({
|
|
1679
1705
|
accountAbstractionConfig,
|
package/dist/lib.esm/providers/account-abstraction-provider/providers/AccountAbstractionProvider.js
CHANGED
|
@@ -54,7 +54,7 @@ class AccountAbstractionProvider extends BaseProvider {
|
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
async setupProvider(eoaProvider) {
|
|
57
|
-
var _bundlerConfig$transp;
|
|
57
|
+
var _ref, _bundlerConfig$transp;
|
|
58
58
|
const currentChain = this.currentChain;
|
|
59
59
|
if (!currentChain) {
|
|
60
60
|
throw WalletInitializationError.invalidProviderConfigError(`AA chain config not found for chain ${this.chainId}`);
|
|
@@ -97,7 +97,14 @@ class AccountAbstractionProvider extends BaseProvider {
|
|
|
97
97
|
chain,
|
|
98
98
|
transport: http(currentChain.rpcTarget)
|
|
99
99
|
});
|
|
100
|
-
|
|
100
|
+
// Firstly, try to get the accounts from the existing connected provider with `eth_accounts` method.
|
|
101
|
+
// We don't wanna do `eth_requestAccounts` method here, coz if the wallet is already connected, it will trigger chainChanged event and unintentionally update the AaProvider re-bind and
|
|
102
|
+
// re-bind run this again, so we will end up in infinite loop.
|
|
103
|
+
const existingAccounts = (_ref = await eoaProvider.request({
|
|
104
|
+
method: METHOD_TYPES.GET_ACCOUNTS
|
|
105
|
+
})) !== null && _ref !== void 0 ? _ref : [];
|
|
106
|
+
// only if the existing accounts are not found (that means wallet isn't connected), then we will trigger `eth_requestAccounts` method to get the accounts.
|
|
107
|
+
const [eoaAddress] = existingAccounts.length > 0 ? existingAccounts : await eoaProvider.request({
|
|
101
108
|
method: METHOD_TYPES.ETH_REQUEST_ACCOUNTS
|
|
102
109
|
});
|
|
103
110
|
const walletClient = createWalletClient({
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
2
|
import { METHOD_TYPES, EIP_5792_METHODS, EIP_7702_METHODS } from '@toruslabs/ethereum-controllers';
|
|
3
3
|
import { createScaffoldMiddlewareV2, providerErrors, rpcErrors } from '@web3auth/auth';
|
|
4
|
-
import { NULL_ON_SUCCESS_METHODS } from '../../../connectors/wallet-connect-v2-connector/config.js';
|
|
5
4
|
|
|
6
5
|
async function createAaMiddleware({
|
|
7
6
|
eoaProvider,
|
|
@@ -200,17 +199,10 @@ function providerAsMiddleware(provider) {
|
|
|
200
199
|
return async ({
|
|
201
200
|
request
|
|
202
201
|
}) => {
|
|
203
|
-
|
|
202
|
+
return provider.request({
|
|
204
203
|
method: request.method,
|
|
205
204
|
params: request.params
|
|
206
205
|
});
|
|
207
|
-
if (result === undefined && NULL_ON_SUCCESS_METHODS.includes(request.method)) {
|
|
208
|
-
// For some RPC requests, such as `wallet_switchEthereumChain`, the standard rpc result is `null`.
|
|
209
|
-
// However, some wallet providers might return `undefined` instead and causing the JRPCEngineV2 to throw `Nothing ended the request` error.
|
|
210
|
-
// So, we handle this case by returning `null` instead, so that JRPCEngineV2 won't throw `Nothing ended the request` error
|
|
211
|
-
return null;
|
|
212
|
-
}
|
|
213
|
-
return result;
|
|
214
206
|
};
|
|
215
207
|
}
|
|
216
208
|
|
|
@@ -162,6 +162,14 @@ function useWeb3AuthInnerContextValue({
|
|
|
162
162
|
setChainId(web3Auth.currentChainId);
|
|
163
163
|
setChainNamespace((_web3Auth$currentChai1 = (_web3Auth$currentChai10 = web3Auth.currentChain) === null || _web3Auth$currentChai10 === void 0 ? void 0 : _web3Auth$currentChai10.chainNamespace) !== null && _web3Auth$currentChai1 !== void 0 ? _web3Auth$currentChai1 : null);
|
|
164
164
|
};
|
|
165
|
+
const connectorDataUpdatedListener = data => {
|
|
166
|
+
const updatedData = data.data;
|
|
167
|
+
if (updatedData.chainId) {
|
|
168
|
+
var _web3Auth$currentChai11;
|
|
169
|
+
setChainId(updatedData.chainId);
|
|
170
|
+
setChainNamespace((_web3Auth$currentChai11 = web3Auth.currentChain) === null || _web3Auth$currentChai11 === void 0 ? void 0 : _web3Auth$currentChai11.chainNamespace);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
165
173
|
if (web3Auth) {
|
|
166
174
|
web3Auth.on(CONNECTOR_EVENTS.NOT_READY, notReadyListener);
|
|
167
175
|
web3Auth.on(CONNECTOR_EVENTS.READY, readyListener);
|
|
@@ -173,6 +181,7 @@ function useWeb3AuthInnerContextValue({
|
|
|
173
181
|
web3Auth.on(CONNECTOR_EVENTS.REHYDRATION_ERROR, rehydrationErrorListener);
|
|
174
182
|
web3Auth.on(CONNECTOR_EVENTS.MFA_ENABLED, mfaEnabledListener);
|
|
175
183
|
web3Auth.on(CONNECTOR_EVENTS.CONNECTION_UPDATED, connectionUpdatedListener);
|
|
184
|
+
web3Auth.on(CONNECTOR_EVENTS.CONNECTOR_DATA_UPDATED, connectorDataUpdatedListener);
|
|
176
185
|
if (web3Auth.loginMode === LOGIN_MODE.MODAL) {
|
|
177
186
|
web3Auth.on(CONNECTOR_EVENTS.CONSENT_ACCEPTED, consentAcceptedListener);
|
|
178
187
|
}
|
|
@@ -189,6 +198,7 @@ function useWeb3AuthInnerContextValue({
|
|
|
189
198
|
web3Auth.removeListener(CONNECTOR_EVENTS.MFA_ENABLED, mfaEnabledListener);
|
|
190
199
|
web3Auth.removeListener(CONNECTOR_EVENTS.AUTHORIZED, authorizedListener);
|
|
191
200
|
web3Auth.removeListener(CONNECTOR_EVENTS.CONNECTION_UPDATED, connectionUpdatedListener);
|
|
201
|
+
web3Auth.removeListener(CONNECTOR_EVENTS.CONNECTOR_DATA_UPDATED, connectorDataUpdatedListener);
|
|
192
202
|
if (web3Auth.loginMode === LOGIN_MODE.MODAL) {
|
|
193
203
|
web3Auth.removeListener(CONNECTOR_EVENTS.CONSENT_ACCEPTED, consentAcceptedListener);
|
|
194
204
|
}
|