diff --git a/applications/tari_walletd/web_ui/package.json b/applications/tari_walletd/web_ui/package.json index 365c00ac29..492b2d841d 100644 --- a/applications/tari_walletd/web_ui/package.json +++ b/applications/tari_walletd/web_ui/package.json @@ -10,43 +10,43 @@ "clean-dist": "rm -rf dist && rm -f tsconfig.tsbuildinfo" }, "dependencies": { - "@emotion/react": "^11.10.6", - "@emotion/styled": "^11.10.6", - "@mui/icons-material": "^5.11.11", - "@mui/material": "^5.11.14", - "@mui/x-data-grid": "^6.0.2", - "@reown/walletkit": "^1.2.8", - "@tanstack/react-query": "^4.33.0", - "@tanstack/react-query-devtools": "^4.33.0", + "@emotion/react": "^11.14.0", + "@emotion/styled": "^11.14.1", + "@mui/icons-material": "^5.18.0", + "@mui/material": "^5.18.0", + "@mui/x-data-grid": "^6.20.4", + "@reown/walletkit": "^1.2.10", + "@tanstack/react-query": "^5.85.7", + "@tanstack/react-query-devtools": "^5.85.7", "@tari-project/tari-extension-common": "^0.0.14", "@tari-project/tari-extension-query-builder": "^0.0.15", "@tari-project/tari-permissions": "0.10.1", "@tari-project/typescript-bindings": "link:../../../bindings", "@tari-project/wallet_jrpc_client": "workspace:*", - "@walletconnect/core": "^2.21.4", - "@walletconnect/utils": "^2.21.4", + "@walletconnect/core": "^2.21.8", + "@walletconnect/utils": "^2.21.8", "buffer": "^6.0.3", "cbor2": "^2.0.1", "file-saver": "^2.0.5", "framer-motion": "^12.23.12", "jwt-decode": "^4.0.0", "prism-react-renderer": "^2.4.1", - "react": "^19.0.0", - "react-dom": "^19.0.0", - "react-icons": "^4.9.0", - "react-router-dom": "^6.9.0", - "use-file-picker": "^2.1.2", + "react": "^19.1.1", + "react-dom": "^19.1.1", + "react-icons": "^4.12.0", + "react-router-dom": "^6.30.1", + "use-file-picker": "^2.1.4", "use-react-router-breadcrumbs": "^4.0.1", - "zustand": "^5.0.3", + "zustand": "^5.0.8", "zustand-persist": "^0.4.0" }, "devDependencies": { "@types/file-saver": "^2.0.7", "@types/node": "catalog:", - "@types/react": "^18.0.28", - "@types/react-dom": "^18.0.11", - "@vitejs/plugin-react-swc": "^3.8.0", - "prettier": "^3.3.2", + "@types/react": "^18.3.24", + "@types/react-dom": "^18.3.7", + "@vitejs/plugin-react-swc": "^3.11.0", + "prettier": "^3.6.2", "typescript": "catalog:", "vite": "catalog:" } diff --git a/applications/tari_walletd/web_ui/src/App.tsx b/applications/tari_walletd/web_ui/src/App.tsx index 05c0b11b55..002a54d16e 100644 --- a/applications/tari_walletd/web_ui/src/App.tsx +++ b/applications/tari_walletd/web_ui/src/App.tsx @@ -21,27 +21,27 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import { Navigate, Route, Routes } from "react-router-dom"; -import Accounts from "./routes/Accounts/Accounts"; -import AccountDetails from "./routes/AccountDetails/AccountDetails"; -import Keys from "./routes/Keys/Keys"; -import ErrorPage from "./routes/ErrorPage"; -import Wallet from "./routes/Wallet/Wallet"; -import Layout from "./theme/LayoutMain"; -import AccessTokensLayout from "./routes/AccessTokens/AccessTokens"; -import Transactions from "./routes/Transactions/TransactionsLayout"; -import TransactionDetails from "./routes/Transactions/TransactionDetails"; -import AssetVault from "./routes/AssetVault/AssetVault"; -import SettingsPage from "./routes/Settings/Settings"; -import Auth, { AUTH_TOKEN_FOR_NONE_AUTH } from "./routes/Auth/Auth"; -import Webauthn from "./routes/WebauthnRegistration/Webauthn"; -import useAuthStore from "./store/authStore"; +import Accounts from "@routes/Accounts/Accounts"; +import AccountDetails from "@routes/AccountDetails/AccountDetails"; +import Keys from "@routes/Keys/Keys"; +import ErrorPage from "@routes/ErrorPage"; +import Wallet from "@routes/Wallet/Wallet"; +import Layout from "@theme/LayoutMain"; +import AccessTokensLayout from "@routes/AccessTokens/AccessTokens"; +import Transactions from "@routes/Transactions/TransactionsLayout"; +import TransactionDetails from "@routes/Transactions/TransactionDetails"; +import AssetVault from "@routes/AssetVault/AssetVault"; +import SettingsPage from "@routes/Settings/Settings"; +import Auth, { AUTH_TOKEN_FOR_NONE_AUTH } from "@routes/Auth/Auth"; +import Webauthn from "@routes/WebauthnRegistration/Webauthn"; +import useAuthStore from "@store/authStore"; import { useEffect } from "react"; -import { useAuthMethod } from "./api/hooks/useAuth"; -import AccessToken from "./routes/AccessToken/AccessToken"; +import { useAuthMethod } from "@api/hooks/useAuth"; +import AccessToken from "@routes/AccessToken/AccessToken"; import { jwtDecode } from "jwt-decode"; -import Templates from "./routes/Templates/Templates"; -import Manifest from "./routes/Manifest/Manifest"; -import FlowEditor from "./routes/FlowEditor/FlowEditor"; +import Templates from "@routes/Templates/Templates"; +import Manifest from "@routes/Manifest/Manifest"; +import FlowEditor from "@routes/FlowEditor/FlowEditor"; export const breadcrumbRoutes = [ { diff --git a/applications/tari_walletd/web_ui/src/Components/CodeBlock.tsx b/applications/tari_walletd/web_ui/src/Components/CodeBlock.tsx index a8417ac71b..6fea907336 100644 --- a/applications/tari_walletd/web_ui/src/Components/CodeBlock.tsx +++ b/applications/tari_walletd/web_ui/src/Components/CodeBlock.tsx @@ -36,7 +36,7 @@ import { IoContractOutline, IoCheckmarkOutline, } from "react-icons/io5"; -import { renderJson } from "../utils/helpers"; +import { renderJson } from "@utils/helpers"; interface ICodeBlockExpand { title: string; diff --git a/applications/tari_walletd/web_ui/src/Components/ConnectorLink/ConnectorLink.tsx b/applications/tari_walletd/web_ui/src/Components/ConnectorLink/ConnectorLink.tsx index dc04ade8ab..d7f2e32e2a 100644 --- a/applications/tari_walletd/web_ui/src/Components/ConnectorLink/ConnectorLink.tsx +++ b/applications/tari_walletd/web_ui/src/Components/ConnectorLink/ConnectorLink.tsx @@ -31,14 +31,14 @@ import DialogContentText from "@mui/material/DialogContentText"; import CloseIcon from "@mui/icons-material/Close"; import IconButton from "@mui/material/IconButton"; import "./ConnectorLink.css"; -import Permissions from "./Permissions"; -import CheckMark from "./CheckMark"; -import ConnectorLogo from "./ConnectorLogo"; -import { parse } from "../../utils/tari_permissions"; -import ConfirmTransaction from "./ConfirmTransaction"; -import Stepper from "../Stepper"; +import Permissions from "@components/ConnectorLink/Permissions"; +import CheckMark from "@components/ConnectorLink/CheckMark"; +import ConnectorLogo from "@components/ConnectorLink/ConnectorLogo"; +import { parse } from "@utils/tari_permissions"; +import ConfirmTransaction from "@components/ConnectorLink/ConfirmTransaction"; +import Stepper from "@components/Stepper"; import { useTheme } from "@mui/material/styles"; -import { webrtcStart } from "../../utils/json_rpc"; +import { webrtcStart } from "@utils/json_rpc"; const ConnectorDialog = () => { const [page, setPage] = useState(1); diff --git a/applications/tari_walletd/web_ui/src/Components/ConnectorLink/index.ts b/applications/tari_walletd/web_ui/src/Components/ConnectorLink/index.ts index 03ae3f4fc0..f824aa68dd 100644 --- a/applications/tari_walletd/web_ui/src/Components/ConnectorLink/index.ts +++ b/applications/tari_walletd/web_ui/src/Components/ConnectorLink/index.ts @@ -20,5 +20,5 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import ConnectorLink from "./ConnectorLink"; +import ConnectorLink from "@components/ConnectorLink/ConnectorLink"; export default ConnectorLink; diff --git a/applications/tari_walletd/web_ui/src/Components/CopyAddress.tsx b/applications/tari_walletd/web_ui/src/Components/CopyAddress.tsx index 70889816e1..570a7be35e 100644 --- a/applications/tari_walletd/web_ui/src/Components/CopyAddress.tsx +++ b/applications/tari_walletd/web_ui/src/Components/CopyAddress.tsx @@ -21,8 +21,8 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import { SubstateId, shortenString } from "@tari-project/typescript-bindings"; -import { isSubstateIdString, shortenSubstateId, substateIdToString } from "../utils/helpers"; -import CopyToClipboard from "./CopyToClipboard"; +import { isSubstateIdString, shortenSubstateId, substateIdToString } from "@utils/helpers"; +import CopyToClipboard from "@components/CopyToClipboard"; interface Props { address: string; diff --git a/applications/tari_walletd/web_ui/src/Components/FetchStatusCheck.tsx b/applications/tari_walletd/web_ui/src/Components/FetchStatusCheck.tsx index c3b72fa7e4..8b7c62b1dd 100644 --- a/applications/tari_walletd/web_ui/src/Components/FetchStatusCheck.tsx +++ b/applications/tari_walletd/web_ui/src/Components/FetchStatusCheck.tsx @@ -20,8 +20,8 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import Loading from "./Loading"; -import Error from "./Error"; +import Loading from "@components/Loading"; +import Error from "@components/Error"; interface FetchStatusCheckProps { errorMessage: string; diff --git a/applications/tari_walletd/web_ui/src/Components/JsonTooltip.tsx b/applications/tari_walletd/web_ui/src/Components/JsonTooltip.tsx index 1c1a67c8bd..3d45f4cdd2 100644 --- a/applications/tari_walletd/web_ui/src/Components/JsonTooltip.tsx +++ b/applications/tari_walletd/web_ui/src/Components/JsonTooltip.tsx @@ -21,7 +21,7 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import React from "react"; -import { renderJson } from "../utils/helpers"; +import { renderJson } from "@utils/helpers"; export default function JsonTooltip({ jsonText, children }: { jsonText: string; children: string }) { if (jsonText === null) { diff --git a/applications/tari_walletd/web_ui/src/Components/MenuItems.tsx b/applications/tari_walletd/web_ui/src/Components/MenuItems.tsx index c270626181..ff305d6d89 100644 --- a/applications/tari_walletd/web_ui/src/Components/MenuItems.tsx +++ b/applications/tari_walletd/web_ui/src/Components/MenuItems.tsx @@ -35,7 +35,7 @@ import { } from "react-icons/io5"; import Tooltip from "@mui/material/Tooltip"; import Fade from "@mui/material/Fade"; -import ThemeSwitcher from "./ThemeSwitcher"; +import ThemeSwitcher from "@components/ThemeSwitcher"; import Box from "@mui/material/Box"; import { useTheme } from "@mui/material/styles"; import { LuLayoutTemplate } from "react-icons/lu"; diff --git a/applications/tari_walletd/web_ui/src/Components/NFTList.tsx b/applications/tari_walletd/web_ui/src/Components/NFTList.tsx index 73e29b48a6..8633a28fd3 100644 --- a/applications/tari_walletd/web_ui/src/Components/NFTList.tsx +++ b/applications/tari_walletd/web_ui/src/Components/NFTList.tsx @@ -21,14 +21,14 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import React from "react"; -import FetchStatusCheck from "./FetchStatusCheck"; +import FetchStatusCheck from "@components/FetchStatusCheck"; import { Table, TableBody, TableCell, TableContainer, TableHead, TableRow } from "@mui/material"; -import type { ApiError } from "../api/helpers/types"; -import { DataTableCell } from "./StyledComponents"; -import { renderJson, shortenString, shortenSubstateId, toHexString } from "../utils/helpers"; +import type { ApiError } from "@api/helpers/types"; +import { DataTableCell } from "@components/StyledComponents"; +import { renderJson, shortenString, shortenSubstateId, toHexString } from "@utils/helpers"; import { IoCheckmarkOutline, IoCloseOutline } from "react-icons/io5"; import type { NonFungibleId, NonFungibleToken, ListNftsResponse } from "@tari-project/typescript-bindings"; -import { convertCborValue } from "../utils/cbor"; +import { convertCborValue } from "@utils/cbor"; function NftListItem({ nft }: { nft: NonFungibleToken }) { return ( diff --git a/applications/tari_walletd/web_ui/src/Components/ThemeSwitcher.tsx b/applications/tari_walletd/web_ui/src/Components/ThemeSwitcher.tsx index a99d17602c..e969f2d309 100644 --- a/applications/tari_walletd/web_ui/src/Components/ThemeSwitcher.tsx +++ b/applications/tari_walletd/web_ui/src/Components/ThemeSwitcher.tsx @@ -22,7 +22,7 @@ import { Button } from "@mui/material"; import { IoMoonOutline, IoSunny } from "react-icons/io5"; -import useThemeStore from "../store/themeStore"; +import useThemeStore from "@store/themeStore"; import { useTheme } from "@mui/material/styles"; const ThemeSwitcher = () => { diff --git a/applications/tari_walletd/web_ui/src/Components/WalletConnectLink/WalletConnectLink.tsx b/applications/tari_walletd/web_ui/src/Components/WalletConnectLink/WalletConnectLink.tsx index 2b16c43979..5cbd8fbc6f 100644 --- a/applications/tari_walletd/web_ui/src/Components/WalletConnectLink/WalletConnectLink.tsx +++ b/applications/tari_walletd/web_ui/src/Components/WalletConnectLink/WalletConnectLink.tsx @@ -31,10 +31,10 @@ import DialogContentText from "@mui/material/DialogContentText"; import CloseIcon from "@mui/icons-material/Close"; import IconButton from "@mui/material/IconButton"; import "./ConnectorLink.css"; -import Permissions from "./Permissions"; -import CheckMark from "./CheckMark"; -import ConnectorLogo from "./ConnectorLogo"; -import ConfirmTransaction from "./ConfirmTransaction"; +import Permissions from "@components/WalletConnectLink/Permissions"; +import CheckMark from "@components/WalletConnectLink/CheckMark"; +import ConnectorLogo from "@components/WalletConnectLink/ConnectorLogo"; +import ConfirmTransaction from "@components/WalletConnectLink/ConfirmTransaction"; import { useTheme } from "@mui/material/styles"; import { TariPermission } from "@tari-project/tari-permissions"; import { Core } from "@walletconnect/core"; @@ -54,8 +54,8 @@ import { transactionsGetResult, transactionsSubmit, walletGetInfo, -} from "../../utils/json_rpc"; -import useAccountStore from "../../store/accountStore"; +} from "@utils/json_rpc"; +import useAccountStore from "@store/accountStore"; import { buildApprovedNamespaces, getSdkError } from "@walletconnect/utils"; import { Error as ErrorIcon } from "@mui/icons-material"; import CircularProgress from "@mui/material/CircularProgress"; diff --git a/applications/tari_walletd/web_ui/src/Components/WalletConnectLink/index.ts b/applications/tari_walletd/web_ui/src/Components/WalletConnectLink/index.ts index be3e456ecc..13efd9b94f 100644 --- a/applications/tari_walletd/web_ui/src/Components/WalletConnectLink/index.ts +++ b/applications/tari_walletd/web_ui/src/Components/WalletConnectLink/index.ts @@ -20,5 +20,5 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import WalletConnectLink from "./WalletConnectLink"; +import WalletConnectLink from "@components/WalletConnectLink/WalletConnectLink"; export default WalletConnectLink; diff --git a/applications/tari_walletd/web_ui/src/api/hooks/useAccounts.ts b/applications/tari_walletd/web_ui/src/api/hooks/useAccounts.ts index e155043274..34526c6d46 100644 --- a/applications/tari_walletd/web_ui/src/api/hooks/useAccounts.ts +++ b/applications/tari_walletd/web_ui/src/api/hooks/useAccounts.ts @@ -35,9 +35,9 @@ import { mintFaucetNfts, nftList, validatorsGetFees, -} from "../../utils/json_rpc"; -import { ApiError } from "../helpers/types"; -import queryClient from "../queryClient"; +} from "@utils/json_rpc"; +import { ApiError } from "@api/helpers/types"; +import queryClient from "@api/queryClient"; import type { AccountOrKeyIndex, ClaimBurnProof, @@ -52,12 +52,13 @@ const DEFAULT_MAX_FEE = 2000; // Fees are passed as strings because Amount is tagged export const useAccountsClaimBurn = () => { - return useMutation((params: ClaimBurnRequest) => accountsClaimBurn(params), { + return useMutation({ + mutationFn: (params: ClaimBurnRequest) => accountsClaimBurn(params), onError: (error: ApiError) => { error; }, onSettled: () => { - queryClient.invalidateQueries(["accounts"]); + queryClient.invalidateQueries({ queryKey: ["accounts"] }); }, }); }; @@ -69,23 +70,21 @@ export type AccountsCreateMutate = { }; export const useAccountsCreate = () => { - return useMutation( - async (req: AccountsCreateMutate) => { + return useMutation({ + mutationFn: async (req: AccountsCreateMutate) => { return await accountsCreate({ account_name: req.accountName || "", is_default: req.isDefault || null, key_id: req.keyId || null, }); }, - { - onError: (error: ApiError) => { - error; - }, - onSettled: () => { - queryClient.invalidateQueries(["accounts"]); - }, + onError: (error: ApiError) => { + error; }, - ); + onSettled: () => { + queryClient.invalidateQueries({ queryKey: ["accounts"] }); + }, + }); }; export interface TransferParams { @@ -102,8 +101,8 @@ export interface TransferParams { } export const useAccountsTransfer = () => { - return useMutation( - (params: TransferParams) => { + return useMutation({ + mutationFn: (params: TransferParams) => { const account = { ComponentAddress: params.account }; const max_fee = params.max_fee || DEFAULT_MAX_FEE; if (params.resourceType === "Confidential") { @@ -147,15 +146,13 @@ export const useAccountsTransfer = () => { return accountsTransfer(transferRequest); } }, - { - onError: (error: ApiError) => { - error; - }, - onSettled: () => { - queryClient.invalidateQueries(["accounts"]); - }, + onError: (error: ApiError) => { + error; + }, + onSettled: () => { + queryClient.invalidateQueries({ queryKey: ["accounts"] }); }, - ); + }); }; export const useAccountsCreateFreeTestCoins = () => { @@ -174,13 +171,14 @@ export const useAccountsCreateFreeTestCoins = () => { max_fee: fee, }); - return useMutation(createFreeTestCoins, { + return useMutation({ + mutationFn: createFreeTestCoins, onError: (error: ApiError) => { console.error(error); }, onSettled: () => { - queryClient.invalidateQueries(["transactions"]); - queryClient.invalidateQueries(["accounts_balances"]); + queryClient.invalidateQueries({ queryKey: ["transactions"] }); + queryClient.invalidateQueries({ queryKey: ["accounts_balances"] }); }, }); }; @@ -204,14 +202,15 @@ export const useMintTestnetFaucetNfts = () => { max_fee: maxFee, }); - return useMutation(callApi, { + return useMutation({ + mutationFn: callApi, onError: (error: ApiError) => { console.error(error); }, - onSettled: (_resp, _err, req) => { - queryClient.invalidateQueries(["transactions"]); - queryClient.invalidateQueries(["accounts_balances"]); - queryClient.invalidateQueries(["nfts_list"]); + onSettled: () => { + queryClient.invalidateQueries({ queryKey: ["transactions"] }); + queryClient.invalidateQueries({ queryKey: ["accounts_balances"] }); + queryClient.invalidateQueries({ queryKey: ["nfts_list"] }); }, }); }; @@ -221,9 +220,6 @@ export const useAccountsList = (offset: number, limit: number, enabled: boolean queryKey: ["accounts"], queryFn: () => accountsList({ offset, limit }), enabled, - onError: (error: ApiError) => { - error; - }, }); }; @@ -231,7 +227,6 @@ export const useAccountsGetBalances = (account: ComponentAddress, refresh: boole return useQuery({ queryKey: [`accounts_balances_${account}`], queryFn: () => accountsGetBalances({ account: { ComponentAddress: account }, refresh }), - onError: (_error: ApiError) => {}, refetchInterval: 5000, structuralSharing: (oldData, newData) => { if (!oldData || !newData) return newData; @@ -244,12 +239,13 @@ export const useAccountsGetBalances = (account: ComponentAddress, refresh: boole }; export const refreshAccountsBalances = (account: ComponentAddress) => { - return useMutation(() => accountsGetBalances({ account: { ComponentAddress: account }, refresh: true }), { + return useMutation({ + mutationFn: () => accountsGetBalances({ account: { ComponentAddress: account }, refresh: true }), onError: (error: ApiError) => { error; }, onSettled: () => { - queryClient.invalidateQueries(["accounts_balances_" + account]); + queryClient.invalidateQueries({ queryKey: ["accounts_balances_" + account] }); }, }); }; @@ -262,14 +258,12 @@ export const useAccountsGetDefault = () => { notifyOnChangeProps: ["data", "error"], retryOnMount: false, retry: false, - onError: (_error: ApiError) => {}, }); }; export const useAccountsGet = (account: ComponentAddress) => { return useQuery({ queryKey: ["accounts_get_" + account], queryFn: () => accountsGet({ name_or_address: { ComponentAddress: account } }), - onError: (_error: ApiError) => {}, }); }; @@ -277,7 +271,6 @@ export const useAccountNFTsList = (account: ComponentAddress, offset: number, li return useQuery({ queryKey: ["nfts_list", account, offset, limit], queryFn: () => nftList({ account: { ComponentAddress: account }, offset, limit }), - onError: (_error: ApiError) => {}, }); }; @@ -285,8 +278,5 @@ export const useValidatorFees = (accountOrKeyIndex: AccountOrKeyIndex, shardGrou return useQuery({ queryKey: ["validator_fees"], queryFn: () => validatorsGetFees({ account_or_key: accountOrKeyIndex, shard_group: shardGroup }), - onError: (error: ApiError) => { - error; - }, }); }; diff --git a/applications/tari_walletd/web_ui/src/api/hooks/useAuth.tsx b/applications/tari_walletd/web_ui/src/api/hooks/useAuth.tsx index 89649eaeed..eea4c22325 100644 --- a/applications/tari_walletd/web_ui/src/api/hooks/useAuth.tsx +++ b/applications/tari_walletd/web_ui/src/api/hooks/useAuth.tsx @@ -2,8 +2,7 @@ // SPDX-License-Identifier: BSD-3-Clause import { useQuery } from "@tanstack/react-query"; -import { authGetMethod } from "../../utils/json_rpc"; -import { ApiError } from "../helpers/types"; +import { authGetMethod } from "@utils/json_rpc"; export const useAuthMethod = () => { return useQuery({ @@ -11,8 +10,5 @@ export const useAuthMethod = () => { queryFn: () => { return authGetMethod(); }, - onError: (error: ApiError) => { - error; - }, }); }; diff --git a/applications/tari_walletd/web_ui/src/api/hooks/useKeys.tsx b/applications/tari_walletd/web_ui/src/api/hooks/useKeys.tsx index 92ee70c9ee..0791e373b5 100644 --- a/applications/tari_walletd/web_ui/src/api/hooks/useKeys.tsx +++ b/applications/tari_walletd/web_ui/src/api/hooks/useKeys.tsx @@ -21,9 +21,9 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import { useQuery, useMutation } from "@tanstack/react-query"; -import { ApiError } from "../helpers/types"; -import queryClient from "../queryClient"; -import { keysCreate, keysList, keysSetActive } from "../../utils/json_rpc"; +import { ApiError } from "@api/helpers/types"; +import queryClient from "@api/queryClient"; +import { keysCreate, keysList, keysSetActive } from "@utils/json_rpc"; import { KeyBranch } from "@tari-project/typescript-bindings"; export const useKeysList = (branch: KeyBranch) => { @@ -32,19 +32,17 @@ export const useKeysList = (branch: KeyBranch) => { queryFn: () => { return keysList({ branch }); }, - onError: (error: ApiError) => { - error; - }, }); }; export const useKeysCreate = (branch: KeyBranch) => { - return useMutation(() => keysCreate({ branch, specific_index: null }), { + return useMutation({ + mutationFn: () => keysCreate({ branch, specific_index: null }), onError: (error: ApiError) => { error; }, onSuccess: () => { - queryClient.invalidateQueries(["keys_list"]); + queryClient.invalidateQueries({ queryKey: ["keys_list"] }); }, }); }; @@ -55,12 +53,13 @@ export const useKeysSetActive = () => { return result; }; - return useMutation(setActive, { + return useMutation({ + mutationFn: setActive, onError: (error: ApiError) => { error; }, onSuccess: () => { - queryClient.invalidateQueries(["keys_list"]); + queryClient.invalidateQueries({ queryKey: ["keys_list"] }); }, }); }; diff --git a/applications/tari_walletd/web_ui/src/api/hooks/useNfts.tsx b/applications/tari_walletd/web_ui/src/api/hooks/useNfts.tsx index 2d3e894e1f..7e7d9f68a5 100644 --- a/applications/tari_walletd/web_ui/src/api/hooks/useNfts.tsx +++ b/applications/tari_walletd/web_ui/src/api/hooks/useNfts.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: BSD-3-Clause import { useMutation, useQuery } from "@tanstack/react-query"; -import { nftList, nftTransfer } from "../../utils/json_rpc"; -import { ApiError } from "../helpers/types"; +import { nftList, nftTransfer } from "@utils/json_rpc"; +import { ApiError } from "@api/helpers/types"; import { TransferNftRequest } from "@tari-project/typescript-bindings"; -import queryClient from "../queryClient"; +import queryClient from "@api/queryClient"; import type { ComponentAddressOrName } from "@tari-project/typescript-bindings/dist"; export interface ListAccountNftsReq { @@ -45,27 +45,25 @@ export const useListNfts = (request: ListAccountNftsReq) => { }; export const useNftsTransfer = (request: TransferNftRequest) => { - return useMutation( - () => { + return useMutation({ + mutationFn: () => { return nftTransfer(request); }, - { - onError: (error: ApiError) => { - error; - }, - onSettled: () => { - // Invalidate all NFT-related queries - queryClient.invalidateQueries({ - predicate: (query) => { - const key = query.queryKey[0]; - return typeof key === "string" && ( - key === "nfts" || - key === "list_nfts" || - key.startsWith("nfts_list_") - ); - } - }); - }, + onError: (error: ApiError) => { + error; + }, + onSettled: () => { + // Invalidate all NFT-related queries + queryClient.invalidateQueries({ + predicate: (query) => { + const key = query.queryKey[0]; + return typeof key === "string" && ( + key === "nfts" || + key === "list_nfts" || + key.startsWith("nfts_list_") + ); + } + }); }, - ); + }); }; diff --git a/applications/tari_walletd/web_ui/src/api/hooks/useTemplate.tsx b/applications/tari_walletd/web_ui/src/api/hooks/useTemplate.tsx index 68ec32e69c..7904de8bc5 100644 --- a/applications/tari_walletd/web_ui/src/api/hooks/useTemplate.tsx +++ b/applications/tari_walletd/web_ui/src/api/hooks/useTemplate.tsx @@ -21,8 +21,7 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import { useQuery } from "@tanstack/react-query"; -import { ApiError } from "../helpers/types"; -import { templatesGet } from "../../utils/json_rpc"; +import { templatesGet } from "@utils/json_rpc"; import { TemplatesGetRequest } from "@tari-project/typescript-bindings"; export const useTemplateGet = (request: TemplatesGetRequest, options = {}) => { @@ -31,9 +30,6 @@ export const useTemplateGet = (request: TemplatesGetRequest, options = {}) => { queryFn: () => { return templatesGet(request); }, - onError: (error: ApiError) => { - error; - }, refetchInterval: false, notifyOnChangeProps: ["data", "error"], retryOnMount: false, diff --git a/applications/tari_walletd/web_ui/src/api/hooks/useTemplatesAuthored.tsx b/applications/tari_walletd/web_ui/src/api/hooks/useTemplatesAuthored.tsx index f57105706d..59b2f968e5 100644 --- a/applications/tari_walletd/web_ui/src/api/hooks/useTemplatesAuthored.tsx +++ b/applications/tari_walletd/web_ui/src/api/hooks/useTemplatesAuthored.tsx @@ -2,8 +2,7 @@ // SPDX-License-Identifier: BSD-3-Clause import { useQuery } from "@tanstack/react-query"; -import { ApiError } from "../helpers/types"; -import { templatesListAuthored } from "../../utils/json_rpc"; +import { templatesListAuthored } from "@utils/json_rpc"; import { TemplatesListAuthoredRequest } from "@tari-project/typescript-bindings"; export const useListTemplatesAuthored = (request: TemplatesListAuthoredRequest) => { @@ -12,9 +11,6 @@ export const useListTemplatesAuthored = (request: TemplatesListAuthoredRequest) queryFn: () => { return templatesListAuthored(request); }, - onError: (error: ApiError) => { - error; - }, refetchInterval: false, notifyOnChangeProps: ["data", "error"], retryOnMount: false, diff --git a/applications/tari_walletd/web_ui/src/api/hooks/useTokens.tsx b/applications/tari_walletd/web_ui/src/api/hooks/useTokens.tsx index e252864878..2e0077528f 100644 --- a/applications/tari_walletd/web_ui/src/api/hooks/useTokens.tsx +++ b/applications/tari_walletd/web_ui/src/api/hooks/useTokens.tsx @@ -21,9 +21,9 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import { useQuery, useMutation } from "@tanstack/react-query"; -import { ApiError } from "../helpers/types"; -import queryClient from "../queryClient"; -import { authGetAllJwt, authRevoke } from "../../utils/json_rpc"; +import { ApiError } from "@api/helpers/types"; +import queryClient from "@api/queryClient"; +import { authGetAllJwt, authRevoke } from "@utils/json_rpc"; export const useGetAllTokens = () => { return useQuery({ @@ -31,9 +31,6 @@ export const useGetAllTokens = () => { queryFn: () => { return authGetAllJwt({}); }, - onError: (error: ApiError) => { - error; - }, }); }; @@ -42,13 +39,14 @@ export const useAuthRevokeToken = () => { const result = await authRevoke({ permission_token_id: token }); return result; }; - return useMutation(revokeToken, { + return useMutation({ + mutationFn: revokeToken, onError: (error: ApiError) => { error; console.error(error); }, onSettled: () => { - queryClient.invalidateQueries(["jwts_list"]); + queryClient.invalidateQueries({ queryKey: ["jwts_list"] }); }, }); }; diff --git a/applications/tari_walletd/web_ui/src/api/hooks/useTransactions.tsx b/applications/tari_walletd/web_ui/src/api/hooks/useTransactions.tsx index 76d59fb161..54728ec568 100644 --- a/applications/tari_walletd/web_ui/src/api/hooks/useTransactions.tsx +++ b/applications/tari_walletd/web_ui/src/api/hooks/useTransactions.tsx @@ -28,9 +28,9 @@ import { transactionsSubmitManifest, transactionsWaitResult, validatorsGetFees, -} from "../../utils/json_rpc"; -import { ApiError } from "../helpers/types"; -import queryClient from "../queryClient"; +} from "@utils/json_rpc"; +import { ApiError } from "@api/helpers/types"; +import queryClient from "@api/queryClient"; import type { AccountOrKeyIndex, TransactionGetAllRequest, TransactionStatus } from "@tari-project/typescript-bindings"; @@ -40,9 +40,6 @@ export const useTransactionDetails = (hash: string) => { queryFn: () => { return transactionsGet({ transaction_id: hash }); }, - onError: (error: ApiError) => { - error; - }, }); }; @@ -50,33 +47,32 @@ export const useGetAllTransactions = (req: TransactionGetAllRequest) => { return useQuery({ queryKey: ["transactions", req.status], queryFn: () => transactionsGetAll(req), - onError: (error: ApiError) => { - error; - }, refetchInterval: 5000, - keepPreviousData: true, + placeholderData: (previousData) => previousData, }); }; export const usePublishTemplate = () => { - return useMutation(transactionsPublishTemplate, { + return useMutation({ + mutationFn: transactionsPublishTemplate, onError: (error: ApiError) => { console.error(error); }, onSettled: () => { - queryClient.invalidateQueries(["transactions"]); - queryClient.invalidateQueries(["accounts_balances"]); + queryClient.invalidateQueries({ queryKey: ["transactions"] }); + queryClient.invalidateQueries({ queryKey: ["accounts_balances"] }); }, }); }; export const useSubmitManifest = () => { - return useMutation(transactionsSubmitManifest, { + return useMutation({ + mutationFn: transactionsSubmitManifest, onError: (error: ApiError) => { console.error(error); }, onSettled: () => { - queryClient.invalidateQueries(["transactions"]); - queryClient.invalidateQueries(["accounts_balances"]); + queryClient.invalidateQueries({ queryKey: ["transactions"] }); + queryClient.invalidateQueries({ queryKey: ["accounts_balances"] }); }, }); }; diff --git a/applications/tari_walletd/web_ui/src/api/hooks/useWebauthn.tsx b/applications/tari_walletd/web_ui/src/api/hooks/useWebauthn.tsx index 12c4184876..bcb846fa2b 100644 --- a/applications/tari_walletd/web_ui/src/api/hooks/useWebauthn.tsx +++ b/applications/tari_walletd/web_ui/src/api/hooks/useWebauthn.tsx @@ -2,8 +2,7 @@ // SPDX-License-Identifier: BSD-3-Clause import { useQuery } from "@tanstack/react-query"; -import { ApiError } from "../helpers/types"; -import { webauthnAlreadyRegistered } from "../../utils/json_rpc"; +import { webauthnAlreadyRegistered } from "@utils/json_rpc"; export const useWebauthnAlreadyRegistered = (username: string) => { return useQuery({ @@ -11,9 +10,6 @@ export const useWebauthnAlreadyRegistered = (username: string) => { queryFn: () => { return webauthnAlreadyRegistered(username); }, - onError: (error: ApiError) => { - error; - }, refetchInterval: false, notifyOnChangeProps: ["data", "error"], retryOnMount: false, diff --git a/applications/tari_walletd/web_ui/src/hooks/useTimeAgo.ts b/applications/tari_walletd/web_ui/src/hooks/useTimeAgo.ts index 62c08c1c76..12e6c04c2b 100644 --- a/applications/tari_walletd/web_ui/src/hooks/useTimeAgo.ts +++ b/applications/tari_walletd/web_ui/src/hooks/useTimeAgo.ts @@ -21,7 +21,7 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import { useEffect, useState } from "react"; -import { parseTimestamp } from "../utils/helpers"; +import { parseTimestamp } from "@utils/helpers"; export function useTimeAgo(rawTimestamp: string | null | undefined): string { const getTimeAgo = (timestamp: string | null | undefined): string => { diff --git a/applications/tari_walletd/web_ui/src/main.tsx b/applications/tari_walletd/web_ui/src/main.tsx index e62a2739ea..4f6a0dec48 100644 --- a/applications/tari_walletd/web_ui/src/main.tsx +++ b/applications/tari_walletd/web_ui/src/main.tsx @@ -22,14 +22,14 @@ import ReactDOM from "react-dom/client"; import { createBrowserRouter, RouterProvider } from "react-router-dom"; -import App from "./App"; -import "./theme/theme.css"; -import Accounts from "./routes/Accounts/Accounts"; -import TransactionDetails from "./routes/Transactions/TransactionDetails"; +import App from "@/App"; +import "@theme/theme.css"; +import Accounts from "@routes/Accounts/Accounts"; +import TransactionDetails from "@routes/Transactions/TransactionDetails"; import { QueryClientProvider } from "@tanstack/react-query"; import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; -import queryClient from "./api/queryClient"; -import "./utils/serialize"; +import queryClient from "@api/queryClient"; +import "@utils/serialize"; const router = createBrowserRouter([ { @@ -52,6 +52,6 @@ const router = createBrowserRouter([ ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( - + , ); diff --git a/applications/tari_walletd/web_ui/src/routes/AccessToken/AccessToken.tsx b/applications/tari_walletd/web_ui/src/routes/AccessToken/AccessToken.tsx index 136150530e..7db7610f3b 100644 --- a/applications/tari_walletd/web_ui/src/routes/AccessToken/AccessToken.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AccessToken/AccessToken.tsx @@ -1,9 +1,9 @@ // Copyright 2025 The Tari Project // SPDX-License-Identifier: BSD-3-Clause -import useAuthStore from "../../store/authStore"; +import useAuthStore from "@store/authStore"; import Grid from "@mui/material/Grid"; -import CopyToClipboard from "../../Components/CopyToClipboard"; +import CopyToClipboard from "@components/CopyToClipboard"; import Typography from "@mui/material/Typography"; import TextField from "@mui/material/TextField/TextField"; diff --git a/applications/tari_walletd/web_ui/src/routes/AccessTokens/AccessTokens.tsx b/applications/tari_walletd/web_ui/src/routes/AccessTokens/AccessTokens.tsx index ddc0632456..5e6ae7997a 100644 --- a/applications/tari_walletd/web_ui/src/routes/AccessTokens/AccessTokens.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AccessTokens/AccessTokens.tsx @@ -20,10 +20,10 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import PageHeading from "../../Components/PageHeading"; +import PageHeading from "@components/PageHeading"; import Grid from "@mui/material/Grid"; -import { StyledPaper } from "../../Components/StyledComponents"; -import AccessTokens from "../Wallet/Components/AccessTokens"; +import { StyledPaper } from "@components/StyledComponents"; +import AccessTokens from "@routes/Wallet/Components/AccessTokens"; function AccessTokensLayout() { return ( diff --git a/applications/tari_walletd/web_ui/src/routes/AccountDetails/AccountDetails.tsx b/applications/tari_walletd/web_ui/src/routes/AccountDetails/AccountDetails.tsx index 50355450fd..ba16c0b2b4 100644 --- a/applications/tari_walletd/web_ui/src/routes/AccountDetails/AccountDetails.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AccountDetails/AccountDetails.tsx @@ -21,31 +21,32 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import { useState } from "react"; -import PageHeading from "../../Components/PageHeading"; +import PageHeading from "@components/PageHeading"; import Grid from "@mui/material/Grid"; -import { StyledPaper } from "../../Components/StyledComponents"; +import { StyledPaper } from "@components/StyledComponents"; import TableContainer from "@mui/material/TableContainer"; import Table from "@mui/material/Table"; import TableHead from "@mui/material/TableHead"; import TableRow from "@mui/material/TableRow"; import TableCell from "@mui/material/TableCell"; import TableBody from "@mui/material/TableBody"; -import { useAccountsGetBalances, useAccountNFTsList, useAccountsGet } from "../../api/hooks/useAccounts"; -import { DataTableCell } from "../../Components/StyledComponents"; -import FetchStatusCheck from "../../Components/FetchStatusCheck"; +import { useAccountsGetBalances, useAccountNFTsList, useAccountsGet } from "@api/hooks/useAccounts"; +import { ApiError } from "@api/helpers/types"; +import { DataTableCell } from "@components/StyledComponents"; +import FetchStatusCheck from "@components/FetchStatusCheck"; import { AccountGetResponse, BalanceEntry, substateIdToString } from "@tari-project/typescript-bindings"; -import NftList from "../AssetVault/NFTs/NFTList"; -import CopyAddress from "../../Components/CopyAddress"; -import useAccountStore from "../../store/accountStore"; +import NftList from "@routes/AssetVault/NFTs/NFTList"; +import CopyAddress from "@components/CopyAddress"; +import useAccountStore from "@store/accountStore"; import { Form, useParams } from "react-router-dom"; -import { accountsAssociateStealthResource, accountsGet } from "../../utils/json_rpc"; -import Loading from "../../Components/Loading"; +import { accountsAssociateStealthResource, accountsGet } from "@utils/json_rpc"; +import Loading from "@components/Loading"; import Button from "@mui/material/Button"; import { IoAdd } from "react-icons/io5"; import Box from "@mui/material/Box"; import Fade from "@mui/material/Fade"; import TextField from "@mui/material/TextField/TextField"; -import { handleChangePage, handleChangeRowsPerPage } from "../../utils/helpers"; +import { handleChangePage, handleChangeRowsPerPage } from "@utils/helpers"; function BalanceRow(props: BalanceEntry) { return ( @@ -210,7 +211,7 @@ function AccountDetailsLayout() { state.account); diff --git a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/AccountBalance.tsx b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/AccountBalance.tsx index 9f71d6c172..6a379c36a6 100644 --- a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/AccountBalance.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/AccountBalance.tsx @@ -26,12 +26,12 @@ import IconButton from "@mui/material/IconButton"; import Typography from "@mui/material/Typography"; import { useTheme } from "@mui/material/styles"; import { IoEyeOffOutline, IoEyeOutline } from "react-icons/io5"; -import FetchStatusCheck from "../../../Components/FetchStatusCheck"; -import { useAccountsGetBalances } from "../../../api/hooks/useAccounts"; -import useAccountStore from "../../../store/accountStore"; +import FetchStatusCheck from "@components/FetchStatusCheck"; +import { useAccountsGetBalances } from "@api/hooks/useAccounts"; +import useAccountStore from "@store/accountStore"; import { useEffect } from "react"; -import { substateIdToString, bigintToDecimalString } from "../../../utils/helpers"; -import { CURRENCY } from "../../../utils/constants"; +import { substateIdToString, bigintToDecimalString } from "@utils/helpers"; +import { CURRENCY } from "@utils/constants"; import { Account } from "@tari-project/typescript-bindings"; const XTR_RESOURCE = "resource_0101010101010101010101010101010101010101010101010101010101010101"; diff --git a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/AccountDetails.tsx b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/AccountDetails.tsx index f9c0703e67..390e64350b 100644 --- a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/AccountDetails.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/AccountDetails.tsx @@ -21,10 +21,10 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import Box from "@mui/material/Box"; -import { GridHeadCell, GridDataCell, DataTableCell } from "../../../Components/StyledComponents"; +import { GridHeadCell, GridDataCell, DataTableCell } from "@components/StyledComponents"; import { styled } from "@mui/material/styles"; -import useAccountStore from "../../../store/accountStore"; -import CopyAddress from "../../../Components/CopyAddress"; +import useAccountStore from "@store/accountStore"; +import CopyAddress from "@components/CopyAddress"; import { substateIdToString } from "@tari-project/typescript-bindings"; import Table from "@mui/material/Table"; import TableBody from "@mui/material/TableBody"; diff --git a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/ActionMenu.tsx b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/ActionMenu.tsx index fca8233b15..32954afb27 100644 --- a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/ActionMenu.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/ActionMenu.tsx @@ -23,9 +23,9 @@ import Box from "@mui/material/Box"; import Button from "@mui/material/Button"; import { useTheme } from "@mui/material/styles"; -import { useAccountsCreateFreeTestCoins } from "../../../api/hooks/useAccounts"; +import { useAccountsCreateFreeTestCoins } from "@api/hooks/useAccounts"; import ClaimBurn from "./ClaimBurn"; -import useAccountStore from "../../../store/accountStore"; +import useAccountStore from "@store/accountStore"; import SendMoney from "./SendMoney"; import ClaimFees from "./ClaimFees"; import PublishTemplate from "./PublishTemplate"; diff --git a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/AddAccount.tsx b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/AddAccount.tsx index cdc0954d89..8b8183fa96 100644 --- a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/AddAccount.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/AddAccount.tsx @@ -29,9 +29,9 @@ import DialogContent from "@mui/material/DialogContent"; import DialogTitle from "@mui/material/DialogTitle"; import Box from "@mui/material/Box"; import Snackbar from "@mui/material/Snackbar"; -import { useAccountsCreate } from "../../../api/hooks/useAccounts"; +import { useAccountsCreate } from "@api/hooks/useAccounts"; import { useTheme } from "@mui/material/styles"; -import queryClient from "../../../api/queryClient"; +import queryClient from "@api/queryClient"; function AddAccount({ open, setOpen }: { open: boolean; setOpen: React.Dispatch> }) { const [accountFormState, setAccountFormState] = useState({ @@ -56,7 +56,7 @@ function AddAccount({ open, setOpen }: { open: boolean; setOpen: React.Dispatch< accountName: "", }); setOpen(false); - queryClient.invalidateQueries(["accounts"]); + queryClient.invalidateQueries({ queryKey: ["accounts"] }); }, }, ); diff --git a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/Assets.tsx b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/Assets.tsx index 4686db2e45..d5829ea065 100644 --- a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/Assets.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/Assets.tsx @@ -31,19 +31,20 @@ import TableRow from "@mui/material/TableRow"; import Tabs from "@mui/material/Tabs"; import Typography from "@mui/material/Typography"; import React, { useState } from "react"; -import FetchStatusCheck from "../../../Components/FetchStatusCheck"; -import { DataTableCell } from "../../../Components/StyledComponents"; -import { useAccountNFTsList, useAccountsGetBalances } from "../../../api/hooks/useAccounts"; -import { useListNfts } from "../../../api/hooks/useNfts"; -import useAccountStore from "../../../store/accountStore"; +import FetchStatusCheck from "@components/FetchStatusCheck"; +import { DataTableCell } from "@components/StyledComponents"; +import { useAccountNFTsList, useAccountsGetBalances } from "@api/hooks/useAccounts"; +import { ApiError } from "@api/helpers/types"; +import { useListNfts } from "@api/hooks/useNfts"; +import useAccountStore from "@store/accountStore"; import { bigintToDecimalString, shortenSubstateId, substateIdToString, handleChangePage, handleChangeRowsPerPage, -} from "../../../utils/helpers"; -import NFTList from "../NFTs/NFTList"; +} from "@utils/helpers"; +import NFTList from "@routes/AssetVault/NFTs/NFTList"; import { Button } from "@mui/material"; import { SendMoneyDialog } from "./SendMoney"; import { @@ -54,7 +55,7 @@ import { Account, Amount, } from "@tari-project/typescript-bindings"; -import CopyAddress from "../../../Components/CopyAddress"; +import CopyAddress from "@components/CopyAddress"; interface TabPanelProps { children?: React.ReactNode; @@ -266,7 +267,7 @@ function Assets({ account }: { account: Account }) { diff --git a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/PublishTemplate.tsx b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/PublishTemplate.tsx index 0e13024ba8..73d9b2a5e4 100644 --- a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/PublishTemplate.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/PublishTemplate.tsx @@ -28,19 +28,19 @@ import Dialog from "@mui/material/Dialog"; import DialogContent from "@mui/material/DialogContent"; import DialogTitle from "@mui/material/DialogTitle"; import Box from "@mui/material/Box"; -import { useAccountsList } from "../../../api/hooks/useAccounts"; +import { useAccountsList } from "@api/hooks/useAccounts"; import { useTheme } from "@mui/material/styles"; -import useAccountStore from "../../../store/accountStore"; +import useAccountStore from "@store/accountStore"; import Select from "@mui/material/Select"; import { SelectChangeEvent } from "@mui/material/Select/Select"; import MenuItem from "@mui/material/MenuItem"; import { useFilePicker } from "use-file-picker"; import { ResourceAddress, ResourceType, substateIdToString } from "@tari-project/typescript-bindings"; import InputLabel from "@mui/material/InputLabel"; -import { usePublishTemplate } from "../../../api/hooks/useTransactions"; +import { usePublishTemplate } from "@api/hooks/useTransactions"; import { FileAmountLimitValidator, FileSizeValidator, FileTypeValidator } from "use-file-picker/validators"; import { FileContent } from "use-file-picker/types"; -import { base64FromArrayBuffer } from "../../../utils/helpers"; +import { base64FromArrayBuffer } from "@utils/helpers"; export default function PublishTemplate() { const [open, setOpen] = useState(false); diff --git a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/SelectAccount.tsx b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/SelectAccount.tsx index 3b3b1afd78..4c2782625b 100644 --- a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/SelectAccount.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/SelectAccount.tsx @@ -30,8 +30,8 @@ import MenuItem from "@mui/material/MenuItem"; import FormControl from "@mui/material/FormControl"; import Select, { SelectChangeEvent } from "@mui/material/Select"; import Dialog from "./AddAccount"; -import useAccountStore from "../../../store/accountStore"; -import { useAccountsList } from "../../../api/hooks/useAccounts"; +import useAccountStore from "@store/accountStore"; +import { useAccountsList } from "@api/hooks/useAccounts"; import { AccountInfo, substateIdToString } from "@tari-project/typescript-bindings"; function SelectAccount() { diff --git a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/SendMoney.tsx b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/SendMoney.tsx index 7da4d9231a..3164e52822 100644 --- a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/SendMoney.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/SendMoney.tsx @@ -30,9 +30,9 @@ import DialogContent from "@mui/material/DialogContent"; import DialogTitle from "@mui/material/DialogTitle"; import FormControlLabel from "@mui/material/FormControlLabel"; import Box from "@mui/material/Box"; -import { useAccountsGetBalances, useAccountsTransfer } from "../../../api/hooks/useAccounts"; +import { useAccountsGetBalances, useAccountsTransfer } from "@api/hooks/useAccounts"; import { useTheme } from "@mui/material/styles"; -import useAccountStore from "../../../store/accountStore"; +import useAccountStore from "@store/accountStore"; import Select from "@mui/material/Select"; import { SelectChangeEvent } from "@mui/material/Select/Select"; import MenuItem from "@mui/material/MenuItem"; @@ -46,7 +46,7 @@ import { XTR, } from "@tari-project/typescript-bindings"; import InputLabel from "@mui/material/InputLabel"; -import { transactionsWaitResult } from "../../../utils/json_rpc"; +import { transactionsWaitResult } from "@utils/json_rpc"; export default function SendMoney() { const [open, setOpen] = useState(false); diff --git a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/TransferNft.tsx b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/TransferNft.tsx index 6d892153ba..d12c6893a8 100644 --- a/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/TransferNft.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AssetVault/Components/TransferNft.tsx @@ -29,7 +29,7 @@ import DialogContent from "@mui/material/DialogContent"; import DialogTitle from "@mui/material/DialogTitle"; import Box from "@mui/material/Box"; import { useTheme } from "@mui/material/styles"; -import useAccountStore from "../../../store/accountStore"; +import useAccountStore from "@store/accountStore"; import type { Account, ComponentAddressOrName, @@ -44,9 +44,9 @@ import Checkbox from "@mui/material/Checkbox"; import ListItemText from "@mui/material/ListItemText"; import { InputLabel } from "@mui/material"; import { SelectChangeEvent } from "@mui/material/Select/Select"; -import { useListNfts, useNftsTransfer } from "../../../api/hooks/useNfts"; -import { substateIdToString } from "../../../utils/helpers"; -import { useAccountsList } from "../../../api/hooks/useAccounts"; +import { useListNfts, useNftsTransfer } from "@api/hooks/useNfts"; +import { substateIdToString } from "@utils/helpers"; +import { useAccountsList } from "@api/hooks/useAccounts"; export default function TransferNft() { const [open, setOpen] = useState(false); diff --git a/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/NFTList.tsx b/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/NFTList.tsx index 408ecd392f..4286bf1738 100644 --- a/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/NFTList.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/NFTList.tsx @@ -35,8 +35,8 @@ import { import type { ListNftsResponse, NonFungibleToken } from "@tari-project/typescript-bindings"; import React, { useState } from "react"; import { IoApps, IoList } from "react-icons/io5"; -import type { ApiError } from "../../../api/helpers/types"; -import FetchStatusCheck from "../../../Components/FetchStatusCheck"; +import type { ApiError } from "@api/helpers/types"; +import FetchStatusCheck from "@components/FetchStatusCheck"; import ClaimNftsButton from "./components/ClaimNftsButton"; import { NftCard, NftRow } from "./components/NftParts"; diff --git a/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/components/ClaimNftsButton.tsx b/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/components/ClaimNftsButton.tsx index 5418acf8cf..600203b4a4 100644 --- a/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/components/ClaimNftsButton.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/components/ClaimNftsButton.tsx @@ -21,10 +21,10 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import Button from "@mui/material/Button"; -import { useMintTestnetFaucetNfts } from "../../../../api/hooks/useAccounts"; -import useAccountStore from "../../../../store/accountStore"; +import { useMintTestnetFaucetNfts } from "@api/hooks/useAccounts"; +import useAccountStore from "@store/accountStore"; import { substateIdToString } from "@tari-project/typescript-bindings"; -import queryClient from "../../../../api/queryClient"; +import queryClient from "@api/queryClient"; function ClaimNftsButton() { const { mutate: claimTestnetFaucetNfts } = useMintTestnetFaucetNfts(); diff --git a/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/components/NftParts.tsx b/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/components/NftParts.tsx index ff3fd4729b..d2d410fd3a 100644 --- a/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/components/NftParts.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/components/NftParts.tsx @@ -24,10 +24,10 @@ import CancelRoundedIcon from "@mui/icons-material/CancelRounded"; import CheckCircleRoundedIcon from "@mui/icons-material/CheckCircleRounded"; import { Avatar, Box, CardContent, CardMedia, Chip, Divider, Grid, TableRow, Typography } from "@mui/material"; import type { NonFungibleToken } from "@tari-project/typescript-bindings"; -import CopyAddress from "../../../../Components/CopyAddress"; -import { NftCard as Card, DataTableCell } from "../../../../Components/StyledComponents"; -import { convertCborValue } from "../../../../utils/cbor"; -import { shortenSubstateId, displayNftId } from "../../../../utils/helpers"; +import CopyAddress from "@components/CopyAddress"; +import { NftCard as Card, DataTableCell } from "@components/StyledComponents"; +import { convertCborValue } from "@utils/cbor"; +import { shortenSubstateId, displayNftId } from "@utils/helpers"; import SendNft from "./SendNft"; diff --git a/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/components/SendNft.tsx b/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/components/SendNft.tsx index e76921c060..ee78c06599 100644 --- a/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/components/SendNft.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/components/SendNft.tsx @@ -27,7 +27,7 @@ import DialogContent from "@mui/material/DialogContent"; import DialogTitle from "@mui/material/DialogTitle"; import { Stepper, Step, StepLabel } from "@mui/material"; import { SelectChangeEvent } from "@mui/material/Select/Select"; -import useAccountStore from "../../../../store/accountStore"; +import useAccountStore from "@store/accountStore"; import type { Account, ComponentAddressOrName, @@ -35,10 +35,10 @@ import type { NonFungibleId, NonFungibleToken, } from "@tari-project/typescript-bindings"; -import { useListNfts, useNftsTransfer } from "../../../../api/hooks/useNfts"; -import { substateIdToString } from "../../../../utils/helpers"; -import { useAccountsList } from "../../../../api/hooks/useAccounts"; -import { useNftTransferStore } from "../../../../store/nftTransferStore"; +import { useListNfts, useNftsTransfer } from "@api/hooks/useNfts"; +import { substateIdToString } from "@utils/helpers"; +import { useAccountsList } from "@api/hooks/useAccounts"; +import { useNftTransferStore } from "@store/nftTransferStore"; import FormStep from "../steps/FormStep"; import ConfirmationStep from "../steps/ConfirmationStep"; import ResultStep from "../steps/ResultStep"; diff --git a/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/steps/ConfirmationStep.tsx b/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/steps/ConfirmationStep.tsx index 28397593a7..8ca220ba81 100644 --- a/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/steps/ConfirmationStep.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/steps/ConfirmationStep.tsx @@ -22,10 +22,10 @@ import { Box, Button, Stack, Typography, Avatar, Divider } from "@mui/material"; import type { Account, NonFungibleId, NonFungibleToken } from "@tari-project/typescript-bindings"; -import CopyAddress from "../../../../Components/CopyAddress"; -import { useNftTransferStore } from "../../../../store/nftTransferStore"; -import { formatXTM, substateIdToString, displayNftId } from "../../../../utils/helpers"; -import { convertCborValue } from "../../../../utils/cbor"; +import CopyAddress from "@components/CopyAddress"; +import { useNftTransferStore } from "@store/nftTransferStore"; +import { formatXTM, substateIdToString, displayNftId } from "@utils/helpers"; +import { convertCborValue } from "@utils/cbor"; interface ConfirmationStepProps { accounts: Array<{ account: Account }> | undefined; diff --git a/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/steps/FormStep.tsx b/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/steps/FormStep.tsx index 998947a1f7..69802b2798 100644 --- a/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/steps/FormStep.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/steps/FormStep.tsx @@ -31,8 +31,8 @@ import ListItemText from "@mui/material/ListItemText"; import { Divider, InputLabel, Stack } from "@mui/material"; import { SelectChangeEvent } from "@mui/material/Select/Select"; import type { NonFungibleId, NonFungibleToken, Account } from "@tari-project/typescript-bindings"; -import { substateIdToString, formatXTM, validateAddress, displayNftId } from "../../../../utils/helpers"; -import { useNftTransferStore } from "../../../../store/nftTransferStore"; +import { substateIdToString, formatXTM, validateAddress, displayNftId } from "@utils/helpers"; +import { useNftTransferStore } from "@store/nftTransferStore"; interface FormStepProps { account: Account; diff --git a/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/steps/ResultStep.tsx b/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/steps/ResultStep.tsx index e5a204992f..263df80d85 100644 --- a/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/steps/ResultStep.tsx +++ b/applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/steps/ResultStep.tsx @@ -21,7 +21,7 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import { Typography, Stack, Button, CircularProgress, Fade, Divider } from "@mui/material"; -import { useNftTransferStore } from "../../../../store/nftTransferStore"; +import { useNftTransferStore } from "@store/nftTransferStore"; import CancelRoundedIcon from "@mui/icons-material/CancelRounded"; import CheckCircleRoundedIcon from "@mui/icons-material/CheckCircleRounded"; diff --git a/applications/tari_walletd/web_ui/src/routes/Auth/Auth.tsx b/applications/tari_walletd/web_ui/src/routes/Auth/Auth.tsx index 7b3bf109a9..f0192f561d 100644 --- a/applications/tari_walletd/web_ui/src/routes/Auth/Auth.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Auth/Auth.tsx @@ -1,11 +1,11 @@ // Copyright 2025 The Tari Project // SPDX-License-Identifier: BSD-3-Clause -import { useAuthMethod } from "../../api/hooks/useAuth"; +import { useAuthMethod } from "@api/hooks/useAuth"; import { useEffect, useState } from "react"; -import Loading from "../../Components/Loading"; +import Loading from "@components/Loading"; import { Navigate, useNavigate, useSearchParams } from "react-router-dom"; -import useAuthStore from "../../store/authStore"; +import useAuthStore from "@store/authStore"; export const AUTH_TOKEN_FOR_NONE_AUTH: string = "auth_none"; diff --git a/applications/tari_walletd/web_ui/src/routes/ErrorPage.tsx b/applications/tari_walletd/web_ui/src/routes/ErrorPage.tsx index 8f0097a450..745981eae3 100644 --- a/applications/tari_walletd/web_ui/src/routes/ErrorPage.tsx +++ b/applications/tari_walletd/web_ui/src/routes/ErrorPage.tsx @@ -21,7 +21,7 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import { useRouteError, isRouteErrorResponse } from "react-router-dom"; -import { StyledPaper } from "../Components/StyledComponents"; +import { StyledPaper } from "@components/StyledComponents"; import Typography from "@mui/material/Typography"; import Grid from "@mui/material/Grid"; diff --git a/applications/tari_walletd/web_ui/src/routes/Manifest/Manifest.tsx b/applications/tari_walletd/web_ui/src/routes/Manifest/Manifest.tsx index ab6e94b84b..c923f44335 100644 --- a/applications/tari_walletd/web_ui/src/routes/Manifest/Manifest.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Manifest/Manifest.tsx @@ -20,19 +20,19 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import PageHeading from "../../Components/PageHeading"; +import PageHeading from "@components/PageHeading"; import Grid from "@mui/material/Grid"; -import { StyledPaper } from "../../Components/StyledComponents"; +import { StyledPaper } from "@components/StyledComponents"; import { Stack, Table, TableBody, TableHead, TableRow, TableCell, TextareaAutosize } from "@mui/material"; import { useState } from "react"; -import useManifestCodeStore from "../../store/manifestStore"; +import useManifestCodeStore from "@store/manifestStore"; import Button from "@mui/material/Button/Button"; import TextField from "@mui/material/TextField/TextField"; import Box from "@mui/material/Box"; -import { useSubmitManifest } from "../../api/hooks/useTransactions"; +import { useSubmitManifest } from "@api/hooks/useTransactions"; import { rejectReasonToString } from "@tari-project/typescript-bindings"; import { useTheme } from "@mui/material"; -import { DataTableCell } from "../../Components/StyledComponents"; +import { DataTableCell } from "@components/StyledComponents"; function Manifest() { return ( @@ -55,7 +55,7 @@ function ManifestEditor() { const [finalizeError, setFinalizeError] = useState(null); const theme = useTheme(); - const { mutateAsync: submitManifest, isLoading: isSubmittingManifest, error } = useSubmitManifest(); + const { mutateAsync: submitManifest, isPending: isSubmittingManifest, error } = useSubmitManifest(); const isDryRun = !fee; diff --git a/applications/tari_walletd/web_ui/src/routes/Onboarding/Onboarding.tsx b/applications/tari_walletd/web_ui/src/routes/Onboarding/Onboarding.tsx index 3abaeb3704..4169cb8551 100644 --- a/applications/tari_walletd/web_ui/src/routes/Onboarding/Onboarding.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Onboarding/Onboarding.tsx @@ -28,9 +28,9 @@ import Button from "@mui/material/Button"; import Grid from "@mui/material/Grid"; import Typography from "@mui/material/Typography"; import { useTheme } from "@mui/material/styles"; -import Loading from "../../Components/Loading"; -import { useAccountsCreate } from "../../api/hooks/useAccounts"; -import useAccountStore from "../../store/accountStore"; +import Loading from "@components/Loading"; +import { useAccountsCreate } from "@api/hooks/useAccounts"; +import useAccountStore from "@store/accountStore"; function Onboarding() { const { mutate, status } = useAccountsCreate(); @@ -66,7 +66,7 @@ function Onboarding() { }); }; - if (status === "loading") { + if (status === "pending") { return ; } diff --git a/applications/tari_walletd/web_ui/src/routes/Settings/Settings.tsx b/applications/tari_walletd/web_ui/src/routes/Settings/Settings.tsx index 9184aaa710..b37289b2dc 100644 --- a/applications/tari_walletd/web_ui/src/routes/Settings/Settings.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Settings/Settings.tsx @@ -20,15 +20,15 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import PageHeading from "../../Components/PageHeading"; +import PageHeading from "@components/PageHeading"; import Grid from "@mui/material/Grid"; -import { StyledPaper } from "../../Components/StyledComponents"; -import Accounts from "../Wallet/Components/Accounts"; -import Keys from "../Wallet/Components/Keys"; -import AccessTokens from "../Wallet/Components/AccessTokens"; -import SettingsTabs from "./Components/SettingsTabs"; -import GeneralSettings from "./Components/GeneralSettings"; -import ViewVaultBalance from "./Components/ViewVaultBalance"; +import { StyledPaper } from "@components/StyledComponents"; +import Accounts from "@routes/Wallet/Components/Accounts"; +import Keys from "@routes/Wallet/Components/Keys"; +import AccessTokens from "@routes/Wallet/Components/AccessTokens"; +import SettingsTabs from "@routes/Settings/Components/SettingsTabs"; +import GeneralSettings from "@routes/Settings/Components/GeneralSettings"; +import ViewVaultBalance from "@routes/Settings/Components/ViewVaultBalance"; export interface ISettingsMenu { label: string; diff --git a/applications/tari_walletd/web_ui/src/routes/Transactions/Events.tsx b/applications/tari_walletd/web_ui/src/routes/Transactions/Events.tsx index 0dc490a371..a104bc1e07 100644 --- a/applications/tari_walletd/web_ui/src/routes/Transactions/Events.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Transactions/Events.tsx @@ -22,13 +22,13 @@ import { useState } from "react"; import { TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Collapse, Box, Chip, Typography } from "@mui/material"; -import { DataTableCell, AccordionIconButton } from "../../Components/StyledComponents"; +import { DataTableCell, AccordionIconButton } from "@components/StyledComponents"; import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown"; import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp"; -import CodeBlockExpand from "../../Components/CodeBlock"; +import CodeBlockExpand from "@components/CodeBlock"; import { useTheme } from "@mui/material/styles"; import { Event, substateIdToString } from "@tari-project/typescript-bindings"; -import CopyAddress from "../../Components/CopyAddress"; +import CopyAddress from "@components/CopyAddress"; function renderPayloadField(key: string, value: any) { if (key === "amount" && typeof value === "string") { diff --git a/applications/tari_walletd/web_ui/src/routes/Transactions/ExecutionResults.tsx b/applications/tari_walletd/web_ui/src/routes/Transactions/ExecutionResults.tsx index f84b78947f..99050930e4 100644 --- a/applications/tari_walletd/web_ui/src/routes/Transactions/ExecutionResults.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Transactions/ExecutionResults.tsx @@ -32,7 +32,7 @@ import { Typography, Chip, } from "@mui/material"; -import { DataTableCell } from "../../Components/StyledComponents"; +import { DataTableCell } from "@components/StyledComponents"; function ResultRowData({ result, index }: { result: any; index: number }) { const returnTypeLabel = diff --git a/applications/tari_walletd/web_ui/src/routes/Transactions/FeeReceipt.tsx b/applications/tari_walletd/web_ui/src/routes/Transactions/FeeReceipt.tsx index 060367a178..1e68a5ca3c 100644 --- a/applications/tari_walletd/web_ui/src/routes/Transactions/FeeReceipt.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Transactions/FeeReceipt.tsx @@ -21,7 +21,7 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import { TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Box, Typography, Chip } from "@mui/material"; -import { DataTableCell } from "../../Components/StyledComponents"; +import { DataTableCell } from "@components/StyledComponents"; export default function FeeReceipt({ data }: { data: any }) { if (!data) { diff --git a/applications/tari_walletd/web_ui/src/routes/Transactions/Inputs.tsx b/applications/tari_walletd/web_ui/src/routes/Transactions/Inputs.tsx index 5707b4d619..a0831e354b 100644 --- a/applications/tari_walletd/web_ui/src/routes/Transactions/Inputs.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Transactions/Inputs.tsx @@ -21,9 +21,9 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import { TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Box, Chip, Typography } from "@mui/material"; -import { DataTableCell } from "../../Components/StyledComponents"; +import { DataTableCell } from "@components/StyledComponents"; import { SubstateRequirement, substateIdToString } from "@tari-project/typescript-bindings"; -import CopyAddress from "../../Components/CopyAddress"; +import CopyAddress from "@components/CopyAddress"; function getSubstateType(substateId: string): string { if (substateId.startsWith("component_")) return "Component"; diff --git a/applications/tari_walletd/web_ui/src/routes/Transactions/Instructions.tsx b/applications/tari_walletd/web_ui/src/routes/Transactions/Instructions.tsx index 3dc1b5537e..e3cb11b125 100644 --- a/applications/tari_walletd/web_ui/src/routes/Transactions/Instructions.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Transactions/Instructions.tsx @@ -22,15 +22,15 @@ import { useState } from "react"; import { TableContainer, Table, TableRow, TableBody, Collapse, Box, Typography } from "@mui/material"; -import { DataTableCell, AccordionIconButton } from "../../Components/StyledComponents"; +import { DataTableCell, AccordionIconButton } from "@components/StyledComponents"; import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown"; import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp"; -import CodeBlockExpand from "../../Components/CodeBlock"; +import CodeBlockExpand from "@components/CodeBlock"; import { useTheme } from "@mui/material/styles"; import type { Instruction } from "@tari-project/typescript-bindings"; import { decode } from "cbor2"; -import { toHexString } from "../../utils/helpers"; -import { BinaryTag } from "../../utils/cbor"; +import { toHexString } from "@utils/helpers"; +import { BinaryTag } from "@utils/cbor"; function RowData({ title, data }: { title: string; data: Instruction }, index: number) { const [open, setOpen] = useState(false); diff --git a/applications/tari_walletd/web_ui/src/routes/Transactions/Logs.tsx b/applications/tari_walletd/web_ui/src/routes/Transactions/Logs.tsx index 51c7b8d034..0f03a4a260 100644 --- a/applications/tari_walletd/web_ui/src/routes/Transactions/Logs.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Transactions/Logs.tsx @@ -21,7 +21,7 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import { TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Chip } from "@mui/material"; -import { DataTableCell } from "../../Components/StyledComponents"; +import { DataTableCell } from "@components/StyledComponents"; import type { LogEntry } from "@tari-project/typescript-bindings"; function getLogLevelColor( diff --git a/applications/tari_walletd/web_ui/src/routes/Transactions/Signers.tsx b/applications/tari_walletd/web_ui/src/routes/Transactions/Signers.tsx index ef125c6a4f..e52c9d93f7 100644 --- a/applications/tari_walletd/web_ui/src/routes/Transactions/Signers.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Transactions/Signers.tsx @@ -21,8 +21,8 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import { TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Chip, Box, Typography } from "@mui/material"; -import { DataTableCell } from "../../Components/StyledComponents"; -import CopyAddress from "../../Components/CopyAddress"; +import { DataTableCell } from "@components/StyledComponents"; +import CopyAddress from "@components/CopyAddress"; import { TransactionSignature } from "@tari-project/typescript-bindings"; interface SignersProps { diff --git a/applications/tari_walletd/web_ui/src/routes/Transactions/Substates.tsx b/applications/tari_walletd/web_ui/src/routes/Transactions/Substates.tsx index 5fa2699d7a..cd2f150a33 100644 --- a/applications/tari_walletd/web_ui/src/routes/Transactions/Substates.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Transactions/Substates.tsx @@ -22,15 +22,15 @@ import { useState } from "react"; import { TableContainer, Table, TableRow, TableBody, Collapse, Box, Typography, Chip } from "@mui/material"; -import { DataTableCell } from "../../Components/StyledComponents"; -import { AccordionIconButton } from "../../Components/StyledComponents"; +import { DataTableCell } from "@components/StyledComponents"; +import { AccordionIconButton } from "@components/StyledComponents"; import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown"; import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp"; import { IoArrowDownCircle, IoArrowUpCircle } from "react-icons/io5"; -import CodeBlockExpand from "../../Components/CodeBlock"; +import CodeBlockExpand from "@components/CodeBlock"; import { useTheme } from "@mui/material/styles"; import { Substate, SubstateId, substateIdToString, TransactionResult } from "@tari-project/typescript-bindings"; -import CopyAddress from "../../Components/CopyAddress"; +import CopyAddress from "@components/CopyAddress"; function renderSubstateDetails(substate: any, id: SubstateId) { if (!substate || typeof substate === "number") { diff --git a/applications/tari_walletd/web_ui/src/routes/Transactions/TimeChip.tsx b/applications/tari_walletd/web_ui/src/routes/Transactions/TimeChip.tsx index 4ff0c51492..bd7de7a097 100644 --- a/applications/tari_walletd/web_ui/src/routes/Transactions/TimeChip.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Transactions/TimeChip.tsx @@ -21,8 +21,8 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import { Chip, Tooltip } from "@mui/material"; -import { useTimeAgo } from "../../hooks/useTimeAgo"; -import { formatTimestamp } from "../../utils/helpers"; +import { useTimeAgo } from "@hooks/useTimeAgo"; +import { formatTimestamp } from "@utils/helpers"; function TimeChip({ timestamp }: { timestamp: string | null | undefined }) { const timeAgo = useTimeAgo(timestamp); diff --git a/applications/tari_walletd/web_ui/src/routes/Transactions/TransactionDetails.tsx b/applications/tari_walletd/web_ui/src/routes/Transactions/TransactionDetails.tsx index 14b2097814..35c69af592 100644 --- a/applications/tari_walletd/web_ui/src/routes/Transactions/TransactionDetails.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Transactions/TransactionDetails.tsx @@ -22,13 +22,13 @@ import { useState } from "react"; import { useParams } from "react-router-dom"; -import { useTransactionDetails } from "../../api/hooks/useTransactions"; -import { Accordion, AccordionDetails, AccordionSummary } from "../../Components/Accordion"; +import { useTransactionDetails } from "@api/hooks/useTransactions"; +import { Accordion, AccordionDetails, AccordionSummary } from "@components/Accordion"; import { Grid, Table, TableContainer, TableBody, TableRow, TableCell, Button, Fade, Stack } from "@mui/material"; import Typography from "@mui/material/Typography"; import { saveAs } from "file-saver"; -import { DataTableCell, StyledPaper } from "../../Components/StyledComponents"; -import PageHeading from "../../Components/PageHeading"; +import { DataTableCell, StyledPaper } from "@components/StyledComponents"; +import PageHeading from "@components/PageHeading"; import Events from "./Events"; import Logs from "./Logs"; import Instructions from "./Instructions"; @@ -37,11 +37,11 @@ import Inputs from "./Inputs"; import Signers from "./Signers"; import ExecutionResults from "./ExecutionResults"; import FeeReceipt from "./FeeReceipt"; -import StatusChip from "../../Components/StatusChip"; +import StatusChip from "@components/StatusChip"; import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown"; import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp"; -import Loading from "../../Components/Loading"; -import Error from "../../Components/Error"; +import Loading from "@components/Loading"; +import Error from "@components/Error"; import { FinalizeResult, TransactionResult, TransactionSignature } from "@tari-project/typescript-bindings"; import { getRejectReasonFromTransactionResult, rejectReasonToString } from "@tari-project/typescript-bindings"; import { BsQuestionCircle } from "react-icons/bs"; diff --git a/applications/tari_walletd/web_ui/src/routes/Transactions/Transactions.tsx b/applications/tari_walletd/web_ui/src/routes/Transactions/Transactions.tsx index 2643d9e670..58393a874a 100644 --- a/applications/tari_walletd/web_ui/src/routes/Transactions/Transactions.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Transactions/Transactions.tsx @@ -36,11 +36,11 @@ import { import { useTheme } from "@mui/material/styles"; import { useEffect, useState } from "react"; import { Link } from "react-router-dom"; -import FetchStatusCheck from "../../Components/FetchStatusCheck"; -import StatusChip from "../../Components/StatusChip"; -import { DataTableCell } from "../../Components/StyledComponents"; -import { useGetAllTransactions } from "../../api/hooks/useTransactions"; -import { emptyRows, handleChangePage, handleChangeRowsPerPage } from "../../utils/helpers"; +import FetchStatusCheck from "@components/FetchStatusCheck"; +import StatusChip from "@components/StatusChip"; +import { DataTableCell } from "@components/StyledComponents"; +import { useGetAllTransactions } from "@api/hooks/useTransactions"; +import { emptyRows, handleChangePage, handleChangeRowsPerPage } from "@utils/helpers"; import { Account, WalletTransaction } from "@tari-project/typescript-bindings"; import TimeChip from "./TimeChip"; diff --git a/applications/tari_walletd/web_ui/src/routes/Transactions/TransactionsLayout.tsx b/applications/tari_walletd/web_ui/src/routes/Transactions/TransactionsLayout.tsx index 59f2761288..15913713c0 100644 --- a/applications/tari_walletd/web_ui/src/routes/Transactions/TransactionsLayout.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Transactions/TransactionsLayout.tsx @@ -20,11 +20,11 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import PageHeading from "../../Components/PageHeading"; +import PageHeading from "@components/PageHeading"; import Grid from "@mui/material/Grid"; -import { StyledPaper } from "../../Components/StyledComponents"; +import { StyledPaper } from "@components/StyledComponents"; import Transactions from "./Transactions"; -import useAccountStore from "../../store/accountStore"; +import useAccountStore from "@store/accountStore"; function TransactionsLayout() { const { account, publicKey } = useAccountStore(); diff --git a/applications/tari_walletd/web_ui/src/routes/Wallet/Components/Accounts.tsx b/applications/tari_walletd/web_ui/src/routes/Wallet/Components/Accounts.tsx index d38cf242e5..d4a2818f89 100644 --- a/applications/tari_walletd/web_ui/src/routes/Wallet/Components/Accounts.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Wallet/Components/Accounts.tsx @@ -34,12 +34,12 @@ import TableRow from "@mui/material/TableRow"; import TextField from "@mui/material/TextField/TextField"; import { ChevronRight } from "@mui/icons-material"; import IconButton from "@mui/material/IconButton"; -import { BoxHeading2, DataTableCell } from "../../../Components/StyledComponents"; -import { useAccountsCreate, useAccountsList } from "../../../api/hooks/useAccounts"; -import FetchStatusCheck from "../../../Components/FetchStatusCheck"; -import queryClient from "../../../api/queryClient"; +import { BoxHeading2, DataTableCell } from "@components/StyledComponents"; +import { useAccountsCreate, useAccountsList } from "@api/hooks/useAccounts"; +import FetchStatusCheck from "@components/FetchStatusCheck"; +import queryClient from "@api/queryClient"; import { AccountInfo, substateIdToString, shortenSubstateId } from "@tari-project/typescript-bindings"; -import CopyAddress from "../../../Components/CopyAddress"; +import CopyAddress from "@components/CopyAddress"; function Account(account: AccountInfo, index: number) { return ( @@ -109,7 +109,7 @@ function Accounts() { fee: "", }); setShowAddAccountDialog(false); - queryClient.invalidateQueries(["accounts"]); + queryClient.invalidateQueries({ queryKey: ["accounts"] }); }, }, ); diff --git a/applications/tari_walletd/web_ui/src/routes/Wallet/Components/Keys.tsx b/applications/tari_walletd/web_ui/src/routes/Wallet/Components/Keys.tsx index bdd4970dbc..de835f1076 100644 --- a/applications/tari_walletd/web_ui/src/routes/Wallet/Components/Keys.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Wallet/Components/Keys.tsx @@ -27,14 +27,14 @@ import TableCell from "@mui/material/TableCell"; import TableContainer from "@mui/material/TableContainer"; import TableHead from "@mui/material/TableHead"; import TableRow from "@mui/material/TableRow"; -import { useKeysCreate, useKeysList, useKeysSetActive } from "../../../api/hooks/useKeys"; -import { BoxHeading2 } from "../../../Components/StyledComponents"; +import { useKeysCreate, useKeysList, useKeysSetActive } from "@api/hooks/useKeys"; +import { BoxHeading2 } from "@components/StyledComponents"; import AddIcon from "@mui/icons-material/Add"; import Fade from "@mui/material/Fade"; import { Form } from "react-router-dom"; import Button from "@mui/material/Button/Button"; -import { DataTableCell } from "../../../Components/StyledComponents"; -import FetchStatusCheck from "../../../Components/FetchStatusCheck"; +import { DataTableCell } from "@components/StyledComponents"; +import FetchStatusCheck from "@components/FetchStatusCheck"; function Key(key: [number, string, boolean], setActive: any) { return ( diff --git a/applications/tari_walletd/web_ui/src/routes/Wallet/Wallet.tsx b/applications/tari_walletd/web_ui/src/routes/Wallet/Wallet.tsx index 883024bc5d..c856021c19 100644 --- a/applications/tari_walletd/web_ui/src/routes/Wallet/Wallet.tsx +++ b/applications/tari_walletd/web_ui/src/routes/Wallet/Wallet.tsx @@ -23,12 +23,12 @@ import Accounts from "./Components/Accounts"; import Keys from "./Components/Keys"; import "./Wallet.css"; -import { StyledPaper } from "../../Components/StyledComponents"; +import { StyledPaper } from "@components/StyledComponents"; import Grid from "@mui/material/Grid"; -import SecondaryHeading from "../../Components/SecondaryHeading"; -import Transactions from "../Transactions/Transactions"; +import SecondaryHeading from "@components/SecondaryHeading"; +import Transactions from "@routes/Transactions/Transactions"; import AccessTokens from "./Components/AccessTokens"; -import useAccountStore from "../../store/accountStore"; +import useAccountStore from "@store/accountStore"; function Wallet() { const { account, publicKey } = useAccountStore(); diff --git a/applications/tari_walletd/web_ui/src/routes/WebauthnRegistration/Components/Registration.tsx b/applications/tari_walletd/web_ui/src/routes/WebauthnRegistration/Components/Registration.tsx index 96a4c835f3..3795ea73c3 100644 --- a/applications/tari_walletd/web_ui/src/routes/WebauthnRegistration/Components/Registration.tsx +++ b/applications/tari_walletd/web_ui/src/routes/WebauthnRegistration/Components/Registration.tsx @@ -15,7 +15,7 @@ import useAuthStore from "../../../store/authStore"; const WEBAUTHN_RP_ID = import.meta.env.VITE_DAEMON_WEBAUTHN_RP_ID || window.location.hostname; -const createCredential = async (rpOptions: { rpId: string; rpName: string }, username: string, challenge: Buffer) => { +const createCredential = async (rpOptions: { rpId: string; rpName: string }, username: string, challenge: BufferSource) => { const publicKeyCredentialCreationOptions: PublicKeyCredentialCreationOptions = { rp: { name: rpOptions.rpName, @@ -85,8 +85,7 @@ function WebauthnRegistration() { throw new Error("Failed to start registration: missing public_key"); } - // @ts-ignore - const challenge = Buffer.from(startRegisterResponse.public_key.challenge, "base64"); + const challenge = Buffer.from((startRegisterResponse.public_key as any).challenge, "base64"); const regSessionId = startRegisterResponse.session_id; // get credential diff --git a/applications/tari_walletd/web_ui/src/store/authStore.ts b/applications/tari_walletd/web_ui/src/store/authStore.ts index 22e8c574f2..b25544deb5 100644 --- a/applications/tari_walletd/web_ui/src/store/authStore.ts +++ b/applications/tari_walletd/web_ui/src/store/authStore.ts @@ -3,7 +3,7 @@ import { create } from "zustand"; import { persist } from "zustand/middleware"; -import { AUTH_TOKEN_FOR_NONE_AUTH } from "../routes/Auth/Auth"; +import { AUTH_TOKEN_FOR_NONE_AUTH } from "@routes/Auth/Auth"; interface Store { username: string; diff --git a/applications/tari_walletd/web_ui/src/theme/LayoutMain.tsx b/applications/tari_walletd/web_ui/src/theme/LayoutMain.tsx index 0636f99a23..a910a9e177 100644 --- a/applications/tari_walletd/web_ui/src/theme/LayoutMain.tsx +++ b/applications/tari_walletd/web_ui/src/theme/LayoutMain.tsx @@ -31,24 +31,24 @@ import List from "@mui/material/List"; import IconButton from "@mui/material/IconButton"; import MenuOpenOutlinedIcon from "@mui/icons-material/MenuOpenOutlined"; import MenuOutlinedIcon from "@mui/icons-material/MenuOutlined"; -import MenuItems from "../Components/MenuItems"; +import MenuItems from "@components/MenuItems"; import { Dialog, Stack, ThemeProvider } from "@mui/material"; import { Link, Outlet } from "react-router-dom"; -import Logo from "../assets/Logo"; +import Logo from "@assets/Logo"; import Container from "@mui/material/Container"; -import ConnectorLink from "../Components/ConnectorLink"; -import Breadcrumbs from "../Components/Breadcrumbs"; -import { breadcrumbRoutes } from "../App"; +import ConnectorLink from "@components/ConnectorLink"; +import Breadcrumbs from "@components/Breadcrumbs"; +import { breadcrumbRoutes } from "@/App"; import Grid from "@mui/material/Grid"; -import useThemeStore from "../store/themeStore"; -import { componentSettings, dark, light } from "./tokens"; -import { lightAlpha } from "./colors"; -import WalletConnectLink from "../Components/WalletConnectLink"; +import useThemeStore from "@store/themeStore"; +import { componentSettings, dark, light } from "@theme/tokens"; +import { lightAlpha } from "@theme/colors"; +import WalletConnectLink from "@components/WalletConnectLink"; import DialogTitle from "@mui/material/DialogTitle"; import DialogContent from "@mui/material/DialogContent"; -import useAccountStore from "../store/accountStore"; +import useAccountStore from "@store/accountStore"; import { Check } from "@mui/icons-material"; -import useAuthStore from "../store/authStore"; +import useAuthStore from "@store/authStore"; import "./theme.css"; const drawerWidth = 300; diff --git a/applications/tari_walletd/web_ui/src/theme/tokens.ts b/applications/tari_walletd/web_ui/src/theme/tokens.ts index 0c94a4dd1d..7c1cc8bbfa 100644 --- a/applications/tari_walletd/web_ui/src/theme/tokens.ts +++ b/applications/tari_walletd/web_ui/src/theme/tokens.ts @@ -21,7 +21,7 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import { ThemeOptions } from "@mui/material/styles"; -import { tariPurple, blue, red, green, orange, grey, teal, gothic } from "./colors"; +import { tariPurple, blue, red, green, orange, grey, teal, gothic } from "@theme/colors"; import "./augmentation"; export const componentSettings: ThemeOptions = { diff --git a/applications/tari_walletd/web_ui/src/utils/helpers.tsx b/applications/tari_walletd/web_ui/src/utils/helpers.tsx index 26362b7098..232832b5a9 100644 --- a/applications/tari_walletd/web_ui/src/utils/helpers.tsx +++ b/applications/tari_walletd/web_ui/src/utils/helpers.tsx @@ -22,7 +22,7 @@ import { ChangeEvent } from "react"; import type { Amount, SubstateId, NonFungibleId } from "@tari-project/typescript-bindings"; -import { CURRENCY } from "./constants"; +import { CURRENCY } from "@utils/constants"; export const renderJson = (json: any) => { if (Array.isArray(json)) { diff --git a/applications/tari_walletd/web_ui/src/utils/json_rpc.ts b/applications/tari_walletd/web_ui/src/utils/json_rpc.ts index a0bbbce897..f55115cc61 100644 --- a/applications/tari_walletd/web_ui/src/utils/json_rpc.ts +++ b/applications/tari_walletd/web_ui/src/utils/json_rpc.ts @@ -107,8 +107,8 @@ import type { WebRtcStartResponse, } from "@tari-project/typescript-bindings"; import { WalletDaemonClient } from "@tari-project/wallet_jrpc_client"; -import useAuthStore from "../store/authStore"; -import { AUTH_TOKEN_FOR_NONE_AUTH } from "../routes/Auth/Auth"; +import useAuthStore from "@store/authStore"; +import { AUTH_TOKEN_FOR_NONE_AUTH } from "@routes/Auth/Auth"; let clientInstance: WalletDaemonClient | null = null; let pendingClientInstance: Promise | null = null; diff --git a/applications/tari_walletd/web_ui/tsconfig.json b/applications/tari_walletd/web_ui/tsconfig.json index e1fcdca5bd..c7c14859de 100644 --- a/applications/tari_walletd/web_ui/tsconfig.json +++ b/applications/tari_walletd/web_ui/tsconfig.json @@ -14,14 +14,26 @@ "strict": true, "forceConsistentCasingInFileNames": true, "module": "ESNext", - "moduleResolution": "Node", + "moduleResolution": "Bundler", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", "declaration": true, "declarationMap": true, - "composite": true + "composite": true, + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"], + "@components/*": ["./src/Components/*"], + "@routes/*": ["./src/routes/*"], + "@utils/*": ["./src/utils/*"], + "@assets/*": ["./src/assets/*"], + "@hooks/*": ["./src/hooks/*"], + "@api/*": ["./src/api/*"], + "@store/*": ["./src/store/*"], + "@theme/*": ["./src/theme/*"] + } }, "include": [ "src" diff --git a/applications/tari_walletd/web_ui/tsconfig.node.json b/applications/tari_walletd/web_ui/tsconfig.node.json index 9d31e2aed9..16dfedc6a6 100644 --- a/applications/tari_walletd/web_ui/tsconfig.node.json +++ b/applications/tari_walletd/web_ui/tsconfig.node.json @@ -2,7 +2,7 @@ "compilerOptions": { "composite": true, "module": "ESNext", - "moduleResolution": "Node", + "moduleResolution": "Bundler", "allowSyntheticDefaultImports": true }, "include": ["vite.config.ts"] diff --git a/applications/tari_walletd/web_ui/vite.config.ts b/applications/tari_walletd/web_ui/vite.config.ts index 606fc20456..efbb27c2c5 100644 --- a/applications/tari_walletd/web_ui/vite.config.ts +++ b/applications/tari_walletd/web_ui/vite.config.ts @@ -22,8 +22,22 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react-swc"; +import path from "path"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], + resolve: { + alias: { + "@": path.resolve(__dirname, "./src"), + "@components": path.resolve(__dirname, "./src/Components"), + "@routes": path.resolve(__dirname, "./src/routes"), + "@utils": path.resolve(__dirname, "./src/utils"), + "@assets": path.resolve(__dirname, "./src/assets"), + "@hooks": path.resolve(__dirname, "./src/hooks"), + "@api": path.resolve(__dirname, "./src/api"), + "@store": path.resolve(__dirname, "./src/store"), + "@theme": path.resolve(__dirname, "./src/theme"), + }, + }, });