Hooks
useProposalPermissions

useProposalPermissions

Hook to check which actions a connected account can take given a proposal.

import { useProposalPermissions } from '@public-assembly/builder-utils'

Usage

import { useProposalPermissions } from '@public-assembly/builder-utils'
 
function App() {
  const { canVeto, canCancel, canVote } = useProposalPermissions({
    proposalId: '0xaf97d910e87200254e6e9af15e5f22b9ed51a191440218073b86f9954ed0366b',
    timeCreated: 17872951,
  })
 
  const { address } = useAccount()
 
  return (
    <>
      <p>
        {address} can veto?: {canVeto}
      </p>
      <p>
        {address} can cancel?: {canCancel}
      </p>
      <p>
        {address} can vote: : {canVote}
      </p>
    </>
  )
}

Returns

{
  canVeto: boolean
  canCancel: boolean
  canVote: boolean
}