@web3auth/modal 9.7.0 → 10.0.0-alpha.1
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/node_modules/style-inject/dist/style-inject.es.js +28 -0
- package/dist/lib.cjs/{config.js → packages/modal/src/config.js} +17 -29
- package/dist/lib.cjs/{index.js → packages/modal/src/index.js} +7 -0
- package/dist/lib.cjs/packages/modal/src/modalManager.js +376 -0
- package/dist/lib.cjs/packages/modal/src/react/Web3AuthProvider.js +15 -0
- package/dist/lib.cjs/packages/modal/src/react/context/Web3AuthInnerContext.js +199 -0
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWeb3Auth.js +15 -0
- package/dist/lib.cjs/packages/modal/src/react/index.js +12 -0
- package/dist/lib.cjs/packages/modal/src/ui/assets/arrow-left-dark.svg.js +7 -0
- package/dist/lib.cjs/packages/modal/src/ui/assets/arrow-left-light.svg.js +7 -0
- package/dist/lib.cjs/packages/modal/src/ui/assets/x-dark.svg.js +7 -0
- package/dist/lib.cjs/packages/modal/src/ui/assets/x-light.svg.js +7 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/AdapterLoader.js +108 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/Button.js +34 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/styles.css.js +8 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletButton.js +44 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletConnect.js +67 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletDetails.js +34 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletHeader.js +46 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletInstall.js +167 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallets.js +273 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Footer.js +20 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Header.js +81 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Icon.js +73 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Image.js +51 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Loader.js +59 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Modal.js +244 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/SelfCustodyViaWeb3Auth.js +30 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginPasswordless.js +141 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLogins.js +148 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/WalletConnect.js +84 -0
- package/dist/lib.cjs/packages/modal/src/ui/config.js +17 -0
- package/dist/lib.cjs/packages/modal/src/ui/context/ThemeContext.js +9 -0
- package/dist/lib.cjs/packages/modal/src/ui/css/web3auth.css.js +8 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/dutch.json.js +84 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/english.json.js +84 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/french.json.js +82 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/german.json.js +84 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/japanese.json.js +84 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/korean.json.js +84 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/mandarin.json.js +84 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/portuguese.json.js +84 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/spanish.json.js +84 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/turkish.json.js +84 -0
- package/dist/lib.cjs/packages/modal/src/ui/interfaces.js +26 -0
- package/dist/lib.cjs/packages/modal/src/ui/localeImport.js +25 -0
- package/dist/lib.cjs/packages/modal/src/ui/loginModal.js +309 -0
- package/dist/lib.cjs/packages/modal/src/ui/utils.js +71 -0
- package/dist/lib.cjs/packages/modal/src/vue/Web3AuthProvider.js +208 -0
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWeb3Auth.js +12 -0
- package/dist/lib.cjs/packages/modal/src/vue/index.js +9 -0
- package/dist/lib.esm/node_modules/style-inject/dist/style-inject.es.js +26 -0
- package/dist/lib.esm/{config.js → packages/modal/src/config.js} +12 -24
- package/dist/lib.esm/{index.js → packages/modal/src/index.js} +1 -0
- package/dist/lib.esm/packages/modal/src/modalManager.js +374 -0
- package/dist/lib.esm/packages/modal/src/react/Web3AuthProvider.js +13 -0
- package/dist/lib.esm/packages/modal/src/react/context/Web3AuthInnerContext.js +196 -0
- package/dist/lib.esm/packages/modal/src/react/hooks/useWeb3Auth.js +13 -0
- package/dist/lib.esm/packages/modal/src/react/index.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/assets/arrow-left-dark.svg.js +5 -0
- package/dist/lib.esm/packages/modal/src/ui/assets/arrow-left-light.svg.js +5 -0
- package/dist/lib.esm/packages/modal/src/ui/assets/x-dark.svg.js +5 -0
- package/dist/lib.esm/packages/modal/src/ui/assets/x-light.svg.js +5 -0
- package/dist/lib.esm/packages/modal/src/ui/components/AdapterLoader.js +106 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Button/Button.js +32 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Button/styles.css.js +6 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletButton.js +42 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletConnect.js +65 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletDetails.js +32 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletHeader.js +44 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletInstall.js +165 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallets.js +271 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Footer.js +18 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Header.js +79 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Icon.js +71 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Image.js +49 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Loader.js +57 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Modal.js +242 -0
- package/dist/lib.esm/packages/modal/src/ui/components/SelfCustodyViaWeb3Auth.js +28 -0
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginPasswordless.js +139 -0
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLogins.js +146 -0
- package/dist/lib.esm/packages/modal/src/ui/components/WalletConnect.js +82 -0
- package/dist/lib.esm/packages/modal/src/ui/config.js +13 -0
- package/dist/lib.esm/packages/modal/src/ui/context/ThemeContext.js +7 -0
- package/dist/lib.esm/packages/modal/src/ui/css/web3auth.css.js +6 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/dutch.json.js +79 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/english.json.js +79 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/french.json.js +77 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/german.json.js +79 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/japanese.json.js +79 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/korean.json.js +79 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/mandarin.json.js +79 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/portuguese.json.js +79 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/spanish.json.js +79 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/turkish.json.js +79 -0
- package/dist/lib.esm/packages/modal/src/ui/interfaces.js +20 -0
- package/dist/lib.esm/packages/modal/src/ui/localeImport.js +23 -0
- package/dist/lib.esm/packages/modal/src/ui/loginModal.js +307 -0
- package/dist/lib.esm/packages/modal/src/ui/utils.js +65 -0
- package/dist/lib.esm/packages/modal/src/vue/Web3AuthProvider.js +206 -0
- package/dist/lib.esm/packages/modal/src/vue/composables/useWeb3Auth.js +10 -0
- package/dist/lib.esm/packages/modal/src/vue/index.js +2 -0
- package/dist/modal.cjs.js +5676 -470
- package/dist/modal.umd.min.js +1 -1
- package/dist/modal.umd.min.js.LICENSE.txt +45 -0
- package/dist/types/config.d.ts +6 -6
- package/dist/types/index.d.ts +1 -0
- package/dist/types/interface.d.ts +5 -5
- package/dist/types/modalManager.d.ts +11 -12
- package/dist/types/react/Web3AuthProvider.d.ts +3 -0
- package/dist/types/react/context/Web3AuthInnerContext.d.ts +4 -0
- package/dist/types/react/context/index.d.ts +1 -0
- package/dist/types/react/hooks/index.d.ts +1 -0
- package/dist/types/react/hooks/useWeb3Auth.d.ts +2 -0
- package/dist/types/react/index.d.ts +4 -0
- package/dist/types/react/interfaces.d.ts +18 -0
- package/dist/types/ui/components/AdapterLoader.d.ts +11 -0
- package/dist/types/ui/components/Button/Button.d.ts +16 -0
- package/dist/types/ui/components/Button/index.d.ts +1 -0
- package/dist/types/ui/components/ExternalWallet/ExternalWalletButton.d.ts +7 -0
- package/dist/types/ui/components/ExternalWallet/ExternalWalletConnect.d.ts +9 -0
- package/dist/types/ui/components/ExternalWallet/ExternalWalletDetails.d.ts +9 -0
- package/dist/types/ui/components/ExternalWallet/ExternalWalletHeader.d.ts +8 -0
- package/dist/types/ui/components/ExternalWallet/ExternalWalletInstall.d.ts +8 -0
- package/dist/types/ui/components/ExternalWallets.d.ts +17 -0
- package/dist/types/ui/components/Footer.d.ts +1 -0
- package/dist/types/ui/components/Header.d.ts +8 -0
- package/dist/types/ui/components/Icon.d.ts +9 -0
- package/dist/types/ui/components/Image.d.ts +12 -0
- package/dist/types/ui/components/Loader.d.ts +10 -0
- package/dist/types/ui/components/Modal.d.ts +16 -0
- package/dist/types/ui/components/SelfCustodyViaWeb3Auth.d.ts +1 -0
- package/dist/types/ui/components/SocialLoginPasswordless.d.ts +16 -0
- package/dist/types/ui/components/SocialLogins.d.ts +14 -0
- package/dist/types/ui/components/WalletConnect.d.ts +8 -0
- package/dist/types/ui/config.d.ts +4 -0
- package/dist/types/ui/context/ThemeContext.d.ts +3 -0
- package/dist/types/ui/helper/countryData.d.ts +7 -0
- package/dist/types/ui/i18n/index.d.ts +11 -0
- package/dist/types/ui/index.d.ts +4 -0
- package/dist/types/ui/interfaces.d.ts +102 -0
- package/dist/types/ui/localeImport.d.ts +3 -0
- package/dist/types/ui/loginModal.d.ts +27 -0
- package/dist/types/ui/utils.d.ts +12 -0
- package/dist/types/vue/Web3AuthProvider.d.ts +13 -0
- package/dist/types/vue/composables/index.d.ts +1 -0
- package/dist/types/vue/composables/useWeb3Auth.d.ts +2 -0
- package/dist/types/vue/index.d.ts +3 -0
- package/dist/types/vue/interfaces.d.ts +42 -0
- package/package.json +100 -43
- package/dist/lib.cjs/modalManager.js +0 -441
- package/dist/lib.esm/modalManager.js +0 -439
- package/dist/modal.esm.js +0 -513
|
@@ -4,6 +4,21 @@
|
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
/*!
|
|
8
|
+
* decimal.js v10.5.0
|
|
9
|
+
* An arbitrary-precision Decimal type for JavaScript.
|
|
10
|
+
* https://github.com/MikeMcl/decimal.js
|
|
11
|
+
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
12
|
+
* MIT Licence
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/*!
|
|
16
|
+
* The buffer module from node.js, for the browser.
|
|
17
|
+
*
|
|
18
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
19
|
+
* @license MIT
|
|
20
|
+
*/
|
|
21
|
+
|
|
7
22
|
/*!
|
|
8
23
|
* The buffer module from node.js, for the browser.
|
|
9
24
|
*
|
|
@@ -11,10 +26,40 @@
|
|
|
11
26
|
* @license MIT
|
|
12
27
|
*/
|
|
13
28
|
|
|
29
|
+
/*! *****************************************************************************
|
|
30
|
+
Copyright (c) Microsoft Corporation.
|
|
31
|
+
|
|
32
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
33
|
+
purpose with or without fee is hereby granted.
|
|
34
|
+
|
|
35
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
36
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
37
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
38
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
39
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
40
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
41
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
42
|
+
***************************************************************************** */
|
|
43
|
+
|
|
14
44
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
15
45
|
|
|
46
|
+
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
47
|
+
|
|
48
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
49
|
+
|
|
16
50
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
17
51
|
|
|
52
|
+
/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @license
|
|
56
|
+
* Lodash <https://lodash.com/>
|
|
57
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
58
|
+
* Released under MIT license <https://lodash.com/license>
|
|
59
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
60
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
61
|
+
*/
|
|
62
|
+
|
|
18
63
|
/**
|
|
19
64
|
* @license React
|
|
20
65
|
* react-dom.production.min.js
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const defaultSolanaDappModalConfig:
|
|
3
|
-
export declare const defaultEvmDappModalConfig:
|
|
4
|
-
export declare const defaultSolanaWalletModalConfig:
|
|
5
|
-
export declare const defaultEvmWalletModalConfig:
|
|
6
|
-
export declare const defaultOtherModalConfig:
|
|
1
|
+
import { ConnectorsModalConfig } from "./interface";
|
|
2
|
+
export declare const defaultSolanaDappModalConfig: ConnectorsModalConfig;
|
|
3
|
+
export declare const defaultEvmDappModalConfig: ConnectorsModalConfig;
|
|
4
|
+
export declare const defaultSolanaWalletModalConfig: ConnectorsModalConfig;
|
|
5
|
+
export declare const defaultEvmWalletModalConfig: ConnectorsModalConfig;
|
|
6
|
+
export declare const defaultOtherModalConfig: ConnectorsModalConfig;
|
|
7
7
|
export declare const walletRegistryUrl = "https://assets.web3auth.io/v1/wallet-registry.json";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export interface ModalConfig extends Omit<
|
|
1
|
+
import type { BaseConnectorConfig, ChainNamespaceType, IProvider, IWeb3Auth, LoginMethodConfig, WALLET_CONNECTOR_TYPE } from "@web3auth/no-modal";
|
|
2
|
+
export interface ModalConfig extends Omit<BaseConnectorConfig, "isInjected"> {
|
|
3
3
|
loginMethods?: LoginMethodConfig;
|
|
4
4
|
}
|
|
5
|
-
export interface
|
|
5
|
+
export interface ConnectorsModalConfig {
|
|
6
6
|
chainNamespace: ChainNamespaceType;
|
|
7
|
-
|
|
7
|
+
connectors?: Record<WALLET_CONNECTOR_TYPE, ModalConfig>;
|
|
8
8
|
}
|
|
9
9
|
export interface ModalConfigParams {
|
|
10
|
-
modalConfig?: Record<
|
|
10
|
+
modalConfig?: Record<WALLET_CONNECTOR_TYPE, ModalConfig>;
|
|
11
11
|
hideWalletDiscovery?: boolean;
|
|
12
12
|
}
|
|
13
13
|
export interface IWeb3AuthModal extends IWeb3Auth {
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { LoginModal, UIConfig } from "
|
|
4
|
-
import { AdaptersModalConfig, IWeb3AuthModal, ModalConfigParams } from "./interface";
|
|
1
|
+
import { type IProvider, type IWeb3AuthCoreOptions, Web3AuthNoModal } from "@web3auth/no-modal";
|
|
2
|
+
import { type ConnectorsModalConfig, type IWeb3AuthModal, type ModalConfigParams } from "./interface";
|
|
3
|
+
import { LoginModal, type UIConfig } from "./ui";
|
|
5
4
|
export interface Web3AuthOptions extends IWeb3AuthCoreOptions {
|
|
6
5
|
/**
|
|
7
6
|
* Config for configuring modal ui display properties
|
|
8
7
|
*/
|
|
9
|
-
uiConfig?: Omit<UIConfig, "
|
|
10
|
-
/**
|
|
11
|
-
* Private key provider for your chain namespace
|
|
12
|
-
*/
|
|
13
|
-
privateKeyProvider: IBaseProvider<string>;
|
|
8
|
+
uiConfig?: Omit<UIConfig, "connectorListener">;
|
|
14
9
|
}
|
|
15
10
|
export declare class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal {
|
|
16
11
|
loginModal: LoginModal;
|
|
17
12
|
readonly options: Web3AuthOptions;
|
|
18
13
|
private modalConfig;
|
|
19
14
|
constructor(options: Web3AuthOptions);
|
|
20
|
-
setModalConfig(modalConfig:
|
|
15
|
+
setModalConfig(modalConfig: ConnectorsModalConfig): void;
|
|
21
16
|
initModal(params?: ModalConfigParams): Promise<void>;
|
|
22
17
|
connect(): Promise<IProvider | null>;
|
|
23
|
-
private
|
|
24
|
-
private
|
|
18
|
+
private getProjectAndWalletConfig;
|
|
19
|
+
private initConnectors;
|
|
20
|
+
private filterConnectors;
|
|
21
|
+
private checkConnectorAvailability;
|
|
22
|
+
private initInAppAndCachedConnectors;
|
|
23
|
+
private initExternalConnectors;
|
|
25
24
|
private subscribeToLoginModalEvents;
|
|
26
25
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { Web3AuthProviderProps } from "./interfaces";
|
|
3
|
+
export declare function Web3AuthProvider({ config, children }: PropsWithChildren<Web3AuthProviderProps>): import("react").FunctionComponentElement<PropsWithChildren<Web3AuthProviderProps>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { IWeb3AuthInnerContext, Web3AuthProviderProps } from "../interfaces";
|
|
3
|
+
export declare const Web3AuthInnerContext: import("react").Context<IWeb3AuthInnerContext>;
|
|
4
|
+
export declare function Web3AuthInnerProvider(params: PropsWithChildren<Web3AuthProviderProps>): import("react").FunctionComponentElement<import("react").ProviderProps<IWeb3AuthInnerContext>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Web3AuthInnerContext";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useWeb3Auth } from "./useWeb3Auth";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ConnectorFn, IBaseWeb3AuthHookContext, IProvider, PluginFn, WALLET_CONNECTOR_TYPE } from "@web3auth/no-modal";
|
|
2
|
+
import { type ModalConfig } from "../interface";
|
|
3
|
+
import type { Web3Auth, Web3AuthOptions } from "../modalManager";
|
|
4
|
+
export type Web3AuthContextConfig = {
|
|
5
|
+
web3AuthOptions: Web3AuthOptions;
|
|
6
|
+
modalConfig?: Record<WALLET_CONNECTOR_TYPE, ModalConfig>;
|
|
7
|
+
hideWalletDiscovery?: boolean;
|
|
8
|
+
connectors?: ConnectorFn[];
|
|
9
|
+
plugins?: PluginFn[];
|
|
10
|
+
};
|
|
11
|
+
export interface Web3AuthProviderProps {
|
|
12
|
+
config: Web3AuthContextConfig;
|
|
13
|
+
}
|
|
14
|
+
export interface IWeb3AuthInnerContext extends IBaseWeb3AuthHookContext {
|
|
15
|
+
web3Auth: Web3Auth | null;
|
|
16
|
+
connect(): Promise<IProvider>;
|
|
17
|
+
}
|
|
18
|
+
export type IWeb3AuthContext = IWeb3AuthInnerContext;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ModalStatusType } from "../interfaces";
|
|
2
|
+
interface DetailedLoaderProps {
|
|
3
|
+
message?: string;
|
|
4
|
+
appLogo?: string;
|
|
5
|
+
connector: string;
|
|
6
|
+
connectorName: string;
|
|
7
|
+
modalStatus: ModalStatusType;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
}
|
|
10
|
+
export default function DetailedLoader(props: DetailedLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "./styles.css";
|
|
2
|
+
import { CSSProperties, ReactNode } from "react";
|
|
3
|
+
type ButtonProps = {
|
|
4
|
+
variant: "primary" | "secondary" | "tertiary";
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
title?: string;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: CSSProperties;
|
|
10
|
+
size?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
type?: "button" | "submit";
|
|
13
|
+
};
|
|
14
|
+
declare function Button(props: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const _default: import("react").MemoExoticComponent<typeof Button>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Button";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ExternalButton } from "../../interfaces";
|
|
2
|
+
interface ExternalWalletButtonProps {
|
|
3
|
+
button: ExternalButton;
|
|
4
|
+
handleWalletClick: (button: ExternalButton) => void;
|
|
5
|
+
}
|
|
6
|
+
export default function ExternalWalletButton(props: ExternalWalletButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ExternalButton } from "../../interfaces";
|
|
2
|
+
interface ExternalWalletConnectProps {
|
|
3
|
+
connectButton: ExternalButton;
|
|
4
|
+
walletConnectUri: string;
|
|
5
|
+
goBack: () => void;
|
|
6
|
+
closeModal: () => void;
|
|
7
|
+
}
|
|
8
|
+
export default function ExternalWalletConnect(props: ExternalWalletConnectProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ExternalButton } from "../../interfaces";
|
|
2
|
+
interface ExternalWalletDetailProps {
|
|
3
|
+
connectButton: ExternalButton;
|
|
4
|
+
walletConnectUri: string;
|
|
5
|
+
goBack: () => void;
|
|
6
|
+
closeModal: () => void;
|
|
7
|
+
}
|
|
8
|
+
export default function ExternalWalletDetail(props: ExternalWalletDetailProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface ExternalWalletHeaderProps {
|
|
2
|
+
title: string;
|
|
3
|
+
goBack: () => void;
|
|
4
|
+
disableBackButton?: boolean;
|
|
5
|
+
closeModal: () => void;
|
|
6
|
+
}
|
|
7
|
+
export default function ExternalWalletHeader(props: ExternalWalletHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ExternalButton } from "../../interfaces";
|
|
2
|
+
interface ExternalWalletInstallProps {
|
|
3
|
+
connectButton: ExternalButton;
|
|
4
|
+
goBack: () => void;
|
|
5
|
+
closeModal: () => void;
|
|
6
|
+
}
|
|
7
|
+
export default function ExternalWalletInstall(props: ExternalWalletInstallProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseConnectorConfig, ChainNamespaceType, WalletRegistry } from "@web3auth/no-modal";
|
|
2
|
+
import { ModalStatusType } from "../interfaces";
|
|
3
|
+
interface ExternalWalletsProps {
|
|
4
|
+
hideExternalWallets: () => void;
|
|
5
|
+
handleExternalWalletClick: (params: {
|
|
6
|
+
connector: string;
|
|
7
|
+
}) => void;
|
|
8
|
+
closeModal: () => void;
|
|
9
|
+
config: Record<string, BaseConnectorConfig>;
|
|
10
|
+
walletConnectUri: string | undefined;
|
|
11
|
+
showBackButton: boolean;
|
|
12
|
+
modalStatus: ModalStatusType;
|
|
13
|
+
chainNamespace: ChainNamespaceType;
|
|
14
|
+
walletRegistry?: WalletRegistry;
|
|
15
|
+
}
|
|
16
|
+
export default function ExternalWallet(props: ExternalWalletsProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Footer(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface HeaderProps {
|
|
2
|
+
appName: string;
|
|
3
|
+
appLogo?: string;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
}
|
|
6
|
+
declare function Header(props: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const memoizedHeader: import("react").MemoExoticComponent<typeof Header>;
|
|
8
|
+
export default memoizedHeader;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ImageProps {
|
|
2
|
+
hoverImageId?: string;
|
|
3
|
+
imageId: string;
|
|
4
|
+
isButton?: boolean;
|
|
5
|
+
height?: string;
|
|
6
|
+
width?: string;
|
|
7
|
+
fallbackImageId?: string;
|
|
8
|
+
extension?: string;
|
|
9
|
+
darkImageId?: string;
|
|
10
|
+
darkHoverImageId?: string;
|
|
11
|
+
}
|
|
12
|
+
export default function Image(props: ImageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ModalStatusType } from "../interfaces";
|
|
2
|
+
interface LoaderProps {
|
|
3
|
+
message?: string;
|
|
4
|
+
modalStatus: ModalStatusType;
|
|
5
|
+
label?: string;
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
canEmit?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export default function Loader(props: LoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type SafeEventEmitter } from "@web3auth/auth";
|
|
2
|
+
import { ChainNamespaceType, WalletRegistry } from "@web3auth/no-modal";
|
|
3
|
+
import { ExternalWalletEventType, SocialLoginEventType, StateEmitterEvents } from "../interfaces";
|
|
4
|
+
interface ModalProps {
|
|
5
|
+
stateListener: SafeEventEmitter<StateEmitterEvents>;
|
|
6
|
+
appLogo?: string;
|
|
7
|
+
appName?: string;
|
|
8
|
+
chainNamespace: ChainNamespaceType;
|
|
9
|
+
walletRegistry?: WalletRegistry;
|
|
10
|
+
handleSocialLoginClick: (params: SocialLoginEventType) => void;
|
|
11
|
+
handleExternalWalletClick: (params: ExternalWalletEventType) => void;
|
|
12
|
+
handleShowExternalWallets: (externalWalletsInitialized: boolean) => void;
|
|
13
|
+
closeModal: () => void;
|
|
14
|
+
}
|
|
15
|
+
export default function Modal(props: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function SelfCustodyViaWeb3Auth(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface SocialLoginPasswordlessProps {
|
|
2
|
+
isPrimaryBtn: boolean;
|
|
3
|
+
isEmailVisible: boolean;
|
|
4
|
+
isSmsVisible: boolean;
|
|
5
|
+
connector: string;
|
|
6
|
+
handleSocialLoginClick: (params: {
|
|
7
|
+
connector: string;
|
|
8
|
+
loginParams: {
|
|
9
|
+
loginProvider: string;
|
|
10
|
+
login_hint?: string;
|
|
11
|
+
name: string;
|
|
12
|
+
};
|
|
13
|
+
}) => void;
|
|
14
|
+
}
|
|
15
|
+
export default function SocialLoginPasswordless(props: SocialLoginPasswordlessProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SocialLoginsConfig } from "../interfaces";
|
|
2
|
+
interface SocialLoginProps {
|
|
3
|
+
socialLoginsConfig: SocialLoginsConfig;
|
|
4
|
+
handleSocialLoginClick: (params: {
|
|
5
|
+
connector: string;
|
|
6
|
+
loginParams: {
|
|
7
|
+
loginProvider: string;
|
|
8
|
+
login_hint?: string;
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
}) => void;
|
|
12
|
+
}
|
|
13
|
+
export default function SocialLogins(props: SocialLoginProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface WalletConnectProps {
|
|
2
|
+
walletConnectUri: string;
|
|
3
|
+
logoImage?: string;
|
|
4
|
+
primaryColor?: string;
|
|
5
|
+
}
|
|
6
|
+
declare function WalletConnect(props: WalletConnectProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const _default: import("react").MemoExoticComponent<typeof WalletConnect>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { LOGIN_PROVIDER_TYPE } from "@web3auth/auth";
|
|
2
|
+
export declare function capitalizeFirstLetter(string: string): string;
|
|
3
|
+
export declare const AUTH_PROVIDERS: ("google" | "facebook" | "reddit" | "discord" | "twitch" | "apple" | "line" | "github" | "kakao" | "linkedin" | "twitter" | "weibo" | "wechat" | "farcaster" | "email_passwordless" | "sms_passwordless" | "webauthn" | "jwt" | "passkeys" | "authenticator")[];
|
|
4
|
+
export declare const AUTH_PROVIDERS_NAMES: Record<LOGIN_PROVIDER_TYPE, string>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import nl from "./dutch.json";
|
|
2
|
+
import en from "./english.json";
|
|
3
|
+
import fr from "./french.json";
|
|
4
|
+
import de from "./german.json";
|
|
5
|
+
import ja from "./japanese.json";
|
|
6
|
+
import ko from "./korean.json";
|
|
7
|
+
import zh from "./mandarin.json";
|
|
8
|
+
import pt from "./portuguese.json";
|
|
9
|
+
import es from "./spanish.json";
|
|
10
|
+
import tr from "./turkish.json";
|
|
11
|
+
export { de, en, es, fr, ja, ko, nl, pt, tr, zh };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { SafeEventEmitter } from "@web3auth/auth";
|
|
2
|
+
import { BaseConnectorConfig, ChainNamespaceType, LoginMethodConfig, UIConfig as CoreUIConfig, WALLET_CONNECTOR_TYPE, WalletRegistry, WalletRegistryItem, Web3AuthNoModalEvents } from "@web3auth/no-modal";
|
|
3
|
+
export interface UIConfig extends CoreUIConfig {
|
|
4
|
+
/**
|
|
5
|
+
* order of how login methods are shown
|
|
6
|
+
*
|
|
7
|
+
* @defaultValue `["google", "facebook", "twitter", "reddit", "discord", "twitch", "apple", "line", "github", "kakao", "linkedin", "weibo", "wechat", "email_passwordless"]`
|
|
8
|
+
*/
|
|
9
|
+
loginMethodsOrder?: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Z-index of the modal and iframe
|
|
12
|
+
* @defaultValue 99998
|
|
13
|
+
*/
|
|
14
|
+
modalZIndex?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Whether to show errors on Web3Auth modal.
|
|
17
|
+
*
|
|
18
|
+
* @defaultValue `true`
|
|
19
|
+
*/
|
|
20
|
+
displayErrorsOnModal?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* number of columns to display the Social Login buttons
|
|
23
|
+
*
|
|
24
|
+
* @defaultValue `3`
|
|
25
|
+
*/
|
|
26
|
+
loginGridCol?: 2 | 3;
|
|
27
|
+
/**
|
|
28
|
+
* Decides which button will be the focus of the modal
|
|
29
|
+
* For `socialLogin` the social icon will be colored
|
|
30
|
+
* For other options like `emailLogin` and `externalLogin` the respective buttons will be converted into a primary button
|
|
31
|
+
*
|
|
32
|
+
* @defaultValue `socialLogin`
|
|
33
|
+
*/
|
|
34
|
+
primaryButton?: "externalLogin" | "socialLogin" | "emailLogin";
|
|
35
|
+
connectorListener: SafeEventEmitter<Web3AuthNoModalEvents>;
|
|
36
|
+
}
|
|
37
|
+
export interface LoginModalProps extends UIConfig {
|
|
38
|
+
chainNamespace: ChainNamespaceType;
|
|
39
|
+
walletRegistry: WalletRegistry;
|
|
40
|
+
}
|
|
41
|
+
export declare const LOGIN_MODAL_EVENTS: {
|
|
42
|
+
readonly INIT_EXTERNAL_WALLETS: "INIT_EXTERNAL_WALLETS";
|
|
43
|
+
readonly LOGIN: "LOGIN";
|
|
44
|
+
readonly DISCONNECT: "DISCONNECT";
|
|
45
|
+
readonly MODAL_VISIBILITY: "MODAL_VISIBILITY";
|
|
46
|
+
};
|
|
47
|
+
export type SocialLoginsConfig = {
|
|
48
|
+
loginMethodsOrder: string[];
|
|
49
|
+
loginMethods: LoginMethodConfig;
|
|
50
|
+
connector: WALLET_CONNECTOR_TYPE;
|
|
51
|
+
uiConfig: Omit<UIConfig, "connectorListener">;
|
|
52
|
+
};
|
|
53
|
+
export declare const MODAL_STATUS: {
|
|
54
|
+
INITIALIZED: string;
|
|
55
|
+
CONNECTED: string;
|
|
56
|
+
CONNECTING: string;
|
|
57
|
+
ERRORED: string;
|
|
58
|
+
};
|
|
59
|
+
export type ModalStatusType = (typeof MODAL_STATUS)[keyof typeof MODAL_STATUS];
|
|
60
|
+
export interface ModalState {
|
|
61
|
+
status: ModalStatusType;
|
|
62
|
+
externalWalletsInitialized: boolean;
|
|
63
|
+
hasExternalWallets: boolean;
|
|
64
|
+
externalWalletsVisibility: boolean;
|
|
65
|
+
modalVisibility: boolean;
|
|
66
|
+
modalVisibilityDelayed: boolean;
|
|
67
|
+
postLoadingMessage: string;
|
|
68
|
+
walletConnectUri: string;
|
|
69
|
+
socialLoginsConfig: SocialLoginsConfig;
|
|
70
|
+
externalWalletsConfig: Record<string, BaseConnectorConfig>;
|
|
71
|
+
detailedLoaderConnector: string;
|
|
72
|
+
detailedLoaderConnectorName: string;
|
|
73
|
+
showExternalWalletsOnly: boolean;
|
|
74
|
+
}
|
|
75
|
+
export type SocialLoginEventType = {
|
|
76
|
+
connector: string;
|
|
77
|
+
loginParams: {
|
|
78
|
+
loginProvider: string;
|
|
79
|
+
login_hint?: string;
|
|
80
|
+
name: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
export type ExternalWalletEventType = {
|
|
84
|
+
connector: string;
|
|
85
|
+
};
|
|
86
|
+
export declare const DEFAULT_LOGO_LIGHT = "https://images.web3auth.io/web3auth-logo-w.svg";
|
|
87
|
+
export declare const DEFAULT_LOGO_DARK = "https://images.web3auth.io/web3auth-logo-w-light.svg";
|
|
88
|
+
export declare const WALLET_CONNECT_LOGO = "https://images.web3auth.io/login-wallet-connect.svg";
|
|
89
|
+
export type StateEmitterEvents = {
|
|
90
|
+
STATE_UPDATED: (state: Partial<ModalState>) => void;
|
|
91
|
+
MOUNTED: () => void;
|
|
92
|
+
};
|
|
93
|
+
export type ExternalButton = {
|
|
94
|
+
name: string;
|
|
95
|
+
displayName?: string;
|
|
96
|
+
href?: string;
|
|
97
|
+
hasInjectedWallet: boolean;
|
|
98
|
+
hasWalletConnect: boolean;
|
|
99
|
+
hasInstallLinks: boolean;
|
|
100
|
+
walletRegistryItem?: WalletRegistryItem;
|
|
101
|
+
imgExtension?: string;
|
|
102
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import "./css/web3auth.css";
|
|
2
|
+
import { SafeEventEmitter } from "@web3auth/auth";
|
|
3
|
+
import { BaseConnectorConfig, LoginMethodConfig, WALLET_CONNECTOR_TYPE } from "@web3auth/no-modal";
|
|
4
|
+
import { LoginModalProps, UIConfig } from "./interfaces";
|
|
5
|
+
export declare class LoginModal extends SafeEventEmitter {
|
|
6
|
+
private uiConfig;
|
|
7
|
+
private stateEmitter;
|
|
8
|
+
private chainNamespace;
|
|
9
|
+
private walletRegistry;
|
|
10
|
+
constructor(uiConfig: LoginModalProps);
|
|
11
|
+
get isDark(): boolean;
|
|
12
|
+
initModal: () => Promise<void>;
|
|
13
|
+
addSocialLogins: (connector: WALLET_CONNECTOR_TYPE, loginMethods: LoginMethodConfig, loginMethodsOrder: string[], uiConfig: Omit<UIConfig, "connectorListener">) => void;
|
|
14
|
+
addWalletLogins: (externalWalletsConfig: Record<string, BaseConnectorConfig>, options: {
|
|
15
|
+
showExternalWalletsOnly: boolean;
|
|
16
|
+
}) => void;
|
|
17
|
+
open: () => void;
|
|
18
|
+
closeModal: () => void;
|
|
19
|
+
initExternalWalletContainer: () => void;
|
|
20
|
+
private handleShowExternalWallets;
|
|
21
|
+
private handleExternalWalletClick;
|
|
22
|
+
private handleSocialLoginClick;
|
|
23
|
+
private setState;
|
|
24
|
+
private updateWalletConnect;
|
|
25
|
+
private handleConnectorData;
|
|
26
|
+
private subscribeCoreEvents;
|
|
27
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LANGUAGE_TYPE } from "@web3auth/auth";
|
|
2
|
+
import { LoginMethodConfig } from "@web3auth/no-modal";
|
|
3
|
+
export declare const getConnectorSocialLogins: (connectorName: string, loginMethodsConfig?: LoginMethodConfig) => LoginMethodConfig;
|
|
4
|
+
export declare function validateImageUrl(url: string): Promise<boolean>;
|
|
5
|
+
export declare function getNetworkIconId(ticker: string): Promise<string>;
|
|
6
|
+
export declare const passwordlessBackendUrl = "https://api-passwordless.web3auth.io";
|
|
7
|
+
export declare const getUserCountry: () => Promise<{
|
|
8
|
+
country: string;
|
|
9
|
+
dialCode: string;
|
|
10
|
+
} | null>;
|
|
11
|
+
export declare const validatePhoneNumber: (phoneNumber: string) => Promise<string | boolean>;
|
|
12
|
+
export declare const getUserLanguage: (defaultLanguage: string | undefined) => LANGUAGE_TYPE;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PropType } from "vue";
|
|
2
|
+
import { Web3AuthContextConfig } from "./interfaces";
|
|
3
|
+
export declare const Web3AuthProvider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
config: {
|
|
5
|
+
type: PropType<Web3AuthContextConfig>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
}>, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
config: {
|
|
10
|
+
type: PropType<Web3AuthContextConfig>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./useWeb3Auth";
|