Skip to content

zone.useWithdrawalFee ​

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

Requires viem >=2.56.2

Zone actions and hooks require viem >=2.56.2.

Usage ​

ts
import { Hooks } from 'wagmi/tempo'
import { Zone } from 'viem/tempo'

const zoneChain = Zone.b

const { data } = Hooks.zone.useWithdrawalFee({
  callbackGas: 21_000n,
  chainId: zoneChain.id,
  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.