Skip to content

useModulesFromApi

Hook for getting all existing modules on a chain.

Import

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

Usage

index.tsx
import { useModulesFromApi } from '@abstract-money/react'
 
function App() {
  const modulesFromApiQuery = useModulesFromApi({
    args: {
      chainName: 'pion'
    }
  })
}

Parameters

args

Arguments passed to the hook

chainName

string

Name of chain to query.

filter (optional)

ModuleFilter

An object to filter the modules. It can include the following properties:

  • name: string (optional) - Filter by the module's name
  • namespace: string (optional) - Filter by the module's namespace
  • status: ModuleStatus (optional) - Filter by the module's status
  • type: ModuleType (optional) - Filter by the module's type
  • version: string (optional) - Filter by the module's version

extra

{ apiUrl?: string | undefined; } | undefined

Extra options to override decorated parameters.

query

QueryOptions | undefined

QueryOptions to use.