@web3modal/wallet
Advanced tools
Comparing version 4.1.3-xafeai01.0 to 4.1.3
export const W3mFrameConstants = { | ||
SECURE_SITE_SDK: 'http://localhost:3010/sdk', | ||
SECURE_SITE_SDK: process.env['NEXT_PUBLIC_SECURE_SITE_SDK_URL'] || 'https://secure.walletconnect.com/sdk', | ||
APP_EVENT_KEY: '@w3m-app/', | ||
@@ -17,3 +17,2 @@ FRAME_EVENT_KEY: '@w3m-frame/', | ||
APP_CONNECT_OTP: '@w3m-app/CONNECT_OTP', | ||
APP_GET_SOCIAL_REDIRECT_URI: '@w3m-app/GET_SOCIAL_REDIRECT_URI', | ||
APP_GET_USER: '@w3m-app/GET_USER', | ||
@@ -41,4 +40,2 @@ APP_SIGN_OUT: '@w3m-app/SIGN_OUT', | ||
FRAME_CONNECT_OTP_ERROR: '@w3m-frame/CONNECT_OTP_ERROR', | ||
FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS: '@w3m-frame/GET_SOCIAL_REDIRECT_URI_SUCCESS', | ||
FRAME_GET_SOCIAL_REDIRECT_URI_ERROR: '@w3m-frame/GET_SOCIAL_REDIRECT_URI_ERROR', | ||
FRAME_GET_USER_SUCCESS: '@w3m-frame/GET_USER_SUCCESS', | ||
@@ -45,0 +42,0 @@ FRAME_GET_USER_ERROR: '@w3m-frame/GET_USER_ERROR', |
@@ -10,3 +10,2 @@ import { W3mFrame } from './W3mFrame.js'; | ||
this.connectOtpResolver = undefined; | ||
this.getSocialRedirectUriResolver = undefined; | ||
this.connectResolver = undefined; | ||
@@ -42,6 +41,2 @@ this.disconnectResolver = undefined; | ||
return this.onConnectOtpError(event); | ||
case W3mFrameConstants.FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS: | ||
return this.onGetSocialRedirectUriSuccess(event); | ||
case W3mFrameConstants.FRAME_GET_SOCIAL_REDIRECT_URI_ERROR: | ||
return this.onGetSocialRedirectUriError(event); | ||
case W3mFrameConstants.FRAME_GET_USER_SUCCESS: | ||
@@ -141,12 +136,2 @@ return this.onConnectSuccess(event); | ||
} | ||
async getSocialRedirectUri(payload) { | ||
await this.w3mFrame.frameLoadPromise; | ||
this.w3mFrame.events.postAppEvent({ | ||
type: W3mFrameConstants.APP_GET_SOCIAL_REDIRECT_URI, | ||
payload | ||
}); | ||
return new Promise((resolve, reject) => { | ||
this.getSocialRedirectUriResolver = { resolve, reject }; | ||
}); | ||
} | ||
async isConnected() { | ||
@@ -339,8 +324,2 @@ await this.w3mFrame.frameLoadPromise; | ||
} | ||
onGetSocialRedirectUriSuccess(event) { | ||
this.getSocialRedirectUriResolver?.resolve(event.payload); | ||
} | ||
onGetSocialRedirectUriError(event) { | ||
this.getSocialRedirectUriResolver?.reject(event.payload.message); | ||
} | ||
onConnectSuccess(event) { | ||
@@ -347,0 +326,0 @@ this.setEmailLoginSuccess(event.payload.email); |
@@ -30,6 +30,6 @@ import { z } from 'zod'; | ||
export const AppConnectOtpRequest = z.object({ otp: z.string() }); | ||
export const AppGetSocialRedirectUriRequest = z.object({ | ||
provider: z.enum(['google', 'apple', 'facebook', 'x', 'github', 'discord', 'twitch', 'telegram']) | ||
export const AppGetUserRequest = z.object({ | ||
chainId: z.optional(z.number()), | ||
preferredAccountType: z.optional(z.string()) | ||
}); | ||
export const AppGetUserRequest = z.object({ chainId: z.optional(z.number()) }); | ||
export const AppUpdateEmailRequest = z.object({ email: z.string().email() }); | ||
@@ -61,3 +61,4 @@ export const AppUpdateEmailPrimaryOtpRequest = z.object({ otp: z.string() }); | ||
address: z.string(), | ||
chainId: z.number() | ||
chainId: z.number(), | ||
smartAccountDeployed: z.optional(z.boolean()) | ||
}); | ||
@@ -75,4 +76,3 @@ export const FrameIsConnectedResponse = z.object({ isConnected: z.boolean() }); | ||
}); | ||
export const FrameSetPreferredAccountResponse = z.object({ type: z.string() }); | ||
export const FrameGetSocialRedirectUriResponse = z.object({ uri: z.string() }); | ||
export const FrameSetPreferredAccountResponse = z.object({ type: z.string(), address: z.string() }); | ||
export const RpcResponse = z.any(); | ||
@@ -229,6 +229,2 @@ export const RpcEthAccountsRequest = z.object({ | ||
.or(z.object({ type: zType('APP_CONNECT_OTP'), payload: AppConnectOtpRequest })) | ||
.or(z.object({ | ||
type: zType('APP_GET_SOCIAL_REDIRECT_URI'), | ||
payload: AppGetSocialRedirectUriRequest | ||
})) | ||
.or(z.object({ type: zType('APP_GET_USER'), payload: z.optional(AppGetUserRequest) })) | ||
@@ -302,7 +298,2 @@ .or(z.object({ type: zType('APP_SIGN_OUT') })) | ||
.or(z.object({ type: zType('FRAME_CONNECT_DEVICE_SUCCESS') })) | ||
.or(z.object({ type: zType('FRAME_GET_SOCIAL_REDIRECT_URI_ERROR'), payload: zError })) | ||
.or(z.object({ | ||
type: zType('FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS'), | ||
payload: FrameGetSocialRedirectUriResponse | ||
})) | ||
.or(z.object({ type: zType('FRAME_GET_USER_ERROR'), payload: zError })) | ||
@@ -309,0 +300,0 @@ .or(z.object({ type: zType('FRAME_GET_USER_SUCCESS'), payload: FrameGetUserResponse })) |
import { z } from 'zod'; | ||
import { W3mFrameSchema, AppConnectEmailRequest, AppConnectOtpRequest, AppSwitchNetworkRequest, FrameConnectEmailResponse, FrameGetChainIdResponse, FrameGetUserResponse, FrameIsConnectedResponse, RpcPersonalSignRequest, RpcResponse, RpcEthSendTransactionRequest, RpcEthSignTypedDataV4, RpcEthAccountsRequest, RpcEthEstimateGas, RpcEthGasPrice, RpcEthBlockNumber, RpcEthGetTransactionByHash, RpcEthGetBlockByNumber, RpcEthCall, RpcEthFeeHistory, RpcEthGetAccount, RpcEthGetBalance, RpcEthGetBlockyByHash, RpcUnistallFilter, RpcEthSyncing, RpcEthSendRawTransaction, RpcEthNewPendingTransactionFilter, RpcEthNewFilter, RpcEthNewBlockFilter, RpcEthMaxPriorityFeePerGas, RpcEthGetUncleCountByBlockNumber, RpcEthGetUncleCountByBlockHash, RpcEthGetTransactionReceipt, RpcEthGetTransactionCount, RpcEthGetTransactionByBlockNumberAndIndex, RpcEthGetTransactionByBlockHashAndIndex, RpcEthGetStorageAt, RpcEthGetProof, RpcEthGetLogs, RpcEthGetFilterLogs, RpcEthGetFilter, RpcEthGetCode, RcpEthGetBlockTransactionCountByNumber, RcpEthGetBlockTransactionCountByHash, RpcEthGetBlockReceipts, FrameSession, AppGetUserRequest, AppUpdateEmailRequest, FrameUpdateEmailSecondaryOtpResolver, AppUpdateEmailPrimaryOtpRequest, AppUpdateEmailSecondaryOtpRequest, AppSyncThemeRequest, RpcEthChainId, FrameSwitchNetworkResponse, AppSyncDappDataRequest, FrameGetSmartAccountEnabledNetworksResponse, FrameInitSmartAccountResponse, AppGetSocialRedirectUriRequest, FrameGetSocialRedirectUriResponse } from './W3mFrameSchema.js'; | ||
import { W3mFrameSchema, AppConnectEmailRequest, AppConnectOtpRequest, AppSwitchNetworkRequest, FrameConnectEmailResponse, FrameGetChainIdResponse, FrameGetUserResponse, FrameIsConnectedResponse, RpcPersonalSignRequest, RpcResponse, RpcEthSendTransactionRequest, RpcEthSignTypedDataV4, RpcEthAccountsRequest, RpcEthEstimateGas, RpcEthGasPrice, RpcEthBlockNumber, RpcEthGetTransactionByHash, RpcEthGetBlockByNumber, RpcEthCall, RpcEthFeeHistory, RpcEthGetAccount, RpcEthGetBalance, RpcEthGetBlockyByHash, RpcUnistallFilter, RpcEthSyncing, RpcEthSendRawTransaction, RpcEthNewPendingTransactionFilter, RpcEthNewFilter, RpcEthNewBlockFilter, RpcEthMaxPriorityFeePerGas, RpcEthGetUncleCountByBlockNumber, RpcEthGetUncleCountByBlockHash, RpcEthGetTransactionReceipt, RpcEthGetTransactionCount, RpcEthGetTransactionByBlockNumberAndIndex, RpcEthGetTransactionByBlockHashAndIndex, RpcEthGetStorageAt, RpcEthGetProof, RpcEthGetLogs, RpcEthGetFilterLogs, RpcEthGetFilter, RpcEthGetCode, RcpEthGetBlockTransactionCountByNumber, RcpEthGetBlockTransactionCountByHash, RpcEthGetBlockReceipts, FrameSession, AppGetUserRequest, AppUpdateEmailRequest, FrameUpdateEmailSecondaryOtpResolver, AppUpdateEmailPrimaryOtpRequest, AppUpdateEmailSecondaryOtpRequest, AppSyncThemeRequest, RpcEthChainId, FrameSwitchNetworkResponse, AppSyncDappDataRequest, FrameGetSmartAccountEnabledNetworksResponse, FrameInitSmartAccountResponse } from './W3mFrameSchema.js'; | ||
//# sourceMappingURL=W3mFrameTypes.js.map |
export declare const W3mFrameConstants: { | ||
readonly SECURE_SITE_SDK: "http://localhost:3010/sdk"; | ||
readonly SECURE_SITE_SDK: string; | ||
readonly APP_EVENT_KEY: "@w3m-app/"; | ||
@@ -17,3 +17,2 @@ readonly FRAME_EVENT_KEY: "@w3m-frame/"; | ||
readonly APP_CONNECT_OTP: "@w3m-app/CONNECT_OTP"; | ||
readonly APP_GET_SOCIAL_REDIRECT_URI: "@w3m-app/GET_SOCIAL_REDIRECT_URI"; | ||
readonly APP_GET_USER: "@w3m-app/GET_USER"; | ||
@@ -41,4 +40,2 @@ readonly APP_SIGN_OUT: "@w3m-app/SIGN_OUT"; | ||
readonly FRAME_CONNECT_OTP_ERROR: "@w3m-frame/CONNECT_OTP_ERROR"; | ||
readonly FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS: "@w3m-frame/GET_SOCIAL_REDIRECT_URI_SUCCESS"; | ||
readonly FRAME_GET_SOCIAL_REDIRECT_URI_ERROR: "@w3m-frame/GET_SOCIAL_REDIRECT_URI_ERROR"; | ||
readonly FRAME_GET_USER_SUCCESS: "@w3m-frame/GET_USER_SUCCESS"; | ||
@@ -45,0 +42,0 @@ readonly FRAME_GET_USER_ERROR: "@w3m-frame/GET_USER_ERROR"; |
@@ -7,3 +7,2 @@ import type { W3mFrameTypes } from './W3mFrameTypes.js'; | ||
private connectOtpResolver; | ||
private getSocialRedirectUriResolver; | ||
private connectResolver; | ||
@@ -32,5 +31,2 @@ private disconnectResolver; | ||
connectOtp(payload: W3mFrameTypes.Requests['AppConnectOtpRequest']): Promise<unknown>; | ||
getSocialRedirectUri(payload: W3mFrameTypes.Requests['AppGetSocialRedirectUriRequest']): Promise<{ | ||
uri: string; | ||
}>; | ||
isConnected(): Promise<{ | ||
@@ -61,2 +57,3 @@ isConnected: boolean; | ||
address: string; | ||
smartAccountDeployed?: boolean | undefined; | ||
}>; | ||
@@ -79,4 +76,2 @@ switchNetwork(chainId: number): Promise<{ | ||
private onConnectOtpError; | ||
private onGetSocialRedirectUriSuccess; | ||
private onGetSocialRedirectUriError; | ||
private onConnectSuccess; | ||
@@ -83,0 +78,0 @@ private onConnectError; |
import { z } from 'zod'; | ||
import { W3mFrameSchema, AppConnectEmailRequest, AppConnectOtpRequest, AppSwitchNetworkRequest, FrameConnectEmailResponse, FrameGetChainIdResponse, FrameGetUserResponse, FrameIsConnectedResponse, RpcPersonalSignRequest, RpcResponse, RpcEthSendTransactionRequest, RpcEthSignTypedDataV4, RpcEthAccountsRequest, RpcEthEstimateGas, RpcEthGasPrice, RpcEthBlockNumber, RpcEthGetTransactionByHash, RpcEthGetBlockByNumber, RpcEthCall, RpcEthFeeHistory, RpcEthGetAccount, RpcEthGetBalance, RpcEthGetBlockyByHash, RpcUnistallFilter, RpcEthSyncing, RpcEthSendRawTransaction, RpcEthNewPendingTransactionFilter, RpcEthNewFilter, RpcEthNewBlockFilter, RpcEthMaxPriorityFeePerGas, RpcEthGetUncleCountByBlockNumber, RpcEthGetUncleCountByBlockHash, RpcEthGetTransactionReceipt, RpcEthGetTransactionCount, RpcEthGetTransactionByBlockNumberAndIndex, RpcEthGetTransactionByBlockHashAndIndex, RpcEthGetStorageAt, RpcEthGetProof, RpcEthGetLogs, RpcEthGetFilterLogs, RpcEthGetFilter, RpcEthGetCode, RcpEthGetBlockTransactionCountByNumber, RcpEthGetBlockTransactionCountByHash, RpcEthGetBlockReceipts, FrameSession, AppGetUserRequest, AppUpdateEmailRequest, FrameUpdateEmailSecondaryOtpResolver, AppUpdateEmailPrimaryOtpRequest, AppUpdateEmailSecondaryOtpRequest, AppSyncThemeRequest, RpcEthChainId, FrameSwitchNetworkResponse, AppSyncDappDataRequest, FrameGetSmartAccountEnabledNetworksResponse, FrameInitSmartAccountResponse, AppGetSocialRedirectUriRequest, FrameGetSocialRedirectUriResponse } from './W3mFrameSchema.js'; | ||
import { W3mFrameSchema, AppConnectEmailRequest, AppConnectOtpRequest, AppSwitchNetworkRequest, FrameConnectEmailResponse, FrameGetChainIdResponse, FrameGetUserResponse, FrameIsConnectedResponse, RpcPersonalSignRequest, RpcResponse, RpcEthSendTransactionRequest, RpcEthSignTypedDataV4, RpcEthAccountsRequest, RpcEthEstimateGas, RpcEthGasPrice, RpcEthBlockNumber, RpcEthGetTransactionByHash, RpcEthGetBlockByNumber, RpcEthCall, RpcEthFeeHistory, RpcEthGetAccount, RpcEthGetBalance, RpcEthGetBlockyByHash, RpcUnistallFilter, RpcEthSyncing, RpcEthSendRawTransaction, RpcEthNewPendingTransactionFilter, RpcEthNewFilter, RpcEthNewBlockFilter, RpcEthMaxPriorityFeePerGas, RpcEthGetUncleCountByBlockNumber, RpcEthGetUncleCountByBlockHash, RpcEthGetTransactionReceipt, RpcEthGetTransactionCount, RpcEthGetTransactionByBlockNumberAndIndex, RpcEthGetTransactionByBlockHashAndIndex, RpcEthGetStorageAt, RpcEthGetProof, RpcEthGetLogs, RpcEthGetFilterLogs, RpcEthGetFilter, RpcEthGetCode, RcpEthGetBlockTransactionCountByNumber, RcpEthGetBlockTransactionCountByHash, RpcEthGetBlockReceipts, FrameSession, AppGetUserRequest, AppUpdateEmailRequest, FrameUpdateEmailSecondaryOtpResolver, AppUpdateEmailPrimaryOtpRequest, AppUpdateEmailSecondaryOtpRequest, AppSyncThemeRequest, RpcEthChainId, FrameSwitchNetworkResponse, AppSyncDappDataRequest, FrameGetSmartAccountEnabledNetworksResponse, FrameInitSmartAccountResponse } from './W3mFrameSchema.js'; | ||
export declare namespace W3mFrameTypes { | ||
@@ -9,3 +9,2 @@ type AppEvent = z.infer<typeof W3mFrameSchema.appEvent>; | ||
AppConnectOtpRequest: z.infer<typeof AppConnectOtpRequest>; | ||
AppGetSocialRedirectUriRequest: z.infer<typeof AppGetSocialRedirectUriRequest>; | ||
AppSwitchNetworkRequest: z.infer<typeof AppSwitchNetworkRequest>; | ||
@@ -28,3 +27,2 @@ AppGetUserRequest: z.infer<typeof AppGetUserRequest>; | ||
FrameInitSmartAccountResponse: z.infer<typeof FrameInitSmartAccountResponse>; | ||
FrameGetSocialRedirectUriResponse: z.infer<typeof FrameGetSocialRedirectUriResponse>; | ||
} | ||
@@ -38,3 +36,2 @@ interface Network { | ||
type FrameSessionType = z.infer<typeof FrameSession>; | ||
type SocialProvider = 'google' | 'apple' | 'facebook' | 'x' | 'github' | 'discord' | 'twitch' | 'telegram'; | ||
} |
{ | ||
"name": "@web3modal/wallet", | ||
"version": "4.1.3-xafeai01.0", | ||
"version": "4.1.3", | ||
"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 too big to display
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
175224
3395