Skip to content

wallet.useSend

Hook for opening the wallet send flow with optional pre-filled send fields.

Usage

ts
import { Hooks } from 'wagmi/tempo'

const send = Hooks.wallet.useSend()

// Call `mutate` in response to user action (e.g. button click, form submission)
send.mutate({
  to: '0x20c0000000000000000000000000000000000001',
  token: '0x20c0000000000000000000000000000000000002',
  value: '1.5',
})

console.log('Transaction hash:', send.data?.receipt.transactionHash)
// @log: Transaction hash: 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
ts
import { createConfig, http } from 'wagmi'
import { tempo } from 'wagmi/chains'
import { tempoWallet } from 'wagmi/tempo'

export const config = createConfig({
  connectors: [tempoWallet()],
  chains: [tempo],
  multiInjectedProviderDiscovery: false,
  transports: {
    [tempo.id]: http(),
  },
})

Return Type

See TanStack Query mutation docs for more info hook return types.

data

See Wagmi Action wallet.send Return Type

mutate/mutateAsync

See Wagmi Action wallet.send Parameters

Parameters

config

Config | undefined

Config to use instead of retrieving from the nearest WagmiProvider.

mutation

See the TanStack Query mutation docs for more info hook parameters.

Action

Released under the MIT License.