Skip to content

useEnableIbc

Hook to enable IBC on the account.

Import

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

Usage

index.tsx
import { useEnableIbc } from '@abstract-money/react'
import { stringToAccountId } from '@abstract-money/core'
 
function App() {
  const enableIbc = useEnableIbc({
    accountId: stringToAccountId('pion-1'),
    chainName: 'pion',
  })
 
  return (
    <button
      onClick={() =>
        enableIbc.mutate({
          fee: 'auto',
          args: {
            ibcEnabled: true,
          },
        })
      }
    >
      enable IBC
    </button>
  )
}

Hook Parameters

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.

mutation

MutationOptions | undefined

MutationOptions to use.

Mutation Parameters

fee

number | StdFee | "auto"

The fee to be paid for the transaction. Can be a number, a StdFee object, or "auto" for automatic fee calculation.

args

Arguments passed to the mutation. This includes:

enableIbc

boolean

Whether to enable IBC on the account.