isWithdrawalFinalized
Returns whether the withdrawal transaction is finalized on the L1 network.
Usage
example.ts
import { client, zksyncClient } from './config'
 
const hash = await client.isWithdrawalFinalized({
  client: zksyncClient,
  hash: '0x…',
})Returns
boolean
Whether the withdrawal transaction is finalized on the L1 network.
Parameters
client
- Type: Client
The L2 client for fetching data from L2 chain.
const hash = await client.isWithdrawalFinalized({
  client: zksyncClient, 
  hash: '0x…',
})hash
- Type: Hex
Hash of the L2 transaction where the withdrawal was initiated.
const hash = await client.isWithdrawalFinalized({
  client: zksyncClient,
  hash: '0x…',  
})index (optional)
- Type: number
- Default: 0
In case there were multiple withdrawals in one transaction, you may pass an index of the withdrawal you want to finalize.
const hash = await client.isWithdrawalFinalized({
  client: zksyncClient,
  hash: '0x…',
  index: 0n, 
})chain (optional)
- Type: Chain
- Default: client.chain
The target chain. If there is a mismatch between the wallet's current chain & the target chain, an error will be thrown.
import { zksync } from 'viem/chains'
 
const hash = await client.isWithdrawalFinalized({
  chain: zksync, 
  client: zksyncClient,
  hash: '0x…',
})
