@web3auth/modal 4.1.1-alpha.0 → 4.2.2-alpha.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/modal.cjs.js +1 -0
- package/dist/modal.cjs.js.map +1 -1
- package/dist/modal.esm.js +1 -0
- package/dist/modal.esm.js.map +1 -1
- package/dist/modal.umd.min.js +1 -1
- package/dist/modal.umd.min.js.map +1 -1
- package/dist/types/interface.d.ts +7 -1
- package/dist/types/modalManager.d.ts +2 -2
- package/package.json +7 -7
- package/src/default.ts +1 -0
- package/src/interface.ts +13 -1
- package/src/modalManager.ts +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseAdapterConfig, ChainNamespaceType, LoginMethodConfig, WALLET_ADAPTER_TYPE } from "@web3auth/base";
|
|
1
|
+
import type { BaseAdapterConfig, ChainNamespaceType, IWeb3Auth, LoginMethodConfig, SafeEventEmitterProvider, WALLET_ADAPTER_TYPE } from "@web3auth/base";
|
|
2
2
|
export interface ModalConfig extends BaseAdapterConfig {
|
|
3
3
|
loginMethods?: LoginMethodConfig;
|
|
4
4
|
}
|
|
@@ -6,3 +6,9 @@ export interface AdaptersModalConfig {
|
|
|
6
6
|
chainNamespace: ChainNamespaceType;
|
|
7
7
|
adapters?: Record<WALLET_ADAPTER_TYPE, ModalConfig>;
|
|
8
8
|
}
|
|
9
|
+
export interface IWeb3AuthModal extends IWeb3Auth {
|
|
10
|
+
initModal(params?: {
|
|
11
|
+
modalConfig?: Record<WALLET_ADAPTER_TYPE, ModalConfig>;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
connect(): Promise<SafeEventEmitterProvider | null>;
|
|
14
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SafeEventEmitterProvider, WALLET_ADAPTER_TYPE } from "@web3auth/base";
|
|
2
2
|
import { Web3AuthCore, Web3AuthCoreOptions } from "@web3auth/core";
|
|
3
3
|
import { LoginModal } from "@web3auth/ui";
|
|
4
|
-
import { ModalConfig } from "./interface";
|
|
4
|
+
import { IWeb3AuthModal, ModalConfig } from "./interface";
|
|
5
5
|
export interface UIConfig {
|
|
6
6
|
/**
|
|
7
7
|
* Logo for your app.
|
|
@@ -52,7 +52,7 @@ export interface Web3AuthOptions extends Web3AuthCoreOptions {
|
|
|
52
52
|
*/
|
|
53
53
|
displayErrorsOnModal?: boolean;
|
|
54
54
|
}
|
|
55
|
-
export declare class Web3Auth extends Web3AuthCore {
|
|
55
|
+
export declare class Web3Auth extends Web3AuthCore implements IWeb3AuthModal {
|
|
56
56
|
loginModal: LoginModal;
|
|
57
57
|
readonly options: Web3AuthOptions;
|
|
58
58
|
private modalConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@web3auth/modal",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.2-alpha.0",
|
|
4
4
|
"homepage": "https://github.com/Web3Auth/Web3Auth#readme",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "dist/modal.cjs.js",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"@web3auth/base": "^4.0.0-alpha.0",
|
|
23
23
|
"@web3auth/core": "^4.0.0-alpha.0",
|
|
24
24
|
"@web3auth/metamask-adapter": "^4.0.0-alpha.0",
|
|
25
|
-
"@web3auth/openlogin-adapter": "^4.
|
|
26
|
-
"@web3auth/phantom-adapter": "^4.
|
|
27
|
-
"@web3auth/torus-evm-adapter": "^4.
|
|
28
|
-
"@web3auth/torus-solana-adapter": "^4.
|
|
29
|
-
"@web3auth/ui": "^4.
|
|
25
|
+
"@web3auth/openlogin-adapter": "^4.2.2-alpha.0",
|
|
26
|
+
"@web3auth/phantom-adapter": "^4.2.2-alpha.0",
|
|
27
|
+
"@web3auth/torus-evm-adapter": "^4.2.2-alpha.0",
|
|
28
|
+
"@web3auth/torus-solana-adapter": "^4.2.2-alpha.0",
|
|
29
|
+
"@web3auth/ui": "^4.2.2-alpha.0",
|
|
30
30
|
"@web3auth/wallet-connect-v1-adapter": "^4.0.0-alpha.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "9d2b2ecb977b9c46530550db7cf072de7afff7e3"
|
|
67
67
|
}
|
package/src/default.ts
CHANGED
|
@@ -39,6 +39,7 @@ export const getDefaultAdapterModule = async (params: {
|
|
|
39
39
|
const defaultOptions = getOpenloginDefaultOptions();
|
|
40
40
|
const adapter = new OpenloginAdapter({
|
|
41
41
|
...defaultOptions,
|
|
42
|
+
clientId,
|
|
42
43
|
chainConfig: { ...finalChainConfig },
|
|
43
44
|
adapterSettings: { ...(defaultOptions.adapterSettings as OpenLoginOptions), clientId },
|
|
44
45
|
});
|
package/src/interface.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
BaseAdapterConfig,
|
|
3
|
+
ChainNamespaceType,
|
|
4
|
+
IWeb3Auth,
|
|
5
|
+
LoginMethodConfig,
|
|
6
|
+
SafeEventEmitterProvider,
|
|
7
|
+
WALLET_ADAPTER_TYPE,
|
|
8
|
+
} from "@web3auth/base";
|
|
2
9
|
export interface ModalConfig extends BaseAdapterConfig {
|
|
3
10
|
loginMethods?: LoginMethodConfig;
|
|
4
11
|
}
|
|
@@ -7,3 +14,8 @@ export interface AdaptersModalConfig {
|
|
|
7
14
|
chainNamespace: ChainNamespaceType;
|
|
8
15
|
adapters?: Record<WALLET_ADAPTER_TYPE, ModalConfig>;
|
|
9
16
|
}
|
|
17
|
+
|
|
18
|
+
export interface IWeb3AuthModal extends IWeb3Auth {
|
|
19
|
+
initModal(params?: { modalConfig?: Record<WALLET_ADAPTER_TYPE, ModalConfig> }): Promise<void>;
|
|
20
|
+
connect(): Promise<SafeEventEmitterProvider | null>;
|
|
21
|
+
}
|
package/src/modalManager.ts
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
defaultSolanaWalletModalConfig,
|
|
23
23
|
} from "./config";
|
|
24
24
|
import { getDefaultAdapterModule } from "./default";
|
|
25
|
-
import { AdaptersModalConfig, ModalConfig } from "./interface";
|
|
25
|
+
import { AdaptersModalConfig, IWeb3AuthModal, ModalConfig } from "./interface";
|
|
26
26
|
import { getUserLanguage } from "./utils";
|
|
27
27
|
|
|
28
28
|
export interface UIConfig {
|
|
@@ -79,7 +79,7 @@ export interface Web3AuthOptions extends Web3AuthCoreOptions {
|
|
|
79
79
|
*/
|
|
80
80
|
displayErrorsOnModal?: boolean;
|
|
81
81
|
}
|
|
82
|
-
export class Web3Auth extends Web3AuthCore {
|
|
82
|
+
export class Web3Auth extends Web3AuthCore implements IWeb3AuthModal {
|
|
83
83
|
public loginModal: LoginModal;
|
|
84
84
|
|
|
85
85
|
readonly options: Web3AuthOptions;
|