Fetch the fee the network will charge for a given serialized message.
HTTP transport instance
Base-64 encoded message to estimate fees for
Desired commitment level (default: "confirmed")
"confirmed"
Additional call options
Context-wrapped fee in lamports, or null if the blockhash has expired
null
const { value: fee } = await getFeeForMessage(transport, base64Msg);if (fee !== null) console.log(`Fee: ${fee} lamports`); Copy
const { value: fee } = await getFeeForMessage(transport, base64Msg);if (fee !== null) console.log(`Fee: ${fee} lamports`);
1.0.0
Fetch the fee the network will charge for a given serialized message.