diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..208f9a12 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,2 @@ +pnpm format:check +pnpm lint diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100644 index 00000000..d709394c --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1 @@ +pnpm typecheck \ No newline at end of file diff --git a/components/Approve/index.tsx b/components/Approve/index.tsx index 9bc33665..2a0c586d 100644 --- a/components/Approve/index.tsx +++ b/components/Approve/index.tsx @@ -25,7 +25,7 @@ const Index = () => { useHandleTransaction("approve", data, error, isPending, isSuccess, { type: "approve", - amount: MAXIMUM_VALUE_UINT256, + amount: BigInt(MAXIMUM_VALUE_UINT256), }); return ( diff --git a/components/DelegatingView/index.tsx b/components/DelegatingView/index.tsx index fe793fa8..80d75e68 100644 --- a/components/DelegatingView/index.tsx +++ b/components/DelegatingView/index.tsx @@ -66,7 +66,7 @@ const Index = ({ delegator, transcoders, protocol, currentRound }: Props) => { useHandleTransaction("withdrawFees", data, error, isPending, isSuccess, { recipient, - amount, + amount: BigInt(amount), }); const isMyAccount = checkAddressEquality( diff --git a/components/DelegatingWidget/Delegate.tsx b/components/DelegatingWidget/Delegate.tsx index 302e4cae..e2f639b6 100644 --- a/components/DelegatingWidget/Delegate.tsx +++ b/components/DelegatingWidget/Delegate.tsx @@ -2,13 +2,13 @@ import { bondingManager } from "@lib/api/abis/main/BondingManager"; import { livepeerToken } from "@lib/api/abis/main/LivepeerToken"; import { MAXIMUM_VALUE_UINT256 } from "@lib/utils"; import { Box, Button } from "@livepeer/design-system"; -import { parseEther } from "ethers/lib/utils"; import { useHandleTransaction } from "hooks"; import { useBondingManagerAddress, useLivepeerTokenAddress, } from "hooks/useContracts"; import { useMemo, useState } from "react"; +import { parseEther } from "viem"; import { useSimulateContract, useWriteContract } from "wagmi"; import ProgressSteps from "../ProgressSteps"; @@ -54,12 +54,12 @@ const Delegate = ({ approveIsSuccess, { type: "bond", - amount: MAXIMUM_VALUE_UINT256, + amount: BigInt(MAXIMUM_VALUE_UINT256), } ); const bondWithHintArgs = { - amount: amount?.toString() ? parseEther(amount) : "0", + amount: amount?.toString() ? parseEther(amount) : BigInt(0), to, oldDelegateNewPosPrev, oldDelegateNewPosNext, diff --git a/components/DelegatingWidget/Footer.tsx b/components/DelegatingWidget/Footer.tsx index 961ea1b2..17691e00 100644 --- a/components/DelegatingWidget/Footer.tsx +++ b/components/DelegatingWidget/Footer.tsx @@ -7,7 +7,6 @@ import { } from "@lib/utils"; import { Box, Button } from "@livepeer/design-system"; import { AccountQueryResult, OrchestratorsSortedQueryResult } from "apollo"; -import { parseEther } from "ethers/lib/utils"; import { StakingAction, useAccountAddress, @@ -15,6 +14,7 @@ import { usePendingFeesAndStakeData, } from "hooks"; import { useMemo } from "react"; +import { parseEther } from "viem"; import Delegate from "./Delegate"; import Footnote from "./Footnote"; diff --git a/components/DelegatingWidget/Undelegate.tsx b/components/DelegatingWidget/Undelegate.tsx index 74c6d5d1..a93367e1 100644 --- a/components/DelegatingWidget/Undelegate.tsx +++ b/components/DelegatingWidget/Undelegate.tsx @@ -1,8 +1,8 @@ import { bondingManager } from "@lib/api/abis/main/BondingManager"; import { Button } from "@livepeer/design-system"; -import { parseEther } from "ethers/lib/utils"; import { useAccountAddress, useHandleTransaction } from "hooks"; import { useBondingManagerAddress } from "hooks/useContracts"; +import { parseEther } from "viem"; import { useSimulateContract, useWriteContract } from "wagmi"; const Undelegate = ({ amount, newPosPrev, newPosNext, disabled }) => { diff --git a/components/DelegatingWidget/index.tsx b/components/DelegatingWidget/index.tsx index 7961def1..813deaf6 100644 --- a/components/DelegatingWidget/index.tsx +++ b/components/DelegatingWidget/index.tsx @@ -67,7 +67,7 @@ const Index = ({ [isMyTranscoder, isDelegated] ); const currentPendingStake = Number( - fromWei(pendingFeesAndStake?.pendingStake ?? 0) + fromWei(pendingFeesAndStake?.pendingStake ?? "0") ); return ( diff --git a/components/Drawer/index.tsx b/components/Drawer/index.tsx index e8e60a58..228970ed 100644 --- a/components/Drawer/index.tsx +++ b/components/Drawer/index.tsx @@ -6,8 +6,8 @@ import Router, { useRouter } from "next/router"; import { useEffect } from "react"; import Account from "../Account"; -import Logo from "../Logo"; import LlamaswapModal from "../LlamaswapModal"; +import Logo from "../Logo"; const Index = ({ items = [], diff --git a/components/HistoryView/index.tsx b/components/HistoryView/index.tsx index 903dda8a..6ae06c70 100644 --- a/components/HistoryView/index.tsx +++ b/components/HistoryView/index.tsx @@ -39,20 +39,13 @@ const Index = () => { ); const events = useMemo( - () => - data?.transactions?.reduce( - (res, { events: e }) => res.concat(e as any), - [] - ) ?? [], + () => data?.transactions?.flatMap(({ events: e }) => e ?? []) ?? [], [data] ); const lastEventTimestamp = useMemo( () => - Number( - (events?.[(events?.length || 0) - 1] as any)?.transaction?.timestamp ?? - 0 - ), + Number(events?.[(events?.length || 0) - 1]?.transaction?.timestamp ?? 0), [events] ); @@ -61,9 +54,7 @@ const Index = () => { const mergedEvents = useMemo( () => [ - ...events.filter( - (e) => (e as any)?.__typename !== "WinningTicketRedeemedEvent" - ), + ...events.filter((e) => e?.__typename !== "WinningTicketRedeemedEvent"), ...(data?.winningTicketRedeemedEvents?.filter( (e) => (e?.transaction?.timestamp ?? 0) > lastEventTimestamp ) ?? []), @@ -110,7 +101,7 @@ const Index = () => { variables: { skip: data.transactions.length, }, - updateQuery: (previousResult: any, { fetchMoreResult }: any) => { + updateQuery: (previousResult, { fetchMoreResult }) => { if (!fetchMoreResult) { return previousResult; } @@ -139,7 +130,7 @@ const Index = () => { }} > - {mergedEvents.map((event: any, i: number) => renderSwitch(event, i))} + {mergedEvents.map((event, i: number) => renderSwitch(event, i))} {loading && data.transactions.length >= 10 && ( { export default Index; -function renderSwitch(event: any, i: number) { +function renderSwitch(event, i: number) { switch (event.__typename) { case "BondEvent": return ( diff --git a/components/LlamaswapModal/index.tsx b/components/LlamaswapModal/index.tsx index 43f89b20..a149fa4a 100644 --- a/components/LlamaswapModal/index.tsx +++ b/components/LlamaswapModal/index.tsx @@ -1,8 +1,4 @@ -import { - Dialog, - DialogContent, - DialogTrigger, -} from "@livepeer/design-system"; +import { Dialog, DialogContent, DialogTrigger } from "@livepeer/design-system"; const Index = ({ trigger, children }) => { return ( diff --git a/components/PerformanceList/index.tsx b/components/PerformanceList/index.tsx index 59e3d963..fede2324 100644 --- a/components/PerformanceList/index.tsx +++ b/components/PerformanceList/index.tsx @@ -11,6 +11,7 @@ import { useAllScoreData, useEnsData } from "hooks"; import Link from "next/link"; import numbro from "numbro"; import { useMemo } from "react"; +import { Column } from "react-table"; const EmptyData = () => ; @@ -63,17 +64,22 @@ const PerformanceList = ({ //sort double values correctly. As such, we use a custom sort function to place 0 values after //non-zero's and before null/undefined values. const sortTypeFn = useMemo( - () => (rowA: any, rowB: any, columnId: string) => { - const a = rowA.values[columnId]; - const b = rowB.values[columnId]; - if (a === null || a === undefined) return -1; - if (b === null || b === undefined) return 1; - return a === b ? 0 : a > b ? 1 : -1; - }, + () => + ( + rowA: { values: Record }, + rowB: { values: Record }, + columnId: string + ) => { + const a = rowA.values[columnId]; + const b = rowB.values[columnId]; + if (a === null || a === undefined) return -1; + if (b === null || b === undefined) return 1; + return a === b ? 0 : a > b ? 1 : -1; + }, [] ); - const columns: any = useMemo( + const columns: Column[] = useMemo( () => [ { Header: "Rank", diff --git a/components/StakeTransactions/index.tsx b/components/StakeTransactions/index.tsx index a600ffd7..d4511cee 100644 --- a/components/StakeTransactions/index.tsx +++ b/components/StakeTransactions/index.tsx @@ -1,6 +1,6 @@ import { Box, Card, Flex, Heading, Text } from "@livepeer/design-system"; import { UnbondingLock } from "apollo"; -import { parseEther } from "ethers/lib/utils"; +import { parseEther } from "viem"; import { abbreviateNumber, diff --git a/components/Table/index.tsx b/components/Table/index.tsx index 679eb0d2..6e9832fa 100644 --- a/components/Table/index.tsx +++ b/components/Table/index.tsx @@ -15,7 +15,16 @@ import { ChevronUpIcon, } from "@radix-ui/react-icons"; import { ReactNode } from "react"; -import { Column, usePagination, useSortBy, useTable } from "react-table"; +import { + Column, + HeaderGroup, + TableInstance, + usePagination, + UsePaginationInstanceProps, + useSortBy, + UseSortByInstanceProps, + useTable, +} from "react-table"; function DataTable({ heading = null, @@ -42,7 +51,7 @@ function DataTable({ nextPage, previousPage, state: { pageIndex }, - }: any = useTable( + } = useTable( { columns, data, @@ -50,7 +59,9 @@ function DataTable({ }, useSortBy, usePagination - ); + ) as TableInstance & + UsePaginationInstanceProps & + UseSortByInstanceProps & { state: { pageIndex: number } }; return ( <> @@ -102,9 +113,17 @@ function DataTable({ return ( - {headerGroup.headers.map((column: any, i) => { + {headerGroup.headers.map((column, i) => { const columnProps = column.getHeaderProps( - column.getSortByToggleProps({ title: undefined }) + ( + column as HeaderGroup & { + getSortByToggleProps: (args?: { + title?: string; + }) => object; + } + ).getSortByToggleProps({ + title: undefined, + }) ); const { key: columnKey, ...restColumnProps } = columnProps; @@ -114,10 +133,12 @@ function DataTable({ key={columnKey} {...restColumnProps} css={{ - px: i === 0 ? "$2" : "auto", + paddingLeft: i === 0 ? "$2" : "auto", + paddingRight: i === 0 ? "$2" : "auto", width: i === 0 ? "40px" : "auto", "@bp1": { - px: i === 0 ? "$5" : "auto", + paddingLeft: i === 0 ? "$5" : "auto", + paddingRight: i === 0 ? "$5" : "auto", }, }} > @@ -132,18 +153,34 @@ function DataTable({ fontWeight: 700, }} > - {column?.sortIconAlignment !== "start" && + {( + column as HeaderGroup & { + sortIconAlignment?: "start"; + } + )?.sortIconAlignment !== "start" && column.render("Header")} & { + sortIconAlignment?: "start"; + } + )?.sortIconAlignment !== "start" ? 20 : 0, }} > - {column.isSorted ? ( - column.isSortedDesc ? ( + {( + column as HeaderGroup & { + isSorted: boolean; + } + ).isSorted ? ( + ( + column as HeaderGroup & { + isSortedDesc: boolean; + } + ).isSortedDesc ? ( ) : ( @@ -153,7 +190,11 @@ function DataTable({ )} - {column?.sortIconAlignment === "start" && ( + {( + column as HeaderGroup & { + sortIconAlignment?: "start"; + } + )?.sortIconAlignment === "start" && ( ({ fontSize: "$3", fontWeight: 500, lineHeight: 2, - px: i === 0 ? "$5" : "$1", + paddingLeft: i === 0 ? "$5" : "$1", + paddingRight: i === 0 ? "$5" : "$1", width: i === 0 ? "40px" : "auto", }} > diff --git a/components/TransactionsList/index.tsx b/components/TransactionsList/index.tsx index 5382aca5..7fdb1e05 100644 --- a/components/TransactionsList/index.tsx +++ b/components/TransactionsList/index.tsx @@ -554,7 +554,7 @@ const TransactionsList = ({ return ( }); const formatLPT = (lpt: string | undefined) => - abbreviateNumber(fromWei(lpt ?? 0), 4); + abbreviateNumber(fromWei(lpt ?? "0"), 4); const TreasuryVotingWidget = ({ proposal, vote, ...props }: Props) => { const accountAddress = useAccountAddress(); diff --git a/components/TxConfirmedDialog/index.tsx b/components/TxConfirmedDialog/index.tsx index 2f1685b9..ee9f3531 100644 --- a/components/TxConfirmedDialog/index.tsx +++ b/components/TxConfirmedDialog/index.tsx @@ -1,4 +1,5 @@ import QueueExecuteButton from "@components/QueueExecuteButton"; +import { ProposalExtended } from "@lib/api/treasury"; import { Badge, Box, @@ -81,6 +82,7 @@ const Index = () => { export default Index; function renderSwitch(tx: TransactionStatus, onDismiss: () => void) { + if (!tx.inputData) return; switch (tx.name) { case "bond": return ( @@ -99,7 +101,7 @@ function renderSwitch(tx: TransactionStatus, onDismiss: () => void) { {Number(tx.inputData.amount) <= 0 ? `Congrats! You've successfully migrated your stake to a new orchestrator.` : `Congrats! You've successfully delegated - ${fromWei(tx.inputData.amount)} LPT.`} + ${fromWei(tx.inputData.amount ?? "0")} LPT.`}
@@ -114,6 +116,7 @@ function renderSwitch(tx: TransactionStatus, onDismiss: () => void) {
); case "unbond": + if (!tx.inputData.amount) return null; return ( @@ -195,6 +198,7 @@ function renderSwitch(tx: TransactionStatus, onDismiss: () => void) { ); case "rebondFromUnbonded": + if (!tx.inputData.delegate) return null; return (
@@ -208,11 +212,10 @@ function renderSwitch(tx: TransactionStatus, onDismiss: () => void) { }} > You've successfully redelegated to orchestrator{" "} - {tx.inputData && - tx.inputData.delegate.replace( - tx.inputData.delegate.slice(7, 37), - "…" - )} + {tx.inputData.delegate.replace( + tx.inputData.delegate.slice(7, 37), + "…" + )}
@@ -239,8 +242,8 @@ function renderSwitch(tx: TransactionStatus, onDismiss: () => void) { You've successfully checkpointed{" "} {!isOrchestrator ? "your stake" - : `your orchestrator (${targetAddress.replace( - targetAddress.slice(7, 37), + : `your orchestrator (${targetAddress?.replace( + targetAddress?.slice(7, 37) ?? "", "…" )}) stake!`}
@@ -300,6 +303,7 @@ function renderSwitch(tx: TransactionStatus, onDismiss: () => void) { ); case "queue": + if (!tx.inputData.proposal) return null; return ( @@ -324,7 +328,7 @@ function renderSwitch(tx: TransactionStatus, onDismiss: () => void) { size="4" variant="primary" css={{ marginRight: "$2", flex: 1 }} - proposal={tx.inputData?.proposal} + proposal={tx.inputData.proposal as ProposalExtended} onClick={onDismiss} /> diff --git a/components/TxStartedDialog/index.tsx b/components/TxStartedDialog/index.tsx index 574953ad..3c80c857 100644 --- a/components/TxStartedDialog/index.tsx +++ b/components/TxStartedDialog/index.tsx @@ -99,18 +99,21 @@ function Table({ tx, account }: { tx: TransactionStatus; account: string }) { function Inputs({ tx }: { tx: TransactionStatus }) { const inputData = tx.inputData; + if (!inputData) return null; + switch (tx.name) { case "bond": + if (!(inputData.to && inputData.amount)) return null; return ( <> Delegate{" "} - {inputData && inputData.to.replace(inputData.to.slice(7, 37), "…")} + {inputData.to.replace(inputData.to.slice(7, 37), "…")} {Number(inputData.amount) > 0 ? ( - Amount {tx.inputData && fromWei(inputData.amount)} LPT + Amount {fromWei(inputData.amount)} LPT ) : ( <> @@ -118,6 +121,7 @@ function Inputs({ tx }: { tx: TransactionStatus }) { ); case "unbond": + if (!inputData.amount) return null; return ( <> @@ -126,12 +130,12 @@ function Inputs({ tx }: { tx: TransactionStatus }) { ); case "rebondFromUnbonded": + if (!inputData.delegate) return null; return ( <> Delegate{" "} - {tx.inputData && - inputData.delegate.replace(inputData.delegate.slice(7, 37), "…")} + {inputData.delegate.replace(inputData.delegate.slice(7, 37), "…")} ); @@ -139,8 +143,7 @@ function Inputs({ tx }: { tx: TransactionStatus }) { return ( <> - Vote{" "} - {tx.inputData && inputData.choiceId === 0 ? "Yes" : "No"} + Vote {inputData.choiceId === 0 ? "Yes" : "No"} ); @@ -148,7 +151,7 @@ function Inputs({ tx }: { tx: TransactionStatus }) { return ( <> - Total Rounds {tx.inputData && inputData.totalRounds} + Total Rounds {inputData.totalRounds} ); @@ -165,14 +168,15 @@ function Inputs({ tx }: { tx: TransactionStatus }) { // case "initializeRound": // return null; case "claimStake": + if (!(inputData.stake && inputData.fees)) return null; return ( <> - Stake {tx.inputData && fromWei(inputData.stake)} + Stake {fromWei(inputData.stake)} - Fees {tx.inputData && fromWei(inputData.fees)} LPT + Fees {fromWei(inputData.fees)} LPT ); diff --git a/components/URLVerificationBanner/index.tsx b/components/URLVerificationBanner/index.tsx index 6f024ef8..8377afd1 100644 --- a/components/URLVerificationBanner/index.tsx +++ b/components/URLVerificationBanner/index.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { Box, Button, @@ -8,6 +7,7 @@ import { Flex, Text, } from "@livepeer/design-system"; +import React from "react"; import { FiAlertTriangle, FiX } from "react-icons/fi"; type URLVerificationBannerProps = { diff --git a/hooks/useExplorerStore.tsx b/hooks/useExplorerStore.tsx index 33cb25d4..54229f20 100644 --- a/hooks/useExplorerStore.tsx +++ b/hooks/useExplorerStore.tsx @@ -1,4 +1,6 @@ +import { ProposalExtended } from "@lib/api/treasury"; import { txMessages } from "lib/utils"; +import { Address } from "viem"; import { create } from "zustand"; export type StakingAction = "undelegate" | "delegate" | null; @@ -9,12 +11,33 @@ export type YieldResults = { principle: number; }; +export type InputData = { + amount?: bigint; + choiceId?: number; + choiceName?: string; + delegate?: Address; + fees?: bigint; + isOrchestrator?: boolean; + newDelegate?: Address; + newPosNext?: string; + newPosPrev?: string; + proposal?: ProposalExtended | string | null; + reason?: string; + recipient?: Address; + stake?: bigint; + targetAddress?: Address | null; + to?: string; + totalRounds?: number; + type?: string; + unbondingLockId?: number; +}; + export type TransactionStep = "summary" | "started" | "confirmed"; export type TransactionIdentifier = keyof typeof txMessages; export type TransactionStatus = { hash?: string; name?: TransactionIdentifier; - inputData?: any | null; + inputData?: InputData | null; step: TransactionStep | null; error?: string; }; @@ -34,7 +57,7 @@ export type ExplorerState = { setLatestTransactionDetails: ( hash: string, id: TransactionIdentifier, - inputData?: any + inputData?: InputData ) => void; setLatestTransactionConfirmed: () => void; setLatestTransactionSummary: () => void; @@ -63,7 +86,7 @@ export const useExplorerStore = create()((set) => ({ setLatestTransactionDetails: ( hash: string, id: TransactionIdentifier, - inputData?: any + inputData?: InputData ) => set(() => ({ latestTransaction: { @@ -83,7 +106,10 @@ export const useExplorerStore = create()((set) => ({ })), setLatestTransactionError: (v: string) => set(({ latestTransaction }) => ({ - latestTransaction: { ...latestTransaction, error: v } as any, + latestTransaction: { ...latestTransaction, error: v } as { + step: TransactionStep | null; + error: string; + }, })), clearLatestTransaction: () => set(() => ({ diff --git a/hooks/useHandleTransaction.tsx b/hooks/useHandleTransaction.tsx index 59f68522..ef28206e 100644 --- a/hooks/useHandleTransaction.tsx +++ b/hooks/useHandleTransaction.tsx @@ -2,7 +2,11 @@ import { useAddRecentTransaction } from "@rainbow-me/rainbowkit"; import { capitalCase } from "change-case"; import { useEffect } from "react"; -import { TransactionIdentifier, useExplorerStore } from "./useExplorerStore"; +import { + InputData, + TransactionIdentifier, + useExplorerStore, +} from "./useExplorerStore"; export const useHandleTransaction = ( id: TransactionIdentifier, @@ -10,7 +14,7 @@ export const useHandleTransaction = ( error: Error | null, isLoading: boolean, isSuccess: boolean, - args: any, + args: InputData, onSuccess?: ((result: `0x${string}`) => Promise | void) | null ) => { const { diff --git a/layouts/main.tsx b/layouts/main.tsx index 03b9c671..77828e10 100644 --- a/layouts/main.tsx +++ b/layouts/main.tsx @@ -8,11 +8,11 @@ import Logo from "@components/Logo"; import PopoverLink from "@components/PopoverLink"; import ProgressBar from "@components/ProgressBar"; import RegisterToVote from "@components/RegisterToVote"; -import URLVerificationBanner from "@components/URLVerificationBanner"; import Search from "@components/Search"; import TxConfirmedDialog from "@components/TxConfirmedDialog"; import TxStartedDialog from "@components/TxStartedDialog"; import TxSummaryDialog from "@components/TxSummaryDialog"; +import URLVerificationBanner from "@components/URLVerificationBanner"; import { IS_L2 } from "@lib/chains"; import { globalStyles } from "@lib/globalStyles"; import { EMPTY_ADDRESS } from "@lib/utils"; @@ -50,13 +50,13 @@ import Link from "next/link"; import Router, { useRouter } from "next/router"; import { ThemeProvider } from "next-themes"; import React, { + ReactNode, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, - ReactNode, } from "react"; import { isMobile } from "react-device-detect"; import ReactGA from "react-ga"; @@ -298,7 +298,8 @@ const Layout = ({ children, title = "Livepeer Explorer" }) => { JSON.stringify([...storage, uniqueBannerID]) ); } - } catch (_err) { + } catch (error) { + console.error(error); window.localStorage.setItem( `bannersDismissed`, JSON.stringify([uniqueBannerID]) diff --git a/lib/api/polls.ts b/lib/api/polls.ts index afc55c18..c3958062 100644 --- a/lib/api/polls.ts +++ b/lib/api/polls.ts @@ -111,7 +111,7 @@ export const getPollExtended = async ( const nonVotersPercent = totalNonVoteStake / totalStake; return { - ...(poll as any), + ...poll, attributes, status, estimatedEndTime, @@ -130,7 +130,7 @@ export const getPollExtended = async ( voters: totalVoteStake, nonVoters: totalNonVoteStake, }, - }; + } as PollExtended; }; const absolutizeLinks = (markdown: string, baseUrl: string) => { diff --git a/lib/api/treasury.ts b/lib/api/treasury.ts index 0099a342..17e4317d 100644 --- a/lib/api/treasury.ts +++ b/lib/api/treasury.ts @@ -86,11 +86,11 @@ export const getProposalExtended = ( const proposal = "attributes" in proposalArg ? proposalArg : parseProposalText(proposalArg); - const totalVoteSupply = +fromWei(state.totalVoteSupply || 0); + const totalVoteSupply = +fromWei(state.totalVoteSupply || "0"); - const againstVotes = +fromWei(state.votes.against || 0); - const forVotes = +fromWei(state.votes.for || 0); - const abstainVotes = +fromWei(state.votes.abstain || 0); + const againstVotes = +fromWei(state.votes.against || "0"); + const forVotes = +fromWei(state.votes.for || "0"); + const abstainVotes = +fromWei(state.votes.abstain || "0"); const totalVotes = againstVotes + forVotes + abstainVotes; const quotaTotalVotes = againstVotes + forVotes; diff --git a/lib/earningsTree.tsx b/lib/earningsTree.tsx index 19a61df7..e047f3f6 100644 --- a/lib/earningsTree.tsx +++ b/lib/earningsTree.tsx @@ -1,11 +1,12 @@ // https://github.com/livepeer/merkle-earnings-cli/blob/master/src/tree/index.ts +// eslint-disable-next-line @typescript-eslint/no-require-imports const { keccak256, bufferToHex } = require("ethereumjs-util"); import { utils } from "ethers"; export interface IMerkleTree { - elements: Array; - layers: Array; + elements: Buffer[]; + layers: Buffer[][]; } export class MerkleTree implements IMerkleTree { @@ -19,18 +20,18 @@ export class MerkleTree implements IMerkleTree { this.elements.sort(Buffer.compare); // Create layers - this.layers = this.getLayers(this.elements); + this.layers = this.getLayers(this.elements) as Buffer[][]; } - elements: any[]; - layers: any[]; + elements: Buffer[]; + layers: Buffer[][]; getLayers(elements) { if (elements.length === 0) { return [[""]]; } - const layers: Array = []; + const layers: Buffer[][] = []; layers.push(elements); // Get next layer until we reach the root diff --git a/lib/fetchWithRetry.ts b/lib/fetchWithRetry.ts index bc135367..79465c22 100644 --- a/lib/fetchWithRetry.ts +++ b/lib/fetchWithRetry.ts @@ -22,7 +22,7 @@ const parseRetryAfter = (h: string | null): number | null => { function mergeSignalsPolyfill(signals: AbortSignal[]): AbortSignal { const ctrl = new AbortController(); - const abort = (s: AbortSignal) => ctrl.abort((s as any).reason); + const abort = (s: AbortSignal) => ctrl.abort(s.reason); for (const s of signals) { if (!s) continue; if (s.aborted) { @@ -53,7 +53,7 @@ export async function fetchWithRetry( const originalReq = new Request(input, init); let lastResponse: Response | undefined; - let lastError: unknown; + let lastError: { message: string } | undefined; for (let attempt = 0; attempt <= retries; attempt++) { // per-attempt timeout + caller signal merged @@ -66,8 +66,16 @@ export async function fetchWithRetry( const signal = signals.length === 1 ? signals[0] - : (AbortSignal as any).any - ? (AbortSignal as any).any(signals) + : ( + AbortSignal as unknown as { + any?: (signals: AbortSignal[]) => AbortSignal; + } + ).any + ? ( + AbortSignal as unknown as { + any: (signals: AbortSignal[]) => AbortSignal; + } + ).any(signals) : mergeSignalsPolyfill(signals); try { @@ -96,19 +104,23 @@ export async function fetchWithRetry( const ra = parseRetryAfter(res.headers.get("retry-after")); await sleep(ra ?? expBackoffJitter(attempt, baseDelayMs, maxDelayMs)); - } catch (err: any) { + } catch (err) { clearTimeout(timeoutId); - lastError = err; + lastError = err as { message: string }; // if caller aborted, fail immediately (don't retry) if (userSignal?.aborted) throw err; - const isAbort = err?.name === "AbortError"; - const isNetwork = err?.name === "TypeError" || err?.code === "ECONNRESET"; + const isAbort = (err as { name?: string })?.name === "AbortError"; + const isNetwork = + (err as { name?: string })?.name === "TypeError" || + (err as { code?: string })?.code === "ECONNRESET"; const canRetry = allowRetry && (isAbort || isNetwork); if (!canRetry || attempt === retries) { - const reason = err?.message || "Request failed after retries"; + const reason = + (err as { message?: string })?.message || + "Request failed after retries"; throw new Error(reason); } @@ -119,6 +131,6 @@ export async function fetchWithRetry( // Fallback: if we somehow exit the loop: if (lastResponse) return lastResponse; throw new Error( - (lastError as any)?.message ?? "Request failed after retries (no response)" + lastError?.message ?? "Request failed after retries (no response)" ); } diff --git a/lib/utils.tsx b/lib/utils.tsx index 83620da4..d4c41b98 100644 --- a/lib/utils.tsx +++ b/lib/utils.tsx @@ -1,8 +1,8 @@ import { AccountQueryResult, OrchestratorsSortedQueryResult } from "apollo"; -import { BigNumber, BigNumberish, ethers } from "ethers"; -import { formatEther, parseUnits } from "ethers/lib/utils"; +import { ethers } from "ethers"; import { StakingAction } from "hooks"; import { DEFAULT_CHAIN_ID, INFURA_NETWORK_URLS } from "lib/chains"; +import { formatEther, parseEther } from "viem"; import { isAddress } from "viem"; export const provider = new ethers.providers.JsonRpcProvider( @@ -193,7 +193,7 @@ export const simulateNewActiveSetOrder = ({ transcoders: NonNullable< OrchestratorsSortedQueryResult["data"] >["transcoders"]; - amount: BigNumber; + amount: bigint; newDelegate: string; oldDelegate?: string; }) => { @@ -207,7 +207,7 @@ export const simulateNewActiveSetOrder = ({ if (action === "delegate") { transcoders[index].totalStake = ( - +transcoders[index].totalStake + +amount + +transcoders[index].totalStake + +amount.toString() ).toString(); // if delegator is moving stake, subtract amount from old delegate @@ -221,13 +221,13 @@ export const simulateNewActiveSetOrder = ({ ); if (oldDelegateIndex !== -1) { transcoders[oldDelegateIndex].totalStake = ( - +transcoders[oldDelegateIndex].totalStake - +amount + +transcoders[oldDelegateIndex].totalStake - +amount.toString() ).toString(); } } } else { transcoders[index].totalStake = ( - +transcoders[index].totalStake - +amount + +transcoders[index].totalStake - +amount.toString() ).toString(); } @@ -251,10 +251,14 @@ export const getPercentChange = (valueNow, value24HoursAgo) => { return adjustedPercentChange; }; -export const fromWei = (wei: BigNumberish) => formatEther(wei); +export const fromWei = (wei: bigint | string) => { + if (typeof wei === "string") { + return formatEther(BigInt(wei)); + } + return formatEther(wei); +}; -export const toWei = (ether: BigNumberish) => - parseUnits(ether.toString(), "ether").toBigInt(); +export const toWei = (ether: number) => parseEther(ether.toString()); /** * Check if a URL is an image URL. diff --git a/package.json b/package.json index 4538804b..51569e36 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,10 @@ "build": "next build", "start": "next start", "lint": "eslint . --max-warnings 0", + "typecheck": "tsc --noEmit --incremental false", "format": "prettier . --write", - "format:check": "prettier . --check" + "format:check": "prettier . --check", + "prepare": "husky" }, "devDependencies": { "@graphql-codegen/add": "^3.2.0", @@ -31,6 +33,7 @@ "eslint-config-next": "16.0.1", "eslint-config-prettier": "^10.1.8", "eslint-plugin-simple-import-sort": "^12.1.1", + "husky": "^9.1.7", "typechain": "^8.1.0", "typescript": "5.1.6" }, diff --git a/pages/index.tsx b/pages/index.tsx index 933f6508..70116787 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -418,7 +418,14 @@ const Home = ({ orchestrators, events, protocol }: PageProps) => { - + ["transactions"][number]["events"] + } + pageSize={10} + /> diff --git a/pages/migrate/delegator/contract-wallet-tool.tsx b/pages/migrate/delegator/contract-wallet-tool.tsx index b483d2be..635ed6b8 100644 --- a/pages/migrate/delegator/contract-wallet-tool.tsx +++ b/pages/migrate/delegator/contract-wallet-tool.tsx @@ -12,7 +12,7 @@ import { TextField, } from "@livepeer/design-system"; import { CHAIN_INFO, DEFAULT_CHAIN_ID, L1_CHAIN_ID } from "lib/chains"; -import { useState } from "react"; +import { ReactNode, useState } from "react"; import useForm from "react-hook-form"; const ReadOnlyCard = styled(Box, { @@ -29,7 +29,10 @@ const ReadOnlyCard = styled(Box, { const ContractWalletTool = () => { const { register } = useForm(); - const [params] = useState(null); + const [params] = useState<{ + migrateDelegatorParams: { [key: string]: ReactNode }; + migrateUnbondingLockParams: { [key: string]: ReactNode }; + } | null>(null); const [message] = useState(null); const [loading] = useState(false); diff --git a/pages/transactions.tsx b/pages/transactions.tsx index 8552e891..cfd87197 100644 --- a/pages/transactions.tsx +++ b/pages/transactions.tsx @@ -60,7 +60,11 @@ const TransactionsPage = ({ events }: PageProps) => { ) : ( ["transactions"][number]["events"] + } pageSize={TRANSACTIONS_PER_PAGE} /> )} diff --git a/pages/voting/[poll].tsx b/pages/voting/[poll].tsx index c1751700..ca93d1eb 100644 --- a/pages/voting/[poll].tsx +++ b/pages/voting/[poll].tsx @@ -16,7 +16,13 @@ import { Heading, Text, } from "@livepeer/design-system"; -import { useAccountQuery, usePollQuery, useVoteQuery } from "apollo"; +import { + AccountQuery, + PollChoice, + useAccountQuery, + usePollQuery, + useVoteQuery, +} from "apollo"; import { sentenceCase } from "change-case"; import Head from "next/head"; import { useRouter } from "next/router"; @@ -343,9 +349,25 @@ const Poll = () => { @@ -354,9 +376,25 @@ const Poll = () => { diff --git a/pages/voting/create-poll.tsx b/pages/voting/create-poll.tsx index 884264cd..d7ba6416 100644 --- a/pages/voting/create-poll.tsx +++ b/pages/voting/create-poll.tsx @@ -64,7 +64,10 @@ const CreatePoll = ({ projectOwner, projectName, gitCommitHash, lips }) => { } }, [delegatorPendingStakeAndFees]); - const [selectedProposal, setSelectedProposal] = useState(null); + const [selectedProposal, setSelectedProposal] = useState<{ + gitCommitHash: string; + text: string; + } | null>(null); const { data: config } = useSimulateContract({ query: { enabled: Boolean(pollCreatorAddress && hash) }, @@ -254,6 +257,23 @@ CreatePoll.getLayout = getLayout; export default CreatePoll; +type TransformedProposal = { + attributes: { + lip: string; + }; +}; + +type TransformedLip = { + attributes: { + lip: string; + title: string; + status: string; + created: string; + "part-of"?: string; + }; + text: string; +}; + export async function getStaticProps() { try { const lipsQuery = ` @@ -318,17 +338,19 @@ export async function getStaticProps() { // check if proposal is valid format {text, gitCommitHash} if (obj?.text && obj?.gitCommitHash) { - const transformedProposal = fm(obj.text) as any; + const transformedProposal = fm(obj.text) as TransformedProposal; createdPolls.push(transformedProposal.attributes.lip); } }) ); } - const lips: any[] = []; + const lips: TransformedLip[] = []; if (result.data) { for (const lip of result.data.repository.content.entries) { - const transformedLip = fm(lip.content.text) as any; + const transformedLip = fm( + lip.content.text + ) as unknown as TransformedLip; transformedLip.attributes.created = transformedLip.attributes.created.toString(); if ( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9710fc9d..70625a30 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -74,7 +74,7 @@ importers: version: 1.2.8(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0) '@rainbow-me/rainbowkit': specifier: ^2.2.9 - version: 2.2.9(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(babel-plugin-macros@3.1.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.1.6)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(wagmi@2.19.3(@tanstack/query-core@5.90.7)(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12)) + version: 2.2.9(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(babel-plugin-macros@3.1.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.1.6)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(wagmi@2.19.3(@tanstack/query-core@5.90.7)(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12)) '@reach/dialog': specifier: ^0.17.0 version: 0.17.0(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0) @@ -260,7 +260,7 @@ importers: version: 2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12) wagmi: specifier: ^2.19.1 - version: 2.19.3(@tanstack/query-core@5.90.7)(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12) + version: 2.19.3(@tanstack/query-core@5.90.7)(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12) zod: specifier: ^4.1.12 version: 4.1.12 @@ -325,6 +325,9 @@ importers: eslint-plugin-simple-import-sort: specifier: ^12.1.1 version: 12.1.1(eslint@9.39.1(jiti@1.17.1)) + husky: + specifier: ^9.1.7 + version: 9.1.7 typechain: specifier: ^8.1.0 version: 8.3.2(typescript@5.1.6) @@ -5987,6 +5990,11 @@ packages: humanize-ms@1.2.1: resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} + husky@9.1.7: + resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} + engines: {node: '>=18'} + hasBin: true + hyphenate-style-name@1.1.0: resolution: {integrity: sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw==} @@ -9999,9 +10007,9 @@ snapshots: '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.28.5 - '@base-org/account@2.4.0(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(use-sync-external-store@1.4.0(react@19.2.0))(utf-8-validate@5.0.10)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12)': + '@base-org/account@2.4.0(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(use-sync-external-store@1.4.0(react@19.2.0))(utf-8-validate@5.0.10)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12)': dependencies: - '@coinbase/cdp-sdk': 1.38.5(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(utf-8-validate@5.0.10)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + '@coinbase/cdp-sdk': 1.38.5(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(utf-8-validate@5.0.10)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@noble/hashes': 1.4.0 clsx: 1.2.1 eventemitter3: 5.0.1 @@ -10024,11 +10032,11 @@ snapshots: - ws - zod - '@coinbase/cdp-sdk@1.38.5(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(utf-8-validate@5.0.10)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))': + '@coinbase/cdp-sdk@1.38.5(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(utf-8-validate@5.0.10)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))': dependencies: - '@solana-program/system': 0.8.1(@solana/kit@3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))) - '@solana-program/token': 0.6.0(@solana/kit@3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))) - '@solana/kit': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + '@solana-program/system': 0.8.1(@solana/kit@3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))) + '@solana-program/token': 0.6.0(@solana/kit@3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))) + '@solana/kit': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@solana/web3.js': 1.98.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.1.6)(utf-8-validate@5.0.10) abitype: 1.0.6(typescript@5.1.6)(zod@3.25.76) axios: 1.13.2 @@ -12806,7 +12814,7 @@ snapshots: '@radix-ui/rect@1.1.1': {} - '@rainbow-me/rainbowkit@2.2.9(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(babel-plugin-macros@3.1.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.1.6)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(wagmi@2.19.3(@tanstack/query-core@5.90.7)(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12))': + '@rainbow-me/rainbowkit@2.2.9(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(babel-plugin-macros@3.1.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.1.6)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(wagmi@2.19.3(@tanstack/query-core@5.90.7)(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12))': dependencies: '@tanstack/react-query': 5.90.7(react@19.2.0) '@vanilla-extract/css': 1.17.3(babel-plugin-macros@3.1.0) @@ -12819,7 +12827,7 @@ snapshots: react-remove-scroll: 2.6.2(@types/react@19.2.2)(react@19.2.0) ua-parser-js: 1.0.41 viem: 2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12) - wagmi: 2.19.3(@tanstack/query-core@5.90.7)(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12) + wagmi: 2.19.3(@tanstack/query-core@5.90.7)(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12) transitivePeerDependencies: - '@types/react' - babel-plugin-macros @@ -13205,13 +13213,13 @@ snapshots: '@socket.io/component-emitter@3.1.2': {} - '@solana-program/system@0.8.1(@solana/kit@3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))': + '@solana-program/system@0.8.1(@solana/kit@3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10)))': dependencies: - '@solana/kit': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + '@solana/kit': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10)) - '@solana-program/token@0.6.0(@solana/kit@3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))': + '@solana-program/token@0.6.0(@solana/kit@3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10)))': dependencies: - '@solana/kit': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + '@solana/kit': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@solana/accounts@3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)': dependencies: @@ -13341,7 +13349,7 @@ snapshots: transitivePeerDependencies: - fastestsmallesttextencoderdecoder - '@solana/kit@3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))': + '@solana/kit@3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))': dependencies: '@solana/accounts': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) '@solana/addresses': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) @@ -13355,11 +13363,11 @@ snapshots: '@solana/rpc': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) '@solana/rpc-parsed-types': 3.0.3(typescript@5.1.6) '@solana/rpc-spec-types': 3.0.3(typescript@5.1.6) - '@solana/rpc-subscriptions': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + '@solana/rpc-subscriptions': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@solana/rpc-types': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) '@solana/signers': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) '@solana/sysvars': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) - '@solana/transaction-confirmation': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + '@solana/transaction-confirmation': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@solana/transaction-messages': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) '@solana/transactions': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) typescript: 5.1.6 @@ -13438,14 +13446,14 @@ snapshots: transitivePeerDependencies: - fastestsmallesttextencoderdecoder - '@solana/rpc-subscriptions-channel-websocket@3.0.3(typescript@5.1.6)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))': + '@solana/rpc-subscriptions-channel-websocket@3.0.3(typescript@5.1.6)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))': dependencies: '@solana/errors': 3.0.3(typescript@5.1.6) '@solana/functional': 3.0.3(typescript@5.1.6) '@solana/rpc-subscriptions-spec': 3.0.3(typescript@5.1.6) '@solana/subscribable': 3.0.3(typescript@5.1.6) typescript: 5.1.6 - ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + ws: 7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@solana/rpc-subscriptions-spec@3.0.3(typescript@5.1.6)': dependencies: @@ -13455,7 +13463,7 @@ snapshots: '@solana/subscribable': 3.0.3(typescript@5.1.6) typescript: 5.1.6 - '@solana/rpc-subscriptions@3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))': + '@solana/rpc-subscriptions@3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))': dependencies: '@solana/errors': 3.0.3(typescript@5.1.6) '@solana/fast-stable-stringify': 3.0.3(typescript@5.1.6) @@ -13463,7 +13471,7 @@ snapshots: '@solana/promises': 3.0.3(typescript@5.1.6) '@solana/rpc-spec-types': 3.0.3(typescript@5.1.6) '@solana/rpc-subscriptions-api': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) - '@solana/rpc-subscriptions-channel-websocket': 3.0.3(typescript@5.1.6)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + '@solana/rpc-subscriptions-channel-websocket': 3.0.3(typescript@5.1.6)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@solana/rpc-subscriptions-spec': 3.0.3(typescript@5.1.6) '@solana/rpc-transformers': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) '@solana/rpc-types': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) @@ -13548,7 +13556,7 @@ snapshots: transitivePeerDependencies: - fastestsmallesttextencoderdecoder - '@solana/transaction-confirmation@3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))': + '@solana/transaction-confirmation@3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))': dependencies: '@solana/addresses': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) '@solana/codecs-strings': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) @@ -13556,7 +13564,7 @@ snapshots: '@solana/keys': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) '@solana/promises': 3.0.3(typescript@5.1.6) '@solana/rpc': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) - '@solana/rpc-subscriptions': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + '@solana/rpc-subscriptions': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@solana/rpc-types': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) '@solana/transaction-messages': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) '@solana/transactions': 3.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.1.6) @@ -14115,9 +14123,9 @@ snapshots: dependencies: '@vanilla-extract/css': 1.17.3(babel-plugin-macros@3.1.0) - '@wagmi/connectors@6.1.4(5fxula2gya3uupqsx2goc4akxm)': + '@wagmi/connectors@6.1.4(iz5vu3tehhsi4xhynmh6nc3x5q)': dependencies: - '@base-org/account': 2.4.0(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(use-sync-external-store@1.4.0(react@19.2.0))(utf-8-validate@5.0.10)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12) + '@base-org/account': 2.4.0(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(use-sync-external-store@1.4.0(react@19.2.0))(utf-8-validate@5.0.10)(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12) '@coinbase/wallet-sdk': 4.3.6(@types/react@19.2.2)(bufferutil@4.0.9)(react@19.2.0)(typescript@5.1.6)(use-sync-external-store@1.4.0(react@19.2.0))(utf-8-validate@5.0.10)(zod@4.1.12) '@gemini-wallet/core': 0.3.2(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12)) '@metamask/sdk': 0.33.1(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) @@ -14126,7 +14134,7 @@ snapshots: '@wagmi/core': 2.22.1(@tanstack/query-core@5.90.7)(@types/react@19.2.2)(react@19.2.0)(typescript@5.1.6)(use-sync-external-store@1.4.0(react@19.2.0))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12)) '@walletconnect/ethereum-provider': 2.21.1(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.2.0)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12) cbw-sdk: '@coinbase/wallet-sdk@3.9.3' - porto: 0.2.35(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(@wagmi/core@2.22.1(@tanstack/query-core@5.90.7)(@types/react@19.2.2)(react@19.2.0)(typescript@5.1.6)(use-sync-external-store@1.4.0(react@19.2.0))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12)))(react@19.2.0)(typescript@5.1.6)(use-sync-external-store@1.4.0(react@19.2.0))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(wagmi@2.19.3(@tanstack/query-core@5.90.7)(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12)) + porto: 0.2.35(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(@wagmi/core@2.22.1(@tanstack/query-core@5.90.7)(@types/react@19.2.2)(react@19.2.0)(typescript@5.1.6)(use-sync-external-store@1.4.0(react@19.2.0))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12)))(react@19.2.0)(typescript@5.1.6)(use-sync-external-store@1.4.0(react@19.2.0))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(wagmi@2.19.3(@tanstack/query-core@5.90.7)(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12)) viem: 2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12) optionalDependencies: typescript: 5.1.6 @@ -17089,6 +17097,8 @@ snapshots: dependencies: ms: 2.1.3 + husky@9.1.7: {} + hyphenate-style-name@1.1.0: {} iconv-lite@0.4.24: @@ -18877,7 +18887,7 @@ snapshots: pony-cause@2.1.11: {} - porto@0.2.35(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(@wagmi/core@2.22.1(@tanstack/query-core@5.90.7)(@types/react@19.2.2)(react@19.2.0)(typescript@5.1.6)(use-sync-external-store@1.4.0(react@19.2.0))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12)))(react@19.2.0)(typescript@5.1.6)(use-sync-external-store@1.4.0(react@19.2.0))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(wagmi@2.19.3(@tanstack/query-core@5.90.7)(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12)): + porto@0.2.35(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(@wagmi/core@2.22.1(@tanstack/query-core@5.90.7)(@types/react@19.2.2)(react@19.2.0)(typescript@5.1.6)(use-sync-external-store@1.4.0(react@19.2.0))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12)))(react@19.2.0)(typescript@5.1.6)(use-sync-external-store@1.4.0(react@19.2.0))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(wagmi@2.19.3(@tanstack/query-core@5.90.7)(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12)): dependencies: '@wagmi/core': 2.22.1(@tanstack/query-core@5.90.7)(@types/react@19.2.2)(react@19.2.0)(typescript@5.1.6)(use-sync-external-store@1.4.0(react@19.2.0))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12)) hono: 4.10.4 @@ -18891,7 +18901,7 @@ snapshots: '@tanstack/react-query': 5.90.7(react@19.2.0) react: 19.2.0 typescript: 5.1.6 - wagmi: 2.19.3(@tanstack/query-core@5.90.7)(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12) + wagmi: 2.19.3(@tanstack/query-core@5.90.7)(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12) transitivePeerDependencies: - '@types/react' - immer @@ -20516,10 +20526,10 @@ snapshots: - utf-8-validate - zod - wagmi@2.19.3(@tanstack/query-core@5.90.7)(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12): + wagmi@2.19.3(@tanstack/query-core@5.90.7)(@tanstack/react-query@5.90.7(react@19.2.0))(@types/react@19.2.2)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.0)(typescript@5.1.6)(utf-8-validate@5.0.10)(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12))(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.12): dependencies: '@tanstack/react-query': 5.90.7(react@19.2.0) - '@wagmi/connectors': 6.1.4(5fxula2gya3uupqsx2goc4akxm) + '@wagmi/connectors': 6.1.4(iz5vu3tehhsi4xhynmh6nc3x5q) '@wagmi/core': 2.22.1(@tanstack/query-core@5.90.7)(@types/react@19.2.2)(react@19.2.0)(typescript@5.1.6)(use-sync-external-store@1.4.0(react@19.2.0))(viem@2.38.6(bufferutil@4.0.9)(typescript@5.1.6)(utf-8-validate@5.0.10)(zod@4.1.12)) react: 19.2.0 use-sync-external-store: 1.4.0(react@19.2.0)