Skip to content

useSimulateRemoteMsg

Hook to simulate a remote message

Import

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

Usage

index.tsx
import { useSimulateRemoteMsg } from '@abstract-money/react'
 
function App() {
  const simulateRemoteMsg = useSimulateRemoteMsg({ chainName: 'osmo' })
 
  return (
    <button
      onClick={() =>
        simulateRemoteMsg.mutate({
          hostChainName: 'osmosis',
          msgs: [
            {
              bank: {
                send: {
                  to_address: 'osmo1...',
                  amount: [
                    {
                      denom: 'uosmo',
                      amount: '1000000',
                    },
                  ],
                },
              },
            },
          ],
        })
      }
    >
      simulateRemoteMsg
    </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

args

Arguments passed to the mutation

hostChainName

string

Host chain name to simulate execution on a remote account.

accountMsg

AccountMsg

The CosmosMsg to be executed on the remote account.