Skip to content

useAnsTokenFromAPI

Hook for getting Token information from ANS.

Import

import { useAnsTokenFromAPI } from '@abstract-money/react'
## Errors were thrown in the sample, but not included in an error tag These errors were not marked as being expected: 2724. Expected: // @errors: 2724 Compiler Errors: index.ts [2724] 9 - '"@abstract-money/react"' has no exported member named 'useAnsTokenFromAPI'. Did you mean 'useAnsTokenFromApi'?

Usage

index.tsx
import { useAnsTokenFromAPI } from '@abstract-money/react'
 
function App() {
  const ansTokenFromAPIQuery = useAnsTokenFromAPI({
    args: {
      id: '...',
      chainName: 'pion'
    }
  })
}
## Errors were thrown in the sample, but not included in an error tag These errors were not marked as being expected: 2724. Expected: // @errors: 2724 Compiler Errors: index.tsx [2724] 9 - '"@abstract-money/react"' has no exported member named 'useAnsTokenFromAPI'. Did you mean 'useAnsTokenFromApi'?

Parameters

args

Arguments passed to the hook

chainName

string | string[]

Array of chains to query.

id

string

ANS Id of the token.

extra

{ apiUrl?: string | undefined; } | undefined

Extra options to override decorated parameters.

query

QueryOptions | undefined

QueryOptions to use.