Skip to content

Commit 6ead89c

Browse files
committed
docs: document /fee-estimates in API.md
1 parent e5899be commit 6ead89c

1 file changed

Lines changed: 38 additions & 1 deletion

File tree

docs/API.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,43 @@ Returns transaction history for a specific address in Esplora-compatible format.
242242
]
243243
```
244244

245+
## Fee Estimation
246+
247+
### Get Fee Estimates
248+
```
249+
GET /fee-estimates
250+
```
251+
Returns fee estimates for various confirmation targets in sat/vB (satoshis per virtual byte). The endpoint queries either the connected node's RPC or proxies to Esplora depending on server configuration.
252+
253+
**Response Format (JSON):**
254+
255+
The following is a non-exhaustive example, more keys are present:
256+
```json
257+
{
258+
"1": 10.5,
259+
"2": 8.2,
260+
"3": 7.5,
261+
"1008": 1.0
262+
}
263+
```
264+
265+
**Response Fields:**
266+
267+
The response is a JSON object where:
268+
- **Key** (string): Confirmation target in blocks (e.g., "1", "6", "144")
269+
- **Value** (float): Estimated fee rate in sat/vB for that confirmation target
270+
271+
**Confirmation Targets:**
272+
273+
The endpoint provides estimates for the following confirmation targets (in blocks):
274+
- Short-term: 1-25 blocks
275+
- Medium-term: 144 blocks (~1 day)
276+
- Long-term: 504 blocks (~3.5 days), 1008 blocks (~1 week)
277+
278+
**Caching:**
279+
280+
Fee estimates are cached server-side for 30 seconds to reduce load on the underlying node or Esplora API.
281+
245282
## Transaction Operations
246283

247284
### Broadcast Transaction
@@ -252,7 +289,7 @@ Broadcasts a raw transaction to the network.
252289

253290
**Request Body:** Raw transaction hex string
254291

255-
**Response:**
292+
**Response:**
256293
- Success (200): Transaction ID
257294
- Error (400): Error message
258295

0 commit comments

Comments
 (0)