post https://{network}.g.alchemy.com/v2/
Get the fee the network will charge for a particular message.
Parameters
message:
<Base-64 string> - encoded Messagecommitment:
<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>, a fee corresponding to the message at the specified blockhash.
Example
Request
curl --location --request POST 'https://solana-mainnet.g.alchemy.com/v2/demo' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": 1,
"jsonrpc": "2.0",
"method": "getFeeForMessage",
"params": ["AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAA"]
}'
Response
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 135143215
},
"value": null
},
"id": 1
}