Skip to content

useModuleInstantiate2AddressFromApi

Hook for predicting instantiate2 address of the contract to deploy.

Import

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

Usage

index.tsx
import { useModuleInstantiate2AddressFromApi } from '@abstract-money/react'
import { stringToAccountId } from '@abstract-money/core'
 
function App() {
  const moduleInstantiate2AddressFromApiQuery = useModuleInstantiate2AddressFromApi({
    accountId: stringToAccountId('pion-1'),
    chainName: 'pion',
    args: {
      moduleId: 'some:id',
      version: 'latest'
    }
  })
}

Parameters

args

Arguments passed to the hook

moduleId

${string}:${string}

Id of the module to predict address of.

version

ModuleVersion | undefined

Version of the module to predict address of.

accountId

AccountId | undefined

Account Id to be used to fetch the query.

chainName

string | undefined

Name of the chain to be used to fetch the query.

extra

{
    apiUrl?: string | undefined;
    accountId?: AccountId | undefined;
    cosmWasmClient?: CosmWasmClient | undefined;
} | undefined

Extra options to override decorated parameters.

query

QueryOptions | undefined

QueryOptions to use.