import type { Account, Address, Chain, Client, ContractFunctionReturnType, DeriveChain, GetChainParameter, Hash, Hex, Transport } from 'viem'; import { standardBridgeAbi } from '../abis/index.js'; import type { BaseWriteContractActionParameters } from '../core/baseWriteAction.js'; /** * Parameters to withdraw an OptimismMintableERC20 | OptimismSuperchainERC20 into the remote token. * @category Types */ export type WithdrawOptimismERC20Parameters> = GetChainParameter & BaseWriteContractActionParameters & { /** The address of the OptimismMintablERC20 token to withdraw */ tokenAddress: Address; /** The token amount to bridge */ amount: bigint; /** The recipient address to bridge to. Defaults to the calling account */ to?: Address; /** The minimums gas the relaying message will be executed with */ minGasLimit?: number; /** Metadata to attach to the bridged message */ extraData?: Hex; /** The address of the StandardBridge to use. Defaults to the L2StandardBridge Predeploy */ bridgeAddress?: Address; }; /** * Transaction hash of the withdrawing transaction. * @category Types */ export type WithdrawOptimismERC20ReturnType = Hash; /** * Return type of the StandardBridge bridgeERC20To function. * @category Types */ export type WithdrawOptimismERC20ContractReturnType = ContractFunctionReturnType; /** * Action to withdraw an OptimismMintableERC20 | OptimismSuperchainERC20 into its remote ERC20. * @category Actions * @param client - Client for the withdrawing chain * @param parameters - {@link WithdrawOptimismERC20Parameters} * @returns The hash of the withdrawing transaction * @example * import { withdrawOptimismERC20 } from '@eth-optimism/viem' * import { op } from '@eth-optimism/viem/chains' * * const client = createPublicClient({ chain: op, transport: http() }) * const hash = await withdrawOptimismERC20(client, { * tokenAddress: '0x0000000000000000000000000000000000000000', * amount: 1000000000000000000n, * }) */ export declare function withdrawOptimismERC20(client: Client, parameters: WithdrawOptimismERC20Parameters): Promise; /** * Estimate the gas cost of the {@link withdrawOptimismERC20} action. * @category Actions * @param client - Client for the withdrawing chain * @param parameters - {@link WithdrawOptimismERC20Parameters} * @returns The gas cost */ export declare function estimateWithdrawOptimismERC20Gas(client: Client, parameters: WithdrawOptimismERC20Parameters): Promise; /** * Simulate the {@link withdrawOptimismERC20} action. * @category Actions * @param client - Client for the withdrawing chain * @param parameters - {@link WithdrawOptimismERC20Parameters} * @returns The simulated transaction */ export declare function simulateWithdrawOptimismERC20(client: Client, parameters: WithdrawOptimismERC20Parameters): Promise;