diff --git a/.changeset/nice-crabs-wink.md b/.changeset/nice-crabs-wink.md new file mode 100644 index 00000000000..63aac17cb26 --- /dev/null +++ b/.changeset/nice-crabs-wink.md @@ -0,0 +1,5 @@ +--- +'@iota/create-dapp': minor +--- + +Update some outdated eslint dependencies of the `@iota/create-dapp` templates, to their eslint v9-compatible versions diff --git a/apps/core/src/components/stake/StakedCard.tsx b/apps/core/src/components/stake/StakedCard.tsx index 58bc5c82f20..92f6b0e8184 100644 --- a/apps/core/src/components/stake/StakedCard.tsx +++ b/apps/core/src/components/stake/StakedCard.tsx @@ -37,7 +37,7 @@ export function StakedCard({ // For inactive validator, show principal + rewards const [principalStaked, symbol] = useFormatCoin( - inactiveValidator ? principal + rewards : principal, + inactiveValidator ? BigInt(principal) + rewards : principal, IOTA_TYPE_ARG, ); diff --git a/apps/core/src/components/transaction/info/UnstakeTransactionInfo.tsx b/apps/core/src/components/transaction/info/UnstakeTransactionInfo.tsx index bb69cf69226..94e120821d3 100644 --- a/apps/core/src/components/transaction/info/UnstakeTransactionInfo.tsx +++ b/apps/core/src/components/transaction/info/UnstakeTransactionInfo.tsx @@ -27,21 +27,21 @@ export function UnstakeTransactionInfo({ renderExplorerLink, }: UnstakeTransactionInfoProps) { const json = event.parsedJson as { - principal_amount?: number; - reward_amount?: number; + principal_amount?: string; + reward_amount?: string; validator_address?: string; }; - const principalAmount = json?.principal_amount || 0; - const rewardAmount = json?.reward_amount || 0; + const principalAmount = json?.principal_amount || '0'; + const rewardAmount = json?.reward_amount || '0'; const validatorAddress = json?.validator_address; - const totalAmount = Number(principalAmount) + Number(rewardAmount); + const totalAmount = BigInt(principalAmount) + BigInt(rewardAmount); const [formatPrinciple, symbol] = useFormatCoin(principalAmount, IOTA_TYPE_ARG); const [formatRewards] = useFormatCoin(rewardAmount || 0, IOTA_TYPE_ARG); return (
{validatorAddress && } - {totalAmount && ( + {totalAmount !== 0n && ( )} diff --git a/apps/core/src/hooks/useCountdownByTimestamp.ts b/apps/core/src/hooks/useCountdownByTimestamp.ts index 3b79b69b915..18a5a598292 100644 --- a/apps/core/src/hooks/useCountdownByTimestamp.ts +++ b/apps/core/src/hooks/useCountdownByTimestamp.ts @@ -9,7 +9,17 @@ import { MILLISECONDS_PER_SECOND, } from '../constants'; -export function useCountdownByTimestamp(initialTimestamp: number | null): string { +interface FormatCountdownOptions { + showSeconds?: boolean; + showMinutes?: boolean; + showHours?: boolean; + showDays?: boolean; +} + +export function useCountdownByTimestamp( + initialTimestamp: number | null, + options?: FormatCountdownOptions, +): string { const [timeRemainingMs, setTimeRemainingMs] = useState(0); useEffect(() => { @@ -22,11 +32,19 @@ export function useCountdownByTimestamp(initialTimestamp: number | null): string return () => clearInterval(interval); }, [initialTimestamp]); - const formattedCountdown = formatCountdown(timeRemainingMs); + const formattedCountdown = formatCountdown(timeRemainingMs, options); return formattedCountdown; } -function formatCountdown(totalMilliseconds: number) { +function formatCountdown( + totalMilliseconds: number, + { + showSeconds = true, + showMinutes = true, + showHours = true, + showDays = true, + }: FormatCountdownOptions = {}, +) { const days = Math.floor(totalMilliseconds / MILLISECONDS_PER_DAY); const hours = Math.floor((totalMilliseconds % MILLISECONDS_PER_DAY) / MILLISECONDS_PER_HOUR); const minutes = Math.floor( @@ -36,11 +54,11 @@ function formatCountdown(totalMilliseconds: number) { (totalMilliseconds % MILLISECONDS_PER_MINUTE) / MILLISECONDS_PER_SECOND, ); - const timeUnits = []; - if (days > 0) timeUnits.push(`${days}d`); - if (hours > 0) timeUnits.push(`${hours}h`); - if (minutes > 0) timeUnits.push(`${minutes}m`); - if (seconds > 0 || timeUnits.length === 0) timeUnits.push(`${seconds}s`); + const timeUnits: string[] = []; + if (showDays && days > 0) timeUnits.push(`${days}d`); + if (showHours && hours > 0) timeUnits.push(`${hours}h`); + if (showMinutes && minutes > 0) timeUnits.push(`${minutes}m`); + if (showSeconds && (seconds > 0 || timeUnits.length === 0)) timeUnits.push(`${seconds}s`); return timeUnits.join(' '); } diff --git a/apps/core/src/utils/getStakeIotaByIotaId.ts b/apps/core/src/utils/getStakeIotaByIotaId.ts index 5bdaa2a01ee..ba2e8837c99 100644 --- a/apps/core/src/utils/getStakeIotaByIotaId.ts +++ b/apps/core/src/utils/getStakeIotaByIotaId.ts @@ -10,7 +10,7 @@ export function getStakeIotaByIotaId(allDelegation: DelegatedStake[], stakeIotaI allDelegation.reduce((acc, curr) => { const total = BigInt( curr.stakes.find(({ stakedIotaId }) => stakedIotaId === stakeIotaId)?.principal || - 0, + 0n, ); return total + acc; }, 0n) || 0n diff --git a/apps/wallet-dashboard/app/(protected)/components/top-nav/TopNav.tsx b/apps/wallet-dashboard/app/(protected)/components/top-nav/TopNav.tsx index 2fe8eba32f3..3b802387ca8 100644 --- a/apps/wallet-dashboard/app/(protected)/components/top-nav/TopNav.tsx +++ b/apps/wallet-dashboard/app/(protected)/components/top-nav/TopNav.tsx @@ -1,18 +1,43 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 +import { SettingsDialog, useSettingsDialog } from '@/components'; import { Badge, BadgeType, Button, ButtonType } from '@iota/apps-ui-kit'; +import { ConnectButton, useIotaClientContext } from '@iota/dapp-kit'; +import { getNetwork, Network } from '@iota/iota-sdk/client'; import { ThemeSwitcher } from '@iota/core'; -import { ConnectButton } from '@iota/dapp-kit'; import { Settings } from '@iota/ui-icons'; export function TopNav() { + const { network } = useIotaClientContext(); + const { name: networkName } = getNetwork(network); + const { + isSettingsDialogOpen, + settingsDialogView, + setSettingsDialogView, + onCloseSettingsDialogClick, + onOpenSettingsDialogClick, + } = useSettingsDialog(); + return (
- + + -
); } diff --git a/apps/wallet-dashboard/app/(protected)/home/page.tsx b/apps/wallet-dashboard/app/(protected)/home/page.tsx index 61f55475702..d435d44f630 100644 --- a/apps/wallet-dashboard/app/(protected)/home/page.tsx +++ b/apps/wallet-dashboard/app/(protected)/home/page.tsx @@ -8,6 +8,7 @@ import { TransactionsOverview, StakingOverview, MigrationOverview, + SupplyIncreaseVestingOverview, } from '@/components'; import { useFeature } from '@growthbook/growthbook-react'; import { Feature } from '@iota/core'; @@ -18,12 +19,13 @@ function HomeDashboardPage(): JSX.Element { const account = useCurrentAccount(); const stardustMigrationEnabled = useFeature(Feature.StardustMigration).value; + const supplyIncreaseVestingEnabled = useFeature(Feature.SupplyIncreaseVesting).value; return (
{connectionStatus === 'connected' && account && ( <> -
+
@@ -31,12 +33,10 @@ function HomeDashboardPage(): JSX.Element {
{stardustMigrationEnabled && } -
+
-
- Vesting -
+ {supplyIncreaseVestingEnabled && }
diff --git a/apps/wallet-dashboard/app/(protected)/vesting/page.tsx b/apps/wallet-dashboard/app/(protected)/vesting/page.tsx index cf53a40fe85..e29d94a7fef 100644 --- a/apps/wallet-dashboard/app/(protected)/vesting/page.tsx +++ b/apps/wallet-dashboard/app/(protected)/vesting/page.tsx @@ -13,17 +13,8 @@ import { } from '@/components'; import { UnstakeDialogView } from '@/components/Dialogs/unstake/enums'; import { useUnstakeDialog } from '@/components/Dialogs/unstake/hooks'; -import { useGetCurrentEpochStartTimestamp, useNotifications } from '@/hooks'; -import { - buildSupplyIncreaseVestingSchedule, - formatDelegatedTimelockedStake, - getLatestOrEarliestSupplyIncreaseVestingPayout, - getVestingOverview, - groupTimelockedStakedObjects, - isTimelockedUnlockable, - mapTimelockObjects, - TimelockedStakedObjectsGrouped, -} from '@/lib/utils'; +import { useGetSupplyIncreaseVestingObjects, useNotifications } from '@/hooks'; +import { groupTimelockedStakedObjects, TimelockedStakedObjectsGrouped } from '@/lib/utils'; import { NotificationType } from '@/stores/notificationStore'; import { useFeature } from '@growthbook/growthbook-react'; import { @@ -46,13 +37,9 @@ import { } from '@iota/apps-ui-kit'; import { Theme, - TIMELOCK_IOTA_TYPE, useFormatCoin, useGetActiveValidatorsInfo, - useGetAllOwnedObjects, - useGetTimelockedStakedObjects, useTheme, - useUnlockTimelockedObjectsTransaction, useCountdownByTimestamp, Feature, } from '@iota/core'; @@ -74,24 +61,13 @@ export default function VestingDashboardPage(): JSX.Element { const [timelockedObjectsToUnstake, setTimelockedObjectsToUnstake] = useState(null); const account = useCurrentAccount(); + const address = account?.address || ''; const iotaClient = useIotaClient(); const router = useRouter(); const { data: system } = useIotaClientQuery('getLatestIotaSystemState'); const [isVestingScheduleDialogOpen, setIsVestingScheduleDialogOpen] = useState(false); const { addNotification } = useNotifications(); - const { data: currentEpochMs } = useGetCurrentEpochStartTimestamp(); const { data: activeValidators } = useGetActiveValidatorsInfo(); - const { data: timelockedObjects, refetch: refetchGetAllOwnedObjects } = useGetAllOwnedObjects( - account?.address || '', - { - StructType: TIMELOCK_IOTA_TYPE, - }, - ); - const { - data: timelockedStakedObjects, - isLoading: istimelockedStakedObjectsLoading, - refetch: refetchTimelockedStakedObjects, - } = useGetTimelockedStakedObjects(account?.address || ''); const { mutateAsync: signAndExecuteTransaction } = useSignAndExecuteTransaction(); const { theme } = useTheme(); @@ -102,16 +78,19 @@ export default function VestingDashboardPage(): JSX.Element { const supplyIncreaseVestingEnabled = useFeature(Feature.SupplyIncreaseVesting).value; - const timelockedMapped = mapTimelockObjects(timelockedObjects || []); - const timelockedstakedMapped = formatDelegatedTimelockedStake(timelockedStakedObjects || []); + const { + nextPayout, + supplyIncreaseVestingPortfolio, + supplyIncreaseVestingSchedule, + supplyIncreaseVestingMapped, + supplyIncreaseVestingStakedMapped, + isTimelockedStakedObjectsLoading, + unlockAllSupplyIncreaseVesting, + refreshStakeList, + } = useGetSupplyIncreaseVestingObjects(address); const timelockedStakedObjectsGrouped: TimelockedStakedObjectsGrouped[] = - groupTimelockedStakedObjects(timelockedstakedMapped || []); - - const vestingSchedule = getVestingOverview( - [...timelockedMapped, ...timelockedstakedMapped], - Number(currentEpochMs), - ); + groupTimelockedStakedObjects(supplyIncreaseVestingStakedMapped || []); const { isDialogStakeOpen, @@ -132,37 +111,22 @@ export default function VestingDashboardPage(): JSX.Element { setView: setUnstakeDialogView, } = useUnstakeDialog(); - const nextPayout = getLatestOrEarliestSupplyIncreaseVestingPayout( - [...timelockedMapped, ...timelockedstakedMapped], - Number(currentEpochMs), - false, - ); - - const lastPayout = getLatestOrEarliestSupplyIncreaseVestingPayout( - [...timelockedMapped, ...timelockedstakedMapped], - Number(currentEpochMs), - true, - ); - - const vestingPortfolio = - lastPayout && buildSupplyIncreaseVestingSchedule(lastPayout, Number(currentEpochMs)); - const formattedLastPayoutExpirationTime = useCountdownByTimestamp( Number(nextPayout?.expirationTimestampMs), ); const [formattedTotalVested, vestedSymbol] = useFormatCoin( - vestingSchedule.totalVested, + supplyIncreaseVestingSchedule.totalVested, IOTA_TYPE_ARG, ); const [formattedTotalLocked, lockedSymbol] = useFormatCoin( - vestingSchedule.totalLocked, + supplyIncreaseVestingSchedule.totalLocked, IOTA_TYPE_ARG, ); const [formattedAvailableClaiming, availableClaimingSymbol] = useFormatCoin( - vestingSchedule.availableClaiming, + supplyIncreaseVestingSchedule.availableClaiming, IOTA_TYPE_ARG, ); @@ -178,30 +142,15 @@ export default function VestingDashboardPage(): JSX.Element { } const [totalStakedFormatted, totalStakedSymbol] = useFormatCoin( - vestingSchedule.totalStaked, + supplyIncreaseVestingSchedule.totalStaked, IOTA_TYPE_ARG, ); const [totalEarnedFormatted, totalEarnedSymbol] = useFormatCoin( - vestingSchedule.totalEarned, + supplyIncreaseVestingSchedule.totalEarned, IOTA_TYPE_ARG, ); - const unlockedTimelockedObjects = timelockedMapped?.filter((timelockedObject) => - isTimelockedUnlockable(timelockedObject, Number(currentEpochMs)), - ); - const unlockedTimelockedObjectIds: string[] = - unlockedTimelockedObjects.map((timelocked) => timelocked.id.id) || []; - const { data: unlockAllTimelockedObjects } = useUnlockTimelockedObjectsTransaction( - account?.address || '', - unlockedTimelockedObjectIds, - ); - - function refreshStakeList() { - refetchTimelockedStakedObjects(); - refetchGetAllOwnedObjects(); - } - function handleOnSuccess(digest: string): void { setTimelockedObjectsToUnstake(null); @@ -213,13 +162,13 @@ export default function VestingDashboardPage(): JSX.Element { } const handleCollect = () => { - if (!unlockAllTimelockedObjects?.transactionBlock) { + if (!unlockAllSupplyIncreaseVesting?.transactionBlock) { addNotification('Failed to create a Transaction', NotificationType.Error); return; } signAndExecuteTransaction( { - transaction: unlockAllTimelockedObjects.transactionBlock, + transaction: unlockAllSupplyIncreaseVesting.transactionBlock, }, { onSuccess: (tx) => { @@ -258,7 +207,7 @@ export default function VestingDashboardPage(): JSX.Element { } }, [router, supplyIncreaseVestingEnabled]); - if (istimelockedStakedObjectsLoading) { + if (isTimelockedStakedObjectsLoading) { return (
@@ -304,8 +253,8 @@ export default function VestingDashboardPage(): JSX.Element { title="Collect" buttonType={ButtonType.Primary} buttonDisabled={ - !vestingSchedule.availableClaiming || - vestingSchedule.availableClaiming === 0n + !supplyIncreaseVestingSchedule.availableClaiming || + supplyIncreaseVestingSchedule.availableClaiming === 0n } /> @@ -329,20 +278,20 @@ export default function VestingDashboardPage(): JSX.Element { onClick={openReceiveTokenDialog} title="See All" buttonType={ButtonType.Secondary} - buttonDisabled={!vestingPortfolio} + buttonDisabled={!supplyIncreaseVestingPortfolio} /> - {vestingPortfolio && ( + {supplyIncreaseVestingPortfolio && ( )}
- {timelockedstakedMapped.length === 0 ? ( + {supplyIncreaseVestingMapped.length === 0 ? ( - {timelockedstakedMapped.length !== 0 ? ( + {supplyIncreaseVestingMapped.length !== 0 ? (
{ setStakeDialogView(StakeDialogView.SelectValidator); }} @@ -422,8 +373,9 @@ export default function VestingDashboardPage(): JSX.Element { setView={setStakeDialogView} selectedValidator={selectedValidator} setSelectedValidator={setSelectedValidator} - maxStakableTimelockedAmount={BigInt(vestingSchedule.availableStaking)} - onUnstakeClick={openUnstakeDialog} + maxStakableTimelockedAmount={BigInt( + supplyIncreaseVestingSchedule.availableStaking, + )} /> )} diff --git a/apps/wallet-dashboard/app/globals.css b/apps/wallet-dashboard/app/globals.css index 04c6811f389..69ca23f41f2 100644 --- a/apps/wallet-dashboard/app/globals.css +++ b/apps/wallet-dashboard/app/globals.css @@ -24,7 +24,6 @@ body { 'balance' 'staking' 'coins' - 'vesting' 'activity'; & @@ -36,13 +35,29 @@ body { height: 200px; } } - .home-page-grid-container:has(.with-migration) { + .home-page-grid-container:has(.with-vesting):not(:has(.with-migration)) { + grid-template-areas: + 'balance' + 'staking' + 'vesting' + 'coins' + 'activity'; + } + .home-page-grid-container:has(.with-migration):not(:has(.with-vesting)) { grid-template-areas: 'balance' 'staking' 'migration' 'coins' + 'activity'; + } + .home-page-grid-container:has(.with-migration):has(.with-vesting) { + grid-template-areas: + 'balance' + 'staking' + 'migration' 'vesting' + 'coins' 'activity'; } @@ -53,28 +68,56 @@ body { 'balance balance' 'staking staking' 'coins coins' + 'activity activity'; + } + .home-page-grid-container:has(.with-vesting):not(:has(.with-migration)) { + grid-template-areas: + 'balance balance' + 'staking staking' 'vesting vesting' + 'coins coins' 'activity activity'; } - .home-page-grid-container:has(.with-migration) { + .home-page-grid-container:has(.with-migration):not(:has(.with-vesting)) { grid-template-areas: 'balance balance' 'staking migration' 'coins coins' + 'activity activity'; + } + .home-page-grid-container:has(.with-migration):has(.with-vesting) { + grid-template-areas: + 'balance balance' + 'staking migration' 'vesting vesting' + 'coins coins' 'activity activity'; } } @screen md { .home-page-grid-container { + min-height: 700px; + height: calc(100vh - 140px); @apply grid-cols-3; + grid-template-areas: + 'balance staking staking' + 'coins activity activity'; + } + .home-page-grid-container:has(.with-vesting):not(:has(.with-migration)) { grid-template-areas: 'balance staking staking' 'coins vesting vesting' 'coins activity activity'; } - .home-page-grid-container:has(.with-migration) { + + .home-page-grid-container:has(.with-migration):not(:has(.with-vesting)) { + grid-template-areas: + 'balance staking migration' + 'coins activity activity'; + } + + .home-page-grid-container:has(.with-migration):has(.with-vesting) { grid-template-areas: 'balance staking migration' 'coins vesting vesting' diff --git a/apps/wallet-dashboard/components/Dialogs/index.ts b/apps/wallet-dashboard/components/Dialogs/index.ts index 50ba05f1571..db380d17927 100644 --- a/apps/wallet-dashboard/components/Dialogs/index.ts +++ b/apps/wallet-dashboard/components/Dialogs/index.ts @@ -6,4 +6,5 @@ export * from './ReceiveFundsDialog'; export * from './Staking'; export * from './unstake'; export * from './vesting'; +export * from './settings'; export * from './MigrationDialog'; diff --git a/apps/wallet-dashboard/components/Dialogs/settings/SettingsDialog.tsx b/apps/wallet-dashboard/components/Dialogs/settings/SettingsDialog.tsx new file mode 100644 index 00000000000..2c87b522af2 --- /dev/null +++ b/apps/wallet-dashboard/components/Dialogs/settings/SettingsDialog.tsx @@ -0,0 +1,38 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +import React from 'react'; +import { Dialog } from '@iota/apps-ui-kit'; +import { SettingsDialogView } from './enums'; +import { SettingsListView, NetworkSelectorView } from './views'; + +interface SettingsDialogProps { + isOpen: boolean; + handleClose: () => void; + view: SettingsDialogView | undefined; + setView: (view: SettingsDialogView) => void; +} + +export function SettingsDialog({ + isOpen, + handleClose, + view, + setView, +}: SettingsDialogProps): JSX.Element { + function onBack(): void { + setView(SettingsDialogView.SelectSetting); + } + + return ( + <Dialog open={isOpen} onOpenChange={() => handleClose()}> + <> + {view === SettingsDialogView.SelectSetting && ( + <SettingsListView handleClose={handleClose} setView={setView} /> + )} + {view === SettingsDialogView.NetworkSettings && ( + <NetworkSelectorView handleClose={handleClose} onBack={onBack} /> + )} + </> + </Dialog> + ); +} diff --git a/apps/wallet-dashboard/components/Dialogs/settings/enums/index.ts b/apps/wallet-dashboard/components/Dialogs/settings/enums/index.ts new file mode 100644 index 00000000000..6f408e39b8c --- /dev/null +++ b/apps/wallet-dashboard/components/Dialogs/settings/enums/index.ts @@ -0,0 +1,4 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +export * from './view.enums'; diff --git a/apps/wallet-dashboard/components/Dialogs/settings/enums/view.enums.ts b/apps/wallet-dashboard/components/Dialogs/settings/enums/view.enums.ts new file mode 100644 index 00000000000..b3f17bb2130 --- /dev/null +++ b/apps/wallet-dashboard/components/Dialogs/settings/enums/view.enums.ts @@ -0,0 +1,7 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +export enum SettingsDialogView { + SelectSetting = 'SelectSetting', + NetworkSettings = 'NetworkSettings', +} diff --git a/apps/wallet-dashboard/components/Dialogs/settings/hooks/index.ts b/apps/wallet-dashboard/components/Dialogs/settings/hooks/index.ts new file mode 100644 index 00000000000..dfc58ee2f8b --- /dev/null +++ b/apps/wallet-dashboard/components/Dialogs/settings/hooks/index.ts @@ -0,0 +1,4 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +export * from './useSettingsDialog'; diff --git a/apps/wallet-dashboard/components/Dialogs/settings/hooks/useSettingsDialog.ts b/apps/wallet-dashboard/components/Dialogs/settings/hooks/useSettingsDialog.ts new file mode 100644 index 00000000000..6691f971e6c --- /dev/null +++ b/apps/wallet-dashboard/components/Dialogs/settings/hooks/useSettingsDialog.ts @@ -0,0 +1,27 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +import { useState } from 'react'; +import { SettingsDialogView } from '../enums'; + +export function useSettingsDialog() { + const [settingsDialogView, setSettingsDialogView] = useState<SettingsDialogView | undefined>(); + + const isSettingsDialogOpen = settingsDialogView !== undefined; + + function onCloseSettingsDialogClick() { + setSettingsDialogView(undefined); + } + + function onOpenSettingsDialogClick() { + setSettingsDialogView(SettingsDialogView.SelectSetting); + } + + return { + isSettingsDialogOpen, + settingsDialogView, + setSettingsDialogView, + onCloseSettingsDialogClick, + onOpenSettingsDialogClick, + }; +} diff --git a/apps/wallet-dashboard/components/Dialogs/settings/index.ts b/apps/wallet-dashboard/components/Dialogs/settings/index.ts new file mode 100644 index 00000000000..00a59c7b679 --- /dev/null +++ b/apps/wallet-dashboard/components/Dialogs/settings/index.ts @@ -0,0 +1,7 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +export * from './enums'; +export * from './SettingsDialog'; +export * from './hooks'; +export * from './views'; diff --git a/apps/wallet-dashboard/components/Dialogs/settings/views/NetworkSelectorView.tsx b/apps/wallet-dashboard/components/Dialogs/settings/views/NetworkSelectorView.tsx new file mode 100644 index 00000000000..cc9b573a9a9 --- /dev/null +++ b/apps/wallet-dashboard/components/Dialogs/settings/views/NetworkSelectorView.tsx @@ -0,0 +1,53 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +import React from 'react'; +import { Header, RadioButton } from '@iota/apps-ui-kit'; +import { DialogLayout, DialogLayoutBody } from '../../layout'; +import { NetworkConfiguration } from '@iota/iota-sdk/client'; +import { useIotaClientContext } from '@iota/dapp-kit'; +import toast from 'react-hot-toast'; + +interface NetworkSelectorViewProps { + handleClose: () => void; + onBack: () => void; +} + +export function NetworkSelectorView({ + handleClose, + onBack, +}: NetworkSelectorViewProps): JSX.Element { + const clientContext = useIotaClientContext(); + const activeNetwork = clientContext.network; + + async function handleNetworkChange(network: NetworkConfiguration) { + if (activeNetwork === network.id) { + return; + } + clientContext.selectNetwork(network.id); + toast.success(`Switched to ${network.name}`); + } + return ( + <DialogLayout> + <Header title="Network" onClose={handleClose} onBack={onBack} titleCentered /> + <DialogLayoutBody> + <div className="flex w-full flex-col gap-md"> + {Object.keys(clientContext.networks).map((network) => { + const networkConfig = clientContext.networks[ + network + ] as NetworkConfiguration; + return ( + <div className="px-md" key={networkConfig.id}> + <RadioButton + label={networkConfig.name} + isChecked={activeNetwork === networkConfig.id} + onChange={() => handleNetworkChange(networkConfig)} + /> + </div> + ); + })} + </div> + </DialogLayoutBody> + </DialogLayout> + ); +} diff --git a/apps/wallet-dashboard/components/Dialogs/settings/views/SettingsListView.tsx b/apps/wallet-dashboard/components/Dialogs/settings/views/SettingsListView.tsx new file mode 100644 index 00000000000..d5d619b3186 --- /dev/null +++ b/apps/wallet-dashboard/components/Dialogs/settings/views/SettingsListView.tsx @@ -0,0 +1,60 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +import React from 'react'; +import { + Card, + CardAction, + CardActionType, + CardBody, + CardImage, + CardType, + Header, + ImageType, +} from '@iota/apps-ui-kit'; +import { DialogLayout, DialogLayoutBody } from '../../layout'; +import { SettingsDialogView } from '../enums'; +import { getNetwork } from '@iota/iota-sdk/client'; +import { useIotaClientContext } from '@iota/dapp-kit'; +import { Globe } from '@iota/ui-icons'; + +interface SettingsListViewProps { + handleClose: () => void; + setView: (view: SettingsDialogView) => void; +} + +export function SettingsListView({ handleClose, setView }: SettingsListViewProps): JSX.Element { + const { network } = useIotaClientContext(); + const { name: networkName } = getNetwork(network); + function onSelectSettingClick(view: SettingsDialogView): void { + setView(view); + } + const MENU_ITEMS = [ + { + title: 'Network', + subtitle: networkName, + icon: <Globe />, + onClick: () => onSelectSettingClick(SettingsDialogView.NetworkSettings), + }, + ]; + return ( + <DialogLayout> + <Header title="Settings" onClose={handleClose} onBack={handleClose} titleCentered /> + <DialogLayoutBody> + <div className="flex w-full flex-col gap-md"> + {MENU_ITEMS.map((item, index) => ( + <Card key={index} type={CardType.Default} onClick={item.onClick}> + <CardImage type={ImageType.BgSolid}> + <div className="flex h-10 w-10 items-center justify-center rounded-full text-neutral-10 dark:text-neutral-92 [&_svg]:h-5 [&_svg]:w-5"> + <span className="text-2xl">{item.icon}</span> + </div> + </CardImage> + <CardBody title={item.title} subtitle={item.subtitle} /> + <CardAction type={CardActionType.Link} /> + </Card> + ))} + </div> + </DialogLayoutBody> + </DialogLayout> + ); +} diff --git a/apps/wallet-dashboard/components/Dialogs/settings/views/index.ts b/apps/wallet-dashboard/components/Dialogs/settings/views/index.ts new file mode 100644 index 00000000000..738311af3ac --- /dev/null +++ b/apps/wallet-dashboard/components/Dialogs/settings/views/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +export * from './SettingsListView'; +export * from './NetworkSelectorView'; diff --git a/apps/wallet-dashboard/components/Dialogs/vesting/VestingScheduleBox.tsx b/apps/wallet-dashboard/components/Dialogs/vesting/VestingScheduleBox.tsx index 25f861590a0..d9a93fc8d7c 100644 --- a/apps/wallet-dashboard/components/Dialogs/vesting/VestingScheduleBox.tsx +++ b/apps/wallet-dashboard/components/Dialogs/vesting/VestingScheduleBox.tsx @@ -8,7 +8,7 @@ import { IOTA_TYPE_ARG } from '@iota/iota-sdk/utils'; import { LockLocked } from '@iota/ui-icons'; interface VestingScheduleBoxProps { - amount: number; + amount: bigint; expirationTimestampMs: number; } diff --git a/apps/wallet-dashboard/components/SupplyIncreaseVestingOverview.tsx b/apps/wallet-dashboard/components/SupplyIncreaseVestingOverview.tsx new file mode 100644 index 00000000000..7608bda1a3a --- /dev/null +++ b/apps/wallet-dashboard/components/SupplyIncreaseVestingOverview.tsx @@ -0,0 +1,151 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +import { useCurrentAccount, useIotaClient } from '@iota/dapp-kit'; +import { useGetSupplyIncreaseVestingObjects } from '@/hooks'; +import { + ButtonType, + Card, + CardAction, + CardActionType, + CardBody, + CardType, + LabelText, + LabelTextSize, + Panel, + Title, +} from '@iota/apps-ui-kit'; +import { StakeDialog, useStakeDialog } from './Dialogs'; +import { TIMELOCK_IOTA_TYPE, useCountdownByTimestamp, useFormatCoin } from '@iota/core'; +import { IOTA_TYPE_ARG } from '@iota/iota-sdk/utils'; +import SvgClock from '@iota/ui-icons/src/Clock'; +import { useQueryClient } from '@tanstack/react-query'; + +export function SupplyIncreaseVestingOverview() { + const account = useCurrentAccount(); + const address = account?.address || ''; + const iotaClient = useIotaClient(); + const queryClient = useQueryClient(); + const { + nextPayout, + supplyIncreaseVestingSchedule, + supplyIncreaseVestingMapped, + supplyIncreaseVestingStakedMapped, + } = useGetSupplyIncreaseVestingObjects(address); + + const { + stakeDialogView, + setStakeDialogView, + selectedStake, + selectedValidator, + setSelectedValidator, + handleCloseStakeDialog, + handleNewStake, + } = useStakeDialog(); + + const formattedLastPayoutExpirationTime = useCountdownByTimestamp( + Number(nextPayout?.expirationTimestampMs), + { showSeconds: false, showMinutes: false }, + ); + const [formattedNextPayout, nextPayoutSymbol, nextPayoutResult] = useFormatCoin( + nextPayout?.amount, + IOTA_TYPE_ARG, + ); + + const [formattedAvailableStaking, availableStakingSymbol] = useFormatCoin( + supplyIncreaseVestingSchedule.availableStaking, + IOTA_TYPE_ARG, + ); + + const showSupplyIncreaseVestingOverview = + supplyIncreaseVestingMapped.length > 0 || supplyIncreaseVestingStakedMapped.length > 0; + + function handleOnSuccess(digest: string): void { + iotaClient + .waitForTransaction({ + digest, + }) + .then(() => { + queryClient.invalidateQueries({ + queryKey: ['get-timelocked-staked-objects', account?.address], + }); + queryClient.invalidateQueries({ + queryKey: [ + 'get-all-owned-objects', + account?.address, + { + StructType: TIMELOCK_IOTA_TYPE, + }, + ], + }); + }); + } + + return showSupplyIncreaseVestingOverview ? ( + <div style={{ gridArea: 'vesting' }} className="with-vesting flex grow overflow-hidden"> + <Panel> + <Title title="Vesting" /> + <div className="flex h-full w-full items-center gap-md p-md--rs"> + <div className="w-1/2"> + <Card type={CardType.Filled}> + <CardBody + title="" + subtitle={ + <LabelText + size={LabelTextSize.Large} + label="Next reward" + text={ + nextPayoutResult.isPending + ? '-' + : `${formattedNextPayout} ` + } + supportingLabel={nextPayoutSymbol} + /> + } + /> + <CardAction + type={CardActionType.Button} + buttonType={ButtonType.Ghost} + title={formattedLastPayoutExpirationTime} + icon={<SvgClock />} + /> + </Card> + </div> + <div className="w-1/2"> + <Card type={CardType.Filled}> + <CardBody + title="" + subtitle={ + <LabelText + size={LabelTextSize.Large} + label="Available for staking" + text={formattedAvailableStaking} + supportingLabel={availableStakingSymbol} + /> + } + /> + <CardAction + type={CardActionType.Button} + buttonType={ButtonType.Primary} + title={'Stake'} + onClick={() => handleNewStake()} + buttonDisabled={!supplyIncreaseVestingSchedule.availableStaking} + /> + </Card> + </div> + </div> + </Panel> + <StakeDialog + isTimelockedStaking={true} + stakedDetails={selectedStake} + onSuccess={handleOnSuccess} + handleClose={handleCloseStakeDialog} + view={stakeDialogView} + setView={setStakeDialogView} + selectedValidator={selectedValidator} + setSelectedValidator={setSelectedValidator} + maxStakableTimelockedAmount={BigInt(supplyIncreaseVestingSchedule.availableStaking)} + /> + </div> + ) : null; +} diff --git a/apps/wallet-dashboard/components/coins/MyCoins.tsx b/apps/wallet-dashboard/components/coins/MyCoins.tsx index fc441d76148..411d7cdc702 100644 --- a/apps/wallet-dashboard/components/coins/MyCoins.tsx +++ b/apps/wallet-dashboard/components/coins/MyCoins.tsx @@ -71,9 +71,9 @@ function MyCoins(): React.JSX.Element { return ( <Panel> - <div className="flex w-full flex-col"> + <div className="flex h-full w-full flex-col"> <Title title="My Coins" /> - <div className="px-sm pb-md pt-sm"> + <div className="px-sm py-sm"> <div className="inline-flex"> <SegmentedButton type={SegmentedButtonType.Filled}> {TOKEN_CATEGORIES.map(({ label, value }) => { @@ -96,37 +96,35 @@ function MyCoins(): React.JSX.Element { })} </SegmentedButton> </div> - <div className="pb-md pt-sm"> - {[TokenCategory.All, TokenCategory.Recognized].includes( - selectedTokenCategory, - ) && - recognized?.map((coin, index) => { - return ( - <CoinItem - key={index} - coinType={coin.coinType} - balance={BigInt(coin.totalBalance)} - onClick={() => openSendTokenDialog(coin)} - icon={ - <RecognizedBadge className="h-4 w-4 text-primary-40" /> - } - /> - ); - })} - {[TokenCategory.All, TokenCategory.Unrecognized].includes( - selectedTokenCategory, - ) && - unrecognized?.map((coin, index) => { - return ( - <CoinItem - key={index} - coinType={coin.coinType} - balance={BigInt(coin.totalBalance)} - onClick={() => openSendTokenDialog(coin)} - /> - ); - })} - </div> + </div> + <div className="h-full overflow-y-auto px-sm pb-md pt-sm"> + {[TokenCategory.All, TokenCategory.Recognized].includes( + selectedTokenCategory, + ) && + recognized?.map((coin, index) => { + return ( + <CoinItem + key={index} + coinType={coin.coinType} + balance={BigInt(coin.totalBalance)} + onClick={() => openSendTokenDialog(coin)} + icon={<RecognizedBadge className="h-4 w-4 text-primary-40" />} + /> + ); + })} + {[TokenCategory.All, TokenCategory.Unrecognized].includes( + selectedTokenCategory, + ) && + unrecognized?.map((coin, index) => { + return ( + <CoinItem + key={index} + coinType={coin.coinType} + balance={BigInt(coin.totalBalance)} + onClick={() => openSendTokenDialog(coin)} + /> + ); + })} </div> </div> {selectedCoin && activeAccountAddress && ( diff --git a/apps/wallet-dashboard/components/index.ts b/apps/wallet-dashboard/components/index.ts index e39bf76a350..fcccf7b3a95 100644 --- a/apps/wallet-dashboard/components/index.ts +++ b/apps/wallet-dashboard/components/index.ts @@ -27,4 +27,5 @@ export * from './Toaster'; export * from './Banner'; export * from './StakeRewardsPanel'; export * from './MigrationOverview'; +export * from './SupplyIncreaseVestingOverview'; export * from './staked-timelock-object'; diff --git a/apps/wallet-dashboard/components/staked-timelock-object/StakedTimelockObject.tsx b/apps/wallet-dashboard/components/staked-timelock-object/StakedTimelockObject.tsx index 8696705bc12..f7e21915a3a 100644 --- a/apps/wallet-dashboard/components/staked-timelock-object/StakedTimelockObject.tsx +++ b/apps/wallet-dashboard/components/staked-timelock-object/StakedTimelockObject.tsx @@ -27,11 +27,11 @@ export function StakedTimelockObject({ // TODO probably we could calculate estimated reward on grouping stage. const summary = timelockedStakedObject.stakes.reduce( (acc, stake) => { - const estimatedReward = stake.status === 'Active' ? stake.estimatedReward : 0; + const estimatedReward = stake.status === 'Active' ? BigInt(stake.estimatedReward) : 0n; return { principal: BigInt(stake.principal) + acc.principal, - estimatedReward: BigInt(estimatedReward) + acc.estimatedReward, + estimatedReward: estimatedReward + acc.estimatedReward, stakeRequestEpoch: stake.stakeRequestEpoch, }; }, diff --git a/apps/wallet-dashboard/components/transactions/TransactionAmount.tsx b/apps/wallet-dashboard/components/transactions/TransactionAmount.tsx index ae7654b0273..498ebc19522 100644 --- a/apps/wallet-dashboard/components/transactions/TransactionAmount.tsx +++ b/apps/wallet-dashboard/components/transactions/TransactionAmount.tsx @@ -5,7 +5,7 @@ import { useFormatCoin } from '@iota/core'; interface TransactionAmountProps { - amount: string | number; + amount: string | number | bigint; coinType: string; label: string; approximation?: boolean; diff --git a/apps/wallet-dashboard/components/transactions/TransactionsOverview.tsx b/apps/wallet-dashboard/components/transactions/TransactionsOverview.tsx index a590e3abcdb..fcaf74eddaa 100644 --- a/apps/wallet-dashboard/components/transactions/TransactionsOverview.tsx +++ b/apps/wallet-dashboard/components/transactions/TransactionsOverview.tsx @@ -9,7 +9,7 @@ function TransactionsOverview() { return ( <Panel> <Title title="Activity" /> - <div className="px-sm pb-md pt-sm"> + <div className="h-full overflow-y-auto px-sm pb-md pt-sm"> <TransactionsList /> </div> </Panel> diff --git a/apps/wallet-dashboard/hooks/index.ts b/apps/wallet-dashboard/hooks/index.ts index 2c8fed3331f..5ad872afeed 100644 --- a/apps/wallet-dashboard/hooks/index.ts +++ b/apps/wallet-dashboard/hooks/index.ts @@ -10,5 +10,6 @@ export * from './useGetCurrentEpochStartTimestamp'; export * from './useTimelockedUnstakeTransaction'; export * from './useExplorerLinkGetter'; export * from './useGetStardustMigratableObjects'; +export * from './useGetSupplyIncreaseVestingObjects'; export * from './useGroupedMigrationObjectsByExpirationDate'; export * from './useTransferTransaction'; diff --git a/apps/wallet-dashboard/hooks/useGetSupplyIncreaseVestingObjects.ts b/apps/wallet-dashboard/hooks/useGetSupplyIncreaseVestingObjects.ts new file mode 100644 index 00000000000..58d19d63641 --- /dev/null +++ b/apps/wallet-dashboard/hooks/useGetSupplyIncreaseVestingObjects.ts @@ -0,0 +1,112 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +import { useGetCurrentEpochStartTimestamp } from '@/hooks'; +import { + SupplyIncreaseVestingPayout, + SupplyIncreaseVestingPortfolio, + TimelockedObject, + VestingOverview, +} from '@/lib/interfaces'; +import { + buildSupplyIncreaseVestingSchedule, + ExtendedDelegatedTimelockedStake, + formatDelegatedTimelockedStake, + getLatestOrEarliestSupplyIncreaseVestingPayout, + getVestingOverview, + isSupplyIncreaseVestingObject, + isTimelockedUnlockable, + mapTimelockObjects, +} from '@/lib/utils'; +import { + TIMELOCK_IOTA_TYPE, + useGetAllOwnedObjects, + useGetTimelockedStakedObjects, + useUnlockTimelockedObjectsTransaction, +} from '@iota/core'; +import { Transaction } from '@iota/iota-sdk/transactions'; + +export function useGetSupplyIncreaseVestingObjects(address: string): { + nextPayout: SupplyIncreaseVestingPayout | undefined; + lastPayout: SupplyIncreaseVestingPayout | undefined; + supplyIncreaseVestingSchedule: VestingOverview; + supplyIncreaseVestingPortfolio: SupplyIncreaseVestingPortfolio | undefined; + supplyIncreaseVestingMapped: TimelockedObject[]; + supplyIncreaseVestingStakedMapped: ExtendedDelegatedTimelockedStake[]; + isTimelockedStakedObjectsLoading: boolean; + unlockAllSupplyIncreaseVesting: + | { + transactionBlock: Transaction; + } + | undefined; + refreshStakeList: () => void; +} { + const { data: currentEpochMs } = useGetCurrentEpochStartTimestamp(); + + const { data: timelockedObjects, refetch: refetchGetAllOwnedObjects } = useGetAllOwnedObjects( + address || '', + { + StructType: TIMELOCK_IOTA_TYPE, + }, + ); + const { + data: timelockedStakedObjects, + isLoading: isTimelockedStakedObjectsLoading, + refetch: refetchTimelockedStakedObjects, + } = useGetTimelockedStakedObjects(address || ''); + + const supplyIncreaseVestingMapped = mapTimelockObjects(timelockedObjects || []).filter( + isSupplyIncreaseVestingObject, + ); + const supplyIncreaseVestingStakedMapped = formatDelegatedTimelockedStake( + timelockedStakedObjects || [], + ).filter(isSupplyIncreaseVestingObject); + + const supplyIncreaseVestingSchedule = getVestingOverview( + [...supplyIncreaseVestingMapped, ...supplyIncreaseVestingStakedMapped], + Number(currentEpochMs), + ); + + const nextPayout = getLatestOrEarliestSupplyIncreaseVestingPayout( + [...supplyIncreaseVestingMapped, ...supplyIncreaseVestingStakedMapped], + Number(currentEpochMs), + false, + ); + + const lastPayout = getLatestOrEarliestSupplyIncreaseVestingPayout( + [...supplyIncreaseVestingMapped, ...supplyIncreaseVestingStakedMapped], + Number(currentEpochMs), + true, + ); + + const supplyIncreaseVestingPortfolio = + lastPayout && buildSupplyIncreaseVestingSchedule(lastPayout, Number(currentEpochMs)); + + const supplyIncreaseVestingUnlocked = supplyIncreaseVestingMapped?.filter( + (supplyIncreaseVestingObject) => + isTimelockedUnlockable(supplyIncreaseVestingObject, Number(currentEpochMs)), + ); + const supplyIncreaseVestingUnlockedObjectIds: string[] = + supplyIncreaseVestingUnlocked.map((unlockedObject) => unlockedObject.id.id) || []; + const { data: unlockAllSupplyIncreaseVesting } = useUnlockTimelockedObjectsTransaction( + address || '', + supplyIncreaseVestingUnlockedObjectIds, + ); + + function refreshStakeList() { + refetchTimelockedStakedObjects(); + refetchGetAllOwnedObjects(); + } + + return { + nextPayout, + lastPayout, + supplyIncreaseVestingSchedule, + supplyIncreaseVestingPortfolio, + supplyIncreaseVestingMapped, + supplyIncreaseVestingStakedMapped, + isTimelockedStakedObjectsLoading, + unlockAllSupplyIncreaseVesting, + refreshStakeList, + }; +} diff --git a/apps/wallet-dashboard/lib/constants/vesting.constants.ts b/apps/wallet-dashboard/lib/constants/vesting.constants.ts index 5e290e70e06..51ace2168a7 100644 --- a/apps/wallet-dashboard/lib/constants/vesting.constants.ts +++ b/apps/wallet-dashboard/lib/constants/vesting.constants.ts @@ -32,7 +32,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0xfe755ca67e3a0714f97ec3c49cfc6f3ecdab2673d96b5840294d3a5db376c99', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1697320800000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -42,7 +42,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x682d14613231dd1dde39397977cdfafb6b6263b5683b6782348c597c104b834', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1698530400000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -52,7 +52,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x93f2bf2d044e45e1a85c010c22357892d1625436b8c95b26dcdb6f309319064', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1699740000000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -62,7 +62,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x44fa510ba216cd555ecd6b99d1ebd612f82e2bf421091c973bca49b064dc72b', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1700949600000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -72,7 +72,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0xacd861b6dc5d108af03655a2175545ac6d432c526bcbe294b90e722fa36b459', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1702159200000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -82,7 +82,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x8f9eeb5953c77d53dcff3057619af7a29be1d9ce67bf66c86ad5309379d17e5', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1703368800000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -92,7 +92,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x70b1063c1104760afc06df5217bebdf02f937e1aff51211fc0472e677ba8c74', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1704578400000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -102,7 +102,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0xb0aa6f655d08f630c15a2cfb4e3e13e307ce9d96c52c1e91c65a71a204819bd', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1705788000000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -112,7 +112,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x65224b9a3b9eadc55be4cb6efa363f283b924607496d60c02deef2aa6bf9e22', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1706997600000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -122,7 +122,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x68f9a2af0ebd0bcd9e3cc836ac7103670a9602e8dca8fd28e7b2b5a693898f2', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1708207200000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -132,7 +132,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x637e6b758efdb8d49ee96397ca909d579bb77b79f8b64e7e7f1af13ad4f7ce4', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1709416800000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -142,7 +142,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0xbd0f349c21b67faec992b6c9a1b9b6343b4ff1f2ad5f33b0b4cd0fc31be2b31', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1710626400000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -152,7 +152,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0xfb8c3539b22e4086bd03417027e70515e6fb6d18f366876ad5ad0d8da3bde0f', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1711836000000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -162,7 +162,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0xbfb7c1a941885cc55a191e579c7c6d5dc345d6b5b9cfa439f724a343d354032', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1713045600000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -172,7 +172,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x8935a904f90e23f6f453cb0c85a03859e07f1c9e5a5d1644b2fbe7005d8e158', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1714255200000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -182,7 +182,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x73be6f8df4b73b83f8ccf909d61aabb56c56c56aa597d2806eccf3ab4fac66b', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1715464800000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -192,7 +192,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x20075cc2ebd5fa6e069829e58e55e6e010ad115e8cbc48d7a3d98d079ce649a', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1716674400000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -202,7 +202,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0xce03433d496cb231ead90a661fe08b924eb9b0cfb43dd560ea02a8060f6afd0', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1717884000000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -212,7 +212,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0xf111b8705ba276f8c6b76bdf72a4a46889cb8207cc5a80d3df0f40d9576116a', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1719093600000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -222,7 +222,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0xbc27940fb9c6f96ae9e2c11ad151446e30de5281172e48aac7f600d1da92c10', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1720303200000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -232,7 +232,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x016fae8797d3d12a26e215ec1815ee8adce70bb93149b4d55eb06a81c476ff9', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1721512800000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -242,7 +242,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x06f1e354ff551d76da8dc890eab728a65319defb3608991b4c70a1a2b30e8f1', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1722722400000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -252,7 +252,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0xc4cf3ea32480aab7d78784c6f00b9210ce0ffaabbcbb8cddd846073e7455386', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1723932000000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -262,7 +262,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x6dc10a8008855549b8d92e7704c799253a953d9835af001970426414fdd3ba7', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1725141600000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -272,7 +272,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0xa5f7a66c575db3f74c5fe7043c28f7231a2127aec4dc2de88f5b9d3cf020511', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1726351200000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -282,7 +282,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0xde0a4c2e0f16541983302c596339815ffa4d4743509e8115bc06fcf7f71ea8f', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1727560800000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -292,7 +292,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0xccc5d23ab69789b934b9bf7f5006e43eef45c2d7a251e3eec8b7dd24bc20a07', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1728770400000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -302,7 +302,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x503dc8844b0cd6e74e735433751328e8283569e81b4602aaa6941ce3fe826bb', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1729980000000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -312,7 +312,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x0fac98b5ac955644dffa0700933aababe438fae6fc58b8a4bd1f740c8aba941', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1731189600000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -322,7 +322,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x756483e3c7dd3491ea405f682df6c5dc1e4a59d8b5c9725b0d194815a25ea95', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1732399200000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -332,7 +332,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x72c4318876f51bed94c2228b395d18f5dce5f243039c7e3d8fad690dfe918fc', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1733608800000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -342,7 +342,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x37f68fd72af05b4c923268b64a0baa7511f27bc4cbd90641e444e7116f02604', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1734818400000, label: SUPPLY_INCREASE_VESTING_LABEL, @@ -352,7 +352,7 @@ export const MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS: TimelockedObject id: '0x97bedf66e48392a0b9baf8a8280e72fcce9b32ff980832edfe1a90a14ce9047', }, locked: { - value: 2_000_000_000, + value: 2_000_000_000n, }, expirationTimestampMs: 1736028000000, label: SUPPLY_INCREASE_VESTING_LABEL, diff --git a/apps/wallet-dashboard/lib/interfaces/timelock.interface.ts b/apps/wallet-dashboard/lib/interfaces/timelock.interface.ts index 12b26daeecb..2cb58e1a988 100644 --- a/apps/wallet-dashboard/lib/interfaces/timelock.interface.ts +++ b/apps/wallet-dashboard/lib/interfaces/timelock.interface.ts @@ -6,7 +6,7 @@ export interface UID { } export interface Balance { - value: number; + value: bigint; } export interface TimelockedObject { diff --git a/apps/wallet-dashboard/lib/interfaces/vesting.interface.ts b/apps/wallet-dashboard/lib/interfaces/vesting.interface.ts index ba846d71e6c..4eac7bcc774 100644 --- a/apps/wallet-dashboard/lib/interfaces/vesting.interface.ts +++ b/apps/wallet-dashboard/lib/interfaces/vesting.interface.ts @@ -7,7 +7,7 @@ export enum SupplyIncreaseUserType { } export interface SupplyIncreaseVestingPayout { - amount: number; + amount: bigint; expirationTimestampMs: number; } diff --git a/apps/wallet-dashboard/lib/utils/timelock.ts b/apps/wallet-dashboard/lib/utils/timelock.ts index 90c77c0ba9f..f8e06340922 100644 --- a/apps/wallet-dashboard/lib/utils/timelock.ts +++ b/apps/wallet-dashboard/lib/utils/timelock.ts @@ -42,14 +42,14 @@ export function mapTimelockObjects(iotaObjects: IotaObjectData[]): TimelockedObj if (!iotaObject?.content?.dataType || iotaObject.content.dataType !== 'moveObject') { return { id: { id: '' }, - locked: { value: 0 }, + locked: { value: 0n }, expirationTimestampMs: 0, }; } const fields = iotaObject.content.fields as unknown as TimelockedIotaResponse; return { id: fields.id, - locked: { value: Number(fields.locked) }, + locked: { value: BigInt(fields.locked) }, expirationTimestampMs: Number(fields.expiration_timestamp_ms), label: fields.label, }; diff --git a/apps/wallet-dashboard/lib/utils/vesting/vesting.spec.ts b/apps/wallet-dashboard/lib/utils/vesting/vesting.spec.ts index e0bb1f37bd5..3612418d48b 100644 --- a/apps/wallet-dashboard/lib/utils/vesting/vesting.spec.ts +++ b/apps/wallet-dashboard/lib/utils/vesting/vesting.spec.ts @@ -21,10 +21,6 @@ import { const MOCKED_CURRENT_EPOCH_TIMESTAMP = Date.now() + MILLISECONDS_PER_HOUR * 6; // 6 hours later -function bigIntRound(n: number) { - return BigInt(Math.floor(n)); -} - describe('get last supply increase vesting payout', () => { it('should get the object with highest expirationTimestampMs', () => { const timelockedObjects = MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS; @@ -48,7 +44,7 @@ describe('get last supply increase vesting payout', () => { describe('get supply increase user type', () => { it('should return staker, if last payout is two years away from vesting starting year (2023)', () => { const vestingPayout: SupplyIncreaseVestingPayout = { - amount: 1000, + amount: 1000n, expirationTimestampMs: 1735689661000, // Wednesday, 1 January 2025 00:01:01 }; const userType = getSupplyIncreaseVestingUserType([vestingPayout]); @@ -57,7 +53,7 @@ describe('get supply increase user type', () => { it('should return entity, if last payout is more than two years away from vesting starting year (2023)', () => { const vestingPayout: SupplyIncreaseVestingPayout = { - amount: 1000, + amount: 1000n, expirationTimestampMs: 1798761661000, // Friday, 1 January 2027 00:01:01 }; const userType = getSupplyIncreaseVestingUserType([vestingPayout]); @@ -125,12 +121,12 @@ describe('vesting overview', () => { it('should get correct vesting overview data with timelocked objects', () => { const timelockedObjects = MOCKED_SUPPLY_INCREASE_VESTING_TIMELOCKED_OBJECTS; const lastPayout = timelockedObjects[timelockedObjects.length - 1]; - const totalAmount = bigIntRound( - (SUPPLY_INCREASE_STAKER_VESTING_DURATION * - SUPPLY_INCREASE_VESTING_PAYOUTS_IN_1_YEAR * + const totalAmount = + (BigInt(SUPPLY_INCREASE_STAKER_VESTING_DURATION) * + BigInt(SUPPLY_INCREASE_VESTING_PAYOUTS_IN_1_YEAR) * + 10n * lastPayout.locked.value) / - 0.9, - ); + 9n; const vestingOverview = getVestingOverview(timelockedObjects, Date.now()); expect(vestingOverview.totalVested).toEqual(totalAmount); @@ -145,9 +141,7 @@ describe('vesting overview', () => { const lockedAmount = vestingPortfolio.reduce( (acc, current) => - current.expirationTimestampMs > Date.now() - ? acc + bigIntRound(current.amount) - : acc, + current.expirationTimestampMs > Date.now() ? acc + current.amount : acc, 0n, ); @@ -159,16 +153,12 @@ describe('vesting overview', () => { const lockedObjectsAmount = timelockedObjects.reduce( (acc, current) => - current.expirationTimestampMs > Date.now() - ? acc + bigIntRound(current.locked.value) - : acc, + current.expirationTimestampMs > Date.now() ? acc + current.locked.value : acc, 0n, ); const unlockedObjectsAmount = timelockedObjects.reduce( (acc, current) => - current.expirationTimestampMs <= Date.now() - ? acc + bigIntRound(current.locked.value) - : acc, + current.expirationTimestampMs <= Date.now() ? acc + current.locked.value : acc, 0n, ); @@ -182,20 +172,20 @@ describe('vesting overview', () => { formatDelegatedTimelockedStake(timelockedStakedObjects); const lastPayout = extendedTimelockedStakedObjects[extendedTimelockedStakedObjects.length - 1]; - const lastPayoutValue = Number(lastPayout.principal); - const totalAmount = bigIntRound( - (SUPPLY_INCREASE_STAKER_VESTING_DURATION * - SUPPLY_INCREASE_VESTING_PAYOUTS_IN_1_YEAR * - lastPayoutValue) / - 0.9, - ); + const lastPayoutValue = BigInt(lastPayout.principal); + const totalAmount = + (BigInt(SUPPLY_INCREASE_STAKER_VESTING_DURATION) * + BigInt(SUPPLY_INCREASE_VESTING_PAYOUTS_IN_1_YEAR) * + lastPayoutValue * + 10n) / + 9n; const vestingOverview = getVestingOverview(extendedTimelockedStakedObjects, Date.now()); expect(vestingOverview.totalVested).toEqual(totalAmount); const vestingPortfolio = buildVestingPortfolio( { - amount: lastPayoutValue, + amount: BigInt(lastPayoutValue), expirationTimestampMs: Number(lastPayout.expirationTimestampMs), }, Date.now(), @@ -203,9 +193,7 @@ describe('vesting overview', () => { const lockedAmount = vestingPortfolio.reduce( (acc, current) => - current.expirationTimestampMs > Date.now() - ? acc + bigIntRound(current.amount) - : acc, + current.expirationTimestampMs > Date.now() ? acc + current.amount : acc, 0n, ); @@ -215,7 +203,7 @@ describe('vesting overview', () => { let totalStaked = 0n; for (const timelockedStakedObject of timelockedStakedObjects) { const stakesAmount = timelockedStakedObject.stakes.reduce( - (acc, current) => acc + bigIntRound(Number(current.principal)), + (acc, current) => acc + BigInt(current.principal), 0n, ); totalStaked += stakesAmount; @@ -239,12 +227,12 @@ describe('vesting overview', () => { mixedObjects, MOCKED_CURRENT_EPOCH_TIMESTAMP, )!; - const totalAmount = bigIntRound( - (SUPPLY_INCREASE_STAKER_VESTING_DURATION * - SUPPLY_INCREASE_VESTING_PAYOUTS_IN_1_YEAR * + const totalAmount = + (BigInt(SUPPLY_INCREASE_STAKER_VESTING_DURATION) * + BigInt(SUPPLY_INCREASE_VESTING_PAYOUTS_IN_1_YEAR) * + 10n * lastPayout.amount) / - 0.9, - ); + 9n; const vestingOverview = getVestingOverview(mixedObjects, Date.now()); expect(vestingOverview.totalVested).toEqual(totalAmount); @@ -259,9 +247,7 @@ describe('vesting overview', () => { const lockedAmount = vestingPortfolio.reduce( (acc, current) => - current.expirationTimestampMs > Date.now() - ? acc + bigIntRound(current.amount) - : acc, + current.expirationTimestampMs > Date.now() ? acc + current.amount : acc, 0n, ); @@ -269,7 +255,7 @@ describe('vesting overview', () => { expect(vestingOverview.totalUnlocked).toEqual(totalAmount - lockedAmount); const totalStaked = extendedTimelockedStakedObjects.reduce( - (acc, current) => acc + bigIntRound(Number(current.principal)), + (acc, current) => acc + BigInt(current.principal), 0n, ); @@ -278,16 +264,12 @@ describe('vesting overview', () => { const timelockObjects = mixedObjects.filter(isTimelockedObject); const availableClaiming = timelockObjects.reduce( (acc, current) => - current.expirationTimestampMs <= Date.now() - ? acc + bigIntRound(current.locked.value) - : acc, + current.expirationTimestampMs <= Date.now() ? acc + current.locked.value : acc, 0n, ); const availableStaking = timelockObjects.reduce( (acc, current) => - current.expirationTimestampMs > Date.now() - ? acc + bigIntRound(current.locked.value) - : acc, + current.expirationTimestampMs > Date.now() ? acc + current.locked.value : acc, 0n, ); expect(vestingOverview.availableClaiming).toEqual(availableClaiming); diff --git a/apps/wallet-dashboard/lib/utils/vesting/vesting.ts b/apps/wallet-dashboard/lib/utils/vesting/vesting.ts index e0bb8a29158..374d9a19204 100644 --- a/apps/wallet-dashboard/lib/utils/vesting/vesting.ts +++ b/apps/wallet-dashboard/lib/utils/vesting/vesting.ts @@ -53,7 +53,7 @@ export function getLatestOrEarliestSupplyIncreaseVestingPayout( } function addVestingPayoutToSupplyIncreaseMap( - value: number, + value: bigint, expirationTimestampMs: number, supplyIncreaseMap: Map<number, SupplyIncreaseVestingPayout>, ) { @@ -85,7 +85,7 @@ function supplyIncreaseVestingObjectsToPayoutMap( expirationToVestingPayout, ); } else if (isTimelockedStakedIota(vestingObject)) { - const objectValue = Number(vestingObject.principal); + const objectValue = BigInt(vestingObject.principal); const expirationTimestampMs = Number(vestingObject.expirationTimestampMs); addVestingPayoutToSupplyIncreaseMap( objectValue, @@ -162,7 +162,7 @@ export function getVestingOverview( const userType = getSupplyIncreaseVestingUserType([latestPayout]); const vestingPayoutsCount = getSupplyIncreaseVestingPayoutsCount(userType!); // Note: we add the initial payout to the total rewards, 10% of the total rewards are paid out immediately - const totalVestedAmount = BigInt(Math.floor((vestingPayoutsCount * latestPayout.amount) / 0.9)); + const totalVestedAmount = (BigInt(vestingPayoutsCount) * latestPayout.amount * 10n) / 9n; const vestingPortfolio = buildSupplyIncreaseVestingSchedule( latestPayout, currentEpochTimestamp, @@ -326,7 +326,7 @@ export function prepareObjectsForTimelockedStakingTransaction( targetAmount: bigint, currentEpochMs: string, ): GroupedTimelockObject[] { - if (Number(targetAmount) === 0) { + if (targetAmount === 0n) { return []; } const timelockedMapped = mapTimelockObjects(timelockedObjects); @@ -368,7 +368,7 @@ export function prepareObjectsForTimelockedStakingTransaction( const remainingAmount = totalLocked - targetAmount; // Add splitAmount property to the vesting objects that need to be split - if (remainingAmount > 0) { + if (remainingAmount > 0n) { selectedGroupedTimelockObjects = adjustSplitAmountsInGroupedTimelockObjects( selectedGroupedTimelockObjects, remainingAmount, diff --git a/apps/wallet-dashboard/providers/AppProviders.tsx b/apps/wallet-dashboard/providers/AppProviders.tsx index 68283c410ab..46d69758c94 100644 --- a/apps/wallet-dashboard/providers/AppProviders.tsx +++ b/apps/wallet-dashboard/providers/AppProviders.tsx @@ -19,11 +19,17 @@ export function AppProviders({ children }: React.PropsWithChildren) { const [queryClient] = useState(() => new QueryClient()); const allNetworks = getAllNetworks(); const defaultNetwork = getDefaultNetwork(); - + function handleNetworkChange() { + queryClient.resetQueries(); + } return ( <GrowthBookProvider growthbook={growthbook}> <QueryClientProvider client={queryClient}> - <IotaClientProvider networks={allNetworks} defaultNetwork={defaultNetwork}> + <IotaClientProvider + networks={allNetworks} + defaultNetwork={defaultNetwork} + onNetworkChange={handleNetworkChange} + > <KioskClientProvider> <WalletProvider autoConnect={true} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2d3181eaebb..005fb06d7d4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1560,128 +1560,6 @@ importers: specifier: ^5.5.3 version: 5.6.2 - sdk/create-dapp/templates/react-client-dapp: - dependencies: - '@iota/dapp-kit': - specifier: workspace:* - version: link:../../../dapp-kit - '@iota/iota-sdk': - specifier: workspace:* - version: link:../../../typescript - '@radix-ui/colors': - specifier: ^3.0.0 - version: 3.0.0 - '@radix-ui/react-icons': - specifier: ^1.3.0 - version: 1.3.0(react@18.3.1) - '@radix-ui/themes': - specifier: ^3.1.1 - version: 3.1.4(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@tanstack/react-query': - specifier: ^5.50.1 - version: 5.56.2(react@18.3.1) - react: - specifier: ^18.3.1 - version: 18.3.1 - react-dom: - specifier: ^18.3.1 - version: 18.3.1(react@18.3.1) - devDependencies: - '@types/react': - specifier: ^18.3.3 - version: 18.3.9 - '@types/react-dom': - specifier: ^18.3.0 - version: 18.3.0 - '@typescript-eslint/eslint-plugin': - specifier: ^7.16.0 - version: 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.6.2))(eslint@8.57.1)(typescript@5.6.2) - '@typescript-eslint/parser': - specifier: ^7.16.0 - version: 7.18.0(eslint@8.57.1)(typescript@5.6.2) - '@vitejs/plugin-react-swc': - specifier: ^3.7.0 - version: 3.7.0(@swc/helpers@0.5.5)(vite@5.4.8(@types/node@22.7.3)(sass@1.79.3)(terser@5.34.0)) - eslint: - specifier: 8.57.1 - version: 8.57.1 - eslint-plugin-react-hooks: - specifier: ^4.6.2 - version: 4.6.2(eslint@8.57.1) - eslint-plugin-react-refresh: - specifier: ^0.4.7 - version: 0.4.12(eslint@8.57.1) - prettier: - specifier: ^3.3.2 - version: 3.3.3 - typescript: - specifier: ^5.5.3 - version: 5.6.2 - vite: - specifier: ^5.3.3 - version: 5.4.8(@types/node@22.7.3)(sass@1.79.3)(terser@5.34.0) - - sdk/create-dapp/templates/react-e2e-counter: - dependencies: - '@iota/dapp-kit': - specifier: workspace:* - version: link:../../../dapp-kit - '@iota/iota-sdk': - specifier: workspace:* - version: link:../../../typescript - '@radix-ui/colors': - specifier: ^3.0.0 - version: 3.0.0 - '@radix-ui/react-icons': - specifier: ^1.3.0 - version: 1.3.0(react@18.3.1) - '@radix-ui/themes': - specifier: ^3.1.1 - version: 3.1.4(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@tanstack/react-query': - specifier: ^5.50.1 - version: 5.56.2(react@18.3.1) - react: - specifier: ^18.3.1 - version: 18.3.1 - react-dom: - specifier: ^18.3.1 - version: 18.3.1(react@18.3.1) - devDependencies: - '@types/react': - specifier: ^18.3.3 - version: 18.3.9 - '@types/react-dom': - specifier: ^18.3.0 - version: 18.3.0 - '@typescript-eslint/eslint-plugin': - specifier: ^6.1.0 - version: 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.6.2))(eslint@8.57.1)(typescript@5.6.2) - '@typescript-eslint/parser': - specifier: ^6.1.0 - version: 6.21.0(eslint@8.57.1)(typescript@5.6.2) - '@vitejs/plugin-react-swc': - specifier: ^3.7.0 - version: 3.7.0(@swc/helpers@0.5.5)(vite@5.4.8(@types/node@22.7.3)(sass@1.79.3)(terser@5.34.0)) - eslint: - specifier: 8.57.1 - version: 8.57.1 - eslint-plugin-react-hooks: - specifier: ^4.6.2 - version: 4.6.2(eslint@8.57.1) - eslint-plugin-react-refresh: - specifier: ^0.4.7 - version: 0.4.12(eslint@8.57.1) - prettier: - specifier: ^3.3.2 - version: 3.3.3 - typescript: - specifier: ^5.5.3 - version: 5.6.2 - vite: - specifier: ^5.3.3 - version: 5.4.8(@types/node@22.7.3)(sass@1.79.3)(terser@5.34.0) - sdk/dapp-kit: dependencies: '@iota/iota-sdk': @@ -5086,15 +4964,9 @@ packages: '@popperjs/core@2.11.8': resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==} - '@radix-ui/colors@3.0.0': - resolution: {integrity: sha512-FUOsGBkHrYJwCSEtWRCIfQbZG7q1e6DgxCIOe1SUQzDe/7rXXeA47s8yCn6fuTNQAj1Zq4oTFi9Yjp3wzElcxg==} - '@radix-ui/number@1.0.1': resolution: {integrity: sha512-T5gIdVO2mmPW3NNhjNgEP3cqMXjXL9UbO0BzWcXfvdBs+BohbQxvd/K5hSVKmn9/lbTdsQVKbUcP5WLCwvUbBg==} - '@radix-ui/number@1.1.0': - resolution: {integrity: sha512-V3gRzhVNU1ldS5XhAPTom1fOIo4ccrjjJgmE+LI2h/WaFpHmx0MQApT+KZHnx8abG6Avtfcz4WoEciMnpFT3HQ==} - '@radix-ui/primitive@1.0.0': resolution: {integrity: sha512-3e7rn8FDMin4CgeL7Z/49smCA3rFYY3Ha2rUQ7HRWFadS5iCRw08ZgVT1LaNTCNqgvrUiyczLflrVrF0SRQtNA==} @@ -5104,32 +4976,6 @@ packages: '@radix-ui/primitive@1.1.0': resolution: {integrity: sha512-4Z8dn6Upk0qk4P74xBhZ6Hd/w0mPEzOOLxy4xiPXOXqjF7jZS0VAKk7/x/H6FyY2zCkYJqePf1G5KmkmNJ4RBA==} - '@radix-ui/react-accessible-icon@1.1.0': - resolution: {integrity: sha512-i9Zg4NOSXlfUva0agzI2DjWrvFJm9uO4L6CMW7nmMa5CIOOX/Yin894W7WwjodFQWPwe5kmAJ4JF33R8slKI2g==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-alert-dialog@1.1.1': - resolution: {integrity: sha512-wmCoJwj7byuVuiLKqDLlX7ClSUU0vd9sdCeM+2Ls+uf13+cpSJoMgwysHq1SGVVkJj5Xn0XWi1NoRCdkMpr6Mw==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@radix-ui/react-arrow@1.0.3': resolution: {integrity: sha512-wSP+pHsB/jQRaL6voubsQ/ZlrGBHHrOjmBnr19hxYgtS0WvAFwZhK2WP/YY5yF9uKECCEEDGxuLxq1NBK51wFA==} peerDependencies: @@ -5156,45 +5002,6 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-aspect-ratio@1.1.0': - resolution: {integrity: sha512-dP87DM/Y7jFlPgUZTlhx6FF5CEzOiaxp2rBCKlaXlpH5Ip/9Fg5zZ9lDOQ5o/MOfUlf36eak14zoWYpgcgGoOg==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-avatar@1.1.0': - resolution: {integrity: sha512-Q/PbuSMk/vyAd/UoIShVGZ7StHHeRFYU7wXmi5GV+8cLXflZAEpHL/F697H1klrzxKXNtZ97vWiC0q3RKUH8UA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-checkbox@1.1.0': - resolution: {integrity: sha512-3+kSzVfMONtP3B6CvaOrXLVTyGYws7tGmG5kOY0AfyH9sexkLytIwciNwjZhY0RoGOEbxI7bMS21XYB8H5itWQ==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@radix-ui/react-checkbox@1.1.1': resolution: {integrity: sha512-0i/EKJ222Afa1FE0C6pNJxDq1itzcl3HChE9DwskA4th4KRse8ojx8a1nVcOjwJdbpDLcz7uol77yYnQNMHdKw==} peerDependencies: @@ -5270,19 +5077,6 @@ packages: '@types/react': optional: true - '@radix-ui/react-context-menu@2.2.1': - resolution: {integrity: sha512-wvMKKIeb3eOrkJ96s722vcidZ+2ZNfcYZWBPRHIB1VWrF+fiF851Io6LX0kmK5wTDQFKdulCCKJk2c3SBaQHvA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@radix-ui/react-context@1.0.0': resolution: {integrity: sha512-1pVM9RfOQ+n/N5PJK33kRSKsr1glNxomxONs5c49MliinBY6Yw2Q995qfBUUo0/Mbg05B/sGA0gkgPI7kmSHBg==} peerDependencies: @@ -5443,37 +5237,6 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-form@0.1.0': - resolution: {integrity: sha512-1/oVYPDjbFILOLIarcGcMKo+y6SbTVT/iUKVEw59CF4offwZgBgC3ZOeSBewjqU0vdA6FWTPWTN63obj55S/tQ==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-hover-card@1.1.1': - resolution: {integrity: sha512-IwzAOP97hQpDADYVKrEEHUH/b2LA+9MgB0LgdmnbFO2u/3M5hmEofjjr2M6CyzUblaAqJdFm6B7oFtU72DPXrA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-icons@1.3.0': - resolution: {integrity: sha512-jQxj/0LKgp+j9BiTXz3O3sgs26RNet2iLWmsPyRz2SIcR4q/4SbazXfnYwbAr+vLYKSfc7qxzyGQA1HLlYiuNw==} - peerDependencies: - react: ^16.x || ^17.x || ^18.x - '@radix-ui/react-id@1.0.0': resolution: {integrity: sha512-Q6iAB/U7Tq3NTolBBQbHTgclPmGWE3OlktGGqrClPozSw4vkQ1DfQAOtzgRPecKsMdJINE05iaoDUG8tRzCBjw==} peerDependencies: @@ -5658,32 +5421,6 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-progress@1.1.0': - resolution: {integrity: sha512-aSzvnYpP725CROcxAOEBVZZSIQVQdHgBr2QQFKySsaD14u8dNT0batuXI+AAGDdAHfXH8rbnHmjYFqVJ21KkRg==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-radio-group@1.2.0': - resolution: {integrity: sha512-yv+oiLaicYMBpqgfpSPw6q+RyXlLdIpQWDHZbUKURxe+nEh53hFXPPlfhfQQtYkS5MMK/5IWIa76SksleQZSzw==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@radix-ui/react-roving-focus@1.1.0': resolution: {integrity: sha512-EA6AMGeq9AEeQDeSH0aZgG198qkfHSbvWTf1HvoDmOB5bBG/qTxjYMWUKMnYiV6J/iP/J8MEFSuB2zRU2n7ODA==} peerDependencies: @@ -5697,19 +5434,6 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-scroll-area@1.1.0': - resolution: {integrity: sha512-9ArIZ9HWhsrfqS765h+GZuLoxaRHD/j0ZWOWilsCvYTpYJp8XwCqNG7Dt9Nu/TItKOdgLGkOPCodQvDc+UMwYg==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@radix-ui/react-select@1.2.2': resolution: {integrity: sha512-zI7McXr8fNaSrUY9mZe4x/HC0jTLY9fWNhO1oLWYMQGDXuV4UCivIGTxwioSzO0ZCYX9iSLyWmAh/1TOmX3Cnw==} peerDependencies: @@ -5723,19 +5447,6 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-select@2.1.1': - resolution: {integrity: sha512-8iRDfyLtzxlprOo9IicnzvpsO1wNCkuwzzCM+Z5Rb5tNOpCdMvcc2AkzX0Fz+Tz9v6NJ5B/7EEgyZveo4FBRfQ==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@radix-ui/react-separator@1.1.0': resolution: {integrity: sha512-3uBAs+egzvJBDZAzvb/n4NxxOYpnspmWxO2u5NbZ8Y6FM/NdrGSF9bop3Cf6F6C71z1rTSn8KV0Fo2ZVd79lGA==} peerDependencies: @@ -5749,19 +5460,6 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-slider@1.2.0': - resolution: {integrity: sha512-dAHCDA4/ySXROEPaRtaMV5WHL8+JB/DbtyTbJjYkY0RXmKMO2Ln8DFZhywG5/mVQ4WqHDBc8smc14yPXPqZHYA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@radix-ui/react-slot@1.0.0': resolution: {integrity: sha512-3mrKauI/tWXo1Ll+gN5dHcxDPdm/Df1ufcDLCecn+pnCIVcdWE7CujXo8QaXOWRJyZyQWWbpB8eFwHzWXlv5mQ==} peerDependencies: @@ -5850,19 +5548,6 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-tooltip@1.1.1': - resolution: {integrity: sha512-LLE8nzNE4MzPMw3O2zlVlkLFid3y9hMUs7uCbSHyKSo+tCN4yMCf+ZCCcfrYgsOC0TiHBPQ1mtpJ2liY3ZT3SQ==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@radix-ui/react-use-callback-ref@1.0.0': resolution: {integrity: sha512-GZtyzoHz95Rhs6S63D2t/eqvdFCm7I+yHMLVQheKM7nBD8mbZIt+ct1jz4536MDnaOGKIxynJ8eHTkVGVVkoTg==} peerDependencies: @@ -6041,19 +5726,6 @@ packages: '@radix-ui/rect@1.1.0': resolution: {integrity: sha512-A9+lCBZoaMJlVKcRBz2YByCG+Cp2t6nAnMnNba+XiWxnj6r4JUFqfsgwocMBZU9LPtdxC6wB56ySYpc7LQIoJg==} - '@radix-ui/themes@3.1.4': - resolution: {integrity: sha512-HmyU8UpoYPmdfXSQIwbEnJS2Wv/5wbzxe/Niw/sMLMJTrlZiUKM/dEOM7N+bc7w2OMpUaQ8OH9czCGpcjHx98w==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: 16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: 16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@reduxjs/toolkit@1.9.7': resolution: {integrity: sha512-t7v8ZPxhhKgOKtU+uyJT13lu4vL7az5aFi4IdoDs/eS548edn2M8Ik9h8fxgvMjGoAUVFSt6ZC1P5cWmQ014QQ==} peerDependencies: @@ -8412,10 +8084,18 @@ packages: resolution: {integrity: sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==} engines: {node: '>=14.16'} + call-bind-apply-helpers@1.0.1: + resolution: {integrity: sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==} + engines: {node: '>= 0.4'} + call-bind@1.0.7: resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} engines: {node: '>= 0.4'} + call-bind@1.0.8: + resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==} + engines: {node: '>= 0.4'} + callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -8576,9 +8256,6 @@ packages: class-variance-authority@0.7.0: resolution: {integrity: sha512-jFI8IQw4hczaL4ALINxqLEXQbWcNjoSkloa4IaufXCJr6QawJyw7tuRysRsrE8w2p/4gGaxKIt/hX3qz/IbD1A==} - classnames@2.3.2: - resolution: {integrity: sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==} - classnames@2.5.1: resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==} @@ -9616,6 +9293,10 @@ packages: resolution: {integrity: sha512-b7Z7cNtHPhH9EJhNNbbeqTcXB8LGFFZhq1PGgEvpeHlzd36bhbdTWoE/Ba/YguqpBSlAPKnARWhVlhunCMwfxg==} engines: {node: '>=0.10'} + dunder-proto@1.0.0: + resolution: {integrity: sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==} + engines: {node: '>= 0.4'} + duplexer@0.1.2: resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==} @@ -9718,6 +9399,10 @@ packages: resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} engines: {node: '>= 0.4'} + es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} + engines: {node: '>= 0.4'} + es-errors@1.3.0: resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} engines: {node: '>= 0.4'} @@ -9910,11 +9595,6 @@ packages: peerDependencies: eslint: 8.57.1 - eslint-plugin-react-refresh@0.4.12: - resolution: {integrity: sha512-9neVjoGv20FwYtCP6CB1dzR1vr57ZDNOXst21wd2xJ/cTlM2xLq0GWVlSNTdMn/4BtP6cHYBMCSp1wFBJ9jBsg==} - peerDependencies: - eslint: 8.57.1 - eslint-plugin-react@7.37.0: resolution: {integrity: sha512-IHBePmfWH5lKhJnJ7WB1V+v/GolbB0rjS8XYVCSQCZKaQCAUhMoVoOEn1Ef8Z8Wf0a7l8KTJvuZg5/e4qrZ6nA==} engines: {node: '>=4'} @@ -10505,6 +10185,10 @@ packages: resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} engines: {node: '>= 0.4'} + get-intrinsic@1.2.6: + resolution: {integrity: sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==} + engines: {node: '>= 0.4'} + get-nonce@1.0.1: resolution: {integrity: sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==} engines: {node: '>=6'} @@ -10652,6 +10336,10 @@ packages: gopd@1.0.1: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} + got@12.6.1: resolution: {integrity: sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==} engines: {node: '>=14.16'} @@ -10779,6 +10467,10 @@ packages: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} + has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} + engines: {node: '>= 0.4'} + has-tostringtag@1.0.2: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} engines: {node: '>= 0.4'} @@ -12157,6 +11849,10 @@ packages: math-expression-evaluator@1.4.0: resolution: {integrity: sha512-4vRUvPyxdO8cWULGTh9dZWL2tZK6LDBvj+OGHBER7poH9Qdt7kXEoj20wiz4lQUbUXQZFjPbe5mVDo9nutizCw==} + math-intrinsics@1.0.0: + resolution: {integrity: sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==} + engines: {node: '>= 0.4'} + mdast-util-definitions@4.0.0: resolution: {integrity: sha512-k8AJ6aNnUkB7IE+5azR9h81O5EQ/cTDXtWdMq9Kk5KcEW/8ritU5CeLg/9HhOC++nALHBlaogJ5jz0Ybk3kPMQ==} @@ -14124,16 +13820,6 @@ packages: resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==} engines: {node: '>=0.10.0'} - react-remove-scroll-bar@2.3.4: - resolution: {integrity: sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - react-remove-scroll-bar@2.3.6: resolution: {integrity: sha512-DtSYaao4mBmX+HDo5YWYdBWQwYIQQshUV/dVxFxK+KM26Wjwp1gZ6rv6OC3oujI6Bfu6Xyg3TwK533AQutsn/g==} engines: {node: '>=10'} @@ -21107,105 +20793,41 @@ snapshots: '@pnpm/npm-conf@2.3.1': dependencies: - '@pnpm/config.env-replace': 1.1.0 - '@pnpm/network.ca-file': 1.0.2 - config-chain: 1.1.13 - - '@polka/url@1.0.0-next.28': {} - - '@popperjs/core@2.11.8': {} - - '@radix-ui/colors@3.0.0': {} - - '@radix-ui/number@1.0.1': - dependencies: - '@babel/runtime': 7.25.6 - - '@radix-ui/number@1.1.0': {} - - '@radix-ui/primitive@1.0.0': - dependencies: - '@babel/runtime': 7.25.6 - - '@radix-ui/primitive@1.0.1': - dependencies: - '@babel/runtime': 7.25.6 - - '@radix-ui/primitive@1.1.0': {} - - '@radix-ui/react-accessible-icon@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-visually-hidden': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-alert-dialog@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-dialog': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.9)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 + '@pnpm/config.env-replace': 1.1.0 + '@pnpm/network.ca-file': 1.0.2 + config-chain: 1.1.13 - '@radix-ui/react-arrow@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@polka/url@1.0.0-next.28': {} + + '@popperjs/core@2.11.8': {} + + '@radix-ui/number@1.0.1': dependencies: '@babel/runtime': 7.25.6 - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 - '@radix-ui/react-arrow@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/primitive@1.0.0': dependencies: - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 + '@babel/runtime': 7.25.6 - '@radix-ui/react-aspect-ratio@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/primitive@1.0.1': dependencies: - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 + '@babel/runtime': 7.25.6 - '@radix-ui/react-avatar@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/primitive@1.1.0': {} + + '@radix-ui/react-arrow@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@radix-ui/react-context': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.9)(react@18.3.1) + '@babel/runtime': 7.25.6 + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: '@types/react': 18.3.9 '@types/react-dom': 18.3.0 - '@radix-ui/react-checkbox@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/react-arrow@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-previous': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-size': 1.1.0(@types/react@18.3.9)(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: @@ -21287,20 +20909,6 @@ snapshots: optionalDependencies: '@types/react': 18.3.9 - '@radix-ui/react-context-menu@2.2.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-context': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-menu': 2.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.9)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 - '@radix-ui/react-context@1.0.0(react@18.3.1)': dependencies: '@babel/runtime': 7.25.6 @@ -21479,41 +21087,6 @@ snapshots: '@types/react': 18.3.9 '@types/react-dom': 18.3.0 - '@radix-ui/react-form@0.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-id': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-label': 2.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-hover-card@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-portal': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.9)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-icons@1.3.0(react@18.3.1)': - dependencies: - react: 18.3.1 - '@radix-ui/react-id@1.0.0(react@18.3.1)': dependencies: '@babel/runtime': 7.25.6 @@ -21723,34 +21296,6 @@ snapshots: '@types/react': 18.3.9 '@types/react-dom': 18.3.0 - '@radix-ui/react-progress@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-context': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-radio-group@1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-direction': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-previous': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-size': 1.1.0(@types/react@18.3.9)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 - '@radix-ui/react-roving-focus@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@radix-ui/primitive': 1.1.0 @@ -21768,23 +21313,6 @@ snapshots: '@types/react': 18.3.9 '@types/react-dom': 18.3.0 - '@radix-ui/react-scroll-area@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/number': 1.1.0 - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-direction': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.9)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 - '@radix-ui/react-select@1.2.2(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@babel/runtime': 7.25.6 @@ -21815,35 +21343,6 @@ snapshots: '@types/react': 18.3.9 '@types/react-dom': 18.3.0 - '@radix-ui/react-select@2.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/number': 1.1.0 - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-direction': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-focus-guards': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-id': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-portal': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-previous': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-visually-hidden': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - aria-hidden: 1.2.4 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-remove-scroll: 2.5.7(@types/react@18.3.9)(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 - '@radix-ui/react-separator@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -21853,25 +21352,6 @@ snapshots: '@types/react': 18.3.9 '@types/react-dom': 18.3.0 - '@radix-ui/react-slider@1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/number': 1.1.0 - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-direction': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-previous': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-size': 1.1.0(@types/react@18.3.9)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 - '@radix-ui/react-slot@1.0.0(react@18.3.1)': dependencies: '@babel/runtime': 7.25.6 @@ -21965,26 +21445,6 @@ snapshots: '@types/react': 18.3.9 '@types/react-dom': 18.3.0 - '@radix-ui/react-tooltip@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-id': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-portal': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-visually-hidden': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 - '@radix-ui/react-use-callback-ref@1.0.0(react@18.3.1)': dependencies: '@babel/runtime': 7.25.6 @@ -22131,49 +21591,6 @@ snapshots: '@radix-ui/rect@1.1.0': {} - '@radix-ui/themes@3.1.4(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/colors': 3.0.0 - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-accessible-icon': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-alert-dialog': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-aspect-ratio': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-avatar': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-checkbox': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-context-menu': 2.2.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-dialog': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-direction': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-dropdown-menu': 2.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-form': 0.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-hover-card': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-navigation-menu': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-popover': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-portal': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-progress': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-radio-group': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-scroll-area': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-select': 2.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slider': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-switch': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-tabs': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-toggle-group': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-tooltip': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-visually-hidden': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - classnames: 2.3.2 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-remove-scroll-bar: 2.3.4(@types/react@18.3.9)(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 - '@reduxjs/toolkit@1.9.7(react-redux@8.1.3(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(redux@4.2.1))(react@18.3.1)': dependencies: immer: 9.0.21 @@ -24409,13 +23826,6 @@ snapshots: transitivePeerDependencies: - '@swc/helpers' - '@vitejs/plugin-react-swc@3.7.0(@swc/helpers@0.5.5)(vite@5.4.8(@types/node@22.7.3)(sass@1.79.3)(terser@5.34.0))': - dependencies: - '@swc/core': 1.7.28(@swc/helpers@0.5.5) - vite: 5.4.8(@types/node@22.7.3)(sass@1.79.3)(terser@5.34.0) - transitivePeerDependencies: - - '@swc/helpers' - '@vitejs/plugin-react@3.1.0(vite@5.4.8(@types/node@20.16.9)(sass@1.79.3)(terser@5.34.0))': dependencies: '@babel/core': 7.25.2 @@ -25496,6 +24906,11 @@ snapshots: normalize-url: 8.0.1 responselike: 3.0.0 + call-bind-apply-helpers@1.0.1: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + call-bind@1.0.7: dependencies: es-define-property: 1.0.0 @@ -25504,6 +24919,13 @@ snapshots: get-intrinsic: 1.2.4 set-function-length: 1.2.2 + call-bind@1.0.8: + dependencies: + call-bind-apply-helpers: 1.0.1 + es-define-property: 1.0.0 + get-intrinsic: 1.2.6 + set-function-length: 1.2.2 + callsites@3.1.0: {} camel-case@4.1.2: @@ -25683,8 +25105,6 @@ snapshots: dependencies: clsx: 2.0.0 - classnames@2.3.2: {} - classnames@2.5.1: {} clean-css@5.3.3: @@ -26799,6 +26219,12 @@ snapshots: nan: 2.20.0 optional: true + dunder-proto@1.0.0: + dependencies: + call-bind-apply-helpers: 1.0.1 + es-errors: 1.3.0 + gopd: 1.2.0 + duplexer@0.1.2: {} duplexify@3.7.1: @@ -26928,6 +26354,8 @@ snapshots: dependencies: get-intrinsic: 1.2.4 + es-define-property@1.0.1: {} + es-errors@1.3.0: {} es-get-iterator@1.1.3: @@ -27257,10 +26685,6 @@ snapshots: dependencies: eslint: 8.57.1 - eslint-plugin-react-refresh@0.4.12(eslint@8.57.1): - dependencies: - eslint: 8.57.1 - eslint-plugin-react@7.37.0(eslint@8.57.1): dependencies: array-includes: 3.1.8 @@ -28003,6 +27427,19 @@ snapshots: has-symbols: 1.0.3 hasown: 2.0.2 + get-intrinsic@1.2.6: + dependencies: + call-bind-apply-helpers: 1.0.1 + dunder-proto: 1.0.0 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.0.0 + function-bind: 1.1.2 + gopd: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + math-intrinsics: 1.0.0 + get-nonce@1.0.1: {} get-npm-tarball-url@2.1.0: {} @@ -28192,6 +27629,8 @@ snapshots: dependencies: get-intrinsic: 1.2.4 + gopd@1.2.0: {} + got@12.6.1: dependencies: '@sindresorhus/is': 5.6.0 @@ -28367,6 +27806,8 @@ snapshots: has-symbols@1.0.3: {} + has-symbols@1.1.0: {} + has-tostringtag@1.0.2: dependencies: has-symbols: 1.0.3 @@ -29146,8 +28587,8 @@ snapshots: is-weakset@2.0.3: dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 + call-bind: 1.0.8 + get-intrinsic: 1.2.6 is-windows@1.0.2: {} @@ -30084,6 +29525,8 @@ snapshots: math-expression-evaluator@1.4.0: {} + math-intrinsics@1.0.0: {} + mdast-util-definitions@4.0.0: dependencies: unist-util-visit: 2.0.3 @@ -32487,14 +31930,6 @@ snapshots: react-refresh@0.14.2: {} - react-remove-scroll-bar@2.3.4(@types/react@18.3.9)(react@18.3.1): - dependencies: - react: 18.3.1 - react-style-singleton: 2.2.1(@types/react@18.3.9)(react@18.3.1) - tslib: 2.7.0 - optionalDependencies: - '@types/react': 18.3.9 - react-remove-scroll-bar@2.3.6(@types/react@18.3.9)(react@18.3.1): dependencies: react: 18.3.1 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 58699ae570b..3ad2792cd72 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -5,7 +5,7 @@ packages: - "sdk/**" - "!**/dist/**" - "!**/.next/**" - - "!sdk/create-dapp/templates" + - "!sdk/create-dapp/templates/*" - "!sdk/typescript/bcs" - "!sdk/typescript/client" - "!sdk/typescript/cryptography" diff --git a/sdk/create-dapp/templates/react-client-dapp/eslint.config.js b/sdk/create-dapp/templates/react-client-dapp/eslint.config.js new file mode 100644 index 00000000000..7c663262678 --- /dev/null +++ b/sdk/create-dapp/templates/react-client-dapp/eslint.config.js @@ -0,0 +1,28 @@ +import eslint from "@eslint/js"; +import tseslint from "typescript-eslint"; +import react from "eslint-plugin-react"; +import reactHooks from "eslint-plugin-react-hooks"; +import reactRefresh from "eslint-plugin-react-refresh"; + +export default tseslint.config( + { + files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"], + plugins: { + react, + reactHooks, + reactRefresh, + }, + settings: { + version: "18", + }, + languageOptions: { + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, + }, + eslint.configs.recommended, + tseslint.configs.recommended, +); diff --git a/sdk/create-dapp/templates/react-client-dapp/package.json b/sdk/create-dapp/templates/react-client-dapp/package.json index 8e79c61bd6b..611f666329d 100644 --- a/sdk/create-dapp/templates/react-client-dapp/package.json +++ b/sdk/create-dapp/templates/react-client-dapp/package.json @@ -6,28 +6,30 @@ "scripts": { "dev": "vite", "build": "tsc && vite build", - "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", - "preview": "vite preview" + "lint": "eslint .", + "preview": "vite preview", + "format": "prettier -w ." }, "dependencies": { "@iota/dapp-kit": "workspace:*", "@iota/iota-sdk": "workspace:*", - "@radix-ui/colors": "^3.0.0", - "@radix-ui/react-icons": "^1.3.0", "@radix-ui/themes": "^3.1.1", "@tanstack/react-query": "^5.50.1", "react": "^18.3.1", "react-dom": "^18.3.1" }, "devDependencies": { + "@eslint/js": "^9.17.0", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", - "@typescript-eslint/eslint-plugin": "^7.16.0", - "@typescript-eslint/parser": "^7.16.0", + "@typescript-eslint/eslint-plugin": "^8.18.0", + "@typescript-eslint/parser": "^8.18.0", "@vitejs/plugin-react-swc": "^3.7.0", - "eslint": "^9.6.0", - "eslint-plugin-react-hooks": "^4.6.2", + "eslint": "^9.17.0", + "eslint-plugin-react-hooks": "^5.1.0", "eslint-plugin-react-refresh": "^0.4.7", + "eslint-plugin-react": "^7.37.2", + "typescript-eslint": "^8.18.0", "prettier": "^3.3.2", "typescript": "^5.5.3", "vite": "^5.3.3" diff --git a/sdk/create-dapp/templates/react-e2e-counter/eslint.config.js b/sdk/create-dapp/templates/react-e2e-counter/eslint.config.js new file mode 100644 index 00000000000..7c663262678 --- /dev/null +++ b/sdk/create-dapp/templates/react-e2e-counter/eslint.config.js @@ -0,0 +1,28 @@ +import eslint from "@eslint/js"; +import tseslint from "typescript-eslint"; +import react from "eslint-plugin-react"; +import reactHooks from "eslint-plugin-react-hooks"; +import reactRefresh from "eslint-plugin-react-refresh"; + +export default tseslint.config( + { + files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"], + plugins: { + react, + reactHooks, + reactRefresh, + }, + settings: { + version: "18", + }, + languageOptions: { + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, + }, + eslint.configs.recommended, + tseslint.configs.recommended, +); diff --git a/sdk/create-dapp/templates/react-e2e-counter/package.json b/sdk/create-dapp/templates/react-e2e-counter/package.json index 607acf6b606..0be7053cb16 100644 --- a/sdk/create-dapp/templates/react-e2e-counter/package.json +++ b/sdk/create-dapp/templates/react-e2e-counter/package.json @@ -6,28 +6,30 @@ "scripts": { "dev": "vite", "build": "tsc && vite build", - "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", - "preview": "vite preview" + "lint": "eslint .", + "preview": "vite preview", + "format": "prettier -w ." }, "dependencies": { "@iota/dapp-kit": "workspace:*", "@iota/iota-sdk": "workspace:*", - "@radix-ui/colors": "^3.0.0", - "@radix-ui/react-icons": "^1.3.0", "@radix-ui/themes": "^3.1.1", "@tanstack/react-query": "^5.50.1", "react": "^18.3.1", "react-dom": "^18.3.1" }, "devDependencies": { + "@eslint/js": "^9.17.0", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", - "@typescript-eslint/eslint-plugin": "^6.1.0", - "@typescript-eslint/parser": "^6.1.0", + "@typescript-eslint/eslint-plugin": "^8.18.0", + "@typescript-eslint/parser": "^8.18.0", "@vitejs/plugin-react-swc": "^3.7.0", - "eslint": "^8.45.0", - "eslint-plugin-react-hooks": "^4.6.2", + "eslint": "^9.17.0", + "eslint-plugin-react-hooks": "^5.1.0", "eslint-plugin-react-refresh": "^0.4.7", + "eslint-plugin-react": "^7.37.2", + "typescript-eslint": "^8.18.0", "prettier": "^3.3.2", "typescript": "^5.5.3", "vite": "^5.3.3"