@web3modal/wallet
Advanced tools
Comparing version 4.1.1 to 4.1.2-05d9e29.0
@@ -17,2 +17,3 @@ export const W3mFrameConstants = { | ||
APP_CONNECT_OTP: '@w3m-app/CONNECT_OTP', | ||
APP_CONNECT_SOCIAL: '@w3m-app/CONNECT_SOCIAL', | ||
APP_GET_USER: '@w3m-app/GET_USER', | ||
@@ -40,2 +41,4 @@ APP_SIGN_OUT: '@w3m-app/SIGN_OUT', | ||
FRAME_CONNECT_OTP_ERROR: '@w3m-frame/CONNECT_OTP_ERROR', | ||
FRAME_CONNECT_SOCIAL_SUCCESS: '@w3m-frame/CONNECT_SOCIAL_SUCCESS', | ||
FRAME_CONNECT_SOCIAL_ERROR: '@w3m-frame/CONNECT_SOCIAL_ERROR', | ||
FRAME_GET_USER_SUCCESS: '@w3m-frame/GET_USER_SUCCESS', | ||
@@ -42,0 +45,0 @@ FRAME_GET_USER_ERROR: '@w3m-frame/GET_USER_ERROR', |
@@ -10,2 +10,3 @@ import { W3mFrame } from './W3mFrame.js'; | ||
this.connectOtpResolver = undefined; | ||
this.connectSocialResolver = undefined; | ||
this.connectResolver = undefined; | ||
@@ -41,2 +42,6 @@ this.disconnectResolver = undefined; | ||
return this.onConnectOtpError(event); | ||
case W3mFrameConstants.FRAME_CONNECT_SOCIAL_SUCCESS: | ||
return this.onConnectSocialSuccess(); | ||
case W3mFrameConstants.FRAME_CONNECT_SOCIAL_ERROR: | ||
return this.onConnectSocialError(event); | ||
case W3mFrameConstants.FRAME_GET_USER_SUCCESS: | ||
@@ -136,2 +141,9 @@ return this.onConnectSuccess(event); | ||
} | ||
async connectSocial(payload) { | ||
await this.w3mFrame.frameLoadPromise; | ||
this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_CONNECT_SOCIAL, payload }); | ||
return new Promise((resolve, reject) => { | ||
this.connectSocialResolver = { resolve, reject }; | ||
}); | ||
} | ||
async isConnected() { | ||
@@ -324,2 +336,8 @@ await this.w3mFrame.frameLoadPromise; | ||
} | ||
onConnectSocialSuccess() { | ||
this.connectSocialResolver?.resolve(undefined); | ||
} | ||
onConnectSocialError(event) { | ||
this.connectSocialResolver?.reject(event.payload.message); | ||
} | ||
onConnectSuccess(event) { | ||
@@ -326,0 +344,0 @@ this.setEmailLoginSuccess(event.payload.email); |
@@ -30,2 +30,5 @@ import { z } from 'zod'; | ||
export const AppConnectOtpRequest = z.object({ otp: z.string() }); | ||
export const AppConnectSocialRequest = z.object({ | ||
provider: z.enum(['google', 'apple', 'facebook', 'x', 'github', 'discord', 'twitch', 'telegram']) | ||
}); | ||
export const AppGetUserRequest = z.object({ chainId: z.optional(z.number()) }); | ||
@@ -223,2 +226,3 @@ export const AppUpdateEmailRequest = z.object({ email: z.string().email() }); | ||
.or(z.object({ type: zType('APP_CONNECT_OTP'), payload: AppConnectOtpRequest })) | ||
.or(z.object({ type: zType('APP_CONNECT_SOCIAL'), payload: AppConnectSocialRequest })) | ||
.or(z.object({ type: zType('APP_GET_USER'), payload: z.optional(AppGetUserRequest) })) | ||
@@ -292,2 +296,4 @@ .or(z.object({ type: zType('APP_SIGN_OUT') })) | ||
.or(z.object({ type: zType('FRAME_CONNECT_DEVICE_SUCCESS') })) | ||
.or(z.object({ type: zType('FRAME_CONNECT_SOCIAL_ERROR'), payload: zError })) | ||
.or(z.object({ type: zType('FRAME_CONNECT_SOCIAL_SUCCESS') })) | ||
.or(z.object({ type: zType('FRAME_GET_USER_ERROR'), payload: zError })) | ||
@@ -294,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 } 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, AppConnectSocialRequest } from './W3mFrameSchema.js'; | ||
//# sourceMappingURL=W3mFrameTypes.js.map |
@@ -17,2 +17,3 @@ export declare const W3mFrameConstants: { | ||
readonly APP_CONNECT_OTP: "@w3m-app/CONNECT_OTP"; | ||
readonly APP_CONNECT_SOCIAL: "@w3m-app/CONNECT_SOCIAL"; | ||
readonly APP_GET_USER: "@w3m-app/GET_USER"; | ||
@@ -40,2 +41,4 @@ readonly APP_SIGN_OUT: "@w3m-app/SIGN_OUT"; | ||
readonly FRAME_CONNECT_OTP_ERROR: "@w3m-frame/CONNECT_OTP_ERROR"; | ||
readonly FRAME_CONNECT_SOCIAL_SUCCESS: "@w3m-frame/CONNECT_SOCIAL_SUCCESS"; | ||
readonly FRAME_CONNECT_SOCIAL_ERROR: "@w3m-frame/CONNECT_SOCIAL_ERROR"; | ||
readonly FRAME_GET_USER_SUCCESS: "@w3m-frame/GET_USER_SUCCESS"; | ||
@@ -42,0 +45,0 @@ readonly FRAME_GET_USER_ERROR: "@w3m-frame/GET_USER_ERROR"; |
@@ -7,2 +7,3 @@ import type { W3mFrameTypes } from './W3mFrameTypes.js'; | ||
private connectOtpResolver; | ||
private connectSocialResolver; | ||
private connectResolver; | ||
@@ -31,2 +32,3 @@ private disconnectResolver; | ||
connectOtp(payload: W3mFrameTypes.Requests['AppConnectOtpRequest']): Promise<unknown>; | ||
connectSocial(payload: W3mFrameTypes.Requests['AppConnectSocialRequest']): Promise<unknown>; | ||
isConnected(): Promise<{ | ||
@@ -74,2 +76,4 @@ isConnected: boolean; | ||
private onConnectOtpError; | ||
private onConnectSocialSuccess; | ||
private onConnectSocialError; | ||
private onConnectSuccess; | ||
@@ -76,0 +80,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 } 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, AppConnectSocialRequest } from './W3mFrameSchema.js'; | ||
export declare namespace W3mFrameTypes { | ||
@@ -9,2 +9,3 @@ type AppEvent = z.infer<typeof W3mFrameSchema.appEvent>; | ||
AppConnectOtpRequest: z.infer<typeof AppConnectOtpRequest>; | ||
AppConnectSocialRequest: z.infer<typeof AppConnectSocialRequest>; | ||
AppSwitchNetworkRequest: z.infer<typeof AppSwitchNetworkRequest>; | ||
@@ -35,2 +36,3 @@ AppGetUserRequest: z.infer<typeof AppGetUserRequest>; | ||
type FrameSessionType = z.infer<typeof FrameSession>; | ||
type SocialProvider = 'google' | 'apple' | 'facebook' | 'x' | 'github' | 'discord' | 'twitch' | 'telegram'; | ||
} |
{ | ||
"name": "@web3modal/wallet", | ||
"version": "4.1.1", | ||
"version": "4.1.2-05d9e29.0", | ||
"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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
177944
3445
1