get Fee For Message
Returns the fee, in lamports, that a compiled transaction message would cost right now.
getFeeForMessage takes a base64-encoded, compiled transaction Message (not a full transaction; no signatures required) and returns its fee under the current fee schedule, based on its signature count and compute-budget instructions.
The result depends on the message's embedded blockhash remaining recent, detailed further in Notes.
Parameters
params is a JSON array, with values in this order: message, config.
Base64-encoded, compiled transaction message (the Message, not a full signed Transaction).
Optional configuration.
Show propertiesProperties
Bank state to compute the fee against.
finalizedconfirmedprocessedMinimum slot the node must have processed before answering.
Result
The fee in lamports, wrapped with context, or null if the fee can't be computed.
Show propertiesProperties
Show propertiesProperties
Fee in lamports for the given message, or null if the message's blockhash is not found (for example because it has already expired).
Notes
valueis null when the embedded blockhash is too old for the node to have a fee schedule for it; this is not an error.- 5000 lamports per signature is the current base fee; a priority fee from compute-budget instructions adds to it, and this call reflects that.
- Both example messages encode a single-signer SystemProgram transfer; they differ only in which blockhash was compiled into them.