@web3auth/no-modal 10.0.0-beta.9 → 10.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.
- package/dist/lib.cjs/base/analytics.js +121 -0
- package/dist/lib.cjs/base/connector/constants.js +2 -1
- package/dist/lib.cjs/base/constants.js +13 -0
- package/dist/lib.cjs/base/cookie.js +38 -0
- package/dist/lib.cjs/base/deserialize.js +13 -0
- package/dist/lib.cjs/base/errors/index.js +2 -2
- package/dist/lib.cjs/base/utils.js +112 -9
- package/dist/lib.cjs/base/wallet/index.js +3 -3
- package/dist/lib.cjs/connectors/auth-connector/authConnector.js +40 -63
- package/dist/lib.cjs/connectors/base-evm-connector/baseEvmConnector.js +5 -2
- package/dist/lib.cjs/connectors/base-solana-connector/baseSolanaConnector.js +5 -2
- package/dist/lib.cjs/connectors/coinbase-connector/coinbaseConnector.js +11 -4
- package/dist/lib.cjs/connectors/injected-evm-connector/injectedEvmConnector.js +10 -4
- package/dist/lib.cjs/connectors/injected-solana-connector/walletStandardConnector.js +10 -5
- package/dist/lib.cjs/connectors/metamask-connector/metamaskConnector.js +10 -5
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/WalletConnectV2Provider.js +2 -1
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/config.js +11 -9
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/index.js +0 -1
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/walletConnectV2Connector.js +9 -4
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/walletConnectV2Utils.js +6 -5
- package/dist/lib.cjs/index.js +18 -1
- package/dist/lib.cjs/noModal.js +367 -101
- package/dist/lib.cjs/plugins/nft-checkout-plugin/plugin.js +3 -1
- package/dist/lib.cjs/plugins/wallet-services-plugin/plugin.js +3 -1
- package/dist/lib.cjs/providers/account-abstraction-provider/providers/AccountAbstractionProvider.js +10 -5
- package/dist/lib.cjs/providers/account-abstraction-provider/providers/utils.js +3 -2
- package/dist/lib.cjs/providers/base-provider/baseProvider.js +2 -1
- package/dist/lib.cjs/providers/ethereum-mpc-provider/providers/signingProviders/EthereumSigningProvider.js +2 -1
- package/dist/lib.cjs/providers/ethereum-mpc-provider/providers/signingProviders/signingUtils.js +2 -1
- package/dist/lib.cjs/providers/ethereum-provider/providers/privateKeyProviders/TransactionFormatter/formatter.js +2 -1
- package/dist/lib.cjs/providers/solana-provider/providers/injectedProviders/base/baseInjectedProvider.js +4 -2
- package/dist/lib.cjs/providers/solana-provider/providers/injectedProviders/walletStandardProvider.js +4 -2
- package/dist/lib.cjs/providers/xrpl-provider/providers/privateKeyProviders/xrplPrivateKeyProvider.js +3 -1
- package/dist/lib.cjs/react/context/WalletServicesInnerContext.js +4 -2
- package/dist/lib.cjs/react/context/Web3AuthInnerContext.js +21 -16
- package/dist/lib.cjs/react/hooks/useCheckout.js +4 -2
- package/dist/lib.cjs/react/hooks/useIdentityToken.js +3 -3
- package/dist/lib.cjs/react/hooks/useSwap.js +4 -2
- package/dist/lib.cjs/react/hooks/useWalletConnectScanner.js +4 -2
- package/dist/lib.cjs/react/hooks/useWalletUI.js +4 -2
- package/dist/lib.cjs/react/hooks/useWeb3AuthInner.js +4 -2
- package/dist/lib.cjs/react/solana/hooks/useSolanaWallet.js +3 -2
- package/dist/lib.cjs/react/wagmi/constants.js +16 -0
- package/dist/lib.cjs/react/wagmi/provider.js +14 -9
- package/dist/lib.cjs/types/base/analytics.d.ts +42 -0
- package/dist/lib.cjs/types/base/connector/baseConnector.d.ts +2 -2
- package/dist/lib.cjs/types/base/connector/constants.d.ts +1 -0
- package/dist/lib.cjs/types/base/connector/interfaces.d.ts +3 -2
- package/dist/lib.cjs/types/base/constants.d.ts +6 -0
- package/dist/lib.cjs/types/base/cookie.d.ts +10 -0
- package/dist/lib.cjs/types/base/core/IWeb3Auth.d.ts +31 -11
- package/dist/lib.cjs/types/base/deserialize.d.ts +3 -0
- package/dist/lib.cjs/types/base/errors/index.d.ts +1 -1
- package/dist/lib.cjs/types/base/index.d.ts +2 -0
- package/dist/lib.cjs/types/base/interfaces.d.ts +9 -1
- package/dist/lib.cjs/types/base/utils.d.ts +50 -3
- package/dist/lib.cjs/types/base/wallet/index.d.ts +4 -2
- package/dist/lib.cjs/types/connectors/auth-connector/authConnector.d.ts +1 -1
- package/dist/lib.cjs/types/connectors/auth-connector/interface.d.ts +1 -1
- package/dist/lib.cjs/types/connectors/base-evm-connector/baseEvmConnector.d.ts +2 -2
- package/dist/lib.cjs/types/connectors/base-solana-connector/baseSolanaConnector.d.ts +2 -2
- package/dist/lib.cjs/types/connectors/wallet-connect-v2-connector/config.d.ts +0 -1
- package/dist/lib.cjs/types/noModal.d.ts +18 -9
- package/dist/lib.cjs/types/providers/account-abstraction-provider/providers/AccountAbstractionProvider.d.ts +4 -1
- package/dist/lib.cjs/types/providers/ethereum-provider/providers/converter.d.ts +0 -1
- package/dist/lib.cjs/types/providers/ethereum-provider/providers/privateKeyProviders/TransactionFormatter/utils.d.ts +0 -1
- package/dist/lib.cjs/types/react/hooks/useIdentityToken.d.ts +2 -2
- package/dist/lib.cjs/types/react/interfaces.d.ts +2 -1
- package/dist/lib.cjs/types/react/wagmi/constants.d.ts +43 -0
- package/dist/lib.cjs/types/vue/composables/useIdentityToken.d.ts +1 -1
- package/dist/lib.cjs/types/vue/wagmi/constants.d.ts +43 -0
- package/dist/lib.cjs/types/vue/wagmi/provider.d.ts +1 -0
- package/dist/lib.cjs/vue/WalletServicesInnerProvider.js +4 -2
- package/dist/lib.cjs/vue/Web3AuthProvider.js +7 -1
- package/dist/lib.cjs/vue/composables/useCheckout.js +4 -2
- package/dist/lib.cjs/vue/composables/useEnableMFA.js +4 -2
- package/dist/lib.cjs/vue/composables/useIdentityToken.js +7 -5
- package/dist/lib.cjs/vue/composables/useManageMFA.js +5 -3
- package/dist/lib.cjs/vue/composables/useSwap.js +4 -2
- package/dist/lib.cjs/vue/composables/useSwitchChain.js +4 -2
- package/dist/lib.cjs/vue/composables/useWalletConnectScanner.js +4 -2
- package/dist/lib.cjs/vue/composables/useWalletUI.js +4 -2
- package/dist/lib.cjs/vue/composables/useWeb3AuthConnect.js +4 -2
- package/dist/lib.cjs/vue/composables/useWeb3AuthDisconnect.js +4 -2
- package/dist/lib.cjs/vue/composables/useWeb3AuthInner.js +4 -2
- package/dist/lib.cjs/vue/composables/useWeb3AuthUser.js +4 -2
- package/dist/lib.cjs/vue/solana/composables/useSolanaWallet.js +21 -15
- package/dist/lib.cjs/vue/wagmi/constants.js +16 -0
- package/dist/lib.cjs/vue/wagmi/provider.js +33 -15
- package/dist/lib.esm/base/analytics.js +117 -0
- package/dist/lib.esm/base/connector/constants.js +2 -1
- package/dist/lib.esm/base/constants.js +11 -1
- package/dist/lib.esm/base/cookie.js +34 -0
- package/dist/lib.esm/base/deserialize.js +11 -0
- package/dist/lib.esm/base/errors/index.js +2 -2
- package/dist/lib.esm/base/utils.js +104 -7
- package/dist/lib.esm/base/wallet/index.js +3 -3
- package/dist/lib.esm/connectors/auth-connector/authConnector.js +41 -65
- package/dist/lib.esm/connectors/base-evm-connector/baseEvmConnector.js +1 -1
- package/dist/lib.esm/connectors/base-solana-connector/baseSolanaConnector.js +1 -1
- package/dist/lib.esm/connectors/coinbase-connector/coinbaseConnector.js +9 -3
- package/dist/lib.esm/connectors/injected-evm-connector/injectedEvmConnector.js +7 -3
- package/dist/lib.esm/connectors/injected-solana-connector/walletStandardConnector.js +7 -4
- package/dist/lib.esm/connectors/metamask-connector/metamaskConnector.js +8 -4
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/config.js +8 -7
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/index.js +1 -1
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/walletConnectV2Connector.js +8 -4
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/walletConnectV2Utils.js +1 -1
- package/dist/lib.esm/index.js +5 -3
- package/dist/lib.esm/noModal.js +378 -107
- package/dist/lib.esm/providers/account-abstraction-provider/providers/AccountAbstractionProvider.js +8 -4
- package/dist/lib.esm/react/context/Web3AuthInnerContext.js +22 -17
- package/dist/lib.esm/react/hooks/useIdentityToken.js +3 -3
- package/dist/lib.esm/react/wagmi/constants.js +14 -0
- package/dist/lib.esm/react/wagmi/provider.js +13 -8
- package/dist/lib.esm/vue/Web3AuthProvider.js +7 -1
- package/dist/lib.esm/vue/composables/useIdentityToken.js +3 -3
- package/dist/lib.esm/vue/composables/useManageMFA.js +1 -1
- package/dist/lib.esm/vue/solana/composables/useSolanaWallet.js +18 -14
- package/dist/lib.esm/vue/wagmi/constants.js +14 -0
- package/dist/lib.esm/vue/wagmi/provider.js +33 -13
- package/dist/noModal.umd.min.js +1 -1
- package/dist/noModal.umd.min.js.LICENSE.txt +4 -6
- package/package.json +21 -19
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SafeEventEmitter } from "@web3auth/auth";
|
|
2
2
|
import { ConnectorNamespaceType, CustomChainConfig } from "../chain/IChainInterface";
|
|
3
3
|
import { WALLET_CONNECTOR_TYPE } from "../wallet";
|
|
4
|
-
import type { BaseConnectorLoginParams, BaseConnectorSettings, CONNECTOR_CATEGORY_TYPE, CONNECTOR_STATUS_TYPE, ConnectorEvents, ConnectorInitOptions, IConnector,
|
|
4
|
+
import type { BaseConnectorLoginParams, BaseConnectorSettings, CONNECTOR_CATEGORY_TYPE, CONNECTOR_STATUS_TYPE, ConnectorEvents, ConnectorInitOptions, IConnector, IdentityTokenInfo, IProvider, UserInfo } from "./interfaces";
|
|
5
5
|
export declare abstract class BaseConnector<T> extends SafeEventEmitter<ConnectorEvents> implements IConnector<T> {
|
|
6
6
|
connectorData?: unknown;
|
|
7
7
|
isInjected?: boolean;
|
|
@@ -30,7 +30,7 @@ export declare abstract class BaseConnector<T> extends SafeEventEmitter<Connecto
|
|
|
30
30
|
abstract getUserInfo(): Promise<Partial<UserInfo>>;
|
|
31
31
|
abstract enableMFA(params?: T): Promise<void>;
|
|
32
32
|
abstract manageMFA(params?: T): Promise<void>;
|
|
33
|
-
abstract
|
|
33
|
+
abstract getIdentityToken(): Promise<IdentityTokenInfo>;
|
|
34
34
|
abstract switchChain(params: {
|
|
35
35
|
chainId: string;
|
|
36
36
|
}): Promise<void>;
|
|
@@ -12,6 +12,7 @@ export declare const CONNECTOR_EVENTS: {
|
|
|
12
12
|
readonly CACHE_CLEAR: "cache_clear";
|
|
13
13
|
readonly CONNECTORS_UPDATED: "connectors_updated";
|
|
14
14
|
readonly MFA_ENABLED: "mfa_enabled";
|
|
15
|
+
readonly REHYDRATION_ERROR: "rehydration_error";
|
|
15
16
|
readonly NOT_READY: "not_ready";
|
|
16
17
|
readonly READY: "ready";
|
|
17
18
|
readonly CONNECTING: "connecting";
|
|
@@ -20,7 +20,7 @@ export interface ConnectorInitOptions {
|
|
|
20
20
|
chainId: string;
|
|
21
21
|
}
|
|
22
22
|
export type CONNECTOR_STATUS_TYPE = (typeof CONNECTOR_STATUS)[keyof typeof CONNECTOR_STATUS];
|
|
23
|
-
export type
|
|
23
|
+
export type IdentityTokenInfo = {
|
|
24
24
|
idToken: string;
|
|
25
25
|
};
|
|
26
26
|
export interface BaseConnectorSettings {
|
|
@@ -66,7 +66,7 @@ export interface IConnector<T> extends SafeEventEmitter {
|
|
|
66
66
|
switchChain(params: {
|
|
67
67
|
chainId: string;
|
|
68
68
|
}): Promise<void>;
|
|
69
|
-
|
|
69
|
+
getIdentityToken(): Promise<IdentityTokenInfo>;
|
|
70
70
|
cleanup?(): Promise<void>;
|
|
71
71
|
}
|
|
72
72
|
export type ConnectorParams = {
|
|
@@ -95,6 +95,7 @@ export type ConnectorEvents = {
|
|
|
95
95
|
connector: string;
|
|
96
96
|
}) => void;
|
|
97
97
|
[CONNECTOR_EVENTS.ERRORED]: (error: Web3AuthError) => void;
|
|
98
|
+
[CONNECTOR_EVENTS.REHYDRATION_ERROR]: (error: Web3AuthError) => void;
|
|
98
99
|
[CONNECTOR_EVENTS.CONNECTOR_DATA_UPDATED]: (data: IConnectorDataEvent) => void;
|
|
99
100
|
[CONNECTOR_EVENTS.CACHE_CLEAR]: () => void;
|
|
100
101
|
[CONNECTOR_EVENTS.CONNECTORS_UPDATED]: (data: {
|
|
@@ -11,3 +11,9 @@ export declare const WIDGET_TYPE: {
|
|
|
11
11
|
readonly MODAL: "modal";
|
|
12
12
|
readonly EMBED: "embed";
|
|
13
13
|
};
|
|
14
|
+
export declare const WEB3AUTH_STATE_STORAGE_KEY = "Web3Auth-state";
|
|
15
|
+
export declare const LOGIN_MODE: {
|
|
16
|
+
readonly MODAL: "modal";
|
|
17
|
+
readonly NO_MODAL: "no-modal";
|
|
18
|
+
};
|
|
19
|
+
export declare const SOLANA_CAIP_CHAIN_MAP: Record<string, string>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IWeb3AuthState } from "./interfaces";
|
|
2
|
+
export declare const cookieStorage: (options?: {
|
|
3
|
+
expiry?: number;
|
|
4
|
+
}) => {
|
|
5
|
+
getItem(key: string): string;
|
|
6
|
+
setItem(key: string, value: string): void;
|
|
7
|
+
removeItem(key: string): void;
|
|
8
|
+
};
|
|
9
|
+
export declare function cookieToWeb3AuthState(cookie?: string | null): IWeb3AuthState;
|
|
10
|
+
export declare function parseCookie(cookie: string, key: string): string;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { type AccountAbstractionMultiChainConfig } from "@toruslabs/ethereum-controllers";
|
|
2
|
-
import { type BUILD_ENV_TYPE, type LoginParams, SafeEventEmitter, UX_MODE_TYPE, type WhiteLabelData } from "@web3auth/auth";
|
|
2
|
+
import { type BUILD_ENV_TYPE, type LoginParams, MfaLevelType, MfaSettings, SafeEventEmitter, UX_MODE_TYPE, type WhiteLabelData } from "@web3auth/auth";
|
|
3
3
|
import { type WsEmbedParams } from "@web3auth/ws-embed";
|
|
4
4
|
import { type ChainNamespaceType, type CustomChainConfig } from "../chain/IChainInterface";
|
|
5
|
-
import { CONNECTOR_EVENTS, type CONNECTOR_STATUS_TYPE, ConnectorEvents, type ConnectorFn, type IBaseProvider, type IConnector, type
|
|
5
|
+
import { CONNECTED_EVENT_DATA, CONNECTOR_EVENTS, type CONNECTOR_STATUS_TYPE, ConnectorEvents, type ConnectorFn, type IBaseProvider, type IConnector, type IdentityTokenInfo, type IProvider, type UserInfo, type WEB3AUTH_NETWORK_TYPE } from "../connector";
|
|
6
|
+
import { Web3AuthError } from "../errors";
|
|
7
|
+
import { LoginModeType } from "../interfaces";
|
|
6
8
|
import { type IPlugin, type PluginFn } from "../plugin";
|
|
7
9
|
import { type WALLET_CONNECTOR_TYPE, WALLET_CONNECTORS } from "../wallet";
|
|
8
10
|
export type AuthLoginParams = LoginParams & {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
loginHint?: string;
|
|
12
|
+
idToken?: string;
|
|
11
13
|
};
|
|
12
14
|
export type WalletServicesConfig = Omit<WsEmbedParams, "buildEnv" | "enableLogging" | "chainId" | "chains" | "confirmationStrategy" | "accountAbstractionConfig"> & {
|
|
13
15
|
/**
|
|
@@ -57,7 +59,7 @@ export interface IWeb3AuthCoreOptions {
|
|
|
57
59
|
*
|
|
58
60
|
* @defaultValue "local"
|
|
59
61
|
*/
|
|
60
|
-
storageType?: "session" | "local";
|
|
62
|
+
storageType?: "session" | "local" | "cookies";
|
|
61
63
|
/**
|
|
62
64
|
* sessionTime (in seconds) for idToken issued by Web3Auth for server side verification.
|
|
63
65
|
* @defaultValue 7 * 86400
|
|
@@ -66,15 +68,14 @@ export interface IWeb3AuthCoreOptions {
|
|
|
66
68
|
*/
|
|
67
69
|
sessionTime?: number;
|
|
68
70
|
/**
|
|
69
|
-
* Web3Auth Network to use for the session
|
|
70
|
-
* @defaultValue sapphire_mainnet
|
|
71
|
+
* Web3Auth Network to use for the session.
|
|
71
72
|
*/
|
|
72
|
-
web3AuthNetwork
|
|
73
|
+
web3AuthNetwork: WEB3AUTH_NETWORK_TYPE;
|
|
73
74
|
/**
|
|
74
75
|
* Uses core-kit key with web3auth provider
|
|
75
76
|
* @defaultValue false
|
|
76
77
|
*/
|
|
77
|
-
|
|
78
|
+
useSFAKey?: boolean;
|
|
78
79
|
/**
|
|
79
80
|
* WhiteLabel options for web3auth
|
|
80
81
|
*/
|
|
@@ -108,12 +109,26 @@ export interface IWeb3AuthCoreOptions {
|
|
|
108
109
|
* Private key provider for xrpl, mpc cases
|
|
109
110
|
*/
|
|
110
111
|
privateKeyProvider?: IBaseProvider<string>;
|
|
112
|
+
/**
|
|
113
|
+
* Whether to enable SSR mode
|
|
114
|
+
*
|
|
115
|
+
* @defaultValue false
|
|
116
|
+
*/
|
|
117
|
+
ssr?: boolean;
|
|
111
118
|
/**
|
|
112
119
|
* Build environment for Auth connector
|
|
113
120
|
* @internal
|
|
114
121
|
* @defaultValue BUILD_ENV.PRODUCTION
|
|
115
122
|
*/
|
|
116
123
|
authBuildEnv?: BUILD_ENV_TYPE;
|
|
124
|
+
/**
|
|
125
|
+
* MFA settings for the auth connector
|
|
126
|
+
*/
|
|
127
|
+
mfaSettings?: MfaSettings;
|
|
128
|
+
/**
|
|
129
|
+
* MFA level for the auth connector
|
|
130
|
+
*/
|
|
131
|
+
mfaLevel?: MfaLevelType;
|
|
117
132
|
}
|
|
118
133
|
export type LoginParamMap = {
|
|
119
134
|
[WALLET_CONNECTORS.AUTH]: Partial<AuthLoginParams>;
|
|
@@ -142,7 +157,7 @@ export interface IWeb3AuthCore extends SafeEventEmitter {
|
|
|
142
157
|
cleanup: boolean;
|
|
143
158
|
}): Promise<void>;
|
|
144
159
|
getUserInfo(): Promise<Partial<UserInfo>>;
|
|
145
|
-
|
|
160
|
+
getIdentityToken(): Promise<IdentityTokenInfo>;
|
|
146
161
|
switchChain(params: {
|
|
147
162
|
chainId: string;
|
|
148
163
|
}): Promise<void>;
|
|
@@ -160,8 +175,13 @@ export interface IWeb3Auth extends IWeb3AuthCore {
|
|
|
160
175
|
manageMFA<T>(params: T): Promise<void>;
|
|
161
176
|
cleanup(): Promise<void>;
|
|
162
177
|
}
|
|
163
|
-
export type
|
|
178
|
+
export type SDK_CONNECTED_EVENT_DATA = CONNECTED_EVENT_DATA & {
|
|
179
|
+
loginMode: LoginModeType;
|
|
180
|
+
};
|
|
181
|
+
export type Web3AuthNoModalEvents = Omit<ConnectorEvents, "connected" | "errored" | "ready"> & {
|
|
164
182
|
[CONNECTOR_EVENTS.READY]: () => void;
|
|
183
|
+
[CONNECTOR_EVENTS.CONNECTED]: (data: SDK_CONNECTED_EVENT_DATA) => void;
|
|
184
|
+
[CONNECTOR_EVENTS.ERRORED]: (error: Web3AuthError, loginMode: LoginModeType) => void;
|
|
165
185
|
MODAL_VISIBILITY: (visibility: boolean) => void;
|
|
166
186
|
};
|
|
167
187
|
export type Web3AuthNoModalOptions = IWeb3AuthCoreOptions;
|
|
@@ -47,7 +47,7 @@ export declare class WalletLoginError extends Web3AuthError {
|
|
|
47
47
|
static mfaEnabled(extraMessage?: string, cause?: unknown): IWeb3AuthError;
|
|
48
48
|
static chainConfigNotAdded(extraMessage?: string, cause?: unknown): IWeb3AuthError;
|
|
49
49
|
static unsupportedOperation(extraMessage?: string, cause?: unknown): IWeb3AuthError;
|
|
50
|
-
static
|
|
50
|
+
static sfaKeyNotFound(extraMessage?: string, cause?: unknown): IWeb3AuthError;
|
|
51
51
|
static userNotLoggedIn(extraMessage?: string, cause?: unknown): IWeb3AuthError;
|
|
52
52
|
}
|
|
53
53
|
export declare class WalletOperationsError extends Web3AuthError {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
export * from "./analytics";
|
|
1
2
|
export * from "./chain/IChainInterface";
|
|
2
3
|
export * from "./composables";
|
|
3
4
|
export * from "./connector";
|
|
4
5
|
export * from "./constants";
|
|
6
|
+
export { cookieToWeb3AuthState } from "./cookie";
|
|
5
7
|
export * from "./core/IWeb3Auth";
|
|
6
8
|
export * from "./errors";
|
|
7
9
|
export * from "./hooks";
|
|
@@ -2,11 +2,18 @@ import { type BUTTON_POSITION_TYPE } from "@toruslabs/base-controllers";
|
|
|
2
2
|
import { type SmartAccountType } from "@toruslabs/ethereum-controllers";
|
|
3
3
|
import { AuthConnectionConfigItem, type WhiteLabelData } from "@web3auth/auth";
|
|
4
4
|
import { type ChainNamespaceType, type CustomChainConfig } from "./chain/IChainInterface";
|
|
5
|
-
import { MODAL_SIGN_IN_METHODS, SMART_ACCOUNT_WALLET_SCOPE, WIDGET_TYPE } from "./constants";
|
|
5
|
+
import { LOGIN_MODE, MODAL_SIGN_IN_METHODS, SMART_ACCOUNT_WALLET_SCOPE, WIDGET_TYPE } from "./constants";
|
|
6
|
+
import { WALLET_CONNECTOR_TYPE } from "./wallet";
|
|
6
7
|
export interface WhitelistResponse {
|
|
7
8
|
urls: string[];
|
|
8
9
|
signed_urls: Record<string, string>;
|
|
9
10
|
}
|
|
11
|
+
export interface IWeb3AuthState {
|
|
12
|
+
cachedConnector: string | null;
|
|
13
|
+
connectedConnectorName: WALLET_CONNECTOR_TYPE | null;
|
|
14
|
+
currentChainId: string;
|
|
15
|
+
idToken: string | null;
|
|
16
|
+
}
|
|
10
17
|
export type ChainsConfig = CustomChainConfig[];
|
|
11
18
|
export interface ExternalWalletsConfig {
|
|
12
19
|
disableAllRecommendedWallets?: boolean;
|
|
@@ -95,6 +102,7 @@ export interface WalletRegistryItem {
|
|
|
95
102
|
}[];
|
|
96
103
|
imgExtension?: string;
|
|
97
104
|
}
|
|
105
|
+
export type LoginModeType = (typeof LOGIN_MODE)[keyof typeof LOGIN_MODE];
|
|
98
106
|
export type WalletRegistry = {
|
|
99
107
|
others: Record<string, WalletRegistryItem>;
|
|
100
108
|
default: Record<string, WalletRegistryItem>;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { cloneDeep } from "@toruslabs/base-controllers";
|
|
2
|
-
import {
|
|
2
|
+
import { type AccountAbstractionMultiChainConfig } from "@toruslabs/ethereum-controllers";
|
|
3
|
+
import { type BUILD_ENV_TYPE } from "@web3auth/auth";
|
|
3
4
|
import { type Chain } from "viem";
|
|
4
|
-
import { CustomChainConfig } from "./chain/IChainInterface";
|
|
5
|
+
import { type CustomChainConfig } from "./chain/IChainInterface";
|
|
5
6
|
import { type WEB3AUTH_NETWORK_TYPE } from "./connector";
|
|
7
|
+
import { type UIConfig, type WalletServicesConfig } from "./core/IWeb3Auth";
|
|
6
8
|
import type { ProjectConfig, WalletRegistry } from "./interfaces";
|
|
7
9
|
export declare const isHexStrict: (hex: string) => boolean;
|
|
8
|
-
export declare const signerHost: (web3AuthNetwork?: WEB3AUTH_NETWORK_TYPE
|
|
10
|
+
export declare const signerHost: (web3AuthNetwork?: WEB3AUTH_NETWORK_TYPE) => string;
|
|
9
11
|
export declare const fetchProjectConfig: ({ clientId, web3AuthNetwork, aaProvider, authBuildEnv, }: {
|
|
10
12
|
clientId: string;
|
|
11
13
|
web3AuthNetwork: WEB3AUTH_NETWORK_TYPE;
|
|
@@ -16,5 +18,50 @@ export declare const fetchWalletRegistry: (url?: string) => Promise<WalletRegist
|
|
|
16
18
|
export declare const normalizeWalletName: (name: string) => string;
|
|
17
19
|
export declare const fromWagmiChain: (chain: Chain) => CustomChainConfig;
|
|
18
20
|
export declare function withAbort<T>(fn: () => Promise<T>, signal?: AbortSignal, onAbort?: () => void): Promise<T>;
|
|
21
|
+
export declare const isBrowser: () => boolean;
|
|
19
22
|
export declare const fromViemChain: (chain: Chain) => CustomChainConfig;
|
|
20
23
|
export { cloneDeep };
|
|
24
|
+
export declare const getWhitelabelAnalyticsProperties: (uiConfig?: UIConfig) => {
|
|
25
|
+
whitelabel_app_name: string;
|
|
26
|
+
whitelabel_app_url: string;
|
|
27
|
+
whitelabel_logo_light_enabled: boolean;
|
|
28
|
+
whitelabel_logo_dark_enabled: boolean;
|
|
29
|
+
whitelabel_default_language: import("@web3auth/auth").LANGUAGE_TYPE;
|
|
30
|
+
whitelabel_theme_mode: import("@web3auth/auth").THEME_MODE_TYPE;
|
|
31
|
+
whitelabel_use_logo_loader: boolean;
|
|
32
|
+
whitelabel_theme_primary: string;
|
|
33
|
+
whitelabel_theme_on_primary: string;
|
|
34
|
+
whitelabel_tnc_link_enabled: boolean;
|
|
35
|
+
whitelabel_privacy_policy_enabled: boolean;
|
|
36
|
+
};
|
|
37
|
+
export declare const getAaAnalyticsProperties: (accountAbstractionConfig?: AccountAbstractionMultiChainConfig) => {
|
|
38
|
+
aa_smart_account_type: import("@toruslabs/ethereum-controllers").SmartAccountType;
|
|
39
|
+
aa_chain_ids: string[];
|
|
40
|
+
aa_bundler_urls: string[];
|
|
41
|
+
aa_paymaster_urls: string[];
|
|
42
|
+
aa_paymaster_enabled: boolean;
|
|
43
|
+
aa_paymaster_context_enabled: boolean;
|
|
44
|
+
aa_erc20_paymaster_enabled: boolean;
|
|
45
|
+
};
|
|
46
|
+
export declare const getWalletServicesAnalyticsProperties: (walletServicesConfig?: WalletServicesConfig) => {
|
|
47
|
+
ws_confirmation_strategy: "modal" | "auto-approve" | "default";
|
|
48
|
+
ws_enable_key_export: boolean;
|
|
49
|
+
ws_show_widget_button: boolean;
|
|
50
|
+
ws_button_position: import("@web3auth/ws-embed").BUTTON_POSITION_TYPE;
|
|
51
|
+
ws_hide_nft_display: boolean;
|
|
52
|
+
ws_hide_token_display: boolean;
|
|
53
|
+
ws_hide_transfers: boolean;
|
|
54
|
+
ws_hide_topup: boolean;
|
|
55
|
+
ws_hide_receive: boolean;
|
|
56
|
+
ws_hide_swap: boolean;
|
|
57
|
+
ws_hide_show_all_tokens: boolean;
|
|
58
|
+
ws_hide_wallet_connect: boolean;
|
|
59
|
+
ws_default_portfolio: "token" | "nft";
|
|
60
|
+
};
|
|
61
|
+
export declare const sdkVersion: string;
|
|
62
|
+
export declare const getErrorAnalyticsProperties: (error: unknown) => {
|
|
63
|
+
error_message?: string;
|
|
64
|
+
error_code?: number;
|
|
65
|
+
};
|
|
66
|
+
export declare const getHostname: (url: string) => string;
|
|
67
|
+
export declare const getCaipChainId: (chain: Pick<CustomChainConfig, "chainNamespace" | "chainId">) => string;
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
export declare const MULTI_CHAIN_CONNECTORS: {
|
|
2
2
|
readonly AUTH: "auth";
|
|
3
3
|
readonly WALLET_CONNECT_V2: "wallet-connect-v2";
|
|
4
|
+
readonly METAMASK: "metamask";
|
|
4
5
|
};
|
|
5
6
|
export declare const SOLANA_CONNECTORS: {
|
|
6
7
|
readonly AUTH: "auth";
|
|
7
8
|
readonly WALLET_CONNECT_V2: "wallet-connect-v2";
|
|
9
|
+
readonly METAMASK: "metamask";
|
|
8
10
|
};
|
|
9
11
|
export declare const EVM_CONNECTORS: {
|
|
10
12
|
readonly AUTH: "auth";
|
|
11
13
|
readonly WALLET_CONNECT_V2: "wallet-connect-v2";
|
|
12
|
-
readonly COINBASE: "coinbase";
|
|
13
14
|
readonly METAMASK: "metamask";
|
|
15
|
+
readonly COINBASE: "coinbase";
|
|
14
16
|
};
|
|
15
17
|
export declare const WALLET_CONNECTORS: {
|
|
16
18
|
readonly AUTH: "auth";
|
|
17
19
|
readonly WALLET_CONNECT_V2: "wallet-connect-v2";
|
|
18
|
-
readonly COINBASE: "coinbase";
|
|
19
20
|
readonly METAMASK: "metamask";
|
|
21
|
+
readonly COINBASE: "coinbase";
|
|
20
22
|
};
|
|
21
23
|
export type WALLET_CONNECTOR_TYPE = (typeof WALLET_CONNECTORS)[keyof typeof WALLET_CONNECTORS];
|
|
22
24
|
export type SOLANA_CONNECTOR_TYPE = (typeof SOLANA_CONNECTORS)[keyof typeof SOLANA_CONNECTORS];
|
|
@@ -28,7 +28,7 @@ declare class AuthConnector extends BaseConnector<AuthLoginParams> {
|
|
|
28
28
|
disconnect(options?: {
|
|
29
29
|
cleanup: boolean;
|
|
30
30
|
}): Promise<void>;
|
|
31
|
-
|
|
31
|
+
getIdentityToken(): Promise<{
|
|
32
32
|
idToken: string;
|
|
33
33
|
}>;
|
|
34
34
|
getUserInfo(): Promise<Partial<UserInfo>>;
|
|
@@ -7,7 +7,7 @@ export type WalletServicesSettings = Omit<WsEmbedParams, "chains" | "chainId"> &
|
|
|
7
7
|
modalZIndex?: number;
|
|
8
8
|
};
|
|
9
9
|
export interface AuthConnectorOptions extends BaseConnectorSettings {
|
|
10
|
-
connectorSettings?: Omit<AuthOptions, "clientId" | "network" | "authConnectionConfig">;
|
|
10
|
+
connectorSettings?: Omit<AuthOptions, "clientId" | "network" | "authConnectionConfig" | "mfaSettings">;
|
|
11
11
|
loginSettings?: LoginSettings;
|
|
12
12
|
walletServicesSettings?: WalletServicesSettings;
|
|
13
13
|
authConnectionConfig?: (AuthConnectionConfigItem & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BaseConnector, ConnectorInitOptions,
|
|
1
|
+
import { BaseConnector, ConnectorInitOptions, IdentityTokenInfo } from "../../base";
|
|
2
2
|
export declare abstract class BaseEvmConnector<T> extends BaseConnector<T> {
|
|
3
3
|
init(_?: ConnectorInitOptions): Promise<void>;
|
|
4
|
-
|
|
4
|
+
getIdentityToken(): Promise<IdentityTokenInfo>;
|
|
5
5
|
disconnectSession(): Promise<void>;
|
|
6
6
|
disconnect(): Promise<void>;
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BaseConnector, ConnectorInitOptions,
|
|
1
|
+
import { BaseConnector, ConnectorInitOptions, IdentityTokenInfo } from "../../base";
|
|
2
2
|
export declare abstract class BaseSolanaConnector<T> extends BaseConnector<T> {
|
|
3
3
|
init(_?: ConnectorInitOptions): Promise<void>;
|
|
4
|
-
|
|
4
|
+
getIdentityToken(): Promise<IdentityTokenInfo>;
|
|
5
5
|
disconnectSession(): Promise<void>;
|
|
6
6
|
disconnect(): Promise<void>;
|
|
7
7
|
}
|
|
@@ -24,7 +24,6 @@ export declare enum DEFAULT_SOLANA_EVENTS {
|
|
|
24
24
|
SOL_CHAIN_CHANGED = "chainChanged",
|
|
25
25
|
SOL_ACCOUNTS_CHANGED = "accountsChanged"
|
|
26
26
|
}
|
|
27
|
-
export declare const SOLANA_CAIP_CHAIN_MAP: Record<string, string>;
|
|
28
27
|
export declare const getNamespacesFromChains: (chains: string[]) => string[];
|
|
29
28
|
export declare const getSupportedMethodsByNamespace: (namespace: string) => DEFAULT_EIP155_METHODS[] | DEFAULT_SOLANA_METHODS[];
|
|
30
29
|
export declare const getSupportedEventsByNamespace: (namespace: string) => DEFAULT_EIP_155_EVENTS[] | DEFAULT_SOLANA_EVENTS[];
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import { SafeEventEmitter } from "@web3auth/auth";
|
|
2
|
-
import { type ChainNamespaceType, type CONNECTOR_STATUS_TYPE, type CustomChainConfig, type IConnector, type IPlugin, type IProvider, type IWeb3Auth, type IWeb3AuthCoreOptions,
|
|
2
|
+
import { Analytics, type ChainNamespaceType, type CONNECTOR_STATUS_TYPE, type CustomChainConfig, type IConnector, type IdentityTokenInfo, type IPlugin, type IProvider, type IWeb3Auth, type IWeb3AuthCoreOptions, IWeb3AuthState, LoginModeType, type LoginParamMap, type ProjectConfig, type UserInfo, type WALLET_CONNECTOR_TYPE, type Web3AuthNoModalEvents } from "./base";
|
|
3
3
|
import { type AccountAbstractionProvider } from "./providers/account-abstraction-provider";
|
|
4
4
|
import { CommonJRPCProvider } from "./providers/base-provider";
|
|
5
5
|
export declare class Web3AuthNoModal extends SafeEventEmitter<Web3AuthNoModalEvents> implements IWeb3Auth {
|
|
6
6
|
readonly coreOptions: IWeb3AuthCoreOptions;
|
|
7
|
-
connectedConnectorName: WALLET_CONNECTOR_TYPE | null;
|
|
8
7
|
status: CONNECTOR_STATUS_TYPE;
|
|
9
|
-
cachedConnector: string | null;
|
|
10
8
|
protected aaProvider: AccountAbstractionProvider | null;
|
|
11
|
-
protected currentChainId: string;
|
|
12
9
|
protected connectors: IConnector<unknown>[];
|
|
13
10
|
protected commonJRPCProvider: CommonJRPCProvider | null;
|
|
14
|
-
|
|
11
|
+
protected analytics: Analytics;
|
|
12
|
+
protected plugins: Record<string, IPlugin>;
|
|
15
13
|
private storage;
|
|
16
|
-
|
|
14
|
+
private state;
|
|
15
|
+
private loginMode;
|
|
16
|
+
constructor(options: IWeb3AuthCoreOptions, initialState?: IWeb3AuthState);
|
|
17
17
|
get currentChain(): CustomChainConfig | undefined;
|
|
18
18
|
get connected(): boolean;
|
|
19
19
|
get provider(): IProvider | null;
|
|
20
|
+
get connectedConnectorName(): WALLET_CONNECTOR_TYPE | null;
|
|
21
|
+
get cachedConnector(): string | null;
|
|
22
|
+
get currentChainId(): string | null;
|
|
20
23
|
get connectedConnector(): IConnector<unknown> | null;
|
|
21
24
|
get accountAbstractionProvider(): AccountAbstractionProvider | null;
|
|
22
25
|
set provider(_: IProvider | null);
|
|
@@ -33,18 +36,22 @@ export declare class Web3AuthNoModal extends SafeEventEmitter<Web3AuthNoModalEve
|
|
|
33
36
|
* Connect to a specific wallet connector
|
|
34
37
|
* @param connectorName - Key of the wallet connector to use.
|
|
35
38
|
*/
|
|
36
|
-
connectTo<T extends WALLET_CONNECTOR_TYPE>(connectorName: T, loginParams?: LoginParamMap[T]): Promise<IProvider | null>;
|
|
39
|
+
connectTo<T extends WALLET_CONNECTOR_TYPE>(connectorName: T, loginParams?: LoginParamMap[T], loginMode?: LoginModeType): Promise<IProvider | null>;
|
|
37
40
|
logout(options?: {
|
|
38
41
|
cleanup: boolean;
|
|
39
42
|
}): Promise<void>;
|
|
40
43
|
getUserInfo(): Promise<Partial<UserInfo>>;
|
|
41
44
|
enableMFA<T>(loginParams?: T): Promise<void>;
|
|
42
45
|
manageMFA<T>(loginParams?: T): Promise<void>;
|
|
43
|
-
|
|
46
|
+
getIdentityToken(): Promise<IdentityTokenInfo>;
|
|
44
47
|
getPlugin(name: string): IPlugin | null;
|
|
48
|
+
setAnalyticsProperties(properties: Record<string, unknown>): void;
|
|
45
49
|
protected initChainsConfig(projectConfig: ProjectConfig): void;
|
|
46
50
|
protected initAccountAbstractionConfig(projectConfig?: ProjectConfig): void;
|
|
51
|
+
protected initUIConfig(projectConfig: ProjectConfig): void;
|
|
47
52
|
protected initCachedConnectorAndChainId(): void;
|
|
53
|
+
protected initWalletServicesConfig(projectConfig: ProjectConfig): void;
|
|
54
|
+
protected getInitializationTrackData(): {};
|
|
48
55
|
protected setupCommonJRPCProvider(): Promise<void>;
|
|
49
56
|
protected setupConnector(connector: IConnector<unknown>): Promise<void>;
|
|
50
57
|
protected loadConnectors({ projectConfig, modalMode }: {
|
|
@@ -62,6 +69,8 @@ export declare class Web3AuthNoModal extends SafeEventEmitter<Web3AuthNoModalEve
|
|
|
62
69
|
protected getInitialChainIdForConnector(connector: IConnector<unknown>): CustomChainConfig;
|
|
63
70
|
private cacheWallet;
|
|
64
71
|
private setCurrentChain;
|
|
65
|
-
private cacheCurrentChain;
|
|
66
72
|
private connectToPlugins;
|
|
73
|
+
private setState;
|
|
74
|
+
private loadState;
|
|
75
|
+
private getStorageMethod;
|
|
67
76
|
}
|
|
@@ -16,6 +16,7 @@ declare class AccountAbstractionProvider extends BaseProvider<AccountAbstraction
|
|
|
16
16
|
private _publicClient;
|
|
17
17
|
private _bundlerClient;
|
|
18
18
|
private _paymasterClient;
|
|
19
|
+
private _useProviderAsTransport?;
|
|
19
20
|
constructor({ config, state }: {
|
|
20
21
|
config: AccountAbstractionProviderConfig;
|
|
21
22
|
state?: AccountAbstractionProviderState;
|
|
@@ -26,6 +27,7 @@ declare class AccountAbstractionProvider extends BaseProvider<AccountAbstraction
|
|
|
26
27
|
get publicClient(): Client | null;
|
|
27
28
|
static getProviderInstance: (params: AccountAbstractionProviderConfig & {
|
|
28
29
|
eoaProvider: IProvider;
|
|
30
|
+
useProviderAsTransport?: boolean;
|
|
29
31
|
}) => Promise<AccountAbstractionProvider>;
|
|
30
32
|
enable(): Promise<string[]>;
|
|
31
33
|
setupProvider(eoaProvider: IProvider): Promise<void>;
|
|
@@ -38,11 +40,12 @@ declare class AccountAbstractionProvider extends BaseProvider<AccountAbstraction
|
|
|
38
40
|
protected lookupNetwork(): Promise<string>;
|
|
39
41
|
private setupChainSwitchMiddleware;
|
|
40
42
|
}
|
|
41
|
-
export declare const accountAbstractionProvider: ({ accountAbstractionConfig, chain, chains, provider, }: {
|
|
43
|
+
export declare const accountAbstractionProvider: ({ accountAbstractionConfig, chain, chains, provider, useProviderAsTransport, }: {
|
|
42
44
|
accountAbstractionConfig: AccountAbstractionMultiChainConfig;
|
|
43
45
|
chain: CustomChainConfig;
|
|
44
46
|
chains: CustomChainConfig[];
|
|
45
47
|
provider: IProvider;
|
|
48
|
+
useProviderAsTransport?: boolean;
|
|
46
49
|
}) => Promise<AccountAbstractionProvider>;
|
|
47
50
|
export declare const toEoaProvider: (aaProvider: IProvider) => Promise<IProvider>;
|
|
48
51
|
export { type AccountAbstractionMultiChainConfig, type AccountAbstractionProvider, type BundlerConfig, type PaymasterConfig, SMART_ACCOUNT };
|
|
@@ -3,11 +3,11 @@ export interface IUseIdentityToken {
|
|
|
3
3
|
loading: boolean;
|
|
4
4
|
error: Web3AuthError | null;
|
|
5
5
|
token: string | null;
|
|
6
|
-
|
|
6
|
+
getIdentityToken: () => Promise<string | null>;
|
|
7
7
|
}
|
|
8
8
|
export declare const useIdentityToken: () => {
|
|
9
9
|
loading: boolean;
|
|
10
10
|
error: Web3AuthError;
|
|
11
11
|
token: string;
|
|
12
|
-
|
|
12
|
+
getIdentityToken: () => Promise<string>;
|
|
13
13
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConnectorFn, IBaseWeb3AuthHookContext, IWeb3AuthCoreOptions, PluginFn } from "../base";
|
|
1
|
+
import type { ConnectorFn, IBaseWeb3AuthHookContext, IWeb3AuthCoreOptions, IWeb3AuthState, PluginFn } from "../base";
|
|
2
2
|
import { Web3AuthNoModal } from "../noModal";
|
|
3
3
|
import type { WalletServicesPluginType } from "../plugins/wallet-services-plugin";
|
|
4
4
|
export type Web3AuthContextConfig = {
|
|
@@ -8,6 +8,7 @@ export type Web3AuthContextConfig = {
|
|
|
8
8
|
};
|
|
9
9
|
export interface Web3AuthProviderProps {
|
|
10
10
|
config: Web3AuthContextConfig;
|
|
11
|
+
initialState?: IWeb3AuthState;
|
|
11
12
|
}
|
|
12
13
|
export interface IWeb3AuthInnerContext extends IBaseWeb3AuthHookContext {
|
|
13
14
|
web3Auth: Web3AuthNoModal | null;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const defaultWagmiConfig: import("wagmi").Config<readonly [{
|
|
2
|
+
blockExplorers: {
|
|
3
|
+
readonly default: {
|
|
4
|
+
readonly name: "Etherscan";
|
|
5
|
+
readonly url: "https://etherscan.io";
|
|
6
|
+
readonly apiUrl: "https://api.etherscan.io/api";
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
contracts: {
|
|
10
|
+
readonly ensRegistry: {
|
|
11
|
+
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
|
|
12
|
+
};
|
|
13
|
+
readonly ensUniversalResolver: {
|
|
14
|
+
readonly address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67";
|
|
15
|
+
readonly blockCreated: 19258213;
|
|
16
|
+
};
|
|
17
|
+
readonly multicall3: {
|
|
18
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
19
|
+
readonly blockCreated: 14353601;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
ensTlds?: readonly string[] | undefined;
|
|
23
|
+
id: 1;
|
|
24
|
+
name: "Ethereum";
|
|
25
|
+
nativeCurrency: {
|
|
26
|
+
readonly name: "Ether";
|
|
27
|
+
readonly symbol: "ETH";
|
|
28
|
+
readonly decimals: 18;
|
|
29
|
+
};
|
|
30
|
+
rpcUrls: {
|
|
31
|
+
readonly default: {
|
|
32
|
+
readonly http: readonly ["https://eth.merkle.io"];
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
sourceId?: number | undefined | undefined;
|
|
36
|
+
testnet?: boolean | undefined | undefined;
|
|
37
|
+
custom?: Record<string, unknown> | undefined;
|
|
38
|
+
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
39
|
+
formatters?: undefined;
|
|
40
|
+
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
41
|
+
}], {
|
|
42
|
+
1: import("viem").HttpTransport<undefined, false>;
|
|
43
|
+
}, readonly []>;
|
|
@@ -4,6 +4,6 @@ export interface IUseIdentityToken {
|
|
|
4
4
|
loading: Ref<boolean>;
|
|
5
5
|
error: Ref<Web3AuthError | null>;
|
|
6
6
|
token: Ref<string | null>;
|
|
7
|
-
|
|
7
|
+
getIdentityToken: () => Promise<string | null>;
|
|
8
8
|
}
|
|
9
9
|
export declare const useIdentityToken: () => IUseIdentityToken;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const defaultWagmiConfig: import("wagmi").Config<readonly [{
|
|
2
|
+
blockExplorers: {
|
|
3
|
+
readonly default: {
|
|
4
|
+
readonly name: "Etherscan";
|
|
5
|
+
readonly url: "https://etherscan.io";
|
|
6
|
+
readonly apiUrl: "https://api.etherscan.io/api";
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
contracts: {
|
|
10
|
+
readonly ensRegistry: {
|
|
11
|
+
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
|
|
12
|
+
};
|
|
13
|
+
readonly ensUniversalResolver: {
|
|
14
|
+
readonly address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67";
|
|
15
|
+
readonly blockCreated: 19258213;
|
|
16
|
+
};
|
|
17
|
+
readonly multicall3: {
|
|
18
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
19
|
+
readonly blockCreated: 14353601;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
ensTlds?: readonly string[] | undefined;
|
|
23
|
+
id: 1;
|
|
24
|
+
name: "Ethereum";
|
|
25
|
+
nativeCurrency: {
|
|
26
|
+
readonly name: "Ether";
|
|
27
|
+
readonly symbol: "ETH";
|
|
28
|
+
readonly decimals: 18;
|
|
29
|
+
};
|
|
30
|
+
rpcUrls: {
|
|
31
|
+
readonly default: {
|
|
32
|
+
readonly http: readonly ["https://eth.merkle.io"];
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
sourceId?: number | undefined | undefined;
|
|
36
|
+
testnet?: boolean | undefined | undefined;
|
|
37
|
+
custom?: Record<string, unknown> | undefined;
|
|
38
|
+
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
39
|
+
formatters?: undefined;
|
|
40
|
+
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
41
|
+
}], {
|
|
42
|
+
1: import("viem").HttpTransport<undefined, false>;
|
|
43
|
+
}, readonly []>;
|
|
@@ -8,6 +8,7 @@ export declare const WagmiProvider: import("vue").DefineComponent<import("vue").
|
|
|
8
8
|
};
|
|
9
9
|
}>, {
|
|
10
10
|
finalConfig: import("vue").ShallowRef<Config, Config>;
|
|
11
|
+
configKey: import("vue").Ref<string, string>;
|
|
11
12
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
12
13
|
config: {
|
|
13
14
|
type: PropType<WagmiProviderProps>;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
|
-
require('@
|
|
4
|
+
require('@babel/runtime/helpers/objectSpread2');
|
|
5
5
|
require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
require('@segment/analytics-next');
|
|
7
|
+
require('../base/loglevel.js');
|
|
8
|
+
require('@toruslabs/base-controllers');
|
|
6
9
|
require('@web3auth/auth');
|
|
7
10
|
require('../base/errors/index.js');
|
|
8
11
|
require('../base/wallet/index.js');
|
|
9
12
|
var constants = require('../base/connector/constants.js');
|
|
10
13
|
require('jwt-decode');
|
|
11
|
-
require('../base/loglevel.js');
|
|
12
14
|
var errors = require('../base/plugin/errors.js');
|
|
13
15
|
var IPlugin = require('../base/plugin/IPlugin.js');
|
|
14
16
|
require('@toruslabs/constants');
|