Socket
Socket
Sign inDemoInstall

@web3modal/wallet

Package Overview
Dependencies
Maintainers
10
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 5.0.6 to 5.0.7-cn-login-fc.0

6

dist/esm/src/W3mFrameConstants.js

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

APP_SET_PREFERRED_ACCOUNT: '@w3m-app/SET_PREFERRED_ACCOUNT',
APP_CONNECT_FARCASTER: '@w3m-app/CONNECT_FARCASTER',
APP_GET_FARCASTER_URI: '@w3m-app/GET_FARCASTER_URI',
FRAME_SWITCH_NETWORK_ERROR: '@w3m-frame/SWITCH_NETWORK_ERROR',

@@ -49,2 +51,6 @@ FRAME_SWITCH_NETWORK_SUCCESS: '@w3m-frame/SWITCH_NETWORK_SUCCESS',

FRAME_CONNECT_SOCIAL_ERROR: '@w3m-frame/CONNECT_SOCIAL_ERROR',
FRAME_CONNECT_FARCASTER_SUCCESS: '@w3m-frame/CONNECT_FARCASTER_SUCCESS',
FRAME_CONNECT_FARCASTER_ERROR: '@w3m-frame/CONNECT_FARCASTER_ERROR',
FRAME_GET_FARCASTER_URI_SUCCESS: '@w3m-frame/GET_FARCASTER_URI_SUCCESS',
FRAME_GET_FARCASTER_URI_ERROR: '@w3m-frame/GET_FARCASTER_URI_ERROR',
FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS: '@w3m-frame/GET_SOCIAL_REDIRECT_URI_SUCCESS',

@@ -51,0 +57,0 @@ FRAME_GET_SOCIAL_REDIRECT_URI_ERROR: '@w3m-frame/GET_SOCIAL_REDIRECT_URI_ERROR',

53

dist/esm/src/W3mFrameProvider.js

@@ -13,2 +13,4 @@ import { W3mFrame } from './W3mFrame.js';

this.connectSocialResolver = undefined;
this.connectFarcasterResolver = undefined;
this.getFarcasterUriResolver = undefined;
this.disconnectResolver = undefined;

@@ -55,2 +57,10 @@ this.isConnectedResolver = undefined;

return this.onConnectEmailError(event);
case W3mFrameConstants.FRAME_CONNECT_FARCASTER_SUCCESS:
return this.onConnectFarcasterSuccess(event);
case W3mFrameConstants.FRAME_CONNECT_FARCASTER_ERROR:
return this.onConnectFarcasterError(event);
case W3mFrameConstants.FRAME_GET_FARCASTER_URI_SUCCESS:
return this.onGetFarcasterUriSuccess(event);
case W3mFrameConstants.FRAME_GET_FARCASTER_URI_ERROR:
return this.onGetFarcasterUriError(event);
case W3mFrameConstants.FRAME_CONNECT_DEVICE_SUCCESS:

@@ -258,3 +268,5 @@ return this.onConnectDeviceSuccess();

return new Promise((resolve, reject) => {
this.connectResolver = { resolve, reject };
if (!this.connectResolver) {
this.connectResolver = { resolve, reject };
}
});

@@ -271,2 +283,20 @@ }

}
async getFarcasterUri() {
await this.w3mFrame.frameLoadPromise;
this.w3mFrame.events.postAppEvent({
type: W3mFrameConstants.APP_GET_FARCASTER_URI
});
return new Promise((resolve, reject) => {
this.getFarcasterUriResolver = { resolve, reject };
});
}
async connectFarcaster() {
await this.w3mFrame.frameLoadPromise;
this.w3mFrame.events.postAppEvent({
type: W3mFrameConstants.APP_CONNECT_FARCASTER
});
return new Promise((resolve, reject) => {
this.connectFarcasterResolver = { resolve, reject };
});
}
async switchNetwork(chainId) {

@@ -361,2 +391,17 @@ await this.w3mFrame.frameLoadPromise;

}
onGetFarcasterUriSuccess(event) {
this.getFarcasterUriResolver?.resolve(event.payload);
}
onGetFarcasterUriError(event) {
this.getFarcasterUriResolver?.reject(event.payload.message);
}
onConnectFarcasterSuccess(event) {
if (event.payload.userName) {
this.setSocialLoginSuccess(event.payload.userName);
}
this.connectFarcasterResolver?.resolve(event.payload);
}
onConnectFarcasterError(event) {
this.connectFarcasterResolver?.reject(event.payload.message);
}
onConnectDeviceSuccess() {

@@ -378,5 +423,7 @@ this.connectDeviceResolver?.resolve(undefined);

this.connectResolver?.resolve(event.payload);
this.connectResolver = undefined;
}
onConnectError(event) {
this.connectResolver?.reject(event.payload.message);
this.connectResolver = undefined;
}

@@ -493,3 +540,5 @@ onConnectSocialSuccess(event) {

setEmailLoginSuccess(email) {
W3mFrameStorage.set(W3mFrameConstants.EMAIL, email);
if (email) {
W3mFrameStorage.set(W3mFrameConstants.EMAIL, email);
}
W3mFrameStorage.set(W3mFrameConstants.EMAIL_LOGIN_USED_KEY, 'true');

@@ -496,0 +545,0 @@ W3mFrameStorage.delete(W3mFrameConstants.LAST_EMAIL_LOGIN_TIME);

import { z } from 'zod';
import { W3mFrameConstants } from './W3mFrameConstants.js';
import { W3mFrameConstants, W3mFrameRpcConstants } from './W3mFrameConstants.js';
const zError = z.object({ message: z.string() });

@@ -62,2 +62,8 @@ function zType(key) {

});
export const FrameGetFarcasterUriResponse = z.object({
url: z.string()
});
export const FrameConnectFarcasterResponse = z.object({
userName: z.string()
});
export const FrameConnectSocialResponse = z.object({

@@ -67,2 +73,11 @@ email: z.string(),

chainId: z.number(),
accounts: z
.array(z.object({
address: z.string(),
type: z.enum([
W3mFrameRpcConstants.ACCOUNT_TYPES.EOA,
W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT
])
}))
.optional(),
userName: z.string().optional()

@@ -74,6 +89,15 @@ });

export const FrameGetUserResponse = z.object({
email: z.string().email(),
email: z.string().email().optional().nullable(),
address: z.string(),
chainId: z.number(),
smartAccountDeployed: z.optional(z.boolean()),
accounts: z
.array(z.object({
address: z.string(),
type: z.enum([
W3mFrameRpcConstants.ACCOUNT_TYPES.EOA,
W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT
])
}))
.optional(),
preferredAccountType: z.optional(z.string())

@@ -246,2 +270,4 @@ });

.or(z.object({ type: zType('APP_CONNECT_SOCIAL'), payload: AppConnectSocialRequest }))
.or(z.object({ type: zType('APP_GET_FARCASTER_URI') }))
.or(z.object({ type: zType('APP_CONNECT_FARCASTER') }))
.or(z.object({ type: zType('APP_GET_USER'), payload: z.optional(AppGetUserRequest) }))

@@ -314,2 +340,12 @@ .or(z.object({

.or(z.object({ type: zType('FRAME_CONNECT_EMAIL_ERROR'), payload: zError }))
.or(z.object({
type: zType('FRAME_GET_FARCASTER_URI_SUCCESS'),
payload: FrameGetFarcasterUriResponse
}))
.or(z.object({ type: zType('FRAME_GET_FARCASTER_URI_ERROR'), payload: zError }))
.or(z.object({
type: zType('FRAME_CONNECT_FARCASTER_SUCCESS'),
payload: FrameConnectFarcasterResponse
}))
.or(z.object({ type: zType('FRAME_CONNECT_FARCASTER_ERROR'), payload: zError }))
.or(z.object({ type: zType('FRAME_CONNECT_EMAIL_SUCCESS'), payload: FrameConnectEmailResponse }))

@@ -316,0 +352,0 @@ .or(z.object({ type: zType('FRAME_CONNECT_OTP_ERROR'), payload: zError }))

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

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

readonly APP_SET_PREFERRED_ACCOUNT: "@w3m-app/SET_PREFERRED_ACCOUNT";
readonly APP_CONNECT_FARCASTER: "@w3m-app/CONNECT_FARCASTER";
readonly APP_GET_FARCASTER_URI: "@w3m-app/GET_FARCASTER_URI";
readonly FRAME_SWITCH_NETWORK_ERROR: "@w3m-frame/SWITCH_NETWORK_ERROR";

@@ -49,2 +51,6 @@ readonly FRAME_SWITCH_NETWORK_SUCCESS: "@w3m-frame/SWITCH_NETWORK_SUCCESS";

readonly FRAME_CONNECT_SOCIAL_ERROR: "@w3m-frame/CONNECT_SOCIAL_ERROR";
readonly FRAME_CONNECT_FARCASTER_SUCCESS: "@w3m-frame/CONNECT_FARCASTER_SUCCESS";
readonly FRAME_CONNECT_FARCASTER_ERROR: "@w3m-frame/CONNECT_FARCASTER_ERROR";
readonly FRAME_GET_FARCASTER_URI_SUCCESS: "@w3m-frame/GET_FARCASTER_URI_SUCCESS";
readonly FRAME_GET_FARCASTER_URI_ERROR: "@w3m-frame/GET_FARCASTER_URI_ERROR";
readonly FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS: "@w3m-frame/GET_SOCIAL_REDIRECT_URI_SUCCESS";

@@ -51,0 +57,0 @@ readonly FRAME_GET_SOCIAL_REDIRECT_URI_ERROR: "@w3m-frame/GET_SOCIAL_REDIRECT_URI_ERROR";

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

private connectSocialResolver;
private connectFarcasterResolver;
private getFarcasterUriResolver;
private disconnectResolver;

@@ -59,5 +61,9 @@ private isConnectedResolver;

chainId: number;
email: string;
address: string;
email?: string | null | undefined;
smartAccountDeployed?: boolean | undefined;
accounts?: {
type: "eoa" | "smartAccount";
address: string;
}[] | undefined;
preferredAccountType?: string | undefined;

@@ -67,7 +73,15 @@ }>;

chainId: number;
email: string;
address: string;
email?: string | null | undefined;
smartAccountDeployed?: boolean | undefined;
accounts?: {
type: "eoa" | "smartAccount";
address: string;
}[] | undefined;
preferredAccountType?: string | undefined;
}>;
getFarcasterUri(): Promise<{
url: string;
}>;
connectFarcaster(): Promise<unknown>;
switchNetwork(chainId: number): Promise<{

@@ -89,2 +103,6 @@ chainId: number;

private onConnectEmailError;
private onGetFarcasterUriSuccess;
private onGetFarcasterUriError;
private onConnectFarcasterSuccess;
private onConnectFarcasterError;
private onConnectDeviceSuccess;

@@ -91,0 +109,0 @@ private onConnectDeviceError;

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

@@ -30,2 +30,4 @@ export declare namespace W3mFrameTypes {

FrameConnectSocialResponse: z.infer<typeof FrameConnectSocialResponse>;
FrameGetFarcasterUriResponse: z.infer<typeof FrameGetFarcasterUriResponse>;
FrameConnectFarcasterResponse: z.infer<typeof FrameConnectFarcasterResponse>;
}

@@ -32,0 +34,0 @@ interface Network {

{
"name": "@web3modal/wallet",
"version": "5.0.6",
"version": "5.0.7-cn-login-fc.0",
"type": "module",

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

"@walletconnect/logger": "2.1.2",
"@web3modal/polyfills": "5.0.6",
"@web3modal/polyfills": "5.0.7-cn-login-fc.0",
"zod": "3.22.4"

@@ -23,0 +23,0 @@ },

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