Watch a subject
PUT /v1/watch/{kind}/{key}- quién puede llamarla
- Una clave o una sesión
- nivel t2 o superior · la sesión de una clave Nostr
- cuán reciente
- Nunca en caché
- cada respuesta lleva la altura del índice y la del nodo
En esta página
Adds the subject (canonicalised) to the caller's list; idempotent (200 when it was there, 201 when added); 429 when the list is full (watchlist_max: t2 10, t3 25, t4 100). since_seq is the feed's head now: poll /v1/watch/changes?since= from it.
Parámetros
| Nombre | Dónde | Tipo | Obligatorio | Qué hace |
|---|---|---|---|---|
kind | ruta | string | obligatorio | The kind of subject: address, tx or block. |
key | ruta | string | obligatorio | The address, txid or block hash. |
Qué responde
200 · application/json
Already watched.
| Campo | Tipo | Qué lleva |
|---|---|---|
subject | object | The subject watched, canonicalised. |
added | boolean | True when the subject was added now; false when it was on the list already. |
since_seq | integer | The change feed's head now. |
watched | integer | How many subjects the list holds now. |
max | integer | The most subjects the tier lets the list hold. |
esquema WatchResult
subjectSubject obligatorio — The subject watched, canonicalised.kindstring — What the key names, which also sets the key's form. · uno de "address", "script", "tx", "block", "outpoint", "pool", "descriptor", "pubkey"keystring — Canonical key.
addedboolean obligatorio — True when the subject was added now; false when it was on the list already.since_seqinteger obligatorio — The change feed's head now.watchedinteger obligatorio — How many subjects the list holds now.maxinteger obligatorio — The most subjects the tier lets the list hold.
201 · application/json
Added.
| Campo | Tipo | Qué lleva |
|---|---|---|
subject | object | The subject watched, canonicalised. |
added | boolean | True when the subject was added now; false when it was on the list already. |
since_seq | integer | The change feed's head now. |
watched | integer | How many subjects the list holds now. |
max | integer | The most subjects the tier lets the list hold. |
esquema WatchResult
subjectSubject obligatorio — The subject watched, canonicalised.kindstring — What the key names, which also sets the key's form. · uno de "address", "script", "tx", "block", "outpoint", "pool", "descriptor", "pubkey"keystring — Canonical key.
addedboolean obligatorio — True when the subject was added now; false when it was on the list already.since_seqinteger obligatorio — The change feed's head now.watchedinteger obligatorio — How many subjects the list holds now.maxinteger obligatorio — The most subjects the tier lets the list hold.
Errores
| Estado | Código | Cuándo |
|---|---|---|
| 400 | invalid_input | Malformed input (invalid_input). |
| 401 | unauthorized | unauthorized: the request does not say who makes it, or what it offers does not verify: no key or session where one is needed, or a password, a code, a passkey or a signed event that does not check. The message says what is missing. |
| 403 | forbidden | forbidden: the caller is known but may not do this: a key without the scope or the tier the action needs, a session without an npub, a second factor or a recent sign-in, an operator without the role or switched off, or a source that does not allow it. The message says which. |
| 422 | nip98_invalid | The NIP-98 event was refused (nip98_invalid): wrong URL or method, stale, bad signature, wrong payload hash, or used before; the message names the reason. |
| 429 | quota_exceeded | quota_exceeded: the caller's tier ran out of requests for the minute or the day. Retry-After says when to try again; every rate-limited answer carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and X-RateLimit-Tier. While the deployment runs in log-only mode the decision is logged instead and X-RateLimit-Policy: log-only is set. |
| 501 | not_configured | not_configured: this deployment does not run what the route needs, for example the mempool engine, accounts, the intel store or watchlists. The message names it. |
Cada uno llega en el sobre de error único, y ninguno se guarda en caché: un error lleva Cache-Control: no-store.
Ejemplo
curl y jq, en cualquier shell.
curl -s -X PUT https://api.btcintel.io/v1/watch/address/bc1qz654h5qcqzalv6ltpxsk4ksdcc3e20wkedqntgnarv3a0t2e2p7scr48pl \
-H "Authorization: Bearer $BTCINTEL_KEY" | jqThis route needs a key. Set BTCINTEL_KEY in your environment first: the snippet reads it from there and holds no key. The description above names the tiers the route takes.