@eth-optimism/viem • Docs
@eth-optimism/viem / actions / WithdrawCrossDomainMessageParameters
WithdrawCrossDomainMessageParameters<
TChain,TAccount,TChainOverride,TDerivedChain>:GetChainParameter<TChain,TChainOverride> &BaseWriteContractActionParameters<TChain,TAccount,TChainOverride,TDerivedChain> &object
Withdraw a cross-domain message from the child chain (L2).
optionalcrossDomainMessengerAddress:Address
The address of the CrossDomainMessenger to use. Defaults to the L2CrossDomainMessenger Predeploy
message:
Hex
The calldata to invoke the target with
optionalminGasLimit:bigint
The minimum gas limit for the transaction
target:
Address
The address of the target contract
value:
bigint
The value to send with the transaction
• TChain extends Chain | undefined
• TAccount extends Account | undefined
• TChainOverride extends Chain | undefined
• TDerivedChain extends Chain | undefined = DeriveChain<TChain, TChainOverride>
Client for the withdrawing chain
WithdrawCrossDomainMessageParameters
import { withdrawCrossDomainMessage } from '@eth-optimism/viem'
import { op } from '@eth-optimism/viem/chains'
const hash = await withdrawCrossDomainMessage(client, {
target: '0x0000000000000000000000000000000000000000',
message: '0x',
targetChain: op,
})