Skip to content

useAccounts

Hook for getting accounts owned by an address.

Import

import { useAccounts } from '@abstract-money/react'

Usage

index.tsx
import { useAccounts } from '@abstract-money/react'
 
function App() {
  const accountsQuery = useAccounts({
    args: {
      owner: '...',
      chainName: 'pion'
    }
  })
}
## Errors were thrown in the sample, but not included in an error tag These errors were not marked as being expected: 2353. Expected: // @errors: 2353 Compiler Errors: index.tsx [2353] 146 - Object literal may only specify known properties, and 'chainName' does not exist in type '{ owner: string; chains: string[]; }'.

Parameters

args

Arguments passed to the hook

owner

string

Bech address of the queried owner of the accounts

chainName

string | string[]

Array of chains to query.

extra

{ apiUrl?: string | undefined; } | undefined

Extra options to override decorated parameters.

query

QueryOptions | undefined

QueryOptions to use.