Skip to main content
Calculates the total fee for a ZeroDev user operation given its gas limits and max fee per gas. Returns fee data in native units (wei), human-readable format (ETH), and optionally USD. Unlike estimateUserOperationGas, this function is synchronous and does not make any network calls — it computes the fee from gas values you already have (e.g., after calling estimateUserOperationGas or building a user operation manually).

Installation

Usage

Parameters

Returns

EvmTransactionFeeData (synchronous — not a Promise):

Examples

Display fee before sending

With USD conversion

Error handling

Last modified on February 20, 2026