Solana RPC · Transactions
POST getFeeForMessage
Fee the cluster will charge for a compiled message.
Endpoint
POST https://solrpc.infinityblocks.io/<API_KEY>
Standard Solana JSON-RPC 2.0 over HTTP POST. The API key is part of the URL path.
Parameters
| Param | Type | Required | Description |
|---|---|---|---|
message | string | yes | Base-64 encoded transaction message. |
config | object | no | commitment. |
Request
curl -s https://solrpc.infinityblocks.io/<API_KEY> \
-X POST -H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"getFeeForMessage","params":["<MESSAGE_BASE64>",{"commitment":"confirmed"}]}'
With @solana/web3.js
const { value: fee } = await rpc.getFeeForMessage(message);
Response
{ "jsonrpc": "2.0", "id": 1, "result": { "context": { "slot": 423214981 }, "value": 5000 } }
Try it
Run getFeeForMessagelive · POST
Replace placeholders (e.g. <ADDRESS>) with real values. Your key is stored only in this browser.
—