Skip to content

wallet.useDeposit

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

Usage

ts
import { Hooks } from 'wagmi/tempo'

const deposit = Hooks.wallet.useDeposit()

// Call `mutate` in response to user action (e.g. button click, form submission)
deposit.mutate({
  address: '0x20c0000000000000000000000000000000000001',
  chainId: 1,
  displayName: 'My Account',
  token: '0x20c0000000000000000000000000000000000002',
  value: '1.5',
})

console.log('Receipts:', deposit.data?.receipts)
// @log: Receipts: [...]
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.deposit Return Type

mutate/mutateAsync

See Wagmi Action wallet.deposit 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.