@web3auth/modal 8.0.0-alpha.8 → 8.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.
@@ -1,4 +1,4 @@
1
- import { IProvider, WALLET_ADAPTER_TYPE, Web3AuthNoModalOptions } from "@web3auth/base";
1
+ import { IBaseProvider, IProvider, WALLET_ADAPTER_TYPE, Web3AuthNoModalOptions } from "@web3auth/base";
2
2
  import { Web3AuthNoModal } from "@web3auth/no-modal";
3
3
  import { LoginModal, UIConfig } from "@web3auth/ui";
4
4
  import { AdaptersModalConfig, IWeb3AuthModal, ModalConfig } from "./interface";
@@ -7,6 +7,10 @@ export interface Web3AuthOptions extends Web3AuthNoModalOptions {
7
7
  * Config for configuring modal ui display properties
8
8
  */
9
9
  uiConfig?: Omit<UIConfig, "adapterListener">;
10
+ /**
11
+ * Private key provider for your chain namespace
12
+ */
13
+ privateKeyProvider: IBaseProvider<string>;
10
14
  }
11
15
  export declare class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal {
12
16
  loginModal: LoginModal;
package/package.json CHANGED
@@ -4,21 +4,20 @@
4
4
  "url": "https://github.com/Web3Auth/Web3Auth/issues"
5
5
  },
6
6
  "dependencies": {
7
- "@web3auth/base": "^8.0.0-alpha.8",
8
- "@web3auth/base-provider": "^8.0.0-alpha.8",
9
- "@web3auth/no-modal": "^8.0.0-alpha.8",
10
- "@web3auth/openlogin-adapter": "^8.0.0-alpha.8",
11
- "@web3auth/ui": "^8.0.0-alpha.8"
7
+ "@web3auth/base": "^8.0.0",
8
+ "@web3auth/base-provider": "^8.0.0",
9
+ "@web3auth/no-modal": "^8.0.0",
10
+ "@web3auth/openlogin-adapter": "^8.0.0",
11
+ "@web3auth/ui": "^8.0.0"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@svgr/webpack": "^8.1.0",
15
15
  "@toruslabs/isomorphic-style-loader": "^5.3.3",
16
- "@toruslabs/openlogin-utils": "^6.2.5",
17
- "@web3auth/wallet-connect-v2-adapter": "^8.0.0-alpha.8",
18
- "css-loader": "^6.9.1",
16
+ "@toruslabs/openlogin-utils": "^7.0.4",
17
+ "@web3auth/wallet-connect-v2-adapter": "^8.0.0",
18
+ "css-loader": "^6.10.0",
19
19
  "postcss-prefix-selector": "^1.16.0",
20
20
  "style-loader": "^3.3.4",
21
- "tailwindcss": "^3.4.1",
22
21
  "url-loader": "^4.1.1"
23
22
  },
24
23
  "engines": {
@@ -69,6 +68,6 @@
69
68
  },
70
69
  "types": "dist/types/index.d.ts",
71
70
  "unpkg": "dist/modal.umd.min.js",
72
- "version": "8.0.0-alpha.8",
73
- "gitHead": "6ca3c8fee49b28687d8294dad0c32523eae9bc32"
71
+ "version": "8.0.0",
72
+ "gitHead": "0428ae575ef36e3ad783f37d14a10a78e66e2909"
74
73
  }
@@ -5,6 +5,7 @@ import {
5
5
  BaseAdapterConfig,
6
6
  CustomChainConfig,
7
7
  getChainConfig,
8
+ IBaseProvider,
8
9
  IProvider,
9
10
  log,
10
11
  LoginMethodConfig,
@@ -27,6 +28,11 @@ export interface Web3AuthOptions extends Web3AuthNoModalOptions {
27
28
  * Config for configuring modal ui display properties
28
29
  */
29
30
  uiConfig?: Omit<UIConfig, "adapterListener">;
31
+
32
+ /**
33
+ * Private key provider for your chain namespace
34
+ */
35
+ privateKeyProvider: IBaseProvider<string>;
30
36
  }
31
37
 
32
38
  export class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal {
@@ -43,6 +49,7 @@ export class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal {
43
49
  if (!this.options.uiConfig) this.options.uiConfig = {};
44
50
  if (!this.options.uiConfig.defaultLanguage) this.options.uiConfig.defaultLanguage = getUserLanguage(this.options.uiConfig.defaultLanguage);
45
51
  if (!this.options.uiConfig.mode) this.options.uiConfig.mode = "auto";
52
+ if (!this.coreOptions.privateKeyProvider) throw WalletInitializationError.invalidParams("privateKeyProvider is required");
46
53
 
47
54
  this.loginModal = new LoginModal({
48
55
  ...this.options.uiConfig,
@@ -198,7 +205,7 @@ export class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal {
198
205
  return;
199
206
  }
200
207
  // in-app wallets or cached wallet (being connected or already connected) are initialized first.
201
- // if adapter is configured thn only initialize in app or cached adapter.
208
+ // if adapter is configured then only initialize in app or cached adapter.
202
209
  // external wallets are initialized on INIT_EXTERNAL_WALLET event.
203
210
  this.subscribeToAdapterEvents(adapter);
204
211
  if (adapter.status === ADAPTER_STATUS.NOT_READY) await adapter.init({ autoConnect: this.cachedAdapter === adapterName });