useFetchVotingSettings QUERY

Fetches the settings of a TokenVoting plugin.

import { useFetchVotingSettings } from '@daobox/use-aragon'

Usage

import { useFetchVotingSettings } from '@daobox/use-aragon'

function App() {
  const { data, isLoading, isError } = useFetchVotingSettings({
    // required
    pluginAddress: '0x1234567890123456789012345678901234567890',
  })

  if (isLoading) return <div>Loading...</div>
  if (isError) return <div>Error!!!</div>

  return (
    <>
      <pre style={{ whiteSpace: 'pre-wrap' }}>
        {JSON.stringify(data, null, 2)}
      </pre>
    </>
  )
}

Required Parameters

  • Name
    pluginAddress
    Type
    string
    Description

    The address of the TokenVoting plugin.

Return Data

data: TokenVotingProposalListItem[] | null

Return Data example

{ VotingSettings: {
    minDuration: 10000, // 10 seconds
    minParticipation: 0.25, // 25%
    supportThreshold: 0.5, // 50%
    minProposerVotingPower: BigInt("5000"),
    votingMode: "Standard"
  }
}

Return Values

{
  data: VotingSettings | null,
  error: Error | null,
  isSuccess: boolean,
  isError: boolean,
  isLoading: boolean,
  isRefetching: boolean,
}