Skip to content

zone.useWithdrawalFee

Hook for getting the withdrawal fee for a given gas limit.

Requires viem >=2.48.0

Zone actions and hooks require viem >=2.48.0.

Usage

ts
import { Hooks } from 'wagmi/tempo'
import { zone } from 'viem/tempo/zones'

const zoneChain = zone(7)

const { data } = Hooks.zone.useWithdrawalFee({
  chainId: zoneChain.id,
  gas: 21_000n,
  query: {
    initialData: 22_000n,
  },
})

console.log('Fee:', data)
// @log: Fee: 22000n

Return Type

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

data

See Wagmi Action zone.getWithdrawalFee Return Type

Parameters

See Wagmi Action zone.getWithdrawalFee Parameters

query

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

Action

Released under the MIT License.