useFetchVotingToken QUERY

checks if an account can vote on a proposal

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

Usage

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

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

  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 plugin.

Return Data

data: tokenDetails | null

Return Data example

  tokenDetails {
    address: "0x123456789000987654323112345678900987654321",
    name: "Token",
    symbol: "TOK",
    decimals: 18
  }

Return Values

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