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
Required
string

Hex-encoded serialization of the TransactionPayload for the transaction.

estimated_leninteger

Estimation of the final length (in bytes) of the transaction, including any post-conditions and signatures.

Status codeDescription
200Estimated fees for the transaction
/v2/fees/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
    }
  ]
}