Socket
Socket
Sign inDemoInstall

@web3modal/wallet

Package Overview
Dependencies
Maintainers
11
Versions
183
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web3modal/wallet - npm Package Compare versions

Comparing version 3.6.0-dd04125d to 3.6.0-eb1021c6

2

dist/esm/src/W3mFrame.js

@@ -65,3 +65,3 @@ import { W3mFrameConstants } from './W3mFrameConstants.js';

this.iframe.onerror = () => {
this.frameLoadPromiseResolver?.reject();
this.frameLoadPromiseResolver?.reject('Unable to load email login dependency');
};

@@ -68,0 +68,0 @@ }

export const W3mFrameConstants = {
SECURE_SITE_SDK: 'http://localhost:3010/sdk',
SECURE_SITE_SDK: 'https://secure.web3modal.com/sdk',
APP_EVENT_KEY: '@w3m-app/',

@@ -9,2 +9,5 @@ FRAME_EVENT_KEY: '@w3m-frame/',

EMAIL_LOGIN_USED_KEY: 'EMAIL_LOGIN_USED_KEY',
LAST_USED_CHAIN_KEY: 'LAST_USED_CHAIN_KEY',
LAST_EMAIL_LOGIN_TIME: 'LAST_EMAIL_LOGIN_TIME',
EMAIL: 'EMAIL',
APP_SWITCH_NETWORK: '@w3m-app/SWITCH_NETWORK',

@@ -19,2 +22,5 @@ APP_CONNECT_EMAIL: '@w3m-app/CONNECT_EMAIL',

APP_RPC_REQUEST: '@w3m-app/RPC_REQUEST',
APP_UPDATE_EMAIL: '@w3m-app/UPDATE_EMAIL',
APP_AWAIT_UPDATE_EMAIL: '@w3m-app/AWAIT_UPDATE_EMAIL',
APP_SYNC_THEME: '@w3m-app/SYNC_THEME',
FRAME_SWITCH_NETWORK_ERROR: '@w3m-frame/SWITCH_NETWORK_ERROR',

@@ -38,4 +44,10 @@ FRAME_SWITCH_NETWORK_SUCCESS: '@w3m-frame/SWITCH_NETWORK_SUCCESS',

FRAME_RPC_REQUEST_ERROR: '@w3m-frame/RPC_REQUEST_ERROR',
FRAME_SESSION_UPDATE: '@w3m-frame/SESSION_UPDATE'
FRAME_SESSION_UPDATE: '@w3m-frame/SESSION_UPDATE',
FRAME_UPDATE_EMAIL_SUCCESS: '@w3m-frame/UPDATE_EMAIL_SUCCESS',
FRAME_UPDATE_EMAIL_ERROR: '@w3m-frame/UPDATE_EMAIL_ERROR',
FRAME_AWAIT_UPDATE_EMAIL_SUCCESS: '@w3m-frame/AWAIT_UPDATE_EMAIL_SUCCESS',
FRAME_AWAIT_UPDATE_EMAIL_ERROR: '@w3m-frame/AWAIT_UPDATE_EMAIL_ERROR',
FRAME_SYNC_THEME_SUCCESS: '@w3m-frame/SYNC_THEME_SUCCESS',
FRAME_SYNC_THEME_ERROR: '@w3m-frame/SYNC_THEME_ERROR'
};
//# sourceMappingURL=W3mFrameConstants.js.map

@@ -0,1 +1,3 @@

import { W3mFrameStorage } from './W3mFrameStorage.js';
import { W3mFrameConstants } from './W3mFrameConstants.js';
const RESTRICTED_TIMEZONES = [

@@ -13,2 +15,3 @@ 'ASIA/SHANGHAI',

];
const EMAIL_MINIMUM_TIMEOUT = 30 * 1000;
export const W3mFrameHelpers = {

@@ -26,4 +29,24 @@ getBlockchainApiUrl() {

}
},
checkIfAllowedToTriggerEmail() {
const lastEmailLoginTime = W3mFrameStorage.get(W3mFrameConstants.LAST_EMAIL_LOGIN_TIME);
if (lastEmailLoginTime) {
const difference = Date.now() - Number(lastEmailLoginTime);
if (difference < EMAIL_MINIMUM_TIMEOUT) {
const cooldownSec = Math.ceil((EMAIL_MINIMUM_TIMEOUT - difference) / 1000);
throw new Error(`Please try again after ${cooldownSec} seconds`);
}
}
},
getTimeToNextEmailLogin() {
const lastEmailLoginTime = W3mFrameStorage.get(W3mFrameConstants.LAST_EMAIL_LOGIN_TIME);
if (lastEmailLoginTime) {
const difference = Date.now() - Number(lastEmailLoginTime);
if (difference < EMAIL_MINIMUM_TIMEOUT) {
return Math.ceil((EMAIL_MINIMUM_TIMEOUT - difference) / 1000);
}
}
return 0;
}
};
//# sourceMappingURL=W3mFrameHelpers.js.map
import { W3mFrame } from './W3mFrame.js';
import { W3mFrameConstants } from './W3mFrameConstants.js';
import { W3mFrameStorage } from './W3mFrameStorage.js';
import { W3mFrameHelpers } from './W3mFrameHelpers.js';
export class W3mFrameProvider {

@@ -15,2 +16,5 @@ constructor(projectId) {

this.rpcRequestResolver = undefined;
this.updateEmailResolver = undefined;
this.awaitUpdateEmailResolver = undefined;
this.syncThemeResolver = undefined;
this.w3mFrame = new W3mFrame(projectId, true);

@@ -49,3 +53,3 @@ this.w3mFrame.events.onFrameEvent(event => {

case W3mFrameConstants.FRAME_SWITCH_NETWORK_SUCCESS:
return this.onSwitchChainSuccess();
return this.onSwitchChainSuccess(event);
case W3mFrameConstants.FRAME_SWITCH_NETWORK_ERROR:

@@ -59,2 +63,14 @@ return this.onSwitchChainError(event);

return this.onSessionUpdate(event);
case W3mFrameConstants.FRAME_UPDATE_EMAIL_SUCCESS:
return this.onUpdateEmailSuccess();
case W3mFrameConstants.FRAME_UPDATE_EMAIL_ERROR:
return this.onUpdateEmailError(event);
case W3mFrameConstants.FRAME_AWAIT_UPDATE_EMAIL_SUCCESS:
return this.onAwaitUpdateEmailSuccess(event);
case W3mFrameConstants.FRAME_AWAIT_UPDATE_EMAIL_ERROR:
return this.onAwaitUpdateEmailError(event);
case W3mFrameConstants.FRAME_SYNC_THEME_SUCCESS:
return this.onSyncThemeSuccess();
case W3mFrameConstants.FRAME_SYNC_THEME_ERROR:
return this.onSyncThemeError(event);
default:

@@ -68,4 +84,8 @@ return null;

}
getEmail() {
return W3mFrameStorage.get(W3mFrameConstants.EMAIL);
}
async connectEmail(payload) {
await this.w3mFrame.frameLoadPromise;
W3mFrameHelpers.checkIfAllowedToTriggerEmail();
this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_CONNECT_EMAIL, payload });

@@ -92,6 +112,5 @@ return new Promise((resolve, reject) => {

await this.w3mFrame.frameLoadPromise;
const token = this.getSessionToken();
this.w3mFrame.events.postAppEvent({
type: W3mFrameConstants.APP_IS_CONNECTED,
payload: token ? { token } : undefined
payload: undefined
});

@@ -109,5 +128,31 @@ return new Promise((resolve, reject) => {

}
async updateEmail(payload) {
await this.w3mFrame.frameLoadPromise;
W3mFrameHelpers.checkIfAllowedToTriggerEmail();
this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_UPDATE_EMAIL, payload });
return new Promise((resolve, reject) => {
this.updateEmailResolver = { resolve, reject };
});
}
async awaitUpdateEmail() {
await this.w3mFrame.frameLoadPromise;
this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_AWAIT_UPDATE_EMAIL });
return new Promise((resolve, reject) => {
this.awaitUpdateEmailResolver = { resolve, reject };
});
}
async syncTheme(payload) {
await this.w3mFrame.frameLoadPromise;
this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_SYNC_THEME, payload });
return new Promise((resolve, reject) => {
this.syncThemeResolver = { resolve, reject };
});
}
async connect(payload) {
const chainId = payload?.chainId ?? this.getLastUsedChainId() ?? 1;
await this.w3mFrame.frameLoadPromise;
this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_GET_USER, payload });
this.w3mFrame.events.postAppEvent({
type: W3mFrameConstants.APP_GET_USER,
payload: { chainId }
});
return new Promise((resolve, reject) => {

@@ -129,3 +174,2 @@ this.connectResolver = { resolve, reject };

await this.w3mFrame.frameLoadPromise;
this.deleteSessionToken();
this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_SIGN_OUT });

@@ -163,2 +207,5 @@ return new Promise((resolve, reject) => {

if (event.type === W3mFrameConstants.FRAME_IS_CONNECTED_SUCCESS) {
if (!event.payload.isConnected) {
this.deleteEmailLoginCache();
}
callback();

@@ -170,3 +217,3 @@ }

this.connectEmailResolver?.resolve(event.payload);
W3mFrameStorage.set(W3mFrameConstants.EMAIL_LOGIN_USED_KEY, 'true');
this.setNewLastEmailLoginTime();
}

@@ -189,2 +236,4 @@ onConnectEmailError(event) {

onConnectSuccess(event) {
this.setEmailLoginSuccess(event.payload.email);
this.setLastUsedChainId(event.payload.chainId);
this.connectResolver?.resolve(event.payload);

@@ -202,2 +251,3 @@ }

onGetChainIdSuccess(event) {
this.setLastUsedChainId(event.payload.chainId);
this.getChainIdResolver?.resolve(event.payload);

@@ -210,3 +260,3 @@ }

this.disconnectResolver?.resolve(undefined);
W3mFrameStorage.delete(W3mFrameConstants.EMAIL_LOGIN_USED_KEY);
this.deleteEmailLoginCache();
}

@@ -216,4 +266,5 @@ onSignOutError(event) {

}
onSwitchChainSuccess() {
this.switchChainResolver?.resolve(undefined);
onSwitchChainSuccess(event) {
this.setLastUsedChainId(event.payload.chainId);
this.switchChainResolver?.resolve(event.payload);
}

@@ -232,15 +283,44 @@ onSwitchChainError(event) {

if (payload) {
this.setSessionToken(payload.token);
}
}
setSessionToken(token) {
W3mFrameStorage.set(W3mFrameConstants.SESSION_TOKEN_KEY, token);
onUpdateEmailSuccess() {
this.updateEmailResolver?.resolve(undefined);
this.setNewLastEmailLoginTime();
}
getSessionToken() {
return W3mFrameStorage.get(W3mFrameConstants.SESSION_TOKEN_KEY);
onUpdateEmailError(event) {
this.updateEmailResolver?.reject(event.payload.message);
}
deleteSessionToken() {
W3mFrameStorage.delete(W3mFrameConstants.SESSION_TOKEN_KEY);
onAwaitUpdateEmailSuccess(event) {
this.setEmailLoginSuccess(event.payload.email);
this.awaitUpdateEmailResolver?.resolve(event.payload);
}
onAwaitUpdateEmailError(event) {
this.awaitUpdateEmailResolver?.reject(event.payload.message);
}
onSyncThemeSuccess() {
this.syncThemeResolver?.resolve(undefined);
}
onSyncThemeError(event) {
this.syncThemeResolver?.reject(event.payload.message);
}
setNewLastEmailLoginTime() {
W3mFrameStorage.set(W3mFrameConstants.LAST_EMAIL_LOGIN_TIME, Date.now().toString());
}
setEmailLoginSuccess(email) {
W3mFrameStorage.set(W3mFrameConstants.EMAIL, email);
W3mFrameStorage.set(W3mFrameConstants.EMAIL_LOGIN_USED_KEY, 'true');
W3mFrameStorage.delete(W3mFrameConstants.LAST_EMAIL_LOGIN_TIME);
}
deleteEmailLoginCache() {
W3mFrameStorage.delete(W3mFrameConstants.EMAIL_LOGIN_USED_KEY);
W3mFrameStorage.delete(W3mFrameConstants.EMAIL);
W3mFrameStorage.delete(W3mFrameConstants.LAST_USED_CHAIN_KEY);
}
setLastUsedChainId(chainId) {
W3mFrameStorage.set(W3mFrameConstants.LAST_USED_CHAIN_KEY, `${chainId}`);
}
getLastUsedChainId() {
return Number(W3mFrameStorage.get(W3mFrameConstants.LAST_USED_CHAIN_KEY));
}
}
//# sourceMappingURL=W3mFrameProvider.js.map

@@ -11,2 +11,7 @@ import { z } from 'zod';

export const AppGetUserRequest = z.object({ chainId: z.optional(z.number()) });
export const AppUpdateEmailRequest = z.object({ email: z.string().email() });
export const AppSyncThemeRequest = z.object({
themeMode: z.optional(z.enum(['light', 'dark'])),
themeVariables: z.optional(z.record(z.string(), z.string().or(z.number())))
});
export const FrameConnectEmailResponse = z.object({

@@ -16,2 +21,3 @@ action: z.enum(['VERIFY_DEVICE', 'VERIFY_OTP'])

export const FrameGetUserResponse = z.object({
email: z.string().email(),
address: z.string(),

@@ -22,2 +28,4 @@ chainId: z.number()

export const FrameGetChainIdResponse = z.object({ chainId: z.number() });
export const FrameSwitchNetworkResponse = z.object({ chainId: z.number() });
export const FrameAwaitUpdateEmailResponse = z.object({ email: z.string().email() });
export const RpcResponse = z.string();

@@ -50,2 +58,8 @@ export const RpcPersonalSignRequest = z.object({

});
export const RpcEthBlockNumber = z.object({
method: z.literal('eth_blockNumber')
});
export const RpcEthChainId = z.object({
method: z.literal('eth_chainId')
});
export const FrameSession = z.object({

@@ -72,6 +86,11 @@ token: z.string()

.or(RpcEthSignTypedDataV4)
})),
.or(RpcEthBlockNumber)
.or(RpcEthChainId)
}))
.or(z.object({ type: zType('APP_UPDATE_EMAIL'), payload: AppUpdateEmailRequest }))
.or(z.object({ type: zType('APP_AWAIT_UPDATE_EMAIL') }))
.or(z.object({ type: zType('APP_SYNC_THEME'), payload: AppSyncThemeRequest })),
frameEvent: z
.object({ type: zType('FRAME_SWITCH_NETWORK_ERROR'), payload: zError })
.or(z.object({ type: zType('FRAME_SWITCH_NETWORK_SUCCESS') }))
.or(z.object({ type: zType('FRAME_SWITCH_NETWORK_SUCCESS'), payload: FrameSwitchNetworkResponse }))
.or(z.object({ type: zType('FRAME_CONNECT_EMAIL_ERROR'), payload: zError }))

@@ -94,3 +113,12 @@ .or(z.object({ type: zType('FRAME_CONNECT_EMAIL_SUCCESS'), payload: FrameConnectEmailResponse }))

.or(z.object({ type: zType('FRAME_SESSION_UPDATE'), payload: FrameSession }))
.or(z.object({ type: zType('FRAME_UPDATE_EMAIL_ERROR'), payload: zError }))
.or(z.object({ type: zType('FRAME_UPDATE_EMAIL_SUCCESS') }))
.or(z.object({ type: zType('FRAME_AWAIT_UPDATE_EMAIL_ERROR'), payload: zError }))
.or(z.object({
type: zType('FRAME_AWAIT_UPDATE_EMAIL_SUCCESS'),
payload: FrameAwaitUpdateEmailResponse
}))
.or(z.object({ type: zType('FRAME_SYNC_THEME_ERROR'), payload: zError }))
.or(z.object({ type: zType('FRAME_SYNC_THEME_SUCCESS') }))
};
//# sourceMappingURL=W3mFrameSchema.js.map
import { z } from 'zod';
import { W3mFrameSchema, AppConnectEmailRequest, AppConnectOtpRequest, AppSwitchNetworkRequest, FrameConnectEmailResponse, FrameGetChainIdResponse, FrameGetUserResponse, FrameIsConnectedResponse, RpcPersonalSignRequest, RpcResponse, RpcEthSendTransactionRequest, RpcEthSignTypedDataV4, RpcEthAccountsRequest, RpcEthEstimateGas, RpcEthGasPrice, RpcGetBalance, FrameSession, AppGetUserRequest } from './W3mFrameSchema.js';
import { W3mFrameSchema, AppConnectEmailRequest, AppConnectOtpRequest, AppSwitchNetworkRequest, FrameConnectEmailResponse, FrameGetChainIdResponse, FrameGetUserResponse, FrameIsConnectedResponse, RpcPersonalSignRequest, RpcResponse, RpcEthSendTransactionRequest, RpcEthSignTypedDataV4, RpcEthAccountsRequest, RpcEthEstimateGas, RpcEthGasPrice, RpcGetBalance, RpcEthBlockNumber, FrameSession, AppGetUserRequest, AppUpdateEmailRequest, FrameAwaitUpdateEmailResponse, AppSyncThemeRequest, RpcEthChainId, FrameSwitchNetworkResponse } from './W3mFrameSchema.js';
//# sourceMappingURL=W3mFrameTypes.js.map
export declare const W3mFrameConstants: {
readonly SECURE_SITE_SDK: "http://localhost:3010/sdk";
readonly SECURE_SITE_SDK: "https://secure.web3modal.com/sdk";
readonly APP_EVENT_KEY: "@w3m-app/";

@@ -9,2 +9,5 @@ readonly FRAME_EVENT_KEY: "@w3m-frame/";

readonly EMAIL_LOGIN_USED_KEY: "EMAIL_LOGIN_USED_KEY";
readonly LAST_USED_CHAIN_KEY: "LAST_USED_CHAIN_KEY";
readonly LAST_EMAIL_LOGIN_TIME: "LAST_EMAIL_LOGIN_TIME";
readonly EMAIL: "EMAIL";
readonly APP_SWITCH_NETWORK: "@w3m-app/SWITCH_NETWORK";

@@ -19,2 +22,5 @@ readonly APP_CONNECT_EMAIL: "@w3m-app/CONNECT_EMAIL";

readonly APP_RPC_REQUEST: "@w3m-app/RPC_REQUEST";
readonly APP_UPDATE_EMAIL: "@w3m-app/UPDATE_EMAIL";
readonly APP_AWAIT_UPDATE_EMAIL: "@w3m-app/AWAIT_UPDATE_EMAIL";
readonly APP_SYNC_THEME: "@w3m-app/SYNC_THEME";
readonly FRAME_SWITCH_NETWORK_ERROR: "@w3m-frame/SWITCH_NETWORK_ERROR";

@@ -39,2 +45,8 @@ readonly FRAME_SWITCH_NETWORK_SUCCESS: "@w3m-frame/SWITCH_NETWORK_SUCCESS";

readonly FRAME_SESSION_UPDATE: "@w3m-frame/SESSION_UPDATE";
readonly FRAME_UPDATE_EMAIL_SUCCESS: "@w3m-frame/UPDATE_EMAIL_SUCCESS";
readonly FRAME_UPDATE_EMAIL_ERROR: "@w3m-frame/UPDATE_EMAIL_ERROR";
readonly FRAME_AWAIT_UPDATE_EMAIL_SUCCESS: "@w3m-frame/AWAIT_UPDATE_EMAIL_SUCCESS";
readonly FRAME_AWAIT_UPDATE_EMAIL_ERROR: "@w3m-frame/AWAIT_UPDATE_EMAIL_ERROR";
readonly FRAME_SYNC_THEME_SUCCESS: "@w3m-frame/SYNC_THEME_SUCCESS";
readonly FRAME_SYNC_THEME_ERROR: "@w3m-frame/SYNC_THEME_ERROR";
};
export declare const W3mFrameHelpers: {
getBlockchainApiUrl(): false | "https://rpc.walletconnect.org" | "https://rpc.walletconnect.com";
checkIfAllowedToTriggerEmail(): void;
getTimeToNextEmailLogin(): number;
};

@@ -13,4 +13,8 @@ import type { W3mFrameTypes } from './W3mFrameTypes.js';

private rpcRequestResolver;
private updateEmailResolver;
private awaitUpdateEmailResolver;
private syncThemeResolver;
constructor(projectId: string);
getLoginEmailUsed(): boolean;
getEmail(): string | null;
connectEmail(payload: W3mFrameTypes.Requests['AppConnectEmailRequest']): Promise<{

@@ -27,7 +31,15 @@ action: "VERIFY_DEVICE" | "VERIFY_OTP";

}>;
updateEmail(payload: W3mFrameTypes.Requests['AppUpdateEmailRequest']): Promise<unknown>;
awaitUpdateEmail(): Promise<{
email: string;
}>;
syncTheme(payload: W3mFrameTypes.Requests['AppSyncThemeRequest']): Promise<unknown>;
connect(payload?: W3mFrameTypes.Requests['AppGetUserRequest']): Promise<{
chainId: number;
email: string;
address: string;
}>;
switchNetwork(chainId: number): Promise<unknown>;
switchNetwork(chainId: number): Promise<{
chainId: number;
}>;
disconnect(): Promise<unknown>;

@@ -57,5 +69,13 @@ request(req: W3mFrameTypes.RPCRequest): Promise<string>;

private onSessionUpdate;
private setSessionToken;
private getSessionToken;
private deleteSessionToken;
private onUpdateEmailSuccess;
private onUpdateEmailError;
private onAwaitUpdateEmailSuccess;
private onAwaitUpdateEmailError;
private onSyncThemeSuccess;
private onSyncThemeError;
private setNewLastEmailLoginTime;
private setEmailLoginSuccess;
private deleteEmailLoginCache;
private setLastUsedChainId;
private getLastUsedChainId;
}

@@ -30,2 +30,19 @@ import { z } from 'zod';

}>;
export declare const AppUpdateEmailRequest: z.ZodObject<{
email: z.ZodString;
}, "strip", z.ZodTypeAny, {
email: string;
}, {
email: string;
}>;
export declare const AppSyncThemeRequest: z.ZodObject<{
themeMode: z.ZodOptional<z.ZodEnum<["light", "dark"]>>;
themeVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber]>>>;
}, "strip", z.ZodTypeAny, {
themeMode?: "light" | "dark" | undefined;
themeVariables?: Record<string, string | number> | undefined;
}, {
themeMode?: "light" | "dark" | undefined;
themeVariables?: Record<string, string | number> | undefined;
}>;
export declare const FrameConnectEmailResponse: z.ZodObject<{

@@ -39,2 +56,3 @@ action: z.ZodEnum<["VERIFY_DEVICE", "VERIFY_OTP"]>;

export declare const FrameGetUserResponse: z.ZodObject<{
email: z.ZodString;
address: z.ZodString;

@@ -44,5 +62,7 @@ chainId: z.ZodNumber;

chainId: number;
email: string;
address: string;
}, {
chainId: number;
email: string;
address: string;

@@ -64,2 +84,16 @@ }>;

}>;
export declare const FrameSwitchNetworkResponse: z.ZodObject<{
chainId: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
chainId: number;
}, {
chainId: number;
}>;
export declare const FrameAwaitUpdateEmailResponse: z.ZodObject<{
email: z.ZodString;
}, "strip", z.ZodTypeAny, {
email: string;
}, {
email: string;
}>;
export declare const RpcResponse: z.ZodString;

@@ -130,2 +164,16 @@ export declare const RpcPersonalSignRequest: z.ZodObject<{

}>;
export declare const RpcEthBlockNumber: z.ZodObject<{
method: z.ZodLiteral<"eth_blockNumber">;
}, "strip", z.ZodTypeAny, {
method: "eth_blockNumber";
}, {
method: "eth_blockNumber";
}>;
export declare const RpcEthChainId: z.ZodObject<{
method: z.ZodLiteral<"eth_chainId">;
}, "strip", z.ZodTypeAny, {
method: "eth_chainId";
}, {
method: "eth_chainId";
}>;
export declare const FrameSession: z.ZodObject<{

@@ -139,3 +187,3 @@ token: z.ZodString;

export declare const W3mFrameSchema: {
appEvent: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
appEvent: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
type: z.ZodLiteral<"@w3m-app/SWITCH_NETWORK">;

@@ -255,3 +303,3 @@ payload: z.ZodObject<{

type: z.ZodLiteral<"@w3m-app/RPC_REQUEST">;
payload: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
payload: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
method: z.ZodLiteral<"personal_sign">;

@@ -313,2 +361,14 @@ params: z.ZodArray<z.ZodAny, "many">;

method: "eth_signTypedData_v4";
}>]>, z.ZodObject<{
method: z.ZodLiteral<"eth_blockNumber">;
}, "strip", z.ZodTypeAny, {
method: "eth_blockNumber";
}, {
method: "eth_blockNumber";
}>]>, z.ZodObject<{
method: z.ZodLiteral<"eth_chainId">;
}, "strip", z.ZodTypeAny, {
method: "eth_chainId";
}, {
method: "eth_chainId";
}>]>;

@@ -336,2 +396,6 @@ }, "strip", z.ZodTypeAny, {

method: "eth_signTypedData_v4";
} | {
method: "eth_blockNumber";
} | {
method: "eth_chainId";
};

@@ -359,5 +423,58 @@ }, {

method: "eth_signTypedData_v4";
} | {
method: "eth_blockNumber";
} | {
method: "eth_chainId";
};
}>]>, z.ZodObject<{
type: z.ZodLiteral<"@w3m-app/UPDATE_EMAIL">;
payload: z.ZodObject<{
email: z.ZodString;
}, "strip", z.ZodTypeAny, {
email: string;
}, {
email: string;
}>;
}, "strip", z.ZodTypeAny, {
type: "@w3m-app/UPDATE_EMAIL";
payload: {
email: string;
};
}, {
type: "@w3m-app/UPDATE_EMAIL";
payload: {
email: string;
};
}>]>, z.ZodObject<{
type: z.ZodLiteral<"@w3m-app/AWAIT_UPDATE_EMAIL">;
}, "strip", z.ZodTypeAny, {
type: "@w3m-app/AWAIT_UPDATE_EMAIL";
}, {
type: "@w3m-app/AWAIT_UPDATE_EMAIL";
}>]>, z.ZodObject<{
type: z.ZodLiteral<"@w3m-app/SYNC_THEME">;
payload: z.ZodObject<{
themeMode: z.ZodOptional<z.ZodEnum<["light", "dark"]>>;
themeVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber]>>>;
}, "strip", z.ZodTypeAny, {
themeMode?: "light" | "dark" | undefined;
themeVariables?: Record<string, string | number> | undefined;
}, {
themeMode?: "light" | "dark" | undefined;
themeVariables?: Record<string, string | number> | undefined;
}>;
}, "strip", z.ZodTypeAny, {
type: "@w3m-app/SYNC_THEME";
payload: {
themeMode?: "light" | "dark" | undefined;
themeVariables?: Record<string, string | number> | undefined;
};
}, {
type: "@w3m-app/SYNC_THEME";
payload: {
themeMode?: "light" | "dark" | undefined;
themeVariables?: Record<string, string | number> | undefined;
};
}>]>;
frameEvent: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
frameEvent: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
type: z.ZodLiteral<"@w3m-frame/SWITCH_NETWORK_ERROR">;

@@ -383,6 +500,19 @@ payload: z.ZodObject<{

type: z.ZodLiteral<"@w3m-frame/SWITCH_NETWORK_SUCCESS">;
payload: z.ZodObject<{
chainId: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
chainId: number;
}, {
chainId: number;
}>;
}, "strip", z.ZodTypeAny, {
type: "@w3m-frame/SWITCH_NETWORK_SUCCESS";
payload: {
chainId: number;
};
}, {
type: "@w3m-frame/SWITCH_NETWORK_SUCCESS";
payload: {
chainId: number;
};
}>]>, z.ZodObject<{

@@ -498,2 +628,3 @@ type: z.ZodLiteral<"@w3m-frame/CONNECT_EMAIL_ERROR">;

payload: z.ZodObject<{
email: z.ZodString;
address: z.ZodString;

@@ -503,5 +634,7 @@ chainId: z.ZodNumber;

chainId: number;
email: string;
address: string;
}, {
chainId: number;
email: string;
address: string;

@@ -513,2 +646,3 @@ }>;

chainId: number;
email: string;
address: string;

@@ -520,2 +654,3 @@ };

chainId: number;
email: string;
address: string;

@@ -671,3 +806,91 @@ };

};
}>]>, z.ZodObject<{
type: z.ZodLiteral<"@w3m-frame/UPDATE_EMAIL_ERROR">;
payload: z.ZodObject<{
message: z.ZodString;
}, "strip", z.ZodTypeAny, {
message: string;
}, {
message: string;
}>;
}, "strip", z.ZodTypeAny, {
type: "@w3m-frame/UPDATE_EMAIL_ERROR";
payload: {
message: string;
};
}, {
type: "@w3m-frame/UPDATE_EMAIL_ERROR";
payload: {
message: string;
};
}>]>, z.ZodObject<{
type: z.ZodLiteral<"@w3m-frame/UPDATE_EMAIL_SUCCESS">;
}, "strip", z.ZodTypeAny, {
type: "@w3m-frame/UPDATE_EMAIL_SUCCESS";
}, {
type: "@w3m-frame/UPDATE_EMAIL_SUCCESS";
}>]>, z.ZodObject<{
type: z.ZodLiteral<"@w3m-frame/AWAIT_UPDATE_EMAIL_ERROR">;
payload: z.ZodObject<{
message: z.ZodString;
}, "strip", z.ZodTypeAny, {
message: string;
}, {
message: string;
}>;
}, "strip", z.ZodTypeAny, {
type: "@w3m-frame/AWAIT_UPDATE_EMAIL_ERROR";
payload: {
message: string;
};
}, {
type: "@w3m-frame/AWAIT_UPDATE_EMAIL_ERROR";
payload: {
message: string;
};
}>]>, z.ZodObject<{
type: z.ZodLiteral<"@w3m-frame/AWAIT_UPDATE_EMAIL_SUCCESS">;
payload: z.ZodObject<{
email: z.ZodString;
}, "strip", z.ZodTypeAny, {
email: string;
}, {
email: string;
}>;
}, "strip", z.ZodTypeAny, {
type: "@w3m-frame/AWAIT_UPDATE_EMAIL_SUCCESS";
payload: {
email: string;
};
}, {
type: "@w3m-frame/AWAIT_UPDATE_EMAIL_SUCCESS";
payload: {
email: string;
};
}>]>, z.ZodObject<{
type: z.ZodLiteral<"@w3m-frame/SYNC_THEME_ERROR">;
payload: z.ZodObject<{
message: z.ZodString;
}, "strip", z.ZodTypeAny, {
message: string;
}, {
message: string;
}>;
}, "strip", z.ZodTypeAny, {
type: "@w3m-frame/SYNC_THEME_ERROR";
payload: {
message: string;
};
}, {
type: "@w3m-frame/SYNC_THEME_ERROR";
payload: {
message: string;
};
}>]>, z.ZodObject<{
type: z.ZodLiteral<"@w3m-frame/SYNC_THEME_SUCCESS">;
}, "strip", z.ZodTypeAny, {
type: "@w3m-frame/SYNC_THEME_SUCCESS";
}, {
type: "@w3m-frame/SYNC_THEME_SUCCESS";
}>]>;
};
import { z } from 'zod';
import { W3mFrameSchema, AppConnectEmailRequest, AppConnectOtpRequest, AppSwitchNetworkRequest, FrameConnectEmailResponse, FrameGetChainIdResponse, FrameGetUserResponse, FrameIsConnectedResponse, RpcPersonalSignRequest, RpcResponse, RpcEthSendTransactionRequest, RpcEthSignTypedDataV4, RpcEthAccountsRequest, RpcEthEstimateGas, RpcEthGasPrice, RpcGetBalance, FrameSession, AppGetUserRequest } from './W3mFrameSchema.js';
import { W3mFrameSchema, AppConnectEmailRequest, AppConnectOtpRequest, AppSwitchNetworkRequest, FrameConnectEmailResponse, FrameGetChainIdResponse, FrameGetUserResponse, FrameIsConnectedResponse, RpcPersonalSignRequest, RpcResponse, RpcEthSendTransactionRequest, RpcEthSignTypedDataV4, RpcEthAccountsRequest, RpcEthEstimateGas, RpcEthGasPrice, RpcGetBalance, RpcEthBlockNumber, FrameSession, AppGetUserRequest, AppUpdateEmailRequest, FrameAwaitUpdateEmailResponse, AppSyncThemeRequest, RpcEthChainId, FrameSwitchNetworkResponse } from './W3mFrameSchema.js';
export declare namespace W3mFrameTypes {

@@ -11,2 +11,4 @@ type AppEvent = z.infer<typeof W3mFrameSchema.appEvent>;

AppGetUserRequest: z.infer<typeof AppGetUserRequest>;
AppUpdateEmailRequest: z.infer<typeof AppUpdateEmailRequest>;
AppSyncThemeRequest: z.infer<typeof AppSyncThemeRequest>;
}

@@ -18,2 +20,4 @@ interface Responses {

FrameIsConnectedResponse: z.infer<typeof FrameIsConnectedResponse>;
FrameAwaitUpdateEmailResponse: z.infer<typeof FrameAwaitUpdateEmailResponse>;
FrameSwitchNetworkResponse: z.infer<typeof FrameSwitchNetworkResponse>;
}

@@ -24,5 +28,5 @@ interface Network {

}
type RPCRequest = z.infer<typeof RpcPersonalSignRequest> | z.infer<typeof RpcEthSendTransactionRequest> | z.infer<typeof RpcEthSignTypedDataV4> | z.infer<typeof RpcEthAccountsRequest> | z.infer<typeof RpcEthEstimateGas> | z.infer<typeof RpcEthGasPrice> | z.infer<typeof RpcGetBalance>;
type RPCRequest = z.infer<typeof RpcPersonalSignRequest> | z.infer<typeof RpcEthSendTransactionRequest> | z.infer<typeof RpcEthSignTypedDataV4> | z.infer<typeof RpcEthAccountsRequest> | z.infer<typeof RpcEthEstimateGas> | z.infer<typeof RpcEthGasPrice> | z.infer<typeof RpcGetBalance> | z.infer<typeof RpcEthBlockNumber> | z.infer<typeof RpcEthChainId>;
type RPCResponse = z.infer<typeof RpcResponse>;
type FrameSessionType = z.infer<typeof FrameSession>;
}
{
"name": "@web3modal/wallet",
"version": "3.6.0-dd04125d",
"version": "3.6.0-eb1021c6",
"type": "module",

@@ -5,0 +5,0 @@ "main": "./dist/esm/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc