diff --git a/apps/hub/src/app/governance/[genre]/components/proposal-card.tsx b/apps/hub/src/app/governance/[genre]/components/proposal-card.tsx index 08ff83ee1..c3d0a4082 100755 --- a/apps/hub/src/app/governance/[genre]/components/proposal-card.tsx +++ b/apps/hub/src/app/governance/[genre]/components/proposal-card.tsx @@ -10,29 +10,15 @@ import { formatEther } from "viem"; import { getBadgeColor, getTimeText, - getTopicColor, getTotalVotes, getVotesDataList, parseProposalBody, } from "../../helper"; import { StatusEnum } from "../../types"; -import { VoteInfo } from "./Voter"; import { ProgressBarChart } from "./progress-bar-chart"; import { QuorumStatus } from "./quorum-status"; -import { Icons } from "@bera/ui/icons"; import { ProposalHeading } from "../../components/proposal-heading"; -// If the proposal is active there is a time left to vote -const tAgo = new Intl.RelativeTimeFormat("en-US", { - style: "long", - numeric: "auto", -}); -// If the proposal is closed there is a time ago -const tIn = new Intl.RelativeTimeFormat("en-US", { - style: "long", - numeric: "auto", -}); - export function ProposalCard({ details = false, truncate = true, @@ -57,31 +43,39 @@ export function ProposalCard({ >
-
+
{proposal.status} - {getTimeText(proposal)} + {getTimeText(proposal)}
-
- - -
+ {![ + StatusEnum.PENDING, + StatusEnum.CANCELED_BY_USER, + StatusEnum.CANCELED_BY_GUARDIAN, + ].includes(proposal.status as StatusEnum) ? ( +
+ + +
+ ) : ( +
--
+ )}
); } diff --git a/apps/hub/src/app/governance/[genre]/components/quorum-status.tsx b/apps/hub/src/app/governance/[genre]/components/quorum-status.tsx index d2e43c30c..d228bc763 100644 --- a/apps/hub/src/app/governance/[genre]/components/quorum-status.tsx +++ b/apps/hub/src/app/governance/[genre]/components/quorum-status.tsx @@ -15,7 +15,7 @@ export const QuorumStatus = ({ .toNumber(); return ( -
+
of{" "} diff --git a/apps/hub/src/app/governance/[genre]/components/voter-column.tsx b/apps/hub/src/app/governance/[genre]/components/voter-column.tsx index b4a70c9e9..fd049210b 100644 --- a/apps/hub/src/app/governance/[genre]/components/voter-column.tsx +++ b/apps/hub/src/app/governance/[genre]/components/voter-column.tsx @@ -6,6 +6,11 @@ import { formatEther } from "viem"; import { VoteEnum } from "../../types"; import { VoteInfo } from "./Voter"; +import { + AccordionContent, + AccordionItem, + AccordionTrigger, +} from "@bera/ui/accordion"; const getBadgeColor = (type: keyof typeof VoteEnum) => { switch (type) { @@ -23,7 +28,22 @@ const getBadgeColor = (type: keyof typeof VoteEnum) => { export const voterColumns: ColumnDef[] = [ { header: "Voter", - cell: ({ row }) => , + cell: ({ row }) => ( + + + + + + {row.original.reason ? ( +

{row.original.reason}

+ ) : ( + + No reason provided + + )} +
+
+ ), accessorKey: "voter", enableSorting: false, minSize: 200, diff --git a/apps/hub/src/app/governance/[genre]/components/voter-table.tsx b/apps/hub/src/app/governance/[genre]/components/voter-table.tsx index b7fa5c5f8..b6e9437df 100755 --- a/apps/hub/src/app/governance/[genre]/components/voter-table.tsx +++ b/apps/hub/src/app/governance/[genre]/components/voter-table.tsx @@ -8,10 +8,10 @@ import { } from "@bera/shared-ui"; import { Skeleton } from "@bera/ui/skeleton"; -import { MultiSelectBadge, SelectedVotes } from "./multi-select-badge"; +import { MultiSelectBadge } from "./multi-select-badge"; import { voterColumns } from "./voter-column"; import { VoteOption } from "@bera/proto/ts-proto-gen/cosmos-ts/cosmos/gov/v1/gov"; -import { Tabs, TabsList, TabsTrigger } from "@bera/ui/tabs"; +import { Accordion } from "@bera/ui/accordion"; const voteOptionMap: Record = { [VoteOption.VOTE_OPTION_YES]: "for", @@ -126,13 +126,15 @@ export function VoterTable({ ) : votes.length === 0 ? ( ) : ( - + + + )}
diff --git a/apps/hub/src/app/governance/components/home-page.tsx b/apps/hub/src/app/governance/components/home-page.tsx index 587dfb15b..56329643e 100644 --- a/apps/hub/src/app/governance/components/home-page.tsx +++ b/apps/hub/src/app/governance/components/home-page.tsx @@ -6,63 +6,53 @@ import { Others, } from "../governance-genre-helper"; +const GovernanceSection = ({ + title, + dapps, +}: { + title: string; + dapps: GovernanceTopic[]; +}) => { + return ( +
+

+ {title} +

+
+ {dapps.map((dapp: GovernanceTopic) => ( + +
+ {dapp.icon} +
+

{dapp.name}

+ + ))} +
+
+ ); +}; + export const HomePage = () => { return (
-
+

GOVERNANCE -

-
+ +

Berachain
Governance Forum -

-
- -
-
- NATIVE dAPPS -
-
- {NativeDapps.map((dapp: GovernanceTopic) => ( - -
- {dapp.icon} -
-
{dapp.name}
- - ))} -
+
-
-
- OTHER -
-
- {Others.map((dapp: GovernanceTopic) => ( - -
- {dapp.icon} -
-
{dapp.name}
- - ))} -
-
+ +
); }; diff --git a/apps/hub/src/app/governance/components/proposal-heading.tsx b/apps/hub/src/app/governance/components/proposal-heading.tsx index ba56a11e5..bdeb7a0c8 100644 --- a/apps/hub/src/app/governance/components/proposal-heading.tsx +++ b/apps/hub/src/app/governance/components/proposal-heading.tsx @@ -12,38 +12,42 @@ export const ProposalHeading = ({ const Heading = size === "sm" ? "h3" : "h1"; return ( <> -

-

- {(fm.data.topics || fm.data.topic)?.map((topic: string) => ( - - {topic} - - ))} -

- {fm.data.forumLink && ( - <> - - - View Forum Post - - - - )} -

+ {(fm.data.topics || fm.data.topic || fm.data.forumLink) && ( +
+

+ {(fm.data.topics || fm.data.topic)?.map((topic: string) => ( + + {topic} + + ))} +

+ {fm.data.forumLink && ( + <> + + + View Forum Post + + + + )} +
+ )} diff --git a/apps/hub/src/app/governance/helper.ts b/apps/hub/src/app/governance/helper.ts index c9d593524..c5462a269 100755 --- a/apps/hub/src/app/governance/helper.ts +++ b/apps/hub/src/app/governance/helper.ts @@ -5,24 +5,25 @@ import { decodeFunctionData, formatEther } from "viem"; import { ProposalTypeEnum, StatusEnum, VoteColorMap } from "./types"; import { NativeDapps, Others } from "./governance-genre-helper"; +import { ComponentProps } from "react"; +import { Badge } from "@bera/ui/badge"; -export const getBadgeColor = (proposalStatus: StatusEnum) => { +export const getBadgeColor = ( + proposalStatus: StatusEnum, +): ComponentProps["variant"] => { switch (proposalStatus) { case StatusEnum.PENDING: - case StatusEnum.IN_QUEUE: - case StatusEnum.EXPIRED: - return "default"; + return "outline"; case StatusEnum.ACTIVE: case StatusEnum.EXECUTED: return "success"; case StatusEnum.DEFEATED: - case StatusEnum.CANCELED: return "destructive"; - case StatusEnum.PENDING_EXECUTION: - case StatusEnum.PENDING_QUEUE: - return "info"; - default: - return "foreground"; + case StatusEnum.EXPIRED: + return "warning"; + case StatusEnum.CANCELED_BY_GUARDIAN: + case StatusEnum.CANCELED_BY_USER: + return "outline"; } }; diff --git a/apps/hub/src/app/governance/proposal/[proposalId]/Status.tsx b/apps/hub/src/app/governance/proposal/[proposalId]/Status.tsx index 1e4d7bc68..01f27244f 100644 --- a/apps/hub/src/app/governance/proposal/[proposalId]/Status.tsx +++ b/apps/hub/src/app/governance/proposal/[proposalId]/Status.tsx @@ -12,11 +12,12 @@ export const StatusAction = ({ userVote: Vote | false | undefined; }) => { const status = proposal.status as StatusEnum; - const date = new Date(proposal.start.timestamp); - const time = `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`; + + if (!proposal || !proposal.onchainId) { + return null; + } return (
- {status === StatusEnum.PENDING &&
Voting starts at {time}
} {status === StatusEnum.IN_QUEUE && ( )} + {(status === StatusEnum.PENDING_EXECUTION || + status === StatusEnum.PENDING) && } + {status === StatusEnum.PENDING_QUEUE && ( +
Pending Queue
+ )} {status === StatusEnum.ACTIVE && ( - + )} - {status === StatusEnum.CANCELED &&
Canceled
} - {status === StatusEnum.PENDING_QUEUE && ( - + {(status === StatusEnum.CANCELED_BY_USER || + status === StatusEnum.CANCELED_BY_GUARDIAN) && ( +
Canceled
)} {status === StatusEnum.DEFEATED && (
Defeated
@@ -40,7 +46,6 @@ export const StatusAction = ({ {status === StatusEnum.EXECUTED && (
Executed
)} - {userVote &&
{userVote.type}
}
); }; diff --git a/apps/hub/src/app/governance/proposal/[proposalId]/components/cancel-button.tsx b/apps/hub/src/app/governance/proposal/[proposalId]/components/cancel-button.tsx index c0dd655b0..5f58e40fd 100644 --- a/apps/hub/src/app/governance/proposal/[proposalId]/components/cancel-button.tsx +++ b/apps/hub/src/app/governance/proposal/[proposalId]/components/cancel-button.tsx @@ -1,42 +1,84 @@ -import { useBeraJs } from "@bera/berajs"; -import { useCancellerRole } from "@bera/berajs"; +import { GOVERNANCE_ABI, Proposal, useBeraJs } from "@bera/berajs"; +import { useCancellerRole, useProposalState } from "@bera/berajs"; import { governanceTimelockAbi } from "@bera/berajs"; -import { governanceTimelockAddress } from "@bera/config"; +import { governanceTimelockAddress, governorAddress } from "@bera/config"; import { ActionButton, useTxn } from "@bera/shared-ui"; import { Button } from "@bera/ui/button"; -import { Address } from "viem"; +import { useGovernance } from "~/app/governance/[genre]/components/governance-provider"; +import { StatusEnum } from "~/app/governance/types"; -export const CancelButton = ({ - proposalTimelockId, -}: { proposalTimelockId: Address }) => { +export const CancelButton = ({ proposal }: { proposal: Proposal }) => { + // const { governorAddress } = useGovernance(); const { data: cancellerRole = "0xDa9487a32DD76e22B31cd5993F0699C0dc94435e" } = useCancellerRole(); + const { + data: onChainProposalState, + isLoading, + mutate, + } = useProposalState({ + proposalId: proposal?.onchainId, + governorAddress, + }); const { account } = useBeraJs(); const { write, ModalPortal } = useTxn({ message: "Cancelling proposal", + onSuccess: mutate, }); + if (!proposal) { + return null; + } + + // This ensures user + const isCanceledOnChain = !isLoading && onChainProposalState === "canceled"; + + const canCancel = + !isCanceledOnChain && + ((proposal.status === StatusEnum.PENDING_EXECUTION && + account === cancellerRole) || + (proposal.status === StatusEnum.PENDING && + account === proposal.creator.address)); + return ( <> {ModalPortal} - - {account === cancellerRole ? ( - - ) : ( -
Execution in queue
- )} -
+ {isCanceledOnChain ? ( + + {canCancel ? ( + + ) : ( +
Execution in queue
+ )} +
+ ) : ( +
Canceled
+ )} ); }; diff --git a/apps/hub/src/app/governance/proposal/[proposalId]/components/execute-button.tsx b/apps/hub/src/app/governance/proposal/[proposalId]/components/execute-button.tsx new file mode 100644 index 000000000..000e5d677 --- /dev/null +++ b/apps/hub/src/app/governance/proposal/[proposalId]/components/execute-button.tsx @@ -0,0 +1,32 @@ +import React from "react"; +import { GOVERNANCE_ABI } from "@bera/berajs"; +import { ActionButton, useTxn } from "@bera/shared-ui"; +import { Button } from "@bera/ui/button"; +import { useGovernance } from "~/app/governance/[genre]/components/governance-provider"; + +export const ExecuteButton = ({ proposalId }: { proposalId: string }) => { + const { write, ModalPortal } = useTxn({ + message: "Queuing proposal", + }); + const { governorAddress } = useGovernance(); + + return ( + <> + {ModalPortal} + + + + + ); +}; diff --git a/apps/hub/src/app/governance/proposal/[proposalId]/components/proposal-details.tsx b/apps/hub/src/app/governance/proposal/[proposalId]/components/proposal-details.tsx index fdb2313e9..36474a0ae 100755 --- a/apps/hub/src/app/governance/proposal/[proposalId]/components/proposal-details.tsx +++ b/apps/hub/src/app/governance/proposal/[proposalId]/components/proposal-details.tsx @@ -31,6 +31,7 @@ import { SWRFallback } from "@bera/berajs/contexts"; import { unstable_serialize } from "swr"; import { ProposalTimeline } from "./proposal-timeline"; import { ProposalHeading } from "~/app/governance/components/proposal-heading"; +import { cn } from "@bera/ui"; export const ProposalDetailsWrapper = ({ children, @@ -60,6 +61,8 @@ export default function ProposalDetails({ const { account, isReady } = useBeraJs(); const { isLoading, proposal, votes } = usePollProposal(proposalId); + console.log({ proposal }); + const userVote = isReady && votes.find((vote: Vote) => vote.voter.address === account); @@ -99,14 +102,24 @@ export default function ProposalDetails({ {getTimeText(proposal)}
-
+
-
+ +

votes

@@ -115,7 +128,16 @@ export default function ProposalDetails({ className="sm:w-52" />
-
+

quorum

@@ -148,7 +170,7 @@ export default function ProposalDetails({
- +
@@ -164,16 +186,21 @@ export default function ProposalDetails({
-
-
- Overview -
- -
- -
- -
+ {[StatusEnum.PENDING, StatusEnum.CANCELED_BY_USER].includes( + proposal.status as StatusEnum, + ) && ( + <> +
+
+ Overview +
+ +
+
+ +
+ + )}
)} diff --git a/apps/hub/src/app/governance/proposal/[proposalId]/components/proposal-timeline.tsx b/apps/hub/src/app/governance/proposal/[proposalId]/components/proposal-timeline.tsx index 4bc2091c0..8b97324d1 100644 --- a/apps/hub/src/app/governance/proposal/[proposalId]/components/proposal-timeline.tsx +++ b/apps/hub/src/app/governance/proposal/[proposalId]/components/proposal-timeline.tsx @@ -1,5 +1,7 @@ +import { Proposal } from "@bera/berajs"; +import { ProposalStatus } from "@bera/proto/ts-proto-gen/cosmos-ts/cosmos/gov/v1/gov"; import { cn } from "@bera/ui"; -import { useBlockNumber } from "wagmi"; +import { StatusEnum } from "~/app/governance/types"; const dateFormatter = new Intl.DateTimeFormat("en-US", { year: "numeric", @@ -35,27 +37,82 @@ const Step = ({
); }; -export const ProposalTimeline = () => { - const activeStep: number = 0; - const now = Date.now(); +export const ProposalTimeline = ({ proposal }: { proposal: Proposal }) => { + const steps = [ + { + title: "Initiated", + date: new Date(proposal.createdAt), + isActive: proposal.status === StatusEnum.PENDING, + }, + ]; + + if (proposal.status === StatusEnum.CANCELED_BY_USER) { + steps.push({ + title: "Canceled by proposer", + date: new Date(proposal.createdAt), + isActive: true, + }); + } else { + steps.push({ + title: "Voting Period Begins", + date: new Date(proposal.start.timestamp), + isActive: proposal.status === StatusEnum.ACTIVE, + }); + } + + if (proposal.status === StatusEnum.ACTIVE) { + steps.push({ + title: "Voting Period Ends", + date: new Date(proposal.start.timestamp), + isActive: false, + }); + } else if (proposal.status === StatusEnum.DEFEATED) { + steps.push({ + title: "Proposal Defeated", + date: new Date(0), + isActive: true, + }); + } else { + steps.push({ + title: "Proposal Passed", + date: new Date(0), + isActive: proposal.status === StatusEnum.PENDING_QUEUE, + }); + + if (proposal.status !== StatusEnum.PENDING_QUEUE) { + steps.push({ + title: "Proposal Queued", + date: new Date(0), + isActive: proposal.status === StatusEnum.PENDING_EXECUTION, + }); + + if (proposal.status === StatusEnum.CANCELED_BY_GUARDIAN) { + steps.push({ + title: "Canceled by guardian", + date: new Date(0), + isActive: true, + }); + } else if (proposal.status === StatusEnum.EXECUTED) { + steps.push({ + title: "Proposal Executed", + date: new Date(0), + isActive: proposal.status === StatusEnum.EXECUTED, + }); + } else if (proposal.status === StatusEnum.PENDING_EXECUTION) { + steps.push({ + title: "Proposal Executs", + date: new Date(0), + isActive: true, + }); + } + } + } + return (
- - - - + {steps.map((step) => ( + + ))}
); }; diff --git a/apps/hub/src/app/governance/types.ts b/apps/hub/src/app/governance/types.ts index d5b207875..57e7b4024 100755 --- a/apps/hub/src/app/governance/types.ts +++ b/apps/hub/src/app/governance/types.ts @@ -5,8 +5,10 @@ import { PROPOSAL_GENRE } from "./governance-genre-helper"; export enum StatusEnum { PENDING = "pending", ACTIVE = "active", + CANCELED_BY_GUARDIAN = "canceled-by-guardian", + CANCELED_BY_USER = "canceled", + SUCCEEDED = "succeeded", DEFEATED = "defeated", - CANCELED = "canceled", PENDING_QUEUE = "pending-queue", IN_QUEUE = "in-queue", PENDING_EXECUTION = "pending-execution", diff --git a/apps/hub/src/app/layout.tsx b/apps/hub/src/app/layout.tsx index 83d37787b..43e3247ce 100755 --- a/apps/hub/src/app/layout.tsx +++ b/apps/hub/src/app/layout.tsx @@ -25,6 +25,10 @@ const fontSans = IBM_Plex_Sans({ export const metadata: Metadata = { metadataBase: new URL(hubUrl), + title: { + template: `%s | ${hubName}`, + default: hubName, + }, }; export default function RootLayout(props: { children: React.ReactNode }) { @@ -57,9 +61,10 @@ export default function RootLayout(props: { children: React.ReactNode }) {
{props.children} diff --git a/packages/berajs/package.json b/packages/berajs/package.json index 408c03398..849ff7c8b 100755 --- a/packages/berajs/package.json +++ b/packages/berajs/package.json @@ -4,7 +4,6 @@ "main": "dist/index.js", "module": "dist/index.js", "sideEffects": false, - "types": "dist/index.d.ts", "type": "module", "files": ["dist"], "author": "deez", diff --git a/packages/berajs/src/actions/governance/getAllProposals.ts b/packages/berajs/src/actions/governance/getAllProposals.ts index c39a66d06..387110659 100755 --- a/packages/berajs/src/actions/governance/getAllProposals.ts +++ b/packages/berajs/src/actions/governance/getAllProposals.ts @@ -42,7 +42,7 @@ export const getAllProposals = async ({ const data = await response.json(); return data.data.proposals.nodes; } catch (e) { - console.log("getAllProposals:", e); + console.error("getAllProposals:", e); return []; } }; diff --git a/packages/berajs/src/hooks/modules/governance/index.ts b/packages/berajs/src/hooks/modules/governance/index.ts index 4a428edd4..19df9b13a 100644 --- a/packages/berajs/src/hooks/modules/governance/index.ts +++ b/packages/berajs/src/hooks/modules/governance/index.ts @@ -5,3 +5,4 @@ export * from "./usePollProposalThreshold"; export * from "./useGetPastVotes"; export * from "./useProposalSnapshot"; export * from "./useCancellerRole"; +export * from "./useProposalState"; diff --git a/packages/berajs/src/hooks/modules/governance/useGetPastVotes.ts b/packages/berajs/src/hooks/modules/governance/useGetPastVotes.ts index 00fd88184..8fbca4994 100644 --- a/packages/berajs/src/hooks/modules/governance/useGetPastVotes.ts +++ b/packages/berajs/src/hooks/modules/governance/useGetPastVotes.ts @@ -58,8 +58,6 @@ export const useGetPastVotes = ( args: [wallet, BigInt(ts!)], }); - console.log(QUERY_KEY, formatUnits(votes, 18)); - return formatUnits(votes, 18); }); }; diff --git a/packages/berajs/src/hooks/modules/governance/useProposalSnapshot.ts b/packages/berajs/src/hooks/modules/governance/useProposalSnapshot.ts index 6a6d852b0..620251f0f 100644 --- a/packages/berajs/src/hooks/modules/governance/useProposalSnapshot.ts +++ b/packages/berajs/src/hooks/modules/governance/useProposalSnapshot.ts @@ -26,8 +26,6 @@ export const useProposalSnapshot = ({ args: [BigInt(proposalId!)], }); - console.log(QUERY_KEY, snapshot.toString()); - return snapshot.toString(); }); }; diff --git a/packages/berajs/src/hooks/modules/governance/useProposalState.ts b/packages/berajs/src/hooks/modules/governance/useProposalState.ts new file mode 100644 index 000000000..ca69328bf --- /dev/null +++ b/packages/berajs/src/hooks/modules/governance/useProposalState.ts @@ -0,0 +1,57 @@ +import useSWRImmutable from "swr/immutable"; +import { usePublicClient } from "wagmi"; +import { GOVERNANCE_ABI } from "../../../abi"; +import { SWRResponse } from "swr"; +import { Address } from "viem"; + +enum ProposalState { + Pending = 0, + Active = 1, + Canceled = 2, + Defeated = 3, + Succeeded = 4, + Queued = 5, + Expired = 6, + Executed = 7, +} + +const ProposalStateMap: Record = { + [ProposalState.Pending]: "pending", + [ProposalState.Active]: "active", + [ProposalState.Canceled]: "canceled", + [ProposalState.Defeated]: "defeated", + [ProposalState.Succeeded]: "succeeded", + [ProposalState.Queued]: "queued", + [ProposalState.Expired]: "expired", + [ProposalState.Executed]: "executed", +}; + +export const useProposalState = ({ + proposalId, + governorAddress, +}: { + proposalId: number | bigint | string | undefined; + governorAddress: Address; +}): SWRResponse => { + const publicClient = usePublicClient(); + + const QUERY_KEY = + governorAddress && publicClient && proposalId + ? ["useProposalSnapshot", proposalId] + : null; + + return useSWRImmutable(QUERY_KEY, async () => { + if (!publicClient) { + throw new Error("public client is not defined"); + } + + const snapshot = (await publicClient.readContract({ + abi: GOVERNANCE_ABI, + address: governorAddress, + functionName: "state", + args: [BigInt(proposalId!)], + })) as ProposalState; + + return ProposalStateMap[snapshot]; + }); +}; diff --git a/packages/berajs/tsup.config.ts b/packages/berajs/tsup.config.ts index a0ecc4692..eb28255e9 100755 --- a/packages/berajs/tsup.config.ts +++ b/packages/berajs/tsup.config.ts @@ -1,4 +1,6 @@ -const config = { +import { defineConfig } from "tsup"; + +const config = defineConfig({ entryPoints: [ "src/abi/index.ts", "src/actions/index.ts", @@ -13,11 +15,11 @@ const config = { splitting: true, outDir: "dist", skipNodeModulesBundle: true, - minify: true, // Whether to minify the output - sourcemap: true, // Whether to generate sourcemaps + minify: process.env.NODE_ENV !== "development", // Whether to minify the output + sourcemap: process.env.NODE_ENV !== "development", // Whether to generate sourcemaps // splitting: true, // Whether to split the bundle into chunks dts: true, // Whether to generate TypeScript declaration files // target: "node18", // Specify your target environment -}; +}); export default config; diff --git a/packages/config/env/tsup.config.ts b/packages/config/env/tsup.config.ts index 5e9952924..903d7c023 100755 --- a/packages/config/env/tsup.config.ts +++ b/packages/config/env/tsup.config.ts @@ -5,8 +5,8 @@ const config = { splitting: true, outDir: "dist", skipNodeModulesBundle: true, - minify: true, // Whether to minify the output - sourcemap: true, // Whether to generate sourcemaps + minify: process.env.NODE_ENV !== "development", // Whether to minify the output + sourcemap: process.env.NODE_ENV !== "development", // Whether to generate sourcemaps // splitting: true, // Whether to split the bundle into chunks dts: true, // Whether to generate TypeScript declaration files // target: "node18", // Specify your target environment diff --git a/packages/graphql/src/modules/governance/codegen.ts b/packages/graphql/src/modules/governance/codegen.ts index 7f3875ceb..6d6f6e1bb 100644 --- a/packages/graphql/src/modules/governance/codegen.ts +++ b/packages/graphql/src/modules/governance/codegen.ts @@ -1,414 +1,429 @@ -import { gql } from '@apollo/client'; -import * as Apollo from '@apollo/client'; +import { gql } from "@apollo/client"; +import * as Apollo from "@apollo/client"; export type Maybe = T | null; export type InputMaybe = Maybe; -export type Exact = { [K in keyof T]: T[K] }; -export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; -export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; -export type MakeEmpty = { [_ in K]?: never }; -export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; +export type MakeEmpty< + T extends { [key: string]: unknown }, + K extends keyof T, +> = { [_ in K]?: never }; +export type Incremental = + | T + | { + [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never; + }; const defaultOptions = {} as const; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { - ID: { input: string; output: string; } - String: { input: string; output: string; } - Boolean: { input: boolean; output: boolean; } - Int: { input: number; output: number; } - Float: { input: number; output: number; } - BigDecimal: { input: any; output: any; } - BigInt: { input: any; output: any; } - Bytes: { input: any; output: any; } - Int8: { input: any; output: any; } - Timestamp: { input: any; output: any; } + ID: { input: string; output: string }; + String: { input: string; output: string }; + Boolean: { input: boolean; output: boolean }; + Int: { input: number; output: number }; + Float: { input: number; output: number }; + BigDecimal: { input: any; output: any }; + BigInt: { input: any; output: any }; + Bytes: { input: any; output: any }; + Int8: { input: any; output: any }; + Timestamp: { input: any; output: any }; }; export enum Aggregation_Interval { - Day = 'day', - Hour = 'hour' + Day = "day", + Hour = "hour", } export type BlockChangedFilter = { - number_gte: Scalars['Int']['input']; + number_gte: Scalars["Int"]["input"]; }; export type Block_Height = { - hash?: InputMaybe; - number?: InputMaybe; - number_gte?: InputMaybe; + hash?: InputMaybe; + number?: InputMaybe; + number_gte?: InputMaybe; }; export type CallScheduled = { - __typename?: 'CallScheduled'; - data: Scalars['Bytes']['output']; - delay: Scalars['BigInt']['output']; - id: Scalars['Int8']['output']; - index: Scalars['BigInt']['output']; - predecessor: Scalars['Bytes']['output']; - target: Scalars['Bytes']['output']; - timelockId: Scalars['Bytes']['output']; - value: Scalars['BigInt']['output']; + __typename?: "CallScheduled"; + data: Scalars["Bytes"]["output"]; + delay: Scalars["BigInt"]["output"]; + id: Scalars["Int8"]["output"]; + index: Scalars["BigInt"]["output"]; + predecessor: Scalars["Bytes"]["output"]; + target: Scalars["Bytes"]["output"]; + timelockId: Scalars["Bytes"]["output"]; + value: Scalars["BigInt"]["output"]; }; export type CallScheduled_Filter = { /** Filter for the block changed event. */ _change_block?: InputMaybe; and?: InputMaybe>>; - data?: InputMaybe; - data_contains?: InputMaybe; - data_gt?: InputMaybe; - data_gte?: InputMaybe; - data_in?: InputMaybe>; - data_lt?: InputMaybe; - data_lte?: InputMaybe; - data_not?: InputMaybe; - data_not_contains?: InputMaybe; - data_not_in?: InputMaybe>; - delay?: InputMaybe; - delay_gt?: InputMaybe; - delay_gte?: InputMaybe; - delay_in?: InputMaybe>; - delay_lt?: InputMaybe; - delay_lte?: InputMaybe; - delay_not?: InputMaybe; - delay_not_in?: InputMaybe>; - id?: InputMaybe; - id_gt?: InputMaybe; - id_gte?: InputMaybe; - id_in?: InputMaybe>; - id_lt?: InputMaybe; - id_lte?: InputMaybe; - id_not?: InputMaybe; - id_not_in?: InputMaybe>; - index?: InputMaybe; - index_gt?: InputMaybe; - index_gte?: InputMaybe; - index_in?: InputMaybe>; - index_lt?: InputMaybe; - index_lte?: InputMaybe; - index_not?: InputMaybe; - index_not_in?: InputMaybe>; + data?: InputMaybe; + data_contains?: InputMaybe; + data_gt?: InputMaybe; + data_gte?: InputMaybe; + data_in?: InputMaybe>; + data_lt?: InputMaybe; + data_lte?: InputMaybe; + data_not?: InputMaybe; + data_not_contains?: InputMaybe; + data_not_in?: InputMaybe>; + delay?: InputMaybe; + delay_gt?: InputMaybe; + delay_gte?: InputMaybe; + delay_in?: InputMaybe>; + delay_lt?: InputMaybe; + delay_lte?: InputMaybe; + delay_not?: InputMaybe; + delay_not_in?: InputMaybe>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; + index?: InputMaybe; + index_gt?: InputMaybe; + index_gte?: InputMaybe; + index_in?: InputMaybe>; + index_lt?: InputMaybe; + index_lte?: InputMaybe; + index_not?: InputMaybe; + index_not_in?: InputMaybe>; or?: InputMaybe>>; - predecessor?: InputMaybe; - predecessor_contains?: InputMaybe; - predecessor_gt?: InputMaybe; - predecessor_gte?: InputMaybe; - predecessor_in?: InputMaybe>; - predecessor_lt?: InputMaybe; - predecessor_lte?: InputMaybe; - predecessor_not?: InputMaybe; - predecessor_not_contains?: InputMaybe; - predecessor_not_in?: InputMaybe>; - target?: InputMaybe; - target_contains?: InputMaybe; - target_gt?: InputMaybe; - target_gte?: InputMaybe; - target_in?: InputMaybe>; - target_lt?: InputMaybe; - target_lte?: InputMaybe; - target_not?: InputMaybe; - target_not_contains?: InputMaybe; - target_not_in?: InputMaybe>; - timelockId?: InputMaybe; - timelockId_contains?: InputMaybe; - timelockId_gt?: InputMaybe; - timelockId_gte?: InputMaybe; - timelockId_in?: InputMaybe>; - timelockId_lt?: InputMaybe; - timelockId_lte?: InputMaybe; - timelockId_not?: InputMaybe; - timelockId_not_contains?: InputMaybe; - timelockId_not_in?: InputMaybe>; - value?: InputMaybe; - value_gt?: InputMaybe; - value_gte?: InputMaybe; - value_in?: InputMaybe>; - value_lt?: InputMaybe; - value_lte?: InputMaybe; - value_not?: InputMaybe; - value_not_in?: InputMaybe>; + predecessor?: InputMaybe; + predecessor_contains?: InputMaybe; + predecessor_gt?: InputMaybe; + predecessor_gte?: InputMaybe; + predecessor_in?: InputMaybe>; + predecessor_lt?: InputMaybe; + predecessor_lte?: InputMaybe; + predecessor_not?: InputMaybe; + predecessor_not_contains?: InputMaybe; + predecessor_not_in?: InputMaybe>; + target?: InputMaybe; + target_contains?: InputMaybe; + target_gt?: InputMaybe; + target_gte?: InputMaybe; + target_in?: InputMaybe>; + target_lt?: InputMaybe; + target_lte?: InputMaybe; + target_not?: InputMaybe; + target_not_contains?: InputMaybe; + target_not_in?: InputMaybe>; + timelockId?: InputMaybe; + timelockId_contains?: InputMaybe; + timelockId_gt?: InputMaybe; + timelockId_gte?: InputMaybe; + timelockId_in?: InputMaybe>; + timelockId_lt?: InputMaybe; + timelockId_lte?: InputMaybe; + timelockId_not?: InputMaybe; + timelockId_not_contains?: InputMaybe; + timelockId_not_in?: InputMaybe>; + value?: InputMaybe; + value_gt?: InputMaybe; + value_gte?: InputMaybe; + value_in?: InputMaybe>; + value_lt?: InputMaybe; + value_lte?: InputMaybe; + value_not?: InputMaybe; + value_not_in?: InputMaybe>; }; export enum CallScheduled_OrderBy { - Data = 'data', - Delay = 'delay', - Id = 'id', - Index = 'index', - Predecessor = 'predecessor', - Target = 'target', - TimelockId = 'timelockId', - Value = 'value' + Data = "data", + Delay = "delay", + Id = "id", + Index = "index", + Predecessor = "predecessor", + Target = "target", + TimelockId = "timelockId", + Value = "value", } /** Defines the order direction, either ascending or descending */ export enum OrderDirection { - Asc = 'asc', - Desc = 'desc' + Asc = "asc", + Desc = "desc", } export type Proposal = { - __typename?: 'Proposal'; - calldatas: Array; - canceledAt?: Maybe; - canceledAtBlock?: Maybe; - createdAt: Scalars['BigInt']['output']; - createdAtBlock: Scalars['BigInt']['output']; - description: Scalars['String']['output']; - executedAt?: Maybe; - executedAtBlock?: Maybe; - id: Scalars['ID']['output']; - proposalId: Scalars['BigInt']['output']; - proposer: Scalars['Bytes']['output']; - queuedAt?: Maybe; - queuedAtBlock?: Maybe; - signatures: Array; - status: Scalars['String']['output']; - targets: Array; - values: Array; - voteEnd: Scalars['BigInt']['output']; - voteStart: Scalars['BigInt']['output']; + __typename?: "Proposal"; + calldatas: Array; + canceledAt?: Maybe; + canceledAtBlock?: Maybe; + createdAt: Scalars["BigInt"]["output"]; + createdAtBlock: Scalars["BigInt"]["output"]; + description: Scalars["String"]["output"]; + executedAt?: Maybe; + executedAtBlock?: Maybe; + id: Scalars["ID"]["output"]; + proposalId: Scalars["BigInt"]["output"]; + proposer: Scalars["Bytes"]["output"]; + queuedAt?: Maybe; + queuedAtBlock?: Maybe; + signatures: Array; + status: Scalars["String"]["output"]; + targets: Array; + values: Array; + voteEnd: Scalars["BigInt"]["output"]; + voteStart: Scalars["BigInt"]["output"]; }; export type ProposalVotesAggregated = { - __typename?: 'ProposalVotesAggregated'; - id: Scalars['Int8']['output']; - proposalId: Scalars['BigInt']['output']; - support: Scalars['Int']['output']; - timestamp: Scalars['Timestamp']['output']; - weight: Scalars['BigInt']['output']; + __typename?: "ProposalVotesAggregated"; + id: Scalars["Int8"]["output"]; + proposalId: Scalars["BigInt"]["output"]; + support: Scalars["Int"]["output"]; + timestamp: Scalars["Timestamp"]["output"]; + weight: Scalars["BigInt"]["output"]; }; export type ProposalVotesAggregated_Filter = { /** Filter for the block changed event. */ _change_block?: InputMaybe; and?: InputMaybe>>; - id?: InputMaybe; - id_gt?: InputMaybe; - id_gte?: InputMaybe; - id_in?: InputMaybe>; - id_lt?: InputMaybe; - id_lte?: InputMaybe; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; or?: InputMaybe>>; - proposalId?: InputMaybe; - proposalId_gt?: InputMaybe; - proposalId_gte?: InputMaybe; - proposalId_in?: InputMaybe>; - proposalId_lt?: InputMaybe; - proposalId_lte?: InputMaybe; - support?: InputMaybe; - support_gt?: InputMaybe; - support_gte?: InputMaybe; - support_in?: InputMaybe>; - support_lt?: InputMaybe; - support_lte?: InputMaybe; - timestamp?: InputMaybe; - timestamp_gt?: InputMaybe; - timestamp_gte?: InputMaybe; - timestamp_in?: InputMaybe>; - timestamp_lt?: InputMaybe; - timestamp_lte?: InputMaybe; + proposalId?: InputMaybe; + proposalId_gt?: InputMaybe; + proposalId_gte?: InputMaybe; + proposalId_in?: InputMaybe>; + proposalId_lt?: InputMaybe; + proposalId_lte?: InputMaybe; + support?: InputMaybe; + support_gt?: InputMaybe; + support_gte?: InputMaybe; + support_in?: InputMaybe>; + support_lt?: InputMaybe; + support_lte?: InputMaybe; + timestamp?: InputMaybe; + timestamp_gt?: InputMaybe; + timestamp_gte?: InputMaybe; + timestamp_in?: InputMaybe>; + timestamp_lt?: InputMaybe; + timestamp_lte?: InputMaybe; }; export type Proposal_Filter = { /** Filter for the block changed event. */ _change_block?: InputMaybe; and?: InputMaybe>>; - calldatas?: InputMaybe>; - calldatas_contains?: InputMaybe>; - calldatas_contains_nocase?: InputMaybe>; - calldatas_not?: InputMaybe>; - calldatas_not_contains?: InputMaybe>; - calldatas_not_contains_nocase?: InputMaybe>; - canceledAt?: InputMaybe; - canceledAtBlock?: InputMaybe; - canceledAtBlock_gt?: InputMaybe; - canceledAtBlock_gte?: InputMaybe; - canceledAtBlock_in?: InputMaybe>; - canceledAtBlock_lt?: InputMaybe; - canceledAtBlock_lte?: InputMaybe; - canceledAtBlock_not?: InputMaybe; - canceledAtBlock_not_in?: InputMaybe>; - canceledAt_gt?: InputMaybe; - canceledAt_gte?: InputMaybe; - canceledAt_in?: InputMaybe>; - canceledAt_lt?: InputMaybe; - canceledAt_lte?: InputMaybe; - canceledAt_not?: InputMaybe; - canceledAt_not_in?: InputMaybe>; - createdAt?: InputMaybe; - createdAtBlock?: InputMaybe; - createdAtBlock_gt?: InputMaybe; - createdAtBlock_gte?: InputMaybe; - createdAtBlock_in?: InputMaybe>; - createdAtBlock_lt?: InputMaybe; - createdAtBlock_lte?: InputMaybe; - createdAtBlock_not?: InputMaybe; - createdAtBlock_not_in?: InputMaybe>; - createdAt_gt?: InputMaybe; - createdAt_gte?: InputMaybe; - createdAt_in?: InputMaybe>; - createdAt_lt?: InputMaybe; - createdAt_lte?: InputMaybe; - createdAt_not?: InputMaybe; - createdAt_not_in?: InputMaybe>; - description?: InputMaybe; - description_contains?: InputMaybe; - description_contains_nocase?: InputMaybe; - description_ends_with?: InputMaybe; - description_ends_with_nocase?: InputMaybe; - description_gt?: InputMaybe; - description_gte?: InputMaybe; - description_in?: InputMaybe>; - description_lt?: InputMaybe; - description_lte?: InputMaybe; - description_not?: InputMaybe; - description_not_contains?: InputMaybe; - description_not_contains_nocase?: InputMaybe; - description_not_ends_with?: InputMaybe; - description_not_ends_with_nocase?: InputMaybe; - description_not_in?: InputMaybe>; - description_not_starts_with?: InputMaybe; - description_not_starts_with_nocase?: InputMaybe; - description_starts_with?: InputMaybe; - description_starts_with_nocase?: InputMaybe; - executedAt?: InputMaybe; - executedAtBlock?: InputMaybe; - executedAtBlock_gt?: InputMaybe; - executedAtBlock_gte?: InputMaybe; - executedAtBlock_in?: InputMaybe>; - executedAtBlock_lt?: InputMaybe; - executedAtBlock_lte?: InputMaybe; - executedAtBlock_not?: InputMaybe; - executedAtBlock_not_in?: InputMaybe>; - executedAt_gt?: InputMaybe; - executedAt_gte?: InputMaybe; - executedAt_in?: InputMaybe>; - executedAt_lt?: InputMaybe; - executedAt_lte?: InputMaybe; - executedAt_not?: InputMaybe; - executedAt_not_in?: InputMaybe>; - id?: InputMaybe; - id_gt?: InputMaybe; - id_gte?: InputMaybe; - id_in?: InputMaybe>; - id_lt?: InputMaybe; - id_lte?: InputMaybe; - id_not?: InputMaybe; - id_not_in?: InputMaybe>; + calldatas?: InputMaybe>; + calldatas_contains?: InputMaybe>; + calldatas_contains_nocase?: InputMaybe>; + calldatas_not?: InputMaybe>; + calldatas_not_contains?: InputMaybe>; + calldatas_not_contains_nocase?: InputMaybe>; + canceledAt?: InputMaybe; + canceledAtBlock?: InputMaybe; + canceledAtBlock_gt?: InputMaybe; + canceledAtBlock_gte?: InputMaybe; + canceledAtBlock_in?: InputMaybe>; + canceledAtBlock_lt?: InputMaybe; + canceledAtBlock_lte?: InputMaybe; + canceledAtBlock_not?: InputMaybe; + canceledAtBlock_not_in?: InputMaybe>; + canceledAt_gt?: InputMaybe; + canceledAt_gte?: InputMaybe; + canceledAt_in?: InputMaybe>; + canceledAt_lt?: InputMaybe; + canceledAt_lte?: InputMaybe; + canceledAt_not?: InputMaybe; + canceledAt_not_in?: InputMaybe>; + createdAt?: InputMaybe; + createdAtBlock?: InputMaybe; + createdAtBlock_gt?: InputMaybe; + createdAtBlock_gte?: InputMaybe; + createdAtBlock_in?: InputMaybe>; + createdAtBlock_lt?: InputMaybe; + createdAtBlock_lte?: InputMaybe; + createdAtBlock_not?: InputMaybe; + createdAtBlock_not_in?: InputMaybe>; + createdAt_gt?: InputMaybe; + createdAt_gte?: InputMaybe; + createdAt_in?: InputMaybe>; + createdAt_lt?: InputMaybe; + createdAt_lte?: InputMaybe; + createdAt_not?: InputMaybe; + createdAt_not_in?: InputMaybe>; + description?: InputMaybe; + description_contains?: InputMaybe; + description_contains_nocase?: InputMaybe; + description_ends_with?: InputMaybe; + description_ends_with_nocase?: InputMaybe; + description_gt?: InputMaybe; + description_gte?: InputMaybe; + description_in?: InputMaybe>; + description_lt?: InputMaybe; + description_lte?: InputMaybe; + description_not?: InputMaybe; + description_not_contains?: InputMaybe; + description_not_contains_nocase?: InputMaybe; + description_not_ends_with?: InputMaybe; + description_not_ends_with_nocase?: InputMaybe; + description_not_in?: InputMaybe>; + description_not_starts_with?: InputMaybe; + description_not_starts_with_nocase?: InputMaybe; + description_starts_with?: InputMaybe; + description_starts_with_nocase?: InputMaybe; + executedAt?: InputMaybe; + executedAtBlock?: InputMaybe; + executedAtBlock_gt?: InputMaybe; + executedAtBlock_gte?: InputMaybe; + executedAtBlock_in?: InputMaybe>; + executedAtBlock_lt?: InputMaybe; + executedAtBlock_lte?: InputMaybe; + executedAtBlock_not?: InputMaybe; + executedAtBlock_not_in?: InputMaybe>; + executedAt_gt?: InputMaybe; + executedAt_gte?: InputMaybe; + executedAt_in?: InputMaybe>; + executedAt_lt?: InputMaybe; + executedAt_lte?: InputMaybe; + executedAt_not?: InputMaybe; + executedAt_not_in?: InputMaybe>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; or?: InputMaybe>>; - proposalId?: InputMaybe; - proposalId_gt?: InputMaybe; - proposalId_gte?: InputMaybe; - proposalId_in?: InputMaybe>; - proposalId_lt?: InputMaybe; - proposalId_lte?: InputMaybe; - proposalId_not?: InputMaybe; - proposalId_not_in?: InputMaybe>; - proposer?: InputMaybe; - proposer_contains?: InputMaybe; - proposer_gt?: InputMaybe; - proposer_gte?: InputMaybe; - proposer_in?: InputMaybe>; - proposer_lt?: InputMaybe; - proposer_lte?: InputMaybe; - proposer_not?: InputMaybe; - proposer_not_contains?: InputMaybe; - proposer_not_in?: InputMaybe>; - queuedAt?: InputMaybe; - queuedAtBlock?: InputMaybe; - queuedAtBlock_gt?: InputMaybe; - queuedAtBlock_gte?: InputMaybe; - queuedAtBlock_in?: InputMaybe>; - queuedAtBlock_lt?: InputMaybe; - queuedAtBlock_lte?: InputMaybe; - queuedAtBlock_not?: InputMaybe; - queuedAtBlock_not_in?: InputMaybe>; - queuedAt_gt?: InputMaybe; - queuedAt_gte?: InputMaybe; - queuedAt_in?: InputMaybe>; - queuedAt_lt?: InputMaybe; - queuedAt_lte?: InputMaybe; - queuedAt_not?: InputMaybe; - queuedAt_not_in?: InputMaybe>; - signatures?: InputMaybe>; - signatures_contains?: InputMaybe>; - signatures_contains_nocase?: InputMaybe>; - signatures_not?: InputMaybe>; - signatures_not_contains?: InputMaybe>; - signatures_not_contains_nocase?: InputMaybe>; - status?: InputMaybe; - status_contains?: InputMaybe; - status_contains_nocase?: InputMaybe; - status_ends_with?: InputMaybe; - status_ends_with_nocase?: InputMaybe; - status_gt?: InputMaybe; - status_gte?: InputMaybe; - status_in?: InputMaybe>; - status_lt?: InputMaybe; - status_lte?: InputMaybe; - status_not?: InputMaybe; - status_not_contains?: InputMaybe; - status_not_contains_nocase?: InputMaybe; - status_not_ends_with?: InputMaybe; - status_not_ends_with_nocase?: InputMaybe; - status_not_in?: InputMaybe>; - status_not_starts_with?: InputMaybe; - status_not_starts_with_nocase?: InputMaybe; - status_starts_with?: InputMaybe; - status_starts_with_nocase?: InputMaybe; - targets?: InputMaybe>; - targets_contains?: InputMaybe>; - targets_contains_nocase?: InputMaybe>; - targets_not?: InputMaybe>; - targets_not_contains?: InputMaybe>; - targets_not_contains_nocase?: InputMaybe>; - values?: InputMaybe>; - values_contains?: InputMaybe>; - values_contains_nocase?: InputMaybe>; - values_not?: InputMaybe>; - values_not_contains?: InputMaybe>; - values_not_contains_nocase?: InputMaybe>; - voteEnd?: InputMaybe; - voteEnd_gt?: InputMaybe; - voteEnd_gte?: InputMaybe; - voteEnd_in?: InputMaybe>; - voteEnd_lt?: InputMaybe; - voteEnd_lte?: InputMaybe; - voteEnd_not?: InputMaybe; - voteEnd_not_in?: InputMaybe>; - voteStart?: InputMaybe; - voteStart_gt?: InputMaybe; - voteStart_gte?: InputMaybe; - voteStart_in?: InputMaybe>; - voteStart_lt?: InputMaybe; - voteStart_lte?: InputMaybe; - voteStart_not?: InputMaybe; - voteStart_not_in?: InputMaybe>; + proposalId?: InputMaybe; + proposalId_gt?: InputMaybe; + proposalId_gte?: InputMaybe; + proposalId_in?: InputMaybe>; + proposalId_lt?: InputMaybe; + proposalId_lte?: InputMaybe; + proposalId_not?: InputMaybe; + proposalId_not_in?: InputMaybe>; + proposer?: InputMaybe; + proposer_contains?: InputMaybe; + proposer_gt?: InputMaybe; + proposer_gte?: InputMaybe; + proposer_in?: InputMaybe>; + proposer_lt?: InputMaybe; + proposer_lte?: InputMaybe; + proposer_not?: InputMaybe; + proposer_not_contains?: InputMaybe; + proposer_not_in?: InputMaybe>; + queuedAt?: InputMaybe; + queuedAtBlock?: InputMaybe; + queuedAtBlock_gt?: InputMaybe; + queuedAtBlock_gte?: InputMaybe; + queuedAtBlock_in?: InputMaybe>; + queuedAtBlock_lt?: InputMaybe; + queuedAtBlock_lte?: InputMaybe; + queuedAtBlock_not?: InputMaybe; + queuedAtBlock_not_in?: InputMaybe>; + queuedAt_gt?: InputMaybe; + queuedAt_gte?: InputMaybe; + queuedAt_in?: InputMaybe>; + queuedAt_lt?: InputMaybe; + queuedAt_lte?: InputMaybe; + queuedAt_not?: InputMaybe; + queuedAt_not_in?: InputMaybe>; + signatures?: InputMaybe>; + signatures_contains?: InputMaybe>; + signatures_contains_nocase?: InputMaybe>; + signatures_not?: InputMaybe>; + signatures_not_contains?: InputMaybe>; + signatures_not_contains_nocase?: InputMaybe< + Array + >; + status?: InputMaybe; + status_contains?: InputMaybe; + status_contains_nocase?: InputMaybe; + status_ends_with?: InputMaybe; + status_ends_with_nocase?: InputMaybe; + status_gt?: InputMaybe; + status_gte?: InputMaybe; + status_in?: InputMaybe>; + status_lt?: InputMaybe; + status_lte?: InputMaybe; + status_not?: InputMaybe; + status_not_contains?: InputMaybe; + status_not_contains_nocase?: InputMaybe; + status_not_ends_with?: InputMaybe; + status_not_ends_with_nocase?: InputMaybe; + status_not_in?: InputMaybe>; + status_not_starts_with?: InputMaybe; + status_not_starts_with_nocase?: InputMaybe; + status_starts_with?: InputMaybe; + status_starts_with_nocase?: InputMaybe; + targets?: InputMaybe>; + targets_contains?: InputMaybe>; + targets_contains_nocase?: InputMaybe>; + targets_not?: InputMaybe>; + targets_not_contains?: InputMaybe>; + targets_not_contains_nocase?: InputMaybe>; + values?: InputMaybe>; + values_contains?: InputMaybe>; + values_contains_nocase?: InputMaybe>; + values_not?: InputMaybe>; + values_not_contains?: InputMaybe>; + values_not_contains_nocase?: InputMaybe>; + voteEnd?: InputMaybe; + voteEnd_gt?: InputMaybe; + voteEnd_gte?: InputMaybe; + voteEnd_in?: InputMaybe>; + voteEnd_lt?: InputMaybe; + voteEnd_lte?: InputMaybe; + voteEnd_not?: InputMaybe; + voteEnd_not_in?: InputMaybe>; + voteStart?: InputMaybe; + voteStart_gt?: InputMaybe; + voteStart_gte?: InputMaybe; + voteStart_in?: InputMaybe>; + voteStart_lt?: InputMaybe; + voteStart_lte?: InputMaybe; + voteStart_not?: InputMaybe; + voteStart_not_in?: InputMaybe>; }; export enum Proposal_OrderBy { - Calldatas = 'calldatas', - CanceledAt = 'canceledAt', - CanceledAtBlock = 'canceledAtBlock', - CreatedAt = 'createdAt', - CreatedAtBlock = 'createdAtBlock', - Description = 'description', - ExecutedAt = 'executedAt', - ExecutedAtBlock = 'executedAtBlock', - Id = 'id', - ProposalId = 'proposalId', - Proposer = 'proposer', - QueuedAt = 'queuedAt', - QueuedAtBlock = 'queuedAtBlock', - Signatures = 'signatures', - Status = 'status', - Targets = 'targets', - Values = 'values', - VoteEnd = 'voteEnd', - VoteStart = 'voteStart' + Calldatas = "calldatas", + CanceledAt = "canceledAt", + CanceledAtBlock = "canceledAtBlock", + CreatedAt = "createdAt", + CreatedAtBlock = "createdAtBlock", + Description = "description", + ExecutedAt = "executedAt", + ExecutedAtBlock = "executedAtBlock", + Id = "id", + ProposalId = "proposalId", + Proposer = "proposer", + QueuedAt = "queuedAt", + QueuedAtBlock = "queuedAtBlock", + Signatures = "signatures", + Status = "status", + Targets = "targets", + Values = "values", + VoteEnd = "voteEnd", + VoteStart = "voteStart", } export type Query = { - __typename?: 'Query'; + __typename?: "Query"; /** Access to subgraph metadata */ _meta?: Maybe<_Meta_>; callScheduled?: Maybe; @@ -421,77 +436,69 @@ export type Query = { votes: Array; }; - export type Query_MetaArgs = { block?: InputMaybe; }; - export type QueryCallScheduledArgs = { block?: InputMaybe; - id: Scalars['ID']['input']; + id: Scalars["ID"]["input"]; subgraphError?: _SubgraphErrorPolicy_; }; - export type QueryCallScheduledsArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; - export type QueryProposalArgs = { block?: InputMaybe; - id: Scalars['ID']['input']; + id: Scalars["ID"]["input"]; subgraphError?: _SubgraphErrorPolicy_; }; - export type QueryProposalVotesAggregatedsArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; interval: Aggregation_Interval; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; - export type QueryProposalsArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; - export type QueryVoteArgs = { block?: InputMaybe; - id: Scalars['ID']['input']; + id: Scalars["ID"]["input"]; subgraphError?: _SubgraphErrorPolicy_; }; - export type QueryVotesArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; export type Subscription = { - __typename?: 'Subscription'; + __typename?: "Subscription"; /** Access to subgraph metadata */ _meta?: Maybe<_Meta_>; callScheduled?: Maybe; @@ -504,200 +511,192 @@ export type Subscription = { votes: Array; }; - export type Subscription_MetaArgs = { block?: InputMaybe; }; - export type SubscriptionCallScheduledArgs = { block?: InputMaybe; - id: Scalars['ID']['input']; + id: Scalars["ID"]["input"]; subgraphError?: _SubgraphErrorPolicy_; }; - export type SubscriptionCallScheduledsArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; - export type SubscriptionProposalArgs = { block?: InputMaybe; - id: Scalars['ID']['input']; + id: Scalars["ID"]["input"]; subgraphError?: _SubgraphErrorPolicy_; }; - export type SubscriptionProposalVotesAggregatedsArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; interval: Aggregation_Interval; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; - export type SubscriptionProposalsArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; - export type SubscriptionVoteArgs = { block?: InputMaybe; - id: Scalars['ID']['input']; + id: Scalars["ID"]["input"]; subgraphError?: _SubgraphErrorPolicy_; }; - export type SubscriptionVotesArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; export type Vote = { - __typename?: 'Vote'; - id: Scalars['Int8']['output']; - params?: Maybe; - proposalId: Scalars['BigInt']['output']; - reason: Scalars['String']['output']; - support: Scalars['Int']['output']; - timestamp: Scalars['Timestamp']['output']; - voter: Scalars['Bytes']['output']; - weight: Scalars['BigInt']['output']; + __typename?: "Vote"; + id: Scalars["Int8"]["output"]; + params?: Maybe; + proposalId: Scalars["BigInt"]["output"]; + reason: Scalars["String"]["output"]; + support: Scalars["Int"]["output"]; + timestamp: Scalars["Timestamp"]["output"]; + voter: Scalars["Bytes"]["output"]; + weight: Scalars["BigInt"]["output"]; }; export type Vote_Filter = { /** Filter for the block changed event. */ _change_block?: InputMaybe; and?: InputMaybe>>; - id?: InputMaybe; - id_gt?: InputMaybe; - id_gte?: InputMaybe; - id_in?: InputMaybe>; - id_lt?: InputMaybe; - id_lte?: InputMaybe; - id_not?: InputMaybe; - id_not_in?: InputMaybe>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; or?: InputMaybe>>; - params?: InputMaybe; - params_contains?: InputMaybe; - params_gt?: InputMaybe; - params_gte?: InputMaybe; - params_in?: InputMaybe>; - params_lt?: InputMaybe; - params_lte?: InputMaybe; - params_not?: InputMaybe; - params_not_contains?: InputMaybe; - params_not_in?: InputMaybe>; - proposalId?: InputMaybe; - proposalId_gt?: InputMaybe; - proposalId_gte?: InputMaybe; - proposalId_in?: InputMaybe>; - proposalId_lt?: InputMaybe; - proposalId_lte?: InputMaybe; - proposalId_not?: InputMaybe; - proposalId_not_in?: InputMaybe>; - reason?: InputMaybe; - reason_contains?: InputMaybe; - reason_contains_nocase?: InputMaybe; - reason_ends_with?: InputMaybe; - reason_ends_with_nocase?: InputMaybe; - reason_gt?: InputMaybe; - reason_gte?: InputMaybe; - reason_in?: InputMaybe>; - reason_lt?: InputMaybe; - reason_lte?: InputMaybe; - reason_not?: InputMaybe; - reason_not_contains?: InputMaybe; - reason_not_contains_nocase?: InputMaybe; - reason_not_ends_with?: InputMaybe; - reason_not_ends_with_nocase?: InputMaybe; - reason_not_in?: InputMaybe>; - reason_not_starts_with?: InputMaybe; - reason_not_starts_with_nocase?: InputMaybe; - reason_starts_with?: InputMaybe; - reason_starts_with_nocase?: InputMaybe; - support?: InputMaybe; - support_gt?: InputMaybe; - support_gte?: InputMaybe; - support_in?: InputMaybe>; - support_lt?: InputMaybe; - support_lte?: InputMaybe; - support_not?: InputMaybe; - support_not_in?: InputMaybe>; - timestamp?: InputMaybe; - timestamp_gt?: InputMaybe; - timestamp_gte?: InputMaybe; - timestamp_in?: InputMaybe>; - timestamp_lt?: InputMaybe; - timestamp_lte?: InputMaybe; - timestamp_not?: InputMaybe; - timestamp_not_in?: InputMaybe>; - voter?: InputMaybe; - voter_contains?: InputMaybe; - voter_gt?: InputMaybe; - voter_gte?: InputMaybe; - voter_in?: InputMaybe>; - voter_lt?: InputMaybe; - voter_lte?: InputMaybe; - voter_not?: InputMaybe; - voter_not_contains?: InputMaybe; - voter_not_in?: InputMaybe>; - weight?: InputMaybe; - weight_gt?: InputMaybe; - weight_gte?: InputMaybe; - weight_in?: InputMaybe>; - weight_lt?: InputMaybe; - weight_lte?: InputMaybe; - weight_not?: InputMaybe; - weight_not_in?: InputMaybe>; + params?: InputMaybe; + params_contains?: InputMaybe; + params_gt?: InputMaybe; + params_gte?: InputMaybe; + params_in?: InputMaybe>; + params_lt?: InputMaybe; + params_lte?: InputMaybe; + params_not?: InputMaybe; + params_not_contains?: InputMaybe; + params_not_in?: InputMaybe>; + proposalId?: InputMaybe; + proposalId_gt?: InputMaybe; + proposalId_gte?: InputMaybe; + proposalId_in?: InputMaybe>; + proposalId_lt?: InputMaybe; + proposalId_lte?: InputMaybe; + proposalId_not?: InputMaybe; + proposalId_not_in?: InputMaybe>; + reason?: InputMaybe; + reason_contains?: InputMaybe; + reason_contains_nocase?: InputMaybe; + reason_ends_with?: InputMaybe; + reason_ends_with_nocase?: InputMaybe; + reason_gt?: InputMaybe; + reason_gte?: InputMaybe; + reason_in?: InputMaybe>; + reason_lt?: InputMaybe; + reason_lte?: InputMaybe; + reason_not?: InputMaybe; + reason_not_contains?: InputMaybe; + reason_not_contains_nocase?: InputMaybe; + reason_not_ends_with?: InputMaybe; + reason_not_ends_with_nocase?: InputMaybe; + reason_not_in?: InputMaybe>; + reason_not_starts_with?: InputMaybe; + reason_not_starts_with_nocase?: InputMaybe; + reason_starts_with?: InputMaybe; + reason_starts_with_nocase?: InputMaybe; + support?: InputMaybe; + support_gt?: InputMaybe; + support_gte?: InputMaybe; + support_in?: InputMaybe>; + support_lt?: InputMaybe; + support_lte?: InputMaybe; + support_not?: InputMaybe; + support_not_in?: InputMaybe>; + timestamp?: InputMaybe; + timestamp_gt?: InputMaybe; + timestamp_gte?: InputMaybe; + timestamp_in?: InputMaybe>; + timestamp_lt?: InputMaybe; + timestamp_lte?: InputMaybe; + timestamp_not?: InputMaybe; + timestamp_not_in?: InputMaybe>; + voter?: InputMaybe; + voter_contains?: InputMaybe; + voter_gt?: InputMaybe; + voter_gte?: InputMaybe; + voter_in?: InputMaybe>; + voter_lt?: InputMaybe; + voter_lte?: InputMaybe; + voter_not?: InputMaybe; + voter_not_contains?: InputMaybe; + voter_not_in?: InputMaybe>; + weight?: InputMaybe; + weight_gt?: InputMaybe; + weight_gte?: InputMaybe; + weight_in?: InputMaybe>; + weight_lt?: InputMaybe; + weight_lte?: InputMaybe; + weight_not?: InputMaybe; + weight_not_in?: InputMaybe>; }; export enum Vote_OrderBy { - Id = 'id', - Params = 'params', - ProposalId = 'proposalId', - Reason = 'reason', - Support = 'support', - Timestamp = 'timestamp', - Voter = 'voter', - Weight = 'weight' + Id = "id", + Params = "params", + ProposalId = "proposalId", + Reason = "reason", + Support = "support", + Timestamp = "timestamp", + Voter = "voter", + Weight = "weight", } export type _Block_ = { - __typename?: '_Block_'; + __typename?: "_Block_"; /** The hash of the block */ - hash?: Maybe; + hash?: Maybe; /** The block number */ - number: Scalars['Int']['output']; + number: Scalars["Int"]["output"]; /** The hash of the parent block */ - parentHash?: Maybe; + parentHash?: Maybe; /** Integer representation of the timestamp stored in blocks for the chain */ - timestamp?: Maybe; + timestamp?: Maybe; }; /** The type for the top-level _meta field */ export type _Meta_ = { - __typename?: '_Meta_'; + __typename?: "_Meta_"; /** * Information about a specific subgraph block. The hash of the block * will be null if the _meta field has a block constraint that asks for @@ -707,39 +706,96 @@ export type _Meta_ = { */ block: _Block_; /** The deployment ID */ - deployment: Scalars['String']['output']; + deployment: Scalars["String"]["output"]; /** If `true`, the subgraph encountered indexing errors at some past block */ - hasIndexingErrors: Scalars['Boolean']['output']; + hasIndexingErrors: Scalars["Boolean"]["output"]; }; export enum _SubgraphErrorPolicy_ { /** Data will be returned even if the subgraph has indexing errors */ - Allow = 'allow', + Allow = "allow", /** If the subgraph has indexing errors, data will be omitted. The default. */ - Deny = 'deny' + Deny = "deny", } export type GetVotesQueryVariables = Exact<{ - proposalId: Scalars['BigInt']['input']; + proposalId: Scalars["BigInt"]["input"]; }>; - -export type GetVotesQuery = { __typename?: 'Query', votes: Array<{ __typename?: 'Vote', id: any, params?: any | null, proposalId: any, voter: any, weight: any, support: number, reason: string, timestamp: any }> }; +export type GetVotesQuery = { + __typename?: "Query"; + votes: Array<{ + __typename?: "Vote"; + id: any; + params?: any | null; + proposalId: any; + voter: any; + weight: any; + support: number; + reason: string; + timestamp: any; + }>; +}; export type GovernanceProposalsQueryVariables = Exact<{ - first?: InputMaybe; + first?: InputMaybe; }>; - -export type GovernanceProposalsQuery = { __typename?: 'Query', proposals: Array<{ __typename?: 'Proposal', proposalId: any, createdAt: any, createdAtBlock: any, id: string, status: string, targets: Array, values: Array, voteEnd: any, voteStart: any, queuedAtBlock?: any | null, signatures: Array, queuedAt?: any | null, proposer: any, executedAtBlock?: any | null, executedAt?: any | null, description: string, canceledAtBlock?: any | null, canceledAt?: any | null, calldatas: Array }> }; +export type GovernanceProposalsQuery = { + __typename?: "Query"; + proposals: Array<{ + __typename?: "Proposal"; + proposalId: any; + createdAt: any; + createdAtBlock: any; + id: string; + status: string; + targets: Array; + values: Array; + voteEnd: any; + voteStart: any; + queuedAtBlock?: any | null; + signatures: Array; + queuedAt?: any | null; + proposer: any; + executedAtBlock?: any | null; + executedAt?: any | null; + description: string; + canceledAtBlock?: any | null; + canceledAt?: any | null; + calldatas: Array; + }>; +}; export type ProposalDetailsQueryVariables = Exact<{ - proposalId: Scalars['ID']['input']; + proposalId: Scalars["ID"]["input"]; }>; - -export type ProposalDetailsQuery = { __typename?: 'Query', proposal?: { __typename?: 'Proposal', proposalId: any, createdAt: any, createdAtBlock: any, id: string, status: string, targets: Array, values: Array, voteEnd: any, voteStart: any, queuedAtBlock?: any | null, signatures: Array, queuedAt?: any | null, proposer: any, executedAtBlock?: any | null, executedAt?: any | null, description: string, canceledAtBlock?: any | null, canceledAt?: any | null, calldatas: Array } | null }; - +export type ProposalDetailsQuery = { + __typename?: "Query"; + proposal?: { + __typename?: "Proposal"; + proposalId: any; + createdAt: any; + createdAtBlock: any; + id: string; + status: string; + targets: Array; + values: Array; + voteEnd: any; + voteStart: any; + queuedAtBlock?: any | null; + signatures: Array; + queuedAt?: any | null; + proposer: any; + executedAtBlock?: any | null; + executedAt?: any | null; + description: string; + canceledAtBlock?: any | null; + canceledAt?: any | null; + calldatas: Array; + } | null; +}; export const GetVotesDocument = gql` query GetVotes($proposalId: BigInt!) { @@ -772,22 +828,53 @@ export const GetVotesDocument = gql` * }, * }); */ -export function useGetVotesQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: GetVotesQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetVotesDocument, options); - } -export function useGetVotesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetVotesDocument, options); - } -export function useGetVotesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} - return Apollo.useSuspenseQuery(GetVotesDocument, options); - } +export function useGetVotesQuery( + baseOptions: Apollo.QueryHookOptions & + ({ variables: GetVotesQueryVariables; skip?: boolean } | { skip: boolean }), +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery( + GetVotesDocument, + options, + ); +} +export function useGetVotesLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + GetVotesQuery, + GetVotesQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery( + GetVotesDocument, + options, + ); +} +export function useGetVotesSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +) { + const options = + baseOptions === Apollo.skipToken + ? baseOptions + : { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery( + GetVotesDocument, + options, + ); +} export type GetVotesQueryHookResult = ReturnType; -export type GetVotesLazyQueryHookResult = ReturnType; -export type GetVotesSuspenseQueryHookResult = ReturnType; -export type GetVotesQueryResult = Apollo.QueryResult; +export type GetVotesLazyQueryHookResult = ReturnType< + typeof useGetVotesLazyQuery +>; +export type GetVotesSuspenseQueryHookResult = ReturnType< + typeof useGetVotesSuspenseQuery +>; +export type GetVotesQueryResult = Apollo.QueryResult< + GetVotesQuery, + GetVotesQueryVariables +>; export const GovernanceProposalsDocument = gql` query GovernanceProposals($first: Int = 10) { proposals(orderBy: id, orderDirection: desc, first: $first) { @@ -830,22 +917,60 @@ export const GovernanceProposalsDocument = gql` * }, * }); */ -export function useGovernanceProposalsQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GovernanceProposalsDocument, options); - } -export function useGovernanceProposalsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GovernanceProposalsDocument, options); - } -export function useGovernanceProposalsSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} - return Apollo.useSuspenseQuery(GovernanceProposalsDocument, options); - } -export type GovernanceProposalsQueryHookResult = ReturnType; -export type GovernanceProposalsLazyQueryHookResult = ReturnType; -export type GovernanceProposalsSuspenseQueryHookResult = ReturnType; -export type GovernanceProposalsQueryResult = Apollo.QueryResult; +export function useGovernanceProposalsQuery( + baseOptions?: Apollo.QueryHookOptions< + GovernanceProposalsQuery, + GovernanceProposalsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery< + GovernanceProposalsQuery, + GovernanceProposalsQueryVariables + >(GovernanceProposalsDocument, options); +} +export function useGovernanceProposalsLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + GovernanceProposalsQuery, + GovernanceProposalsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery< + GovernanceProposalsQuery, + GovernanceProposalsQueryVariables + >(GovernanceProposalsDocument, options); +} +export function useGovernanceProposalsSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + GovernanceProposalsQuery, + GovernanceProposalsQueryVariables + >, +) { + const options = + baseOptions === Apollo.skipToken + ? baseOptions + : { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + GovernanceProposalsQuery, + GovernanceProposalsQueryVariables + >(GovernanceProposalsDocument, options); +} +export type GovernanceProposalsQueryHookResult = ReturnType< + typeof useGovernanceProposalsQuery +>; +export type GovernanceProposalsLazyQueryHookResult = ReturnType< + typeof useGovernanceProposalsLazyQuery +>; +export type GovernanceProposalsSuspenseQueryHookResult = ReturnType< + typeof useGovernanceProposalsSuspenseQuery +>; +export type GovernanceProposalsQueryResult = Apollo.QueryResult< + GovernanceProposalsQuery, + GovernanceProposalsQueryVariables +>; export const ProposalDetailsDocument = gql` query ProposalDetails($proposalId: ID!) { proposal(id: $proposalId) { @@ -888,22 +1013,64 @@ export const ProposalDetailsDocument = gql` * }, * }); */ -export function useProposalDetailsQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: ProposalDetailsQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(ProposalDetailsDocument, options); - } -export function useProposalDetailsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(ProposalDetailsDocument, options); - } -export function useProposalDetailsSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} - return Apollo.useSuspenseQuery(ProposalDetailsDocument, options); - } -export type ProposalDetailsQueryHookResult = ReturnType; -export type ProposalDetailsLazyQueryHookResult = ReturnType; -export type ProposalDetailsSuspenseQueryHookResult = ReturnType; -export type ProposalDetailsQueryResult = Apollo.QueryResult; +export function useProposalDetailsQuery( + baseOptions: Apollo.QueryHookOptions< + ProposalDetailsQuery, + ProposalDetailsQueryVariables + > & + ( + | { variables: ProposalDetailsQueryVariables; skip?: boolean } + | { skip: boolean } + ), +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery( + ProposalDetailsDocument, + options, + ); +} +export function useProposalDetailsLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + ProposalDetailsQuery, + ProposalDetailsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery< + ProposalDetailsQuery, + ProposalDetailsQueryVariables + >(ProposalDetailsDocument, options); +} +export function useProposalDetailsSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + ProposalDetailsQuery, + ProposalDetailsQueryVariables + >, +) { + const options = + baseOptions === Apollo.skipToken + ? baseOptions + : { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + ProposalDetailsQuery, + ProposalDetailsQueryVariables + >(ProposalDetailsDocument, options); +} +export type ProposalDetailsQueryHookResult = ReturnType< + typeof useProposalDetailsQuery +>; +export type ProposalDetailsLazyQueryHookResult = ReturnType< + typeof useProposalDetailsLazyQuery +>; +export type ProposalDetailsSuspenseQueryHookResult = ReturnType< + typeof useProposalDetailsSuspenseQuery +>; +export type ProposalDetailsQueryResult = Apollo.QueryResult< + ProposalDetailsQuery, + ProposalDetailsQueryVariables +>; export const GetVotes = gql` query GetVotes($proposalId: BigInt!) { @@ -968,4 +1135,4 @@ export const ProposalDetails = gql` calldatas } } - `; \ No newline at end of file + `; diff --git a/packages/graphql/tsup.config.ts b/packages/graphql/tsup.config.ts index 843c8bf60..ce06271a7 100755 --- a/packages/graphql/tsup.config.ts +++ b/packages/graphql/tsup.config.ts @@ -5,8 +5,8 @@ const config = { splitting: true, outDir: "dist", skipNodeModulesBundle: true, - minify: true, // Whether to minify the output - sourcemap: true, // Whether to generate sourcemaps + minify: process.env.NODE_ENV !== "development", // Whether to minify the output + sourcemap: process.env.NODE_ENV !== "development", // Whether to generate sourcemaps // splitting: true, // Whether to split the bundle into chunks dts: true, // Whether to generate TypeScript declaration files // target: "node18", // Specify your target environment diff --git a/packages/shared-ui/src/hooks/index.ts b/packages/shared-ui/src/hooks/index.ts index c7665c68e..7ac4a4e04 100755 --- a/packages/shared-ui/src/hooks/index.ts +++ b/packages/shared-ui/src/hooks/index.ts @@ -4,3 +4,4 @@ export * from "./useSlippage"; export * from "./useSetSlippage"; export * from "./useDeadline"; export * from "./useBreakpoint"; +export * from "./useOnResize"; diff --git a/packages/shared-ui/src/hooks/useOnResize.ts b/packages/shared-ui/src/hooks/useOnResize.ts new file mode 100644 index 000000000..10ca01af0 --- /dev/null +++ b/packages/shared-ui/src/hooks/useOnResize.ts @@ -0,0 +1,9 @@ +"use client"; +import { useEffect } from "react"; + +export const useOnResize = (cb: () => void) => { + useEffect(() => { + window.addEventListener("resize", cb); + return () => window.removeEventListener("resize", cb); + }, [cb]); +}; diff --git a/packages/ui/tsup.config.ts b/packages/ui/tsup.config.ts index 37e9edfdb..b380bf94f 100755 --- a/packages/ui/tsup.config.ts +++ b/packages/ui/tsup.config.ts @@ -57,7 +57,7 @@ export default defineConfig((opts) => { clean: !opts.watch, dts: true, format: ["esm"], - minify: true, + minify: process.env.NODE_ENV !== "development", outDir: "dist", } satisfies Options; diff --git a/packages/wagmi/tsup.config.ts b/packages/wagmi/tsup.config.ts index 843c8bf60..ce06271a7 100755 --- a/packages/wagmi/tsup.config.ts +++ b/packages/wagmi/tsup.config.ts @@ -5,8 +5,8 @@ const config = { splitting: true, outDir: "dist", skipNodeModulesBundle: true, - minify: true, // Whether to minify the output - sourcemap: true, // Whether to generate sourcemaps + minify: process.env.NODE_ENV !== "development", // Whether to minify the output + sourcemap: process.env.NODE_ENV !== "development", // Whether to generate sourcemaps // splitting: true, // Whether to split the bundle into chunks dts: true, // Whether to generate TypeScript declaration files // target: "node18", // Specify your target environment