Skip to content

useCreateAccountMonarchy

Hook to create an account monarchy

Import

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

Usage

index.tsx
import { useCreateAccountMonarchy } from '@abstract-money/react'
import { stringToAccountId } from '@abstract-money/core'
 
function App() {
  const createAccountMonarchy = useCreateAccountMonarchy({
    chainName: 'pion',
  })
 
  return (
    <button
      onClick={() =>
        createAccountMonarchy.mutate({
          fee: 'auto',
          args: {
            accountId: stringToAccountId('pion-1'),
            owner: 'pion1...',
          },
        })
      }
    >
      createAccountMonarchy
    </button>
  )
}

Hook Parameters

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.

memo (optional)

string | undefined

An optional memo to attach to the transaction.

funds (optional)

An array of coin objects representing the funds to be sent with the transaction. Each object contains:

  • denom: The denomination of the coin
  • amount: The amount of the coin

args

Arguments passed to the mutation

accountId

AccountId | undefined

The account id to create the monarchy for.

owner

string

The owner of the account.

extra

{ apiUrl?: string | undefined; } | undefined

Extra options to override decorated parameters.