Skip to main content

Function: useCreateVote()

useCreateVote(): UseMutationResult<VoteView, Error, CreateVoteInput, { previousProposal: undefined | ProposalView; }>

Defined in: web/lib/hooks/use-governance.ts:546

Mutation hook for casting a vote.

Returns

UseMutationResult<VoteView, Error, CreateVoteInput, { previousProposal: undefined | ProposalView; }>

Mutation object for voting

Example

const createVote = useCreateVote();

await createVote.mutateAsync({
proposalId: 'abc123',
vote: 'approve',
rationale: 'Well-scoped proposal with clear benefit',
});