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 4.2.0 to 4.2.1-social-login-alpha.0

6

dist/esm/src/W3mFrameConstants.js

@@ -19,2 +19,4 @@ export const SECURE_SITE_SDK = process.env['NEXT_PUBLIC_SECURE_SITE_SDK_URL'] || 'https://secure.walletconnect.com/sdk';

APP_CONNECT_OTP: '@w3m-app/CONNECT_OTP',
APP_CONNECT_SOCIAL: '@w3m-app/CONNECT_SOCIAL',
APP_GET_SOCIAL_REDIRECT_URI: '@w3m-app/GET_SOCIAL_REDIRECT_URI',
APP_GET_USER: '@w3m-app/GET_USER',

@@ -42,2 +44,6 @@ 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_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',

@@ -44,0 +50,0 @@ FRAME_GET_USER_ERROR: '@w3m-frame/GET_USER_ERROR',

@@ -11,5 +11,7 @@ import { W3mFrame } from './W3mFrame.js';

this.connectResolver = undefined;
this.connectSocialResolver = undefined;
this.disconnectResolver = undefined;
this.isConnectedResolver = undefined;
this.getChainIdResolver = undefined;
this.getSocialRedirectUriResolver = undefined;
this.switchChainResolver = undefined;

@@ -40,2 +42,10 @@ this.rpcRequestResolver = undefined;

return this.onConnectOtpError(event);
case W3mFrameConstants.FRAME_CONNECT_SOCIAL_SUCCESS:
return this.onConnectSocialSuccess(event);
case W3mFrameConstants.FRAME_CONNECT_SOCIAL_ERROR:
return this.onConnectSocialError(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:

@@ -148,2 +158,12 @@ 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 updateEmail(payload) {

@@ -221,2 +241,11 @@ await this.w3mFrame.frameLoadPromise;

}
async connectSocial(uri) {
this.w3mFrame.events.postAppEvent({
type: W3mFrameConstants.APP_CONNECT_SOCIAL,
payload: { uri }
});
return new Promise((resolve, reject) => {
this.connectSocialResolver = { resolve, reject };
});
}
async switchNetwork(chainId) {

@@ -331,2 +360,8 @@ await this.w3mFrame.frameLoadPromise;

}
onConnectSocialSuccess(event) {
this.connectSocialResolver?.resolve(event.payload);
}
onConnectSocialError(event) {
this.connectSocialResolver?.reject(event.payload.message);
}
onIsConnectedSuccess(event) {

@@ -348,2 +383,8 @@ if (!event.payload.isConnected) {

}
onGetSocialRedirectUriSuccess(event) {
this.getSocialRedirectUriResolver?.resolve(event.payload);
}
onGetSocialRedirectUriError(event) {
this.getSocialRedirectUriResolver?.reject(event.payload.message);
}
onSignOutSuccess() {

@@ -350,0 +391,0 @@ this.disconnectResolver?.resolve(undefined);

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

export const AppConnectOtpRequest = z.object({ otp: z.string() });
export const AppConnectSocialRequest = z.object({ uri: z.string() });
export const AppGetUserRequest = z.object({

@@ -35,2 +36,5 @@ chainId: z.optional(z.number()),

});
export const AppGetSocialRedirectUriRequest = z.object({
provider: z.enum(['google', 'github', 'apple', 'facebook', 'x', 'discord'])
});
export const AppUpdateEmailRequest = z.object({ email: z.string().email() });

@@ -60,2 +64,7 @@ export const AppUpdateEmailPrimaryOtpRequest = z.object({ otp: z.string() });

});
export const FrameConnectSocialResponse = z.object({
email: z.string(),
address: z.string(),
chainId: z.number()
});
export const FrameUpdateEmailResponse = z.object({

@@ -71,2 +80,3 @@ action: z.enum(['VERIFY_PRIMARY_OTP', 'VERIFY_SECONDARY_OTP'])

});
export const FrameGetSocialRedirectUriResponse = z.object({ uri: z.string() });
export const FrameIsConnectedResponse = z.object({ isConnected: z.boolean() });

@@ -235,3 +245,8 @@ export const FrameGetChainIdResponse = z.object({ chainId: z.number() });

.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) }))
.or(z.object({
type: zType('APP_GET_SOCIAL_REDIRECT_URI'),
payload: AppGetSocialRedirectUriRequest
}))
.or(z.object({ type: zType('APP_SIGN_OUT') }))

@@ -304,4 +319,17 @@ .or(z.object({ type: zType('APP_IS_CONNECTED'), payload: z.optional(FrameSession) }))

.or(z.object({ type: zType('FRAME_CONNECT_DEVICE_SUCCESS') }))
.or(z.object({
type: zType('FRAME_CONNECT_SOCIAL_SUCCESS'),
payload: FrameConnectSocialResponse
}))
.or(z.object({
type: zType('FRAME_CONNECT_SOCIAL_ERROR'),
payload: zError
}))
.or(z.object({ type: zType('FRAME_GET_USER_ERROR'), payload: zError }))
.or(z.object({ type: zType('FRAME_GET_USER_SUCCESS'), payload: FrameGetUserResponse }))
.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_SIGN_OUT_ERROR'), payload: zError }))

@@ -308,0 +336,0 @@ .or(z.object({ type: zType('FRAME_SIGN_OUT_SUCCESS') }))

2

dist/esm/src/W3mFrameTypes.js
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, FrameUpdateEmailResponse } 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, FrameUpdateEmailResponse, AppGetSocialRedirectUriRequest, FrameGetSocialRedirectUriResponse, FrameConnectSocialResponse } from './W3mFrameSchema.js';
//# sourceMappingURL=W3mFrameTypes.js.map

@@ -19,2 +19,4 @@ export declare const SECURE_SITE_SDK: string;

readonly APP_CONNECT_OTP: "@w3m-app/CONNECT_OTP";
readonly APP_CONNECT_SOCIAL: "@w3m-app/CONNECT_SOCIAL";
readonly APP_GET_SOCIAL_REDIRECT_URI: "@w3m-app/GET_SOCIAL_REDIRECT_URI";
readonly APP_GET_USER: "@w3m-app/GET_USER";

@@ -42,2 +44,6 @@ 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_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";

@@ -44,0 +50,0 @@ readonly FRAME_GET_USER_ERROR: "@w3m-frame/GET_USER_ERROR";

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

private connectResolver;
private connectSocialResolver;
private disconnectResolver;
private isConnectedResolver;
private getChainIdResolver;
private getSocialRedirectUriResolver;
private switchChainResolver;

@@ -36,2 +38,5 @@ private rpcRequestResolver;

}>;
getSocialRedirectUri(payload: W3mFrameTypes.Requests['AppGetSocialRedirectUriRequest']): Promise<{
uri: string;
}>;
updateEmail(payload: W3mFrameTypes.Requests['AppUpdateEmailRequest']): Promise<{

@@ -57,2 +62,9 @@ action: "VERIFY_PRIMARY_OTP" | "VERIFY_SECONDARY_OTP";

}>;
connectSocial(uri: string): Promise<{
chainId: number;
email: string;
address: string;
smartAccountDeployed?: boolean | undefined;
preferredAccountType?: string | undefined;
}>;
switchNetwork(chainId: number): Promise<{

@@ -80,2 +92,4 @@ chainId: number;

private onConnectError;
private onConnectSocialSuccess;
private onConnectSocialError;
private onIsConnectedSuccess;

@@ -85,2 +99,4 @@ private onIsConnectedError;

private onGetChainIdError;
private onGetSocialRedirectUriSuccess;
private onGetSocialRedirectUriError;
private onSignOutSuccess;

@@ -87,0 +103,0 @@ private onSignOutError;

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, FrameUpdateEmailResponse } 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, FrameUpdateEmailResponse, AppGetSocialRedirectUriRequest, FrameGetSocialRedirectUriResponse, FrameConnectSocialResponse } from './W3mFrameSchema.js';
import type { W3mFrameRpcConstants } from './W3mFrameConstants.js';

@@ -10,2 +10,3 @@ export declare namespace W3mFrameTypes {

AppConnectOtpRequest: z.infer<typeof AppConnectOtpRequest>;
AppGetSocialRedirectUriRequest: z.infer<typeof AppGetSocialRedirectUriRequest>;
AppSwitchNetworkRequest: z.infer<typeof AppSwitchNetworkRequest>;

@@ -28,2 +29,4 @@ AppGetUserRequest: z.infer<typeof AppGetUserRequest>;

FrameUpdateEmailResponse: z.infer<typeof FrameUpdateEmailResponse>;
FrameGetSocialRedirectUriResponse: z.infer<typeof FrameGetSocialRedirectUriResponse>;
FrameConnectSocialResponse: z.infer<typeof FrameConnectSocialResponse>;
}

@@ -38,2 +41,3 @@ interface Network {

type AccountType = (typeof W3mFrameRpcConstants.ACCOUNT_TYPES)[keyof typeof W3mFrameRpcConstants.ACCOUNT_TYPES];
type SocialProvider = 'google' | 'github' | 'apple' | 'facebook' | 'x' | 'discord';
}
{
"name": "@web3modal/wallet",
"version": "4.2.0",
"version": "4.2.1-social-login-alpha.0",
"type": "module",

@@ -20,3 +20,3 @@ "main": "./dist/esm/index.js",

"zod": "3.22.4",
"@web3modal/polyfills": "4.2.0"
"@web3modal/polyfills": "4.2.1-social-login-alpha.0"
},

@@ -23,0 +23,0 @@ "keywords": [

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

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