Expose Chatelet over the LNbits nostr-transport (register_rpc) #1

Closed
opened 2026-07-18 22:19:31 +00:00 by padreug · 1 comment
Owner

Chatelet currently registers nothing on the core LNbits nostr-transport dispatcher (aiolabs/lnbits #4, kind-21000 NIP-44 RPC over relays), so all operator/booking CRUD is HTTP-only. To make the extension drivable over Nostr the way lnurlp is, mirror its pattern.

Reference

lnurlp/__init__.py lnurlp_start() + lnurlp/transport_rpcs.py:

  • register_rpc("lnurlp_create", handler, AUTH_WALLET) etc. from lnbits.core.services.nostr_transport.dispatcher
  • register_link_owner_resolver("lnurlp", resolve_lnurlp_owner) from ...nostr_transport.subscriptions

Work

  • Add chatelet/transport_rpcs.py with handlers that reuse the same crud paths as views_api.py (do not duplicate booking logic).
    • chatelet_room_create / _get / _list / _update / _publish (AUTH_WALLET / AUTH_ACCOUNT)
    • chatelet_availability (public-ish read)
    • chatelet_booking_request (guest write) / chatelet_booking_get
    • chatelet_block_create
  • In chatelet_start(), try: import ...nostr_transport.dispatcher and register RPCs; except ImportError: return (no-op on pre-#4 lnbits) — same graceful degrade as lnurlp.
  • Register a link-owner resolver so payment subscriptions can verify wallet ownership; stamp extra["booking_id"] (already done) and map it to the room's wallet.

Acceptance

An HTTP-allergic client can create a room, check availability, and request a booking entirely over kind-21000 RPC, with no HTTP call.

Depends on the relay plumbing groundwork in the sibling issue (app-event publish/subscribe).

Chatelet currently registers **nothing** on the core LNbits nostr-transport dispatcher (`aiolabs/lnbits` #4, kind-21000 NIP-44 RPC over relays), so all operator/booking CRUD is HTTP-only. To make the extension drivable over Nostr the way `lnurlp` is, mirror its pattern. ### Reference `lnurlp/__init__.py` `lnurlp_start()` + `lnurlp/transport_rpcs.py`: - `register_rpc("lnurlp_create", handler, AUTH_WALLET)` etc. from `lnbits.core.services.nostr_transport.dispatcher` - `register_link_owner_resolver("lnurlp", resolve_lnurlp_owner)` from `...nostr_transport.subscriptions` ### Work - [ ] Add `chatelet/transport_rpcs.py` with handlers that reuse the **same crud paths** as `views_api.py` (do not duplicate booking logic). - `chatelet_room_create` / `_get` / `_list` / `_update` / `_publish` (AUTH_WALLET / AUTH_ACCOUNT) - `chatelet_availability` (public-ish read) - `chatelet_booking_request` (guest write) / `chatelet_booking_get` - `chatelet_block_create` - [ ] In `chatelet_start()`, `try: import ...nostr_transport.dispatcher` and register RPCs; `except ImportError: return` (no-op on pre-#4 lnbits) — same graceful degrade as lnurlp. - [ ] Register a link-owner resolver so payment subscriptions can verify wallet ownership; stamp `extra["booking_id"]` (already done) and map it to the room's wallet. ### Acceptance An HTTP-allergic client can create a room, check availability, and request a booking entirely over kind-21000 RPC, with no HTTP call. Depends on the relay plumbing groundwork in the sibling issue (app-event publish/subscribe).
Author
Owner

Shipped in PR #8 (booking flow over the LNbits nostr-transport, register_rpc) and released in catalog v0.1.0. Closing — the PR's "Closes the code portion of #1" phrasing never matched Forgejo's auto-close parser, so this lingered open.

Shipped in PR #8 (booking flow over the LNbits nostr-transport, `register_rpc`) and released in catalog v0.1.0. Closing — the PR's "Closes the code portion of #1" phrasing never matched Forgejo's auto-close parser, so this lingered open.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aiolabs/chatelet#1
No description provided.