Get fee estimate
Retrieves an estimated fee rate for transactions.
POST
/v2/fees/transaction
Get approximate fees for a given transaction
Note
If the final transaction's byte size is larger than supplied to estimated_len
, then applications should increase this fee amount: fee_rate
x cost_scalar_change_by_byte
x (final_size
- estimated_size
)
Request Body (Optional)
transaction_payload
Requiredstring
Hex-encoded serialization of the TransactionPayload
for the transaction.
estimated_len
integer
Estimation of the final length (in bytes) of the transaction, including any post-conditions and signatures.
Status code | Description |
---|---|
200 | Estimated fees for the transaction |
curl -X POST "https://api.hiro.so/v2/fees/transaction" \
-d '{
"transaction_payload": "string",
"estimated_len": 0
}'
POST response for estimated fee
{
"estimated_cost_scalar": 0,
"cost_scalar_change_by_byte": 0,
"estimated_cost": {
"read_count": 0,
"read_length": 0,
"runtime": 0,
"write_count": 0,
"write_length": 0
},
"estimations": [
{
"fee_rate": 0,
"fee": 0
}
]
}