@web3auth/no-modal 8.0.0-alpha.18 → 8.0.0-alpha.19

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.
@@ -32,6 +32,7 @@ export declare class Web3AuthNoModal extends SafeEventEmitter implements IWeb3Au
32
32
  cleanup: boolean;
33
33
  }): Promise<void>;
34
34
  getUserInfo(): Promise<Partial<UserInfo>>;
35
+ enableMFA<T>(loginParams?: T): Promise<void>;
35
36
  authenticateUser(): Promise<UserAuthInfo>;
36
37
  addPlugin(plugin: IPlugin): IWeb3Auth;
37
38
  protected subscribeToAdapterEvents(walletAdapter: IAdapter<unknown>): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@web3auth/no-modal",
3
- "version": "8.0.0-alpha.18",
3
+ "version": "8.0.0-alpha.19",
4
4
  "description": "Multi chain wallet aggregator for web3Auth",
5
5
  "keywords": [
6
6
  "web3Auth/no-modal",
@@ -40,13 +40,13 @@
40
40
  "@toruslabs/openlogin": "^7.0.4",
41
41
  "@toruslabs/openlogin-jrpc": "^7.0.0",
42
42
  "@toruslabs/openlogin-utils": "^7.0.4",
43
- "@web3auth/base": "^8.0.0-alpha.17",
44
- "@web3auth/base-plugin": "^8.0.0-alpha.17",
45
- "@web3auth/base-provider": "^8.0.0-alpha.18"
43
+ "@web3auth/base": "^8.0.0-alpha.19",
44
+ "@web3auth/base-plugin": "^8.0.0-alpha.19",
45
+ "@web3auth/base-provider": "^8.0.0-alpha.19"
46
46
  },
47
47
  "devDependencies": {
48
- "@web3auth/openlogin-adapter": "^8.0.0-alpha.18",
49
- "@web3auth/wallet-connect-v2-adapter": "^8.0.0-alpha.18"
48
+ "@web3auth/openlogin-adapter": "^8.0.0-alpha.19",
49
+ "@web3auth/wallet-connect-v2-adapter": "^8.0.0-alpha.19"
50
50
  },
51
51
  "peerDependenciesMeta": {
52
52
  "@web3auth/openlogin-adapter": {
@@ -76,5 +76,5 @@
76
76
  "node": ">=18.x",
77
77
  "npm": ">=9.x"
78
78
  },
79
- "gitHead": "b8d5ab92b0b69e531f93c12cab752022ec4f14ec"
79
+ "gitHead": "c863518592b34ee6b79ad7efc126a661966277fa"
80
80
  }
package/src/noModal.ts CHANGED
@@ -180,9 +180,6 @@ export class Web3AuthNoModal extends SafeEventEmitter implements IWeb3Auth {
180
180
  }
181
181
 
182
182
  public async addChain(chainConfig: CustomChainConfig): Promise<void> {
183
- if (this.status === ADAPTER_STATUS.CONNECTED && this.connectedAdapterName)
184
- return this.walletAdapters[this.connectedAdapterName].addChain(chainConfig);
185
-
186
183
  if (this.commonJRPCProvider) {
187
184
  return this.commonJRPCProvider.addChain(chainConfig);
188
185
  }
@@ -190,9 +187,6 @@ export class Web3AuthNoModal extends SafeEventEmitter implements IWeb3Auth {
190
187
  }
191
188
 
192
189
  public async switchChain(params: { chainId: string }): Promise<void> {
193
- if (this.status === ADAPTER_STATUS.CONNECTED && this.connectedAdapterName)
194
- return this.walletAdapters[this.connectedAdapterName].switchChain(params);
195
-
196
190
  if (this.commonJRPCProvider) {
197
191
  return this.commonJRPCProvider.switchChain(params);
198
192
  }
@@ -222,6 +216,13 @@ export class Web3AuthNoModal extends SafeEventEmitter implements IWeb3Auth {
222
216
  return this.walletAdapters[this.connectedAdapterName].getUserInfo();
223
217
  }
224
218
 
219
+ async enableMFA<T>(loginParams?: T): Promise<void> {
220
+ if (this.status !== ADAPTER_STATUS.CONNECTED || !this.connectedAdapterName) throw WalletLoginError.notConnectedError(`No wallet is connected`);
221
+ if (this.connectedAdapterName !== WALLET_ADAPTERS.OPENLOGIN)
222
+ throw WalletLoginError.unsupportedOperation(`EnableMFA is not supported for this adapter.`);
223
+ return this.walletAdapters[this.connectedAdapterName].enableMFA(loginParams);
224
+ }
225
+
225
226
  async authenticateUser(): Promise<UserAuthInfo> {
226
227
  if (this.status !== ADAPTER_STATUS.CONNECTED || !this.connectedAdapterName) throw WalletLoginError.notConnectedError(`No wallet is connected`);
227
228
  return this.walletAdapters[this.connectedAdapterName].authenticateUser();