Skip to content

useAccountBalancesFromApi

Hook for getting account balance from API.

Import

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

Usage

index.tsx
import { useAccountBalancesFromApi } from '@abstract-money/react'
import { stringToAccountId } from '@abstract-money/core'
 
function App() {
  const accountBalanceFromApiQuery = useAccountBalancesFromApi({
    args: {
      accountId: stringToAccountId('pion-1')
    }
  })
}

Parameters

args

Arguments passed to the hook

accountId

AccountId to check balance of.

extra

{ apiUrl?: string | undefined; } | undefined

Extra options to override decorated parameters.

query

QueryOptions | undefined

QueryOptions to use.