getFeeForMessage
Get the fee the network will charge for a particular message

Parameters

  • message: <Base-64 string> - encoded Message
  • commitment: <object> - (optional) Configures the commitment level of the blocks queried Accepts one of the following strings: ["finalized", "confirmed", "processed"] For more info, refer to this doc.

Returns

  • value: <u64>, fee corresponding to the message at the specified blockhash

Example

Request

cURL
1
curl --location --request POST 'https://solana-mainnet.g.alchemy.com/v2/demo' \
2
--header 'Content-Type: application/json' \
3
--data-raw '{
4
"id": 1,
5
"jsonrpc": "2.0",
6
"method": "getFeeForMessage",
7
"params": ["AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAA"]
8
}'
Copied!

Response

1
{
2
"jsonrpc": "2.0",
3
"result": {
4
"context": {
5
"slot": 135143215
6
},
7
"value": null
8
},
9
"id": 1
10
}
Copied!