Skip to content

useCreateRemoteAccount

Hook for creating an account on a remote chain.

Import

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

Usage

index.tsx
import { useCreateRemoteAccount } from '@abstract-money/react'
import { stringToAccountId } from '@abstract-money/core'
 
function App() {
  const createRemoteAccountMutation = useCreateRemoteAccount({
    accountId: stringToAccountId('pion-1'),
    chainName: 'pion'
  })
 
  return (
    <button
      onClick={() =>
        createRemoteAccountMutation.mutate({
          args: {
            hostChainName: 'pion'
          },
          fee: 'auto',
          funds: []
        })
      }
    >
      createRemoteAccount
    </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.

extra

{
    apiUrl?: string | undefined;
    accountId?: AccountId | undefined;
    signingCosmWasmClient?: SigningCosmWasmClient | undefined;
    sender: string | undefined;
} | undefined

Extra options to override decorated parameters.

mutation

MutationOptions | undefined

MutationOptions to use.

Mutation Parameters

args

Arguments passed to the mutation

hostChainName

string

Host chain name to create a remote account on.

fee

number | StdFee | 'auto'

Transaction to fee to submit.

funds (optional)

(Coin & { [key: string]: string })[]

Funds to submit.

memo (optional)

string

Memo to submit.