Skip to content

Commit 3f9ee89

Browse files
committed
Document v4 descriptor endpoint
1 parent d6b34b0 commit 3f9ee89

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

API.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,45 @@ GET /v2/waterfalls.cbor?<query_params>
5858
**Differences between v1 and v2:**
5959
- v2 includes `tip` field in response
6060

61+
### Waterfalls Data with Full Tip Metadata (v4)
62+
63+
```
64+
GET /v4/waterfalls?<query_params>
65+
GET /v4/waterfalls.cbor?<query_params>
66+
```
67+
68+
The v4 endpoints accept the same query parameters as v2 but return extended tip metadata including block height. This is particularly useful for Bitcoin, where the block height cannot be derived from the header alone.
69+
70+
**Response Format (JSON):**
71+
```json
72+
{
73+
"txs_seen": {
74+
"descriptor_or_addresses": [
75+
{
76+
"txid": "transaction_id",
77+
"height": 12345,
78+
"block_hash": "block_hash",
79+
"block_timestamp": 1234567890,
80+
"v": 1
81+
}
82+
]
83+
},
84+
"page": 0,
85+
"tip_meta": {
86+
"b": "current_tip_block_hash",
87+
"t": 1234567890,
88+
"h": 876543
89+
}
90+
}
91+
```
92+
93+
**Differences between v2 and v4:**
94+
- v4 returns `tip_meta` object instead of `tip` hash string
95+
- `tip_meta` contains:
96+
- `b` (string): Block hash of the current tip
97+
- `t` (integer): Block timestamp (Unix epoch seconds)
98+
- `h` (integer): Block height
99+
61100
### Last Used Index
62101
```
63102
GET /v1/last_used_index?descriptor=<descriptor>

0 commit comments

Comments
 (0)