@web3modal/wallet
Advanced tools
Comparing version 3.6.0-48f50850 to 3.6.0-4d3c9e44
@@ -9,2 +9,3 @@ export const W3mFrameConstants = { | ||
EMAIL_LOGIN_USED_KEY: 'EMAIL_LOGIN_USED_KEY', | ||
LAST_USED_CHAIN_KEY: 'LAST_USED_CHAIN_KEY', | ||
LAST_EMAIL_LOGIN_TIME: 'LAST_EMAIL_LOGIN_TIME', | ||
@@ -23,2 +24,3 @@ EMAIL: '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', | ||
@@ -46,4 +48,6 @@ FRAME_SWITCH_NETWORK_SUCCESS: '@w3m-frame/SWITCH_NETWORK_SUCCESS', | ||
FRAME_AWAIT_UPDATE_EMAIL_SUCCESS: '@w3m-frame/AWAIT_UPDATE_EMAIL_SUCCESS', | ||
FRAME_AWAIT_UPDATE_EMAIL_ERROR: '@w3m-frame/AWAIT_UPDATE_EMAIL_ERROR' | ||
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 |
@@ -15,2 +15,3 @@ import { W3mFrameStorage } from './W3mFrameStorage.js'; | ||
]; | ||
const EMAIL_MINIMUM_TIMEOUT = 30 * 1000; | ||
export const W3mFrameHelpers = { | ||
@@ -33,9 +34,19 @@ getBlockchainApiUrl() { | ||
const difference = Date.now() - Number(lastEmailLoginTime); | ||
if (difference < 30000) { | ||
const cooldownSec = Math.ceil((30000 - difference) / 1000); | ||
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 |
@@ -18,2 +18,3 @@ import { W3mFrame } from './W3mFrame.js'; | ||
this.awaitUpdateEmailResolver = undefined; | ||
this.syncThemeResolver = undefined; | ||
this.w3mFrame = new W3mFrame(projectId, true); | ||
@@ -52,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: | ||
@@ -70,2 +71,6 @@ return this.onSwitchChainError(event); | ||
return this.onAwaitUpdateEmailError(event); | ||
case W3mFrameConstants.FRAME_SYNC_THEME_SUCCESS: | ||
return this.onSyncThemeSuccess(); | ||
case W3mFrameConstants.FRAME_SYNC_THEME_ERROR: | ||
return this.onSyncThemeError(event); | ||
default: | ||
@@ -136,5 +141,16 @@ return null; | ||
} | ||
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) => { | ||
@@ -187,3 +203,3 @@ this.connectResolver = { resolve, reject }; | ||
this.w3mFrame.events.onFrameEvent(event => { | ||
if (event.type === W3mFrameConstants.FRAME_IS_CONNECTED_SUCCESS) { | ||
if (event.type === W3mFrameConstants.FRAME_GET_USER_SUCCESS) { | ||
callback(); | ||
@@ -214,2 +230,3 @@ } | ||
this.setEmailLoginSuccess(event.payload.email); | ||
this.setLastUsedChainId(event.payload.chainId); | ||
this.connectResolver?.resolve(event.payload); | ||
@@ -221,2 +238,5 @@ } | ||
onIsConnectedSuccess(event) { | ||
if (!event.payload.isConnected) { | ||
this.deleteEmailLoginCache(); | ||
} | ||
this.isConnectedResolver?.resolve(event.payload); | ||
@@ -228,2 +248,3 @@ } | ||
onGetChainIdSuccess(event) { | ||
this.setLastUsedChainId(event.payload.chainId); | ||
this.getChainIdResolver?.resolve(event.payload); | ||
@@ -236,4 +257,3 @@ } | ||
this.disconnectResolver?.resolve(undefined); | ||
W3mFrameStorage.delete(W3mFrameConstants.EMAIL_LOGIN_USED_KEY); | ||
W3mFrameStorage.delete(W3mFrameConstants.EMAIL); | ||
this.deleteEmailLoginCache(); | ||
} | ||
@@ -243,4 +263,5 @@ onSignOutError(event) { | ||
} | ||
onSwitchChainSuccess() { | ||
this.switchChainResolver?.resolve(undefined); | ||
onSwitchChainSuccess(event) { | ||
this.setLastUsedChainId(event.payload.chainId); | ||
this.switchChainResolver?.resolve(event.payload); | ||
} | ||
@@ -275,2 +296,8 @@ onSwitchChainError(event) { | ||
} | ||
onSyncThemeSuccess() { | ||
this.syncThemeResolver?.resolve(undefined); | ||
} | ||
onSyncThemeError(event) { | ||
this.syncThemeResolver?.reject(event.payload.message); | ||
} | ||
setNewLastEmailLoginTime() { | ||
@@ -284,3 +311,14 @@ W3mFrameStorage.set(W3mFrameConstants.LAST_EMAIL_LOGIN_TIME, Date.now().toString()); | ||
} | ||
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 |
@@ -12,2 +12,6 @@ import { z } from 'zod'; | ||
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({ | ||
@@ -23,2 +27,3 @@ action: z.enum(['VERIFY_DEVICE', 'VERIFY_OTP']) | ||
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() }); | ||
@@ -52,2 +57,12 @@ export const RpcResponse = z.string(); | ||
}); | ||
export const RpcEthGetTransactionByHash = z.object({ | ||
method: z.literal('eth_getTransactionByHash'), | ||
params: z.array(z.any()) | ||
}); | ||
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({ | ||
@@ -74,8 +89,12 @@ token: z.string() | ||
.or(RpcEthSignTypedDataV4) | ||
.or(RpcEthBlockNumber) | ||
.or(RpcEthChainId) | ||
.or(RpcEthGetTransactionByHash) | ||
})) | ||
.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_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 })) | ||
@@ -105,3 +124,5 @@ .or(z.object({ type: zType('FRAME_CONNECT_EMAIL_SUCCESS'), payload: FrameConnectEmailResponse })) | ||
})) | ||
.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, AppUpdateEmailRequest, FrameAwaitUpdateEmailResponse } 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, RpcEthGetTransactionByHash } from './W3mFrameSchema.js'; | ||
//# sourceMappingURL=W3mFrameTypes.js.map |
@@ -9,2 +9,3 @@ export declare const W3mFrameConstants: { | ||
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"; | ||
@@ -23,2 +24,3 @@ readonly EMAIL: "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"; | ||
@@ -47,2 +49,4 @@ readonly FRAME_SWITCH_NETWORK_SUCCESS: "@w3m-frame/SWITCH_NETWORK_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; | ||
}; |
@@ -15,2 +15,3 @@ import type { W3mFrameTypes } from './W3mFrameTypes.js'; | ||
private awaitUpdateEmailResolver; | ||
private syncThemeResolver; | ||
constructor(projectId: string); | ||
@@ -34,2 +35,3 @@ getLoginEmailUsed(): boolean; | ||
}>; | ||
syncTheme(payload: W3mFrameTypes.Requests['AppSyncThemeRequest']): Promise<unknown>; | ||
connect(payload?: W3mFrameTypes.Requests['AppGetUserRequest']): Promise<{ | ||
@@ -40,3 +42,5 @@ chainId: number; | ||
}>; | ||
switchNetwork(chainId: number): Promise<unknown>; | ||
switchNetwork(chainId: number): Promise<{ | ||
chainId: number; | ||
}>; | ||
disconnect(): Promise<unknown>; | ||
@@ -70,4 +74,9 @@ request(req: W3mFrameTypes.RPCRequest): Promise<string>; | ||
private onAwaitUpdateEmailError; | ||
private onSyncThemeSuccess; | ||
private onSyncThemeError; | ||
private setNewLastEmailLoginTime; | ||
private setEmailLoginSuccess; | ||
private deleteEmailLoginCache; | ||
private setLastUsedChainId; | ||
private getLastUsedChainId; | ||
} |
@@ -37,2 +37,12 @@ import { z } from 'zod'; | ||
}>; | ||
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<{ | ||
@@ -72,2 +82,9 @@ action: z.ZodEnum<["VERIFY_DEVICE", "VERIFY_OTP"]>; | ||
}>; | ||
export declare const FrameSwitchNetworkResponse: z.ZodObject<{ | ||
chainId: z.ZodNumber; | ||
}, "strip", z.ZodTypeAny, { | ||
chainId: number; | ||
}, { | ||
chainId: number; | ||
}>; | ||
export declare const FrameAwaitUpdateEmailResponse: z.ZodObject<{ | ||
@@ -145,2 +162,26 @@ email: z.ZodString; | ||
}>; | ||
export declare const RpcEthGetTransactionByHash: z.ZodObject<{ | ||
method: z.ZodLiteral<"eth_getTransactionByHash">; | ||
params: z.ZodArray<z.ZodAny, "many">; | ||
}, "strip", z.ZodTypeAny, { | ||
params: any[]; | ||
method: "eth_getTransactionByHash"; | ||
}, { | ||
params: any[]; | ||
method: "eth_getTransactionByHash"; | ||
}>; | ||
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<{ | ||
@@ -154,3 +195,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.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">; | ||
@@ -270,3 +311,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.ZodUnion<[z.ZodObject<{ | ||
method: z.ZodLiteral<"personal_sign">; | ||
@@ -328,2 +369,23 @@ 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"; | ||
}>]>, z.ZodObject<{ | ||
method: z.ZodLiteral<"eth_getTransactionByHash">; | ||
params: z.ZodArray<z.ZodAny, "many">; | ||
}, "strip", z.ZodTypeAny, { | ||
params: any[]; | ||
method: "eth_getTransactionByHash"; | ||
}, { | ||
params: any[]; | ||
method: "eth_getTransactionByHash"; | ||
}>]>; | ||
@@ -351,2 +413,9 @@ }, "strip", z.ZodTypeAny, { | ||
method: "eth_signTypedData_v4"; | ||
} | { | ||
params: any[]; | ||
method: "eth_getTransactionByHash"; | ||
} | { | ||
method: "eth_blockNumber"; | ||
} | { | ||
method: "eth_chainId"; | ||
}; | ||
@@ -374,2 +443,9 @@ }, { | ||
method: "eth_signTypedData_v4"; | ||
} | { | ||
params: any[]; | ||
method: "eth_getTransactionByHash"; | ||
} | { | ||
method: "eth_blockNumber"; | ||
} | { | ||
method: "eth_chainId"; | ||
}; | ||
@@ -401,4 +477,28 @@ }>]>, z.ZodObject<{ | ||
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.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">; | ||
@@ -424,6 +524,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<{ | ||
@@ -776,3 +889,28 @@ type: z.ZodLiteral<"@w3m-frame/CONNECT_EMAIL_ERROR">; | ||
}; | ||
}>]>, 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, AppUpdateEmailRequest, FrameAwaitUpdateEmailResponse } 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, RpcEthGetTransactionByHash } from './W3mFrameSchema.js'; | ||
export declare namespace W3mFrameTypes { | ||
@@ -12,2 +12,3 @@ type AppEvent = z.infer<typeof W3mFrameSchema.appEvent>; | ||
AppUpdateEmailRequest: z.infer<typeof AppUpdateEmailRequest>; | ||
AppSyncThemeRequest: z.infer<typeof AppSyncThemeRequest>; | ||
} | ||
@@ -20,2 +21,3 @@ interface Responses { | ||
FrameAwaitUpdateEmailResponse: z.infer<typeof FrameAwaitUpdateEmailResponse>; | ||
FrameSwitchNetworkResponse: z.infer<typeof FrameSwitchNetworkResponse>; | ||
} | ||
@@ -26,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> | z.infer<typeof RpcEthGetTransactionByHash>; | ||
type RPCResponse = z.infer<typeof RpcResponse>; | ||
type FrameSessionType = z.infer<typeof FrameSession>; | ||
} |
{ | ||
"name": "@web3modal/wallet", | ||
"version": "3.6.0-48f50850", | ||
"version": "3.6.0-4d3c9e44", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
93013
1735
0