Skip to main content
Estimates the fee for a Solana transaction without running a full simulation. Returns fee data in lamports, human-readable SOL, and optionally USD — but no asset diffs or security validation. Supports both legacy Transaction and VersionedTransaction objects. Includes automatic retry logic for network reliability. Use this when you need a fee estimate only. Use simulateSolanaTransaction when you also want to preview asset changes and security validation.

Installation

Usage

Parameters

Returns

Promise<SolanaTransactionFeeData>:

Examples

SOL transfer fee

With USD conversion

Versioned transaction

Error handling

React

Estimate fees inside a button handler or effect. Re-estimate when the transaction or network changes:
Last modified on June 24, 2026