Network Fees
Finrock exposes two endpoints for working with network fees: one to retrieve the current fee rates for any supported asset, and one to estimate the total fee for a specific transaction before you submit it.Fee Rate Units by Blockchain
Every blockchain family uses a different unit to express fee rates. Provide values in the correct unit when calling fee-related endpoints:Get Current Fee Rates
Use the fee rates endpoint to retrieve the current network fee rates for a given asset. This is useful for building a fee selection UI or for pre-flight checks before submitting high-value transactions.{asset} with the asset ticker (e.g., BTC, USDT_ETH). This endpoint requires authentication.
Estimate Transaction Fee
Before submitting a transaction, you can call the fee estimate endpoint to calculate the total network fee for a given asset, amount (required for UTXO chains), and your chosen fee rate.string
required
The asset ticker as returned by the
/assets endpoint (e.g., BTC, USDT_ETH).float
required
The fee rate in the unit appropriate for the asset’s blockchain (see the table above).
double
The transfer amount. Required for UTXO-based chains (BTC, LTC, DASH, DOGE, BCH) because the fee depends on transaction size, which varies with the number of inputs and the amount.
API Rate Limits
The Finrock API enforces rate limits on a per-minute, per-API-key basis. Rate limits apply globally across all endpoints associated with your API key. If your application exceeds the allowed number of requests within a one-minute window, the API returns anHTTP 429 Too Many Requests response. The limit automatically resets at the start of the next minute.
Rate limits are enforced per API key. If you need a higher limit for a production workload, contact support@finrock.io to request an increase.
Rate Limit Response Headers
Every API response includes rate limit headers so your application can proactively monitor its usage and back off before hitting the limit. Read these headers on every response:Example Rate Limit Header Response
The following shows what the response headers look like when you call an endpoint with the-i flag in cURL to inspect them:
x-rate-limit-remaining: 999 shows there are 999 requests left in the current minute window, and the limit will reset at 2022-08-27T18:23:48Z.
Handling a 429 Response
When your application receives anHTTP 429, implement a back-off and retry strategy:
- Read the
x-rate-limit-resetheader to determine exactly when the window resets. - Pause requests until that timestamp is reached.
- Resume sending requests at the start of the new window.