diff --git a/packages/@justweb3/widget/src/lib/dialogs/AuthorizeMAppDialog/index.tsx b/packages/@justweb3/widget/src/lib/dialogs/AuthorizeMAppDialog/index.tsx
deleted file mode 100644
index ad14cf91..00000000
--- a/packages/@justweb3/widget/src/lib/dialogs/AuthorizeMAppDialog/index.tsx
+++ /dev/null
@@ -1,287 +0,0 @@
-import { FC, Fragment, useEffect, useMemo, useState } from 'react';
-import {
- useAddMAppPermission,
- useCanEnableMApps,
- useIsMAppEnabled,
- useRecords,
-} from '@justaname.id/react';
-import {
- Badge,
- Button,
- ClickableItem,
- Flex,
- H2,
- JustaNameLogoIcon,
- P,
- SPAN,
-} from '@justweb3/ui';
-import { isParseable } from '../../utils';
-import { DefaultDialog } from '../DefaultDialog';
-
-export interface AuthorizeMAppDialogProps {
- mApp: {
- name: string;
- isOpen: boolean;
- };
- handleOpenDialog: (open: boolean) => void;
- logo?: string;
- isLoggedIn: boolean;
- handleOpenSignInDialog: (open: boolean) => void;
- connectedEns: string | undefined;
- isEnsAuthPending: boolean;
- disableOverlay?: boolean;
-}
-
-export const AuthorizeMAppDialog: FC
= ({
- mApp: { name: mApp, isOpen: open },
- handleOpenDialog,
- logo,
- isLoggedIn,
- handleOpenSignInDialog,
- connectedEns,
- isEnsAuthPending,
- disableOverlay,
-}) => {
- const [openOnConnect] = useState(open);
- const { records: mAppRecords, isRecordsPending: isMAppRecordsPending } =
- useRecords({
- ens: mApp || '',
- });
- const { records } = useRecords({
- ens: connectedEns || '',
- });
- const { canEnableMApps, isCanEnableMAppsPending } = useCanEnableMApps({
- ens: connectedEns || '',
- });
- const { isMAppEnabled, isMAppEnabledPending } = useIsMAppEnabled({
- ens: connectedEns || '',
- mApp,
- });
- const { addMAppPermission, isAddMAppPermissionPending } =
- useAddMAppPermission({
- mApp,
- });
-
- const mAppFieldsInEnsRecords = useMemo(() => {
- return records?.records.texts?.filter((text) =>
- text.key.endsWith(`_${mApp}`)
- );
- }, [records, mApp]);
-
- const mAppDescription = useMemo(() => {
- return mAppRecords?.records.texts?.find(
- (text) => text.key === `mApp_description`
- )?.value;
- }, [mAppRecords]);
-
- const mAppPermissions = useMemo((): string[] => {
- if (!mAppRecords) {
- return [];
- }
-
- const permissions = mAppRecords?.records.texts?.find(
- (text) => text.key === `mApp_permissions`
- )?.value;
- if (!permissions) {
- return [];
- }
-
- if (!isParseable(permissions)) {
- return [];
- }
-
- const parsedPermissions = JSON.parse(permissions) as string[];
- if (!Array.isArray(parsedPermissions)) {
- return [];
- }
-
- return parsedPermissions;
- }, [mAppRecords]);
-
- const handleOpenDialogInternal = (_open: boolean) => {
- if (!connectedEns) {
- handleOpenSignInDialog(true);
- return;
- }
-
- if (_open !== open) {
- handleOpenDialog(_open);
- }
- };
-
- useEffect(() => {
- if (connectedEns) {
- if (isCanEnableMAppsPending) {
- return;
- }
-
- if (!canEnableMApps && canEnableMApps !== undefined) {
- handleOpenDialogInternal(false);
- return;
- }
- if (isLoggedIn) {
- if (isMAppEnabledPending || isMAppEnabled === undefined) {
- return;
- }
- handleOpenDialogInternal(!isMAppEnabled && openOnConnect);
- } else {
- handleOpenDialogInternal(false);
- }
- }
- }, [
- isMAppEnabled,
- isLoggedIn,
- isMAppEnabledPending,
- connectedEns,
- isCanEnableMAppsPending,
- canEnableMApps,
- ]);
-
- if (isEnsAuthPending || !connectedEns || !records) {
- return null;
- }
-
- if (
- (isMAppRecordsPending || isCanEnableMAppsPending || isMAppEnabledPending) &&
- open
- ) {
- return null;
- }
-
- return (
- handleOpenDialogInternal(false)}
- header={
-
- {logo ? (
-

- ) : (
-
- )}
-
- }
- disableOverlay={disableOverlay}
- >
-
-
-
-
- {connectedEns}
-
-
-
- Authorise {mApp} mApp
-
-
-
-
- {!mAppDescription && !mAppPermissions.length && (
-
- This mApp does not have any permissions or description, be
- cautious when authorising it.
-
- )}
-
- {mAppDescription && (
-
- {mAppDescription}
-
- )}
-
- {mAppPermissions?.length > 0 ||
- (mAppFieldsInEnsRecords && mAppFieldsInEnsRecords?.length > 0) ? (
-
- {mAppPermissions.map((permission, index) => {
- return (
-
-
- Permission
-
- {permission}
-
-
- );
- })}
-
- {mAppFieldsInEnsRecords && mAppFieldsInEnsRecords.length > 0 && (
- <>
- Installing this mApp will remove the following fields:
-
- {mAppFieldsInEnsRecords.map((field) => {
- return (
-
-
-
- );
- })}
-
- >
- )}
-
- ) : null}
-
-
-
-
- );
-};
diff --git a/packages/@justweb3/widget/src/lib/dialogs/MAppsDialog/index.tsx b/packages/@justweb3/widget/src/lib/dialogs/MAppsDialog/index.tsx
deleted file mode 100644
index ebbc8b34..00000000
--- a/packages/@justweb3/widget/src/lib/dialogs/MAppsDialog/index.tsx
+++ /dev/null
@@ -1,268 +0,0 @@
-import { FC, Fragment, useContext, useEffect, useMemo, useState } from 'react';
-import { useEnabledMApps, useEnsAvatar, useRecords } from '@justaname.id/react';
-import {
- ArrowIcon,
- Avatar,
- Badge,
- Button,
- ClickableItem,
- Divider,
- Flex,
- H2,
- JustaNameLogoIcon,
- LoadingSpinner,
- P,
- SPAN,
- TrashIcon,
-} from '@justweb3/ui';
-import { DefaultDialog } from '../DefaultDialog';
-import { JustWeb3Context, useJustWeb3 } from '../../providers';
-import { useMApps } from '../../providers/MAppProvider';
-
-export interface AuthorizeMAppDialogProps {
- open: boolean;
- handleOpenDialog: (open: boolean) => void;
-}
-
-export const MAppsDialog: FC = ({
- open,
- handleOpenDialog,
-}) => {
- const {
- config: { logo, disableOverlay },
- mApps,
- } = useContext(JustWeb3Context);
- const { handleOpenRevokeMAppDialog, handleOpenAuthorizeMAppDialog } =
- useMApps();
- const { connectedEns, isEnsAuthPending } = useJustWeb3();
- const { getRecords } = useRecords();
- const { enabledMApps, isMAppEnabledPending } = useEnabledMApps({
- ens: connectedEns?.ens || '',
- });
- const { getEnsAvatar } = useEnsAvatar();
- const [mAppsDescription, setMAppsDescription] = useState<
- { mApp: string; description: string }[] | undefined
- >(undefined);
- const [mAppsAvatar, setMAppsAvatar] = useState<
- { mApp: string; avatar: string }[] | undefined
- >(undefined);
- const mAppsToEnable = useMemo(() => {
- if (!mApps || !enabledMApps) {
- return undefined;
- }
- return mApps.filter((mApp) => !enabledMApps.includes(mApp));
- }, [mApps, enabledMApps]);
-
- const mAppsAlreadyEnabled = useMemo(() => {
- if (!mApps || !enabledMApps) {
- return undefined;
- }
- return mApps.filter((mApp) => enabledMApps.includes(mApp));
- }, [mApps, enabledMApps]);
-
- useEffect(() => {
- if (!mApps) {
- return;
- }
- Promise.allSettled(mApps.map((mApp) => getRecords({ ens: mApp }))).then(
- (records) => {
- setMAppsDescription(
- records
- ?.filter((record) => record.status === 'fulfilled')
- .map((record) => record.value)
- .map((record, index) => ({
- mApp: mApps[index],
- description:
- record?.records?.texts.find(
- (text) => text.key === `mApp_description`
- )?.value || '',
- }))
- );
- }
- );
-
- Promise.allSettled(mApps.map((mApp) => getEnsAvatar({ name: mApp }))).then(
- (avatars) => {
- setMAppsAvatar(
- avatars
- ?.filter((avatar) => avatar.status === 'fulfilled')
- .map((avatar) => avatar.value)
- .map((avatar, index) => ({
- mApp: mApps[index],
- avatar: avatar || '',
- }))
- );
- }
- );
- }, [mApps]);
-
- // if (!connectedEns || isEnsAuthPending || isMAppEnabledPending) {
- // return ;
- // }
-
- return (
- handleOpenDialog(false)}
- header={
-
- {logo ? (
-

- ) : (
-
- )}
-
- }
- >
- {!connectedEns || isEnsAuthPending || isMAppEnabledPending ? (
-
-
-
- ) : (
-
-
-
- {connectedEns.ens}
-
-
-
- mApps Configuration
-
-
-
- {mAppsToEnable && mAppsToEnable.length > 0 && (
-
- Installable mApps
-
-
- {mAppsToEnable.map((mApp, index) => {
- return (
-
- avatar.mApp === mApp
- )?.avatar
- }
- size={34}
- />
- }
- style={{
- width: '100%',
- }}
- subtitle={
- mAppsDescription?.find(
- (description) => description.mApp === mApp
- )?.description
- }
- clickable={false}
- right={
- }
- onClick={() =>
- handleOpenAuthorizeMAppDialog(mApp)
- }
- >
- Install
-
- }
- />
-
- );
- })}
-
-
- )}
-
- {mAppsToEnable &&
- mAppsToEnable.length > 0 &&
- mAppsAlreadyEnabled &&
- mAppsAlreadyEnabled.length > 0 ? (
-
- ) : null}
-
- {mAppsAlreadyEnabled && mAppsAlreadyEnabled.length > 0 && (
-
- Configured mApps
-
-
- {mAppsAlreadyEnabled.map((mApp, index) => {
- return (
-
- avatar.mApp === mApp
- )?.avatar
- }
- size={34}
- />
- }
- subtitle={
- mAppsDescription?.find(
- (description) => description.mApp === mApp
- )?.description
- }
- clickable={false}
- style={{
- width: '100%',
- }}
- right={
- }
- onClick={() => handleOpenRevokeMAppDialog(mApp)}
- >
- Revoke
-
- }
- />
-
- );
- })}
-
-
- )}
-
-
- )}
-
- );
-};
diff --git a/packages/@justweb3/widget/src/lib/dialogs/RevokeMAppDialog/index.tsx b/packages/@justweb3/widget/src/lib/dialogs/RevokeMAppDialog/index.tsx
deleted file mode 100644
index 5d3e83db..00000000
--- a/packages/@justweb3/widget/src/lib/dialogs/RevokeMAppDialog/index.tsx
+++ /dev/null
@@ -1,251 +0,0 @@
-import { FC, Fragment, useEffect, useMemo, useState } from 'react';
-import {
- useCanEnableMApps,
- useIsMAppEnabled,
- useRecords,
- useRevokeMAppPermission,
-} from '@justaname.id/react';
-import {
- Badge,
- Button,
- ClickableItem,
- Flex,
- H2,
- JustaNameLogoIcon,
- P,
- SPAN,
- TrashWhiteIcon,
-} from '@justweb3/ui';
-import { DefaultDialog } from '../DefaultDialog';
-
-export interface RevokeMAppDialogProps {
- mApp: {
- name: string;
- isOpen: boolean;
- };
- handleOpenDialog: (open: boolean) => void;
- logo?: string;
- isLoggedIn: boolean;
- handleOpenSignInDialog: (open: boolean) => void;
- connectedEns: string | undefined;
- isEnsAuthPending: boolean;
- disableOverlay?: boolean;
-}
-
-export const RevokeMAppDialog: FC = ({
- mApp: { name: mApp, isOpen: open },
- handleOpenDialog,
- logo,
- isLoggedIn,
- handleOpenSignInDialog,
- connectedEns,
- isEnsAuthPending,
- disableOverlay,
-}) => {
- const [openOnConnect] = useState(open);
- const { records: mAppRecords, isRecordsPending: isMAppRecordsPending } =
- useRecords({
- ens: mApp || '',
- });
- const { records } = useRecords({
- ens: connectedEns || '',
- });
- const { canEnableMApps, isCanEnableMAppsPending } = useCanEnableMApps({
- ens: connectedEns || '',
- });
- const { isMAppEnabled, isMAppEnabledPending } = useIsMAppEnabled({
- ens: connectedEns || '',
- mApp,
- });
- const { revokeMAppPermission, isRevokeMAppPermissionPending } =
- useRevokeMAppPermission({
- mApp,
- });
-
- const mAppDescription = useMemo(() => {
- return mAppRecords?.records.texts?.find(
- (text) => text.key === `mApp_description`
- )?.value;
- }, [mAppRecords]);
-
- const mAppFieldsInEnsRecords = useMemo(() => {
- return records?.records.texts?.filter((text) =>
- text.key.endsWith(`_${mApp}`)
- );
- }, [records, mApp]);
-
- const handleOpenDialogInternal = (_open: boolean) => {
- if (!connectedEns) {
- handleOpenSignInDialog(true);
- return;
- }
-
- if (_open !== open) {
- handleOpenDialog(_open);
- }
- };
-
- useEffect(() => {
- if (connectedEns) {
- if (isCanEnableMAppsPending) {
- return;
- }
-
- if (!canEnableMApps && canEnableMApps !== undefined) {
- handleOpenDialogInternal(false);
- return;
- }
- if (isLoggedIn) {
- if (isMAppEnabledPending || isMAppEnabled === undefined) {
- return;
- }
- handleOpenDialogInternal(!isMAppEnabled && openOnConnect);
- } else {
- handleOpenDialogInternal(false);
- }
- }
- }, [
- isMAppEnabled,
- isLoggedIn,
- isMAppEnabledPending,
- connectedEns,
- isCanEnableMAppsPending,
- canEnableMApps,
- ]);
-
- if (isEnsAuthPending || !connectedEns || !records) {
- return null;
- }
-
- if (
- (isMAppRecordsPending || isCanEnableMAppsPending || isMAppEnabledPending) &&
- open
- ) {
- return null;
- }
-
- return (
- handleOpenDialogInternal(false)}
- header={
-
- {logo ? (
-

- ) : (
-
- )}
-
- }
- disableOverlay={disableOverlay}
- >
-
-
-
-
- {connectedEns}
-
-
-
-
- Revoke {mApp} mApp
-
-
-
-
- {mAppDescription}
-
-
-
- Removing this mApp will revoke all permissions granted to it.
- {mAppFieldsInEnsRecords && mAppFieldsInEnsRecords.length > 0 && (
- <>
- The following fields will be removed:
-
- {mAppFieldsInEnsRecords.map((field) => {
- return (
-
-
-
- );
- })}
-
- >
- )}
-
-
-
-
-
-
-
-
-
- );
-};
diff --git a/packages/@justweb3/widget/src/lib/dialogs/index.ts b/packages/@justweb3/widget/src/lib/dialogs/index.ts
index 34a8d186..d79a6e96 100644
--- a/packages/@justweb3/widget/src/lib/dialogs/index.ts
+++ b/packages/@justweb3/widget/src/lib/dialogs/index.ts
@@ -1,4 +1,3 @@
-export * from './AuthorizeMAppDialog';
export * from './AvatarSelectorDialog';
export * from './BannerSelectorDialog';
export * from './ConfigurationDialog';
diff --git a/packages/@justweb3/widget/src/lib/plugins/index.ts b/packages/@justweb3/widget/src/lib/plugins/index.ts
index 5ba874b9..25e3ec05 100644
--- a/packages/@justweb3/widget/src/lib/plugins/index.ts
+++ b/packages/@justweb3/widget/src/lib/plugins/index.ts
@@ -10,15 +10,12 @@ export interface PluginApi {
isLoggedIn: boolean;
chainId: number | undefined;
records: UseRecordsResult['records'];
- mApps: string[];
setState: (key: string, value: T) => void;
getState: (key: string) => T | undefined;
config: JustWeb3ProviderConfig;
eventEmitter: EventEmitter;
- handleOpenAuthorizeMAppDialog: (mApp: string, open: boolean) => void;
- handleOpenRevokeMAppDialog: (mApp: string, open: boolean) => void;
handleOpenSignInDialog: (open: boolean) => void;
}
@@ -74,30 +71,18 @@ type OnEnsSignInHook = (
pluginApi: PluginApi,
ens: string,
chainId: number,
- records: UseRecordsResult['records'],
- enabledMApps: string[],
- canEnableMApps: boolean
+ records: UseRecordsResult['records']
) => void;
type OnEnsChangeHook = (
pluginApi: PluginApi,
ens: string,
- records: UseRecordsResult['records'],
- enabledMApps: string[],
- canEnableMApps: boolean
+ records: UseRecordsResult['records']
) => void;
type OnEnsSignOutHook = (pluginApi: PluginApi, ens: string) => void;
-type OnMAppAddHook = (pluginApi: PluginApi, ens: string, mApp: string) => void;
-type OnMAppRemoveHook = (
- pluginApi: PluginApi,
- ens: string,
- mApp: string
-) => void;
type OnRecordsChangeHook = (
pluginApi: PluginApi,
ens: string,
- records: UseRecordsResult['records'],
- enabledMApps: string[],
- canEnableMApps: boolean
+ records: UseRecordsResult['records']
) => void;
type OnSubnameClaimedHook = (pluginApi: PluginApi, subname: string) => void;
type OnSwitchChain = (
@@ -117,8 +102,6 @@ interface Hooks {
onSwitchChain?: OnSwitchChain;
onSubnameClaimed?: OnSubnameClaimedHook;
onEnsChange?: OnEnsChangeHook;
- onMAppAdd?: OnMAppAddHook;
- onMAppRemove?: OnMAppRemoveHook;
onRecordsChange?: OnRecordsChangeHook;
onStateChange?: (
pluginApi: PluginApi,
@@ -133,8 +116,6 @@ export interface JustaPlugin {
components?: PluginComponents;
- mApps?: string[];
-
hooks?: Hooks;
priority?: number;
diff --git a/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx b/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx
index 85c80f8c..5a955dd4 100644
--- a/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx
+++ b/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx
@@ -25,7 +25,7 @@ import {
} from '@justaname.id/react';
import { JustWeb3ThemeProvider } from '@justweb3/ui';
import { SignInDialog } from '../../dialogs/SignInDialog';
-import { MAppsProvider } from '../MAppProvider';
+import { PluginProvider } from '../PluginProvider';
import { JustaPlugin } from '../../plugins';
import usePreviousState from '../../hooks/usePreviousState';
import { ProfileDialog, UpdateRecordDialog } from '../../dialogs';
@@ -51,7 +51,6 @@ export interface JustWeb3ContextProps {
isSignInOpen: boolean;
config: JustWeb3ProviderConfig;
plugins: JustaPlugin[];
- mApps: string[];
}
export const JustWeb3Context = createContext({
@@ -63,7 +62,6 @@ export const JustWeb3Context = createContext({
handleJustWeb3Config: () => { },
config: {},
plugins: [],
- mApps: [],
});
export const JustWeb3Provider: FC = ({
@@ -104,20 +102,6 @@ export const JustWeb3Provider: FC = ({
[config.plugins]
);
- const pluginsMApps =
- (useMemo(
- () =>
- plugins
- ?.filter((plugin) => plugin.mApps)
- ?.map((plugin) => plugin.mApps)
- .flat()
- .map((mApp) => ({
- name: mApp,
- openOnConnect: false,
- })),
- [plugins]
- ) as { name: string; openOnConnect: boolean }[]) || [];
-
const handleUpdateRecords = async (
records: UpdateRecordsParams & { ens: string }
) => {
@@ -142,27 +126,6 @@ export const JustWeb3Provider: FC = ({
}
}, [updateRecord]);
- const mAppsWithOpenOnConnect =
- config?.mApps?.map((mApp) => {
- if (typeof mApp === 'string') {
- return {
- name: mApp,
- openOnConnect: false,
- };
- }
- return mApp;
- }) || [];
-
- const allMApps = [...mAppsWithOpenOnConnect, ...pluginsMApps].reduce(
- (acc, mApp) => {
- if (!acc.find((accMApp) => accMApp.name === mApp.name)) {
- return [...acc, mApp];
- }
- return acc;
- },
- [] as { name: string; openOnConnect: boolean }[]
- );
-
const handleOpenSignInDialog = (open: boolean) => {
if (!isConnected) {
return;
@@ -214,16 +177,13 @@ export const JustWeb3Provider: FC = ({
isSignInOpen: signInOpen,
config: config,
plugins,
- mApps: allMApps.map((mApp) => mApp.name),
handleUpdateRecords: handleUpdateRecords,
handleJustWeb3Config,
handleOpenEnsProfile,
handleCloseEnsProfile,
}}
>
- = ({
logo={config.logo}
/>
{children}
-
+
diff --git a/packages/@justweb3/widget/src/lib/providers/MAppProvider/index.tsx b/packages/@justweb3/widget/src/lib/providers/MAppProvider/index.tsx
deleted file mode 100644
index 56cac1bb..00000000
--- a/packages/@justweb3/widget/src/lib/providers/MAppProvider/index.tsx
+++ /dev/null
@@ -1,322 +0,0 @@
-import {
- createContext,
- FC,
- Fragment,
- ReactNode,
- useCallback,
- useContext,
- useEffect,
- useMemo,
- useState,
-} from 'react';
-import {
- useCanEnableMApps,
- useEnabledMApps,
- useEnsAuth,
- useIsMAppEnabled,
-} from '@justaname.id/react';
-import { AuthorizeMAppDialog } from '../../dialogs/AuthorizeMAppDialog';
-import { PluginProvider } from '../PluginProvider';
-import { JustaPlugin } from '../../plugins';
-import { RevokeMAppDialog } from '../../dialogs/RevokeMAppDialog';
-import { JustWeb3ProviderConfig } from '../../types/config';
-
-export interface MApp {
- name: string;
- isOpen: boolean;
-}
-
-export interface MAppContextProps {
- mAppsToEnable: string[] | undefined;
- mAppsAlreadyEnabled: string[] | undefined;
- canEnableMApps: boolean | undefined;
- handleOpenAuthorizeMAppDialog: (mAppName: string, open?: boolean) => void;
- handleOpenRevokeMAppDialog: (mAppName: string, open?: boolean) => void;
- handleOpenSignInDialog: (open: boolean) => void;
- config: JustWeb3ProviderConfig;
-}
-
-export const MAppContext = createContext({
- mAppsToEnable: undefined,
- mAppsAlreadyEnabled: undefined,
- canEnableMApps: undefined,
- handleOpenAuthorizeMAppDialog: () => {},
- handleOpenRevokeMAppDialog: () => {},
- handleOpenSignInDialog: () => {},
- config: {},
-});
-
-interface MAppsProviderProps {
- logo?: string;
- handleOpenSignInDialog: (open: boolean) => void;
- children: ReactNode;
- mApps?: {
- name: string;
- openOnConnect: boolean;
- }[];
- plugins: JustaPlugin[];
- disableOverlay?: boolean;
- config: JustWeb3ProviderConfig;
-}
-
-export const MAppsProvider: FC = ({
- logo,
- handleOpenSignInDialog,
- children,
- disableOverlay,
- mApps: initialMApps = [],
- plugins,
- config,
-}) => {
- const { isEnsAuthPending, isLoggedIn, connectedEns } = useEnsAuth({
- local: !config.enableAuth,
- });
- const [mAppsToEnableOpen, setMAppsToEnableOpen] = useState<
- { name: string; isOpen: boolean }[] | undefined
- >(undefined);
- const [mAppsAlreadyEnabledOpen, setMAppsAlreadyEnabledOpen] = useState<
- { name: string; isOpen: boolean }[] | undefined
- >(undefined);
-
- const { canEnableMApps } = useCanEnableMApps({
- ens: connectedEns?.ens || '',
- });
- const { enabledMApps } = useEnabledMApps({
- ens: connectedEns?.ens || '',
- });
-
- const mAppsToEnable = useMemo(() => {
- if (!initialMApps || !enabledMApps) {
- return undefined;
- }
- return initialMApps.filter((mApp) => !enabledMApps.includes(mApp.name));
- }, [initialMApps, enabledMApps]);
-
- const mAppsAlreadyEnabled = useMemo(() => {
- if (!initialMApps || !enabledMApps) {
- return undefined;
- }
- return initialMApps.filter((mApp) => enabledMApps.includes(mApp.name));
- }, [initialMApps, enabledMApps]);
-
- useEffect(() => {
- if (!mAppsToEnable) {
- return;
- }
- setMAppsToEnableOpen(
- mAppsToEnable.map((mApp) => ({
- name: mApp.name,
- isOpen: mApp.openOnConnect,
- }))
- );
- }, [mAppsToEnable]);
-
- useEffect(() => {
- if (!mAppsAlreadyEnabled) {
- return;
- }
- setMAppsAlreadyEnabledOpen(
- mAppsAlreadyEnabled.map((mApp) => ({ name: mApp.name, isOpen: false }))
- );
- }, [mAppsAlreadyEnabled]);
-
- const handleOpenAuthorizeMAppDialog = useCallback(
- (mAppName: string, open = true) => {
- setMAppsToEnableOpen((prev) =>
- prev?.map((mApp) => {
- if (mApp.name === mAppName) {
- return {
- ...mApp,
- isOpen: open,
- };
- }
- return mApp;
- })
- );
- },
- []
- );
-
- const handleOpenRevokeMAppDialog = useCallback(
- (mAppName: string, open = true) => {
- setMAppsAlreadyEnabledOpen((prev) =>
- prev?.map((mApp) => {
- if (mApp.name === mAppName) {
- return {
- ...mApp,
- isOpen: open,
- };
- }
- return mApp;
- })
- );
- },
- []
- );
-
- return (
- mApp.name),
- mAppsAlreadyEnabled: mAppsAlreadyEnabled?.map((mApp) => mApp.name),
- handleOpenAuthorizeMAppDialog,
- handleOpenRevokeMAppDialog,
- canEnableMApps,
- handleOpenSignInDialog,
- config,
- }}
- >
- mApp.name)}
- plugins={plugins}
- handleOpenSignInDialog={handleOpenSignInDialog}
- handleOpenAuthorizeMAppDialog={handleOpenAuthorizeMAppDialog}
- handleOpenRevokeMAppDialog={handleOpenRevokeMAppDialog}
- config={config}
- >
- {mAppsToEnableOpen &&
- mAppsToEnableOpen.map((mApp) => (
-
-
- handleOpenAuthorizeMAppDialog(mApp.name, open)
- }
- mApp={mApp}
- logo={logo}
- handleOpenSignInDialog={handleOpenSignInDialog}
- connectedEns={connectedEns?.ens}
- isEnsAuthPending={isEnsAuthPending}
- isLoggedIn={isLoggedIn}
- disableOverlay={disableOverlay}
- />
-
- ))}
- {mAppsAlreadyEnabledOpen &&
- mAppsAlreadyEnabledOpen.map((mApp) => (
-
-
- handleOpenRevokeMAppDialog(mApp.name, open)
- }
- mApp={mApp}
- logo={logo}
- handleOpenSignInDialog={handleOpenSignInDialog}
- connectedEns={connectedEns?.ens}
- isEnsAuthPending={isEnsAuthPending}
- isLoggedIn={isLoggedIn}
- disableOverlay={disableOverlay}
- />
-
- ))}
- {children}
-
-
- );
-};
-
-interface UseMAppParams {
- mApp: string;
-}
-
-interface UseMAppResult {
- handleOpenAuthorizeMAppDialog: (open: boolean) => void;
- handleOpenRevokeMAppDialog: (open: boolean) => void;
- isMAppEnabled: boolean | undefined;
- canOpenMAppDialog: boolean;
- isPending: boolean;
-}
-
-export const useMApp = ({ mApp }: UseMAppParams): UseMAppResult => {
- const {
- handleOpenAuthorizeMAppDialog: contextOpenAuthorizeMAppDialog,
- handleOpenRevokeMAppDialog: contextOpenRevokeMAppDialog,
- handleOpenSignInDialog,
- config,
- } = useContext(MAppContext);
- const { connectedEns } = useEnsAuth({
- local: !config.enableAuth,
- });
- const { isMAppEnabled, isMAppEnabledPending } = useIsMAppEnabled({
- ens: connectedEns?.ens || '',
- mApp,
- });
- const { canEnableMApps, isCanEnableMAppsPending } = useCanEnableMApps({
- ens: connectedEns?.ens || '',
- });
-
- const isPending = isMAppEnabledPending || isCanEnableMAppsPending;
-
- const handleOpenAuthorizeMAppDialog = useCallback(
- (open: boolean) => {
- if (!connectedEns) {
- handleOpenSignInDialog(true);
- return;
- }
-
- if (isPending) {
- return;
- }
-
- if (!isMAppEnabled && canEnableMApps) {
- contextOpenAuthorizeMAppDialog(mApp, open);
- }
- },
- [
- connectedEns,
- handleOpenSignInDialog,
- isPending,
- isMAppEnabled,
- canEnableMApps,
- contextOpenAuthorizeMAppDialog,
- mApp,
- ]
- );
-
- const handleOpenRevokeMAppDialog = useCallback(
- (open: boolean) => {
- if (!connectedEns) {
- handleOpenSignInDialog(true);
- return;
- }
-
- if (isPending) {
- return;
- }
-
- if (isMAppEnabled) {
- contextOpenRevokeMAppDialog(mApp, open);
- }
- },
- [
- connectedEns,
- handleOpenSignInDialog,
- isPending,
- isMAppEnabled,
- contextOpenRevokeMAppDialog,
- mApp,
- ]
- );
-
- const canOpenMAppDialog = useMemo(() => {
- if (!connectedEns) {
- return true;
- }
- return !isMAppEnabled && canEnableMApps && !isPending;
- }, [connectedEns, isMAppEnabled, canEnableMApps, isPending]);
-
- return {
- handleOpenAuthorizeMAppDialog,
- handleOpenRevokeMAppDialog,
- isMAppEnabled,
- canOpenMAppDialog: Boolean(canOpenMAppDialog),
- isPending,
- };
-};
-
-export const useMApps = (): MAppContextProps => {
- const context = useContext(MAppContext);
- if (context === undefined) {
- throw new Error('useMApps must be used within a MAppsProvider');
- }
- return context;
-};
diff --git a/packages/@justweb3/widget/src/lib/providers/PluginProvider/index.tsx b/packages/@justweb3/widget/src/lib/providers/PluginProvider/index.tsx
index 5e4d8743..cf5cb4c0 100644
--- a/packages/@justweb3/widget/src/lib/providers/PluginProvider/index.tsx
+++ b/packages/@justweb3/widget/src/lib/providers/PluginProvider/index.tsx
@@ -8,8 +8,6 @@ import React, {
useState,
} from 'react';
import {
- useCanEnableMApps,
- useEnabledMApps,
useEnsAuth,
useMountedAccount,
useRecords,
@@ -34,9 +32,6 @@ interface PluginProviderProps {
children: React.ReactNode;
plugins: JustaPlugin[];
handleOpenSignInDialog: (open: boolean) => void;
- handleOpenAuthorizeMAppDialog: (mAppName: string, open: boolean) => void;
- handleOpenRevokeMAppDialog: (mAppName: string, open: boolean) => void;
- mApps?: string[];
config: JustWeb3ProviderConfig;
}
@@ -44,9 +39,6 @@ export const PluginProvider: FC = ({
children,
plugins,
handleOpenSignInDialog,
- handleOpenAuthorizeMAppDialog,
- handleOpenRevokeMAppDialog,
- mApps,
config,
}) => {
const { connectedEns, isEnsAuthPending, isLoggedIn } = useEnsAuth({
@@ -55,23 +47,14 @@ export const PluginProvider: FC = ({
const { records } = useRecords({
ens: connectedEns?.ens || '',
});
- const { enabledMApps } = useEnabledMApps({
- ens: connectedEns?.ens || '',
- });
- const { canEnableMApps } = useCanEnableMApps({
- ens: connectedEns?.ens || '',
- });
const { address, chain } = useMountedAccount();
const previousConnectedEns = usePreviousState(connectedEns, [
connectedEns,
records,
- enabledMApps,
- canEnableMApps,
]);
const previousChain = usePreviousState(chain, [chain]);
const previousAddress = usePreviousState(address, [address]);
const previousRecords = usePreviousState(records, [records]);
- const previousEnabledMApps = usePreviousState(enabledMApps, [enabledMApps]);
const [pluginStates, setPluginStates] = useState<
Record>
@@ -84,11 +67,8 @@ export const PluginProvider: FC = ({
connectedEns,
isEnsAuthPending,
isLoggedIn,
- mApps: mApps || [],
chainId: chain?.id,
handleOpenSignInDialog,
- handleOpenAuthorizeMAppDialog,
- handleOpenRevokeMAppDialog,
records,
config,
eventEmitter: new EventEmitter(),
@@ -110,9 +90,6 @@ export const PluginProvider: FC = ({
isEnsAuthPending,
isLoggedIn,
handleOpenSignInDialog,
- handleOpenAuthorizeMAppDialog,
- handleOpenRevokeMAppDialog,
- mApps,
eventEmitter,
pluginStates,
records,
@@ -174,8 +151,6 @@ export const PluginProvider: FC = ({
if (
records &&
- enabledMApps !== undefined &&
- canEnableMApps !== undefined &&
connectedEns &&
!previousConnectedEns &&
plugin.hooks?.onEnsSignIn
@@ -185,9 +160,7 @@ export const PluginProvider: FC = ({
pluginApi,
connectedEns?.ens,
chain?.id || 1,
- records,
- enabledMApps,
- canEnableMApps
+ records
);
} catch (error) {
console.error(
@@ -199,21 +172,13 @@ export const PluginProvider: FC = ({
if (
records &&
- enabledMApps !== undefined &&
- canEnableMApps !== undefined &&
connectedEns &&
previousConnectedEns &&
connectedEns.ens !== previousConnectedEns.ens &&
plugin.hooks?.onEnsChange
) {
try {
- plugin.hooks?.onEnsChange(
- pluginApi,
- connectedEns?.ens,
- records,
- enabledMApps,
- canEnableMApps
- );
+ plugin.hooks?.onEnsChange(pluginApi, connectedEns?.ens, records);
} catch (error) {
console.error(
`Error in plugin ${plugin.name} onEnsChange hook:`,
@@ -233,14 +198,7 @@ export const PluginProvider: FC = ({
}
}
});
- }, [
- plugins,
- connectedEns,
- previousConnectedEns,
- records,
- enabledMApps,
- canEnableMApps,
- ]);
+ }, [plugins, connectedEns, previousConnectedEns, records]);
useEffect(() => {
plugins?.forEach((plugin) => {
@@ -290,24 +248,13 @@ export const PluginProvider: FC = ({
plugins?.forEach((plugin) => {
const pluginApi = createPluginApi(plugin.name);
- if (
- !records ||
- enabledMApps === undefined ||
- canEnableMApps === undefined ||
- !connectedEns
- ) {
+ if (!records || !connectedEns) {
return;
}
if (!isEqual(records, previousRecords) && plugin.hooks?.onRecordsChange) {
try {
- plugin.hooks.onRecordsChange(
- pluginApi,
- connectedEns?.ens,
- records,
- enabledMApps,
- canEnableMApps
- );
+ plugin.hooks.onRecordsChange(pluginApi, connectedEns?.ens, records);
} catch (error) {
console.error(
`Error in plugin ${plugin.name} onRecordsChange hook:`,
@@ -316,70 +263,7 @@ export const PluginProvider: FC = ({
}
}
});
- }, [
- plugins,
- records,
- previousRecords,
- connectedEns,
- enabledMApps,
- canEnableMApps,
- ]);
-
- useEffect(() => {
- plugins?.forEach((plugin) => {
- const pluginApi = createPluginApi(plugin.name);
-
- if (
- enabledMApps === undefined ||
- !connectedEns ||
- !previousEnabledMApps
- ) {
- return;
- }
-
- if (
- !isEqual(enabledMApps, previousEnabledMApps) &&
- plugin.hooks?.onMAppAdd
- ) {
- const addedMApp = enabledMApps.find(
- (mApp) => !previousEnabledMApps.includes(mApp)
- );
- if (addedMApp) {
- try {
- plugin.hooks.onMAppAdd(pluginApi, connectedEns?.ens, addedMApp);
- } catch (error) {
- console.error(
- `Error in plugin ${plugin.name} onMAppAdd hook:`,
- error
- );
- }
- }
- }
-
- if (
- !isEqual(enabledMApps, previousEnabledMApps) &&
- plugin.hooks?.onMAppRemove
- ) {
- const removedMApp = previousEnabledMApps.find(
- (mApp) => !enabledMApps.includes(mApp)
- );
- if (removedMApp) {
- try {
- plugin.hooks.onMAppRemove(
- pluginApi,
- connectedEns?.ens,
- removedMApp
- );
- } catch (error) {
- console.error(
- `Error in plugin ${plugin.name} onMAppRemove hook:`,
- error
- );
- }
- }
- }
- });
- }, [plugins, enabledMApps, previousEnabledMApps, connectedEns]);
+ }, [plugins, records, previousRecords, connectedEns]);
const globalComponentsArray: ReactNode[] = plugins?.reduce(
(acc: ReactNode[], plugin: JustaPlugin) => {
diff --git a/packages/@justweb3/widget/src/lib/providers/index.ts b/packages/@justweb3/widget/src/lib/providers/index.ts
index ff941cf6..7250913f 100644
--- a/packages/@justweb3/widget/src/lib/providers/index.ts
+++ b/packages/@justweb3/widget/src/lib/providers/index.ts
@@ -1,3 +1,2 @@
export * from './JustWeb3Provider'
-export { useMApps, useMApp } from './MAppProvider'
export { usePlugins } from './PluginProvider'
\ No newline at end of file
diff --git a/packages/@justweb3/widget/src/lib/types/config/index.ts b/packages/@justweb3/widget/src/lib/types/config/index.ts
index a35595c8..a1b4f569 100644
--- a/packages/@justweb3/widget/src/lib/types/config/index.ts
+++ b/packages/@justweb3/widget/src/lib/types/config/index.ts
@@ -10,7 +10,6 @@ export interface JustWeb3ProviderConfig
logo?: string;
disableOverlay?: boolean;
enableAuth?: boolean;
- mApps?: (string | { name: string; openOnConnect: boolean })[];
plugins?: JustaPlugin[];
onLogout?: () => void;
}
diff --git a/packages/@justweb3/widget/src/stories/multichain.stories.tsx b/packages/@justweb3/widget/src/stories/multichain.stories.tsx
index 8378dcd0..82f50f25 100644
--- a/packages/@justweb3/widget/src/stories/multichain.stories.tsx
+++ b/packages/@justweb3/widget/src/stories/multichain.stories.tsx
@@ -45,7 +45,6 @@ const JustWeb3Config: JustWeb3ProviderConfig = {
providerUrl: import.meta.env.STORYBOOK_APP_SEPOLIA_PROVIDER_URL,
},
],
- mApps: ['justverified.eth', 'justweb3.eth'],
openOnWalletConnect: false,
allowedEns: 'all',
dev: import.meta.env.STORYBOOK_APP_DEV === 'true',
diff --git a/packages/@justweb3/widget/src/stories/signin.stories.tsx b/packages/@justweb3/widget/src/stories/signin.stories.tsx
index 36d52c6d..2eaf3931 100644
--- a/packages/@justweb3/widget/src/stories/signin.stories.tsx
+++ b/packages/@justweb3/widget/src/stories/signin.stories.tsx
@@ -37,7 +37,6 @@ const JustWeb3Config: JustWeb3ProviderConfig = {
providerUrl: import.meta.env.STORYBOOK_APP_SEPOLIA_PROVIDER_URL,
},
],
- mApps: ['justverified.eth', 'justweb3.eth'],
openOnWalletConnect: false,
allowedEns: 'all',
// dev: import.meta.env.STORYBOOK_APP_DEV === 'true',
diff --git a/packages/@justweb3/xmtp-plugin/package.json b/packages/@justweb3/xmtp-plugin/package.json
index 686523be..2a66d7a6 100644
--- a/packages/@justweb3/xmtp-plugin/package.json
+++ b/packages/@justweb3/xmtp-plugin/package.json
@@ -18,6 +18,7 @@
"@justweb3/widget": ">=0.0.95",
"@tanstack/react-query": "^5.x",
"react": ">=17",
+ "viem": "^2.48.0",
"wagmi": "2.x"
},
"exports": {
diff --git a/packages/@justweb3/xmtp-plugin/src/lib/hooks/useClient/index.ts b/packages/@justweb3/xmtp-plugin/src/lib/hooks/useClient/index.ts
index cded1a18..b5e40845 100644
--- a/packages/@justweb3/xmtp-plugin/src/lib/hooks/useClient/index.ts
+++ b/packages/@justweb3/xmtp-plugin/src/lib/hooks/useClient/index.ts
@@ -1,18 +1,16 @@
'use client';
-import { arrayify } from '@ethersproject/bytes';
import { Client, type Signer } from '@xmtp/browser-sdk';
import { ReactionCodec } from '@xmtp/content-type-reaction';
import { AttachmentCodec } from '@xmtp/content-type-remote-attachment';
import { ReplyCodec } from '@xmtp/content-type-reply';
-import { JsonRpcSigner } from 'ethers';
import { useCallback, useContext, useRef, useState } from 'react';
import { XMTPContext } from '../../contexts/XMTPContext';
import { ReadReceiptCodec } from '@xmtp/content-type-read-receipt';
import { useAccount } from 'wagmi';
export type InitializeClientOptions = {
- signer: JsonRpcSigner;
+ signer: Signer;
};
function storeKeys(address: string, key: Uint8Array, env: string) {
@@ -61,23 +59,7 @@ export const useXMTPClient = (onError?: (error: Error) => void) => {
storeKeys(address ?? '', encryptionKey, env);
}
- // Create XMTP signer that converts ethers signatures to Uint8Array
- const xmtpSigner: Signer = {
- type: 'EOA',
- getIdentifier: async () => {
- const signerAddress = await signer.getAddress();
- return {
- identifier: signerAddress,
- identifierKind: 'Ethereum',
- };
- },
- signMessage: async (message: string) => {
- const signature = await signer.signMessage(message);
- return arrayify(signature);
- },
- };
-
- xmtpClient = await Client.create(xmtpSigner, {
+ xmtpClient = await Client.create(signer, {
dbEncryptionKey: encryptionKey,
env,
loggingLevel:
diff --git a/packages/@justweb3/xmtp-plugin/src/lib/hooks/useEthersSigner/index.ts b/packages/@justweb3/xmtp-plugin/src/lib/hooks/useEthersSigner/index.ts
index d12456cf..3fd572fe 100644
--- a/packages/@justweb3/xmtp-plugin/src/lib/hooks/useEthersSigner/index.ts
+++ b/packages/@justweb3/xmtp-plugin/src/lib/hooks/useEthersSigner/index.ts
@@ -1,30 +1,41 @@
'use client';
-import { BrowserProvider, JsonRpcSigner } from 'ethers';
+import type { Signer } from '@xmtp/browser-sdk';
import { useMemo } from 'react';
-import type { Account, Chain, Client, Transport } from 'viem';
+import { hexToBytes } from 'viem';
import { useWalletClient } from 'wagmi';
-export function clientToSigner(client: Client) {
- const { account, chain, transport } = client;
- if (!account || !chain || !transport) return undefined;
- const network = {
- chainId: chain?.id,
- name: chain?.name,
- ensAddress: chain?.contracts?.ensRegistry?.address,
- };
- const provider = new BrowserProvider(transport, network);
- const signer = new JsonRpcSigner(provider, account.address);
- return signer;
-}
+/**
+ * Returns an XMTP-compatible `Signer` backed by the wagmi/viem `WalletClient`.
+ *
+ * Renamed from `useEthersSigner` once the SDK dropped ethers in favor of viem.
+ * Old name kept as alias for backwards compatibility within this plugin.
+ */
+export const useXmtpSigner = ({
+ chainId,
+}: { chainId?: number } = {}): Signer | undefined => {
+ const { data: walletClient } = useWalletClient({ chainId });
-/** Hook to convert a viem Wallet Client to an ethers.js Signer. */
-export const useEthersSigner = ({ chainId }: { chainId?: number } = {}):
- | JsonRpcSigner
- | undefined => {
- const { data: client } = useWalletClient({ chainId });
- const signer = useMemo(
- () => (client ? clientToSigner(client) : undefined),
- [client]
- );
- return signer;
+ return useMemo(() => {
+ if (!walletClient?.account) return undefined;
+ const account = walletClient.account;
+ return {
+ type: 'EOA',
+ getIdentifier: async () => ({
+ identifier: account.address,
+ identifierKind: 'Ethereum',
+ }),
+ signMessage: async (message: string) => {
+ const signature = await walletClient.signMessage({
+ account,
+ message,
+ });
+ return hexToBytes(signature);
+ },
+ };
+ }, [walletClient]);
};
+
+/**
+ * @deprecated Renamed to `useXmtpSigner`. This alias will be removed in the next major version.
+ */
+export const useEthersSigner = useXmtpSigner;
diff --git a/packages/siwens/package.json b/packages/siwens/package.json
index 52de44cc..29ad08cf 100644
--- a/packages/siwens/package.json
+++ b/packages/siwens/package.json
@@ -1,9 +1,12 @@
{
"name": "siwens",
"version": "0.1.52",
+ "dependencies": {
+ "punycode": "^2.3.1"
+ },
"peerDependencies": {
- "ethers": "^5.6.8 || ^6.0.8",
- "siwe": ">=2.0.0"
+ "siwe": ">=2.0.0",
+ "viem": "^2.48.0"
},
"exports": {
"./package.json": "./dist/package.json",
diff --git a/yarn.lock b/yarn.lock
index 7d3466b7..d9a439d4 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4472,9 +4472,8 @@ __metadata:
qs: "npm:6.12.0"
peerDependencies:
"@tanstack/react-query": ^5.x
- ethers: ^5.6.8 || ^6.0.8
react: ">=17"
- viem: 2.x
+ viem: ^2.48.0
wagmi: 2.x
languageName: unknown
linkType: soft
@@ -4488,18 +4487,19 @@ __metadata:
jest: "npm:^29.4.1"
qs: "npm:6.12.0"
peerDependencies:
- ethers: ^5.6.8 || ^6.0.8
siwe: ">=2.0.0"
- viem: ">=2.35.0"
+ viem: ^2.48.0
languageName: unknown
linkType: soft
"@justaname.id/siwens@npm:0.0.145, @justaname.id/siwens@workspace:packages/@justaname.id/siwens":
version: 0.0.0-use.local
resolution: "@justaname.id/siwens@workspace:packages/@justaname.id/siwens"
+ dependencies:
+ punycode: "npm:^2.3.1"
peerDependencies:
- ethers: ^5.6.8 || ^6.0.8
siwe: ">=2.0.0"
+ viem: ^2.48.0
languageName: unknown
linkType: soft
@@ -4628,6 +4628,7 @@ __metadata:
"@justweb3/widget": ">=0.0.95"
"@tanstack/react-query": ^5.x
react: ">=17"
+ viem: ^2.48.0
wagmi: 2.x
languageName: unknown
linkType: soft
@@ -5564,15 +5565,6 @@ __metadata:
languageName: node
linkType: hard
-"@noble/curves@npm:1.2.0":
- version: 1.2.0
- resolution: "@noble/curves@npm:1.2.0"
- dependencies:
- "@noble/hashes": "npm:1.3.2"
- checksum: 10c0/0bac7d1bbfb3c2286910b02598addd33243cb97c3f36f987ecc927a4be8d7d88e0fcb12b0f0ef8a044e7307d1844dd5c49bb724bfa0a79c8ec50ba60768c97f6
- languageName: node
- linkType: hard
-
"@noble/curves@npm:1.4.2, @noble/curves@npm:~1.4.0":
version: 1.4.2
resolution: "@noble/curves@npm:1.4.2"
@@ -5634,13 +5626,6 @@ __metadata:
languageName: node
linkType: hard
-"@noble/hashes@npm:1.3.2":
- version: 1.3.2
- resolution: "@noble/hashes@npm:1.3.2"
- checksum: 10c0/2482cce3bce6a596626f94ca296e21378e7a5d4c09597cbc46e65ffacc3d64c8df73111f2265444e36a3168208628258bbbaccba2ef24f65f58b2417638a20e7
- languageName: node
- linkType: hard
-
"@noble/hashes@npm:1.4.0, @noble/hashes@npm:~1.4.0":
version: 1.4.0
resolution: "@noble/hashes@npm:1.4.0"
@@ -11646,13 +11631,6 @@ __metadata:
languageName: node
linkType: hard
-"@types/node@npm:18.15.13":
- version: 18.15.13
- resolution: "@types/node@npm:18.15.13"
- checksum: 10c0/6e5f61c559e60670a7a8fb88e31226ecc18a21be103297ca4cf9848f0a99049dae77f04b7ae677205f2af494f3701b113ba8734f4b636b355477a6534dbb8ada
- languageName: node
- linkType: hard
-
"@types/node@npm:18.16.9":
version: 18.16.9
resolution: "@types/node@npm:18.16.9"
@@ -13940,9 +13918,9 @@ __metadata:
languageName: node
linkType: hard
-"abitype@npm:1.1.0":
- version: 1.1.0
- resolution: "abitype@npm:1.1.0"
+"abitype@npm:1.2.3":
+ version: 1.2.3
+ resolution: "abitype@npm:1.2.3"
peerDependencies:
typescript: ">=5.0.4"
zod: ^3.22.0 || ^4.0.0
@@ -13951,13 +13929,13 @@ __metadata:
optional: true
zod:
optional: true
- checksum: 10c0/99218d442951c60324fcd96a372c30d71ca8d5434cab62b95d5d80bae89e3024a445a90db323ef1fe4da0d749d86e815ca555a37719b06e6ca03ccad2116c45b
+ checksum: 10c0/c8740de1ae4961723a153224a52cb9a34a57903fb5c2ad61d5082b0b79b53033c9335381aa8c663c7ec213c9955a9853f694d51e95baceedef27356f7745c634
languageName: node
linkType: hard
-"abitype@npm:^1.0.9":
- version: 1.1.1
- resolution: "abitype@npm:1.1.1"
+"abitype@npm:^1.2.3":
+ version: 1.2.4
+ resolution: "abitype@npm:1.2.4"
peerDependencies:
typescript: ">=5.0.4"
zod: ^3.22.0 || ^4.0.0
@@ -13966,7 +13944,7 @@ __metadata:
optional: true
zod:
optional: true
- checksum: 10c0/d52fd8195cb37cdb462ba4d1817dafdba8da403eeab50f144f251748d7458a43308ee29ea46889db2969c91c074780e6d1f00f86acd22dc5772570432ee56b9c
+ checksum: 10c0/b420d8368f92a9bf456bc51a15866af2d8463e2397006551148e654cef9ca786a31d487e27942992c5b5b443b8a6b8adb0efff0c96d58e2ed81b23940fe86b2f
languageName: node
linkType: hard
@@ -14096,13 +14074,6 @@ __metadata:
languageName: node
linkType: hard
-"aes-js@npm:4.0.0-beta.5":
- version: 4.0.0-beta.5
- resolution: "aes-js@npm:4.0.0-beta.5"
- checksum: 10c0/444f4eefa1e602cbc4f2a3c644bc990f93fd982b148425fee17634da510586fc09da940dcf8ace1b2d001453c07ff042e55f7a0482b3cc9372bf1ef75479090c
- languageName: node
- linkType: hard
-
"agent-base@npm:6":
version: 6.0.2
resolution: "agent-base@npm:6.0.2"
@@ -19977,21 +19948,6 @@ __metadata:
languageName: node
linkType: hard
-"ethers@npm:6.11.1":
- version: 6.11.1
- resolution: "ethers@npm:6.11.1"
- dependencies:
- "@adraffy/ens-normalize": "npm:1.10.1"
- "@noble/curves": "npm:1.2.0"
- "@noble/hashes": "npm:1.3.2"
- "@types/node": "npm:18.15.13"
- aes-js: "npm:4.0.0-beta.5"
- tslib: "npm:2.4.0"
- ws: "npm:8.5.0"
- checksum: 10c0/97a920e0244ba6cd1622b58a448c87f26dad20bad242777abb2e583d045bf7752218477bd7367ba6518c2a5e2b16030afff15e87b705526d0ea667498c27ac89
- languageName: node
- linkType: hard
-
"ethers@npm:^5.7.2":
version: 5.8.0
resolution: "ethers@npm:5.8.0"
@@ -25436,7 +25392,6 @@ __metadata:
eslint-plugin-jsx-a11y: "npm:6.7.1"
eslint-plugin-react: "npm:7.32.2"
eslint-plugin-react-hooks: "npm:4.6.0"
- ethers: "npm:6.11.1"
express: "npm:4.18.1"
express-session: "npm:1.18.0"
input-otp: "npm:1.2.4"
@@ -25486,7 +25441,7 @@ __metadata:
url-loader: "npm:4.1.1"
vaul: "npm:1.1.1"
verdaccio: "npm:5.0.4"
- viem: "npm:^2.35.0"
+ viem: "npm:^2.48.0"
vite: "npm:~5.0.0"
vite-plugin-dts: "npm:3.7.3"
vite-plugin-node-polyfills: "npm:0.22.0"
@@ -28517,6 +28472,27 @@ __metadata:
languageName: node
linkType: hard
+"ox@npm:0.14.20":
+ version: 0.14.20
+ resolution: "ox@npm:0.14.20"
+ dependencies:
+ "@adraffy/ens-normalize": "npm:^1.11.0"
+ "@noble/ciphers": "npm:^1.3.0"
+ "@noble/curves": "npm:1.9.1"
+ "@noble/hashes": "npm:^1.8.0"
+ "@scure/bip32": "npm:^1.7.0"
+ "@scure/bip39": "npm:^1.6.0"
+ abitype: "npm:^1.2.3"
+ eventemitter3: "npm:5.0.1"
+ peerDependencies:
+ typescript: ">=5.4.0"
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ checksum: 10c0/fe1c34577536aea3bda5ec47e083be9069d99cb35a270527921f1c7b406283f12bc4b7e9348b46aa3ba88555fc8abc963129c6b5b8b3b375d5e1549f65f2ce9a
+ languageName: node
+ linkType: hard
+
"ox@npm:0.6.7":
version: 0.6.7
resolution: "ox@npm:0.6.7"
@@ -28557,27 +28533,6 @@ __metadata:
languageName: node
linkType: hard
-"ox@npm:0.9.6":
- version: 0.9.6
- resolution: "ox@npm:0.9.6"
- dependencies:
- "@adraffy/ens-normalize": "npm:^1.11.0"
- "@noble/ciphers": "npm:^1.3.0"
- "@noble/curves": "npm:1.9.1"
- "@noble/hashes": "npm:^1.8.0"
- "@scure/bip32": "npm:^1.7.0"
- "@scure/bip39": "npm:^1.6.0"
- abitype: "npm:^1.0.9"
- eventemitter3: "npm:5.0.1"
- peerDependencies:
- typescript: ">=5.4.0"
- peerDependenciesMeta:
- typescript:
- optional: true
- checksum: 10c0/559b39051f80a25352e1ca6e7aba6e04f60c4e29f98e4ef3ec0c8d2b0432d400004ce09d2991200eaf21745179af47367dc28c553da43403dd0b69c2453ebabe
- languageName: node
- linkType: hard
-
"p-cancelable@npm:^2.0.0":
version: 2.1.1
resolution: "p-cancelable@npm:2.1.1"
@@ -35080,13 +35035,6 @@ __metadata:
languageName: node
linkType: hard
-"tslib@npm:2.4.0":
- version: 2.4.0
- resolution: "tslib@npm:2.4.0"
- checksum: 10c0/eb19bda3ae545b03caea6a244b34593468e23d53b26bf8649fbc20fce43e9b21a71127fd6d2b9662c0fe48ee6ff668ead48fd00d3b88b2b716b1c12edae25b5d
- languageName: node
- linkType: hard
-
"tslib@npm:2.6.2":
version: 2.6.2
resolution: "tslib@npm:2.6.2"
@@ -36320,24 +36268,24 @@ __metadata:
languageName: node
linkType: hard
-"viem@npm:^2.35.0":
- version: 2.38.6
- resolution: "viem@npm:2.38.6"
+"viem@npm:^2.48.0":
+ version: 2.49.3
+ resolution: "viem@npm:2.49.3"
dependencies:
"@noble/curves": "npm:1.9.1"
"@noble/hashes": "npm:1.8.0"
"@scure/bip32": "npm:1.7.0"
"@scure/bip39": "npm:1.6.0"
- abitype: "npm:1.1.0"
+ abitype: "npm:1.2.3"
isows: "npm:1.0.7"
- ox: "npm:0.9.6"
+ ox: "npm:0.14.20"
ws: "npm:8.18.3"
peerDependencies:
typescript: ">=5.0.4"
peerDependenciesMeta:
typescript:
optional: true
- checksum: 10c0/9b8571bc9d7dfc414eb72700275ac71b9402cbf4fe3e447501d252cbc43cb7ddf9ce01a16c183fac265d071873d209efc2a459462c724624ef855d941d3447f0
+ checksum: 10c0/f98d0601ec6fecbca0e223735ea59694ac6c6925f85e64b00e46ec57bb1f59c3c5efc84a52abc372875ec730c35254ce6a9cad313dfdcc151ffd6b5d45102a4c
languageName: node
linkType: hard
@@ -37423,21 +37371,6 @@ __metadata:
languageName: node
linkType: hard
-"ws@npm:8.5.0":
- version: 8.5.0
- resolution: "ws@npm:8.5.0"
- peerDependencies:
- bufferutil: ^4.0.1
- utf-8-validate: ^5.0.2
- peerDependenciesMeta:
- bufferutil:
- optional: true
- utf-8-validate:
- optional: true
- checksum: 10c0/0baeee03e97865accda8fad51e8e5fa17d19b8e264529efdf662bbba2acc1c7f1de8316287e6df5cb639231a96009e6d5234b57e6ff36ee2d04e49a0995fec2f
- languageName: node
- linkType: hard
-
"ws@npm:^7.0.0, ws@npm:^7.5.1":
version: 7.5.10
resolution: "ws@npm:7.5.10"