Skip to content

getWithdrawals

Gets withdrawal messages emitted from the MessagePassed log from a withdrawal initialization.

Import

import { getWithdrawals } from 'viem'

Usage

import { extractTransactionDepositedLogs, getWithdrawals } from 'viem'
 
const receipt = await client.getTransactionReceipt({
  hash: '0xa08acae48f12243bccd7153c88d892673d5578cce4ee9988c0332e8bba47436b',
})
 
const withdrawals = getWithdrawals(receipt) 

Returns

Hex

The L2 transaction hash.

Parameters

logs

  • Type: Log[]

An array of L2 logs.

const withdrawals = getWithdrawals({ 
  logs: receipt.logs 
})