@web3auth/no-modal 6.0.0-alpha.0 → 6.0.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.
@@ -56,6 +56,7 @@ export declare class Web3AuthNoModal extends SafeEventEmitter implements IWeb3Au
56
56
  private plugins;
57
57
  private storage;
58
58
  constructor(options: Web3AuthNoModalOptions);
59
+ get connected(): boolean;
59
60
  get provider(): SafeEventEmitterProvider | null;
60
61
  set provider(_: SafeEventEmitterProvider | null);
61
62
  init(): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@web3auth/no-modal",
3
- "version": "6.0.0-alpha.0",
3
+ "version": "6.0.0",
4
4
  "description": "Multi chain wallet aggregator for web3Auth",
5
5
  "keywords": [
6
6
  "web3Auth/no-modal",
@@ -35,12 +35,12 @@
35
35
  "@babel/runtime": "^7.x"
36
36
  },
37
37
  "dependencies": {
38
- "@toruslabs/openlogin": "^4.5.2",
38
+ "@toruslabs/openlogin": "^4.5.4",
39
39
  "@toruslabs/openlogin-jrpc": "^4.5.1",
40
40
  "@toruslabs/openlogin-utils": "^4.5.1",
41
- "@web3auth/base": "^6.0.0-alpha.0",
42
- "@web3auth/base-plugin": "^6.0.0-alpha.0",
43
- "@web3auth/base-provider": "^6.0.0-alpha.0"
41
+ "@web3auth/base": "^6.0.0",
42
+ "@web3auth/base-plugin": "^6.0.0",
43
+ "@web3auth/base-provider": "^6.0.0"
44
44
  },
45
45
  "lint-staged": {
46
46
  "!(*d).ts": [
@@ -62,5 +62,5 @@
62
62
  "node": ">=16.18.1",
63
63
  "npm": ">=8.x"
64
64
  },
65
- "gitHead": "c3f6ff688812333f37f10d8a6cf00be88aa451a1"
65
+ "gitHead": "e6f82b462c440e19d6faeffff3229bc9d1805598"
66
66
  }
package/src/noModal.ts CHANGED
@@ -94,7 +94,7 @@ export class Web3AuthNoModal extends SafeEventEmitter implements IWeb3Auth {
94
94
  super();
95
95
  if (!options.clientId) throw WalletInitializationError.invalidParams("Please provide a valid clientId in constructor");
96
96
  if (options.enableLogging) log.enableAll();
97
- else log.disableAll();
97
+ else log.setLevel("error");
98
98
  if (!options.chainConfig?.chainNamespace || !Object.values(CHAIN_NAMESPACES).includes(options.chainConfig?.chainNamespace))
99
99
  throw WalletInitializationError.invalidParams("Please provide a valid chainNamespace in chainConfig");
100
100
  if (options.storageKey === "session") this.storage = "sessionStorage";
@@ -110,6 +110,10 @@ export class Web3AuthNoModal extends SafeEventEmitter implements IWeb3Auth {
110
110
  this.subscribeToAdapterEvents = this.subscribeToAdapterEvents.bind(this);
111
111
  }
112
112
 
113
+ get connected(): boolean {
114
+ return Boolean(this.connectedAdapterName);
115
+ }
116
+
113
117
  get provider(): SafeEventEmitterProvider | null {
114
118
  if (this.status !== ADAPTER_STATUS.NOT_READY && this.commonJRPCProvider) {
115
119
  return this.commonJRPCProvider.provider;
@@ -122,6 +126,7 @@ export class Web3AuthNoModal extends SafeEventEmitter implements IWeb3Auth {
122
126
  }
123
127
 
124
128
  public async init(): Promise<void> {
129
+ this.commonJRPCProvider = await CommonJRPCProvider.getProviderInstance({ chainConfig: this.coreOptions.chainConfig as CustomChainConfig });
125
130
  const initPromises = Object.keys(this.walletAdapters).map((adapterName) => {
126
131
  this.subscribeToAdapterEvents(this.walletAdapters[adapterName]);
127
132
  // if adapter doesn't have any chain config yet thn set it based on provided namespace and chainId.
@@ -147,7 +152,6 @@ export class Web3AuthNoModal extends SafeEventEmitter implements IWeb3Auth {
147
152
 
148
153
  return this.walletAdapters[adapterName].init({ autoConnect: this.cachedAdapter === adapterName }).catch((e) => log.error(e));
149
154
  });
150
- this.commonJRPCProvider = await CommonJRPCProvider.getProviderInstance({ chainConfig: this.coreOptions.chainConfig as CustomChainConfig });
151
155
  this.status = ADAPTER_STATUS.READY;
152
156
  await Promise.all(initPromises);
153
157
  }