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.1.12-910a844.0 to 4.1.12-cn-sl-13.1

2

dist/esm/src/RegexUtil.js
export const RegexUtil = {
address: /^0x(?:[A-Fa-f0-9]{40})$/u,
transactionHash: /^0x(?:[A-Fa-f0-9]{64})$/u,
signedMessage: /^0x(?:[a-fA-F0-9]{6,})$/u
signedMessage: /^0x(?:[a-fA-F0-9]{62,})$/u
};
//# sourceMappingURL=RegexUtil.js.map

@@ -62,2 +62,3 @@ import { SECURE_SITE_SDK, W3mFrameConstants } from './W3mFrameConstants.js';

iframe.id = 'w3m-iframe';
iframe.name = 'w3mFrame';
iframe.src = `${SECURE_SITE_SDK}?projectId=${projectId}`;

@@ -67,4 +68,2 @@ iframe.style.position = 'fixed';

iframe.style.display = 'none';
iframe.style.borderBottomLeftRadius = `clamp(0px, var(--wui-border-radius-l), 44px)`;
iframe.style.borderBottomRightRadius = `clamp(0px, var(--wui-border-radius-l), 44px)`;
iframe.style.opacity = '0';

@@ -71,0 +70,0 @@ iframe.style.borderBottomLeftRadius = `clamp(0px, var(--wui-border-radius-l), 44px)`;

@@ -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,4 @@ 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',

@@ -70,2 +74,4 @@ FRAME_GET_USER_ERROR: '@w3m-frame/GET_USER_ERROR',

FRAME_SET_PREFERRED_ACCOUNT_ERROR: '@w3m-frame/SET_PREFERRED_ACCOUNT_ERROR',
FRAME_CONNECT_SOCIAL_SUCCESS: '@w3m-frame/CONNECT_SOCIAL_SUCCESS',
FRAME_CONNECT_SOCIAL_ERROR: '@w3m-frame/CONNECT_SOCIAL_ERROR',
RPC_RESPONSE_TYPE_ERROR: 'RPC_RESPONSE_ERROR',

@@ -72,0 +78,0 @@ RPC_RESPONSE_TYPE_TX: 'RPC_RESPONSE_TRANSACTION_HASH',

@@ -10,3 +10,5 @@ import { W3mFrame } from './W3mFrame.js';

this.connectOtpResolver = undefined;
this.getSocialRedirectUriResolver = undefined;
this.connectResolver = undefined;
this.connectSocialResolver = undefined;
this.disconnectResolver = undefined;

@@ -40,2 +42,6 @@ this.isConnectedResolver = 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:

@@ -95,2 +101,6 @@ return this.onConnectSuccess(event);

return this.onSetPreferredAccountError();
case W3mFrameConstants.FRAME_CONNECT_SOCIAL_SUCCESS:
return this.onConnectSocialSuccess(event);
case W3mFrameConstants.FRAME_CONNECT_SOCIAL_ERROR:
return this.onConnectSocialError(event);
default:

@@ -132,2 +142,12 @@ return null;

}
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() {

@@ -222,2 +242,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) {

@@ -324,2 +353,14 @@ await this.w3mFrame.frameLoadPromise;

}
onGetSocialRedirectUriSuccess(event) {
this.getSocialRedirectUriResolver?.resolve(event.payload);
}
onGetSocialRedirectUriError(event) {
this.getSocialRedirectUriResolver?.reject(event.payload.message);
}
onConnectSocialSuccess(event) {
this.connectSocialResolver?.resolve(event.payload);
}
onConnectSocialError(event) {
this.connectSocialResolver?.reject(event.payload.message);
}
onConnectSuccess(event) {

@@ -326,0 +367,0 @@ this.setEmailLoginSuccess(event.payload.email);

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

export const AppConnectOtpRequest = z.object({ otp: z.string() });
export const AppGetSocialRedirectUriRequest = z.object({
provider: z.enum([
'google',
'github',
'apple',
'facebook',
'linkedin',
'twitter',
'discord',
'twitch'
])
});
export const AppGetUserRequest = z.object({

@@ -56,2 +68,3 @@ chainId: z.optional(z.number()),

export const AppSetPreferredAccountRequest = z.object({ type: z.string() });
export const AppConnectSocialRequest = z.object({ uri: z.string() });
export const FrameConnectEmailResponse = z.object({

@@ -82,2 +95,8 @@ action: z.enum(['VERIFY_DEVICE', 'VERIFY_OTP'])

export const FrameSetPreferredAccountResponse = z.object({ type: z.string(), address: z.string() });
export const FrameGetSocialRedirectUriResponse = z.object({ uri: z.string() });
export const FrameConnectSocialResponse = z.object({
email: z.string(),
address: z.string(),
chainId: z.number()
});
export const RpcResponse = z.any();

@@ -234,2 +253,6 @@ 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) }))

@@ -242,2 +265,3 @@ .or(z.object({ type: zType('APP_SIGN_OUT') }))

.or(z.object({ type: zType('APP_SET_PREFERRED_ACCOUNT'), payload: AppSetPreferredAccountRequest }))
.or(z.object({ type: zType('APP_CONNECT_SOCIAL'), payload: AppConnectSocialRequest }))
.or(z.object({

@@ -304,2 +328,7 @@ type: zType('APP_RPC_REQUEST'),

.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 }))

@@ -343,3 +372,11 @@ .or(z.object({ type: zType('FRAME_GET_USER_SUCCESS'), payload: FrameGetUserResponse }))

.or(z.object({ type: zType('FRAME_SET_PREFERRED_ACCOUNT_ERROR'), payload: zError }))
.or(z.object({
type: zType('FRAME_CONNECT_SOCIAL_SUCCESS'),
payload: FrameConnectSocialResponse
}))
.or(z.object({
type: zType('FRAME_CONNECT_SOCIAL_ERROR'),
payload: zError
}))
};
//# sourceMappingURL=W3mFrameSchema.js.map
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, FrameInitSmartAccountResponse, AppGetSocialRedirectUriRequest, FrameGetSocialRedirectUriResponse, FrameConnectSocialResponse, FrameGetSmartAccountEnabledNetworksResponse, FrameUpdateEmailResponse } 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,4 @@ 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";

@@ -70,2 +74,4 @@ readonly FRAME_GET_USER_ERROR: "@w3m-frame/GET_USER_ERROR";

readonly FRAME_SET_PREFERRED_ACCOUNT_ERROR: "@w3m-frame/SET_PREFERRED_ACCOUNT_ERROR";
readonly FRAME_CONNECT_SOCIAL_SUCCESS: "@w3m-frame/CONNECT_SOCIAL_SUCCESS";
readonly FRAME_CONNECT_SOCIAL_ERROR: "@w3m-frame/CONNECT_SOCIAL_ERROR";
readonly RPC_RESPONSE_TYPE_ERROR: "RPC_RESPONSE_ERROR";

@@ -72,0 +78,0 @@ readonly RPC_RESPONSE_TYPE_TX: "RPC_RESPONSE_TRANSACTION_HASH";

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

private connectOtpResolver;
private getSocialRedirectUriResolver;
private connectResolver;
private connectSocialResolver;
private disconnectResolver;

@@ -30,2 +32,5 @@ private isConnectedResolver;

connectOtp(payload: W3mFrameTypes.Requests['AppConnectOtpRequest']): Promise<unknown>;
getSocialRedirectUri(payload: W3mFrameTypes.Requests['AppGetSocialRedirectUriRequest']): Promise<{
uri: string;
}>;
isConnected(): Promise<{

@@ -57,2 +62,9 @@ isConnected: boolean;

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

@@ -78,2 +90,6 @@ chainId: number;

private onConnectOtpError;
private onGetSocialRedirectUriSuccess;
private onGetSocialRedirectUriError;
private onConnectSocialSuccess;
private onConnectSocialError;
private onConnectSuccess;

@@ -80,0 +96,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, 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, FrameInitSmartAccountResponse, AppGetSocialRedirectUriRequest, FrameGetSocialRedirectUriResponse, FrameConnectSocialResponse, FrameGetSmartAccountEnabledNetworksResponse, FrameUpdateEmailResponse } 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>;

@@ -27,2 +28,5 @@ AppGetUserRequest: z.infer<typeof AppGetUserRequest>;

FrameGetSmartAccountEnabledNetworksResponse: z.infer<typeof FrameGetSmartAccountEnabledNetworksResponse>;
FrameInitSmartAccountResponse: z.infer<typeof FrameInitSmartAccountResponse>;
FrameGetSocialRedirectUriResponse: z.infer<typeof FrameGetSocialRedirectUriResponse>;
FrameConnectSocialResponse: z.infer<typeof FrameConnectSocialResponse>;
FrameUpdateEmailResponse: z.infer<typeof FrameUpdateEmailResponse>;

@@ -37,3 +41,4 @@ }

type FrameSessionType = z.infer<typeof FrameSession>;
type SocialProvider = 'google' | 'github' | 'apple' | 'facebook' | 'linkedin' | 'twitter' | 'discord' | 'twitch';
type AccountType = (typeof W3mFrameRpcConstants.ACCOUNT_TYPES)[keyof typeof W3mFrameRpcConstants.ACCOUNT_TYPES];
}
{
"name": "@web3modal/wallet",
"version": "4.1.12-910a844.0",
"version": "4.1.12-cn-sl-13.1",
"type": "module",

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

"zod": "3.22.4",
"@web3modal/polyfills": "4.1.12-910a844.0"
"@web3modal/polyfills": "4.1.12-cn-sl-13.1"
},

@@ -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 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