curl --fail-with-body "$THORNODE_RPC_URL" \
--header 'content-type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "getFeeForMessage",
"params": [
"<BASE64_MESSAGE>",
{
"commitment": "processed"
}
]
}'
const body = {
"jsonrpc": "2.0",
"id": 1,
"method": "getFeeForMessage",
"params": [
"<BASE64_MESSAGE>",
{
"commitment": "processed"
}
]
};
const response = await fetch(process.env.THORNODE_RPC_URL, {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify(body),
});
const { result, error } = await response.json();
console.log(result ?? error);
{
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "4.1.2",
"slot": 439749235
},
"value": 5000
},
"id": 1
}
HTTP methods
getFeeForMessage
Get the fee the network will charge for a particular Message.
curl --fail-with-body "$THORNODE_RPC_URL" \
--header 'content-type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "getFeeForMessage",
"params": [
"<BASE64_MESSAGE>",
{
"commitment": "processed"
}
]
}'
const body = {
"jsonrpc": "2.0",
"id": 1,
"method": "getFeeForMessage",
"params": [
"<BASE64_MESSAGE>",
{
"commitment": "processed"
}
]
};
const response = await fetch(process.env.THORNODE_RPC_URL, {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify(body),
});
const { result, error } = await response.json();
console.log(result ?? error);
{
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "4.1.2",
"slot": 439749235
},
"value": 5000
},
"id": 1
}
Get the fee the network will charge for a particular Message.