getFeeForMessage

Get the fee the network will charge for a particular Message.

📘

Supported on Solana (mainnet) only.

Parameters

  • message: <string> - Base-64 encoded Message
  • (optional) <object> - Configuration object containing the following optional fields:
    • (optional) commitment: <string> - Commitment (used for retrieving blockhash)
    • (optional) minContextSlot: <number> - set the minimum slot that the request can be evaluated at.

Returns

  • <u64|null> - Fee corresponding to the message at the specified blockhash

API Endpoint

The format of an Solana API endpoint is
https://open-platform.nodereal.io/{{apiKey}}/solana/

Here is an example:
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/solana/

Example

Request

curl https://open-platform.nodereal.io/{{apiKey}}/solana/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{
  "id":1,
  "jsonrpc":"2.0",
  "method":"getFeeForMessage",
  "params":[
    "AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAA",
    {
      "commitment":"processed"
    }
  ]
}'

Result

{
  "jsonrpc": "2.0",
  "result": { "context": { "slot": 5068 }, "value": 5000 },
  "id": 1
}