## Summary - Adds a modular extension system for Lightning.Pub enabling third-party plugins - Provides isolated SQLite databases per extension for data safety - Implements ExtensionContext API for accessing Lightning.Pub services (payments, Nostr, storage) - Supports RPC method registration with automatic namespacing - Includes HTTP route handling for protocols like LNURL - Event routing for payment receipts and Nostr events - Comprehensive documentation with architecture overview and working examples ## Key Components - `src/extensions/types.ts` - Core extension interfaces - `src/extensions/loader.ts` - Extension discovery, loading, and lifecycle management - `src/extensions/context.ts` - Bridge between extensions and Lightning.Pub services - `src/extensions/database.ts` - SQLite isolation with WAL mode - `src/extensions/README.md` - Full documentation with examples ## ExtensionContext API | Method | Description | |--------|-------------| | `getApplication()` | Get application info | | `createInvoice()` | Create Lightning invoice | | `payInvoice()` | Pay Lightning invoice | | `getLnurlPayInfo()` | Get LNURL-pay info for a user (enables Lightning Address/zaps) | | `sendEncryptedDM()` | Send Nostr DM (NIP-44) | | `publishNostrEvent()` | Publish Nostr event | | `registerMethod()` | Register RPC method | | `onPaymentReceived()` | Subscribe to payment callbacks | | `onNostrEvent()` | Subscribe to Nostr events | ## Test plan - [x] Review extension loader code for correctness - [x] Verify TypeScript compilation succeeds - [x] Test extension discovery from `src/extensions/` directory - [x] Test RPC method registration and routing - [x] Test database isolation between extensions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: boufni95 <boufni95@gmail.com> Co-authored-by: Patrick Mulligan <patjmulligan@protonmail.com> Reviewed-on: #3
56 KiB
NOSTR API DEFINITION
A nostr request will take the same parameter and give the same response as an http request, but it will use nostr as transport, to do that it will send encrypted events to the server public key, in the event 6 thing are required:
- rpcName: string containing the name of the method
- params: a map with the all the url params for the method
- query: a map with the the url query for the method
- body: the body of the method request
- requestId: id of the request to be able to get a response
The nostr server will send back a message response, and inside the body there will also be a requestId to identify the request this response is answering
NOSTR Methods
These are the nostr methods the client implements to communicate with the API via nostr
-
AddApp
- auth type: Admin
- input: AddAppRequest
- output: AuthApp
-
AddPeer
- auth type: Admin
- input: AddPeerRequest
- This methods has an empty response body
-
AddProduct
- auth type: User
- input: AddProductRequest
- output: Product
-
AddUserOffer
- auth type: User
- input: OfferConfig
- output: OfferId
-
AuthApp
- auth type: Admin
- input: AuthAppRequest
- output: AuthApp
-
AuthorizeManage
- auth type: User
- input: ManageAuthorizationRequest
- output: ManageAuthorization
-
BanDebit
- auth type: User
- input: DebitOperation
- This methods has an empty response body
-
BanUser
- auth type: Admin
- input: BanUserRequest
- output: BanUserResponse
-
BatchUser
- auth type: User
- This methods has an empty request body
- This methods has an empty response body
-
BumpTx
- auth type: Admin
- input: BumpTx
- This methods has an empty response body
-
CloseChannel
- auth type: Admin
- input: CloseChannelRequest
- output: CloseChannelResponse
-
CreateOneTimeInviteLink
- auth type: Admin
- input: CreateOneTimeInviteLinkRequest
- output: CreateOneTimeInviteLinkResponse
-
DecodeInvoice
- auth type: User
- input: DecodeInvoiceRequest
- output: DecodeInvoiceResponse
-
DeleteUserOffer
- auth type: User
- input: OfferId
- This methods has an empty response body
-
EditDebit
- auth type: User
- input: DebitAuthorizationRequest
- This methods has an empty response body
-
EnrollAdminToken
- auth type: User
- input: EnrollAdminTokenRequest
- This methods has an empty response body
-
EnrollMessagingToken
- auth type: User
- input: MessagingToken
- This methods has an empty response body
-
GetAdminInvoiceSwapQuotes
- auth type: Admin
- input: InvoiceSwapRequest
- output: InvoiceSwapQuoteList
-
GetAdminTransactionSwapQuotes
- auth type: Admin
- input: TransactionSwapRequest
- output: TransactionSwapQuoteList
-
GetAppsMetrics
- auth type: Metrics
- input: AppsMetricsRequest
- output: AppsMetrics
-
GetAssetsAndLiabilities
- auth type: Admin
- input: AssetsAndLiabilitiesReq
- output: AssetsAndLiabilities
-
GetBundleMetrics
- auth type: Metrics
- input: LatestBundleMetricReq
- output: BundleMetrics
-
GetDebitAuthorizations
- auth type: User
- This methods has an empty request body
- output: DebitAuthorizations
-
GetErrorStats
- auth type: Metrics
- This methods has an empty request body
- output: ErrorStats
-
GetHttpCreds
- auth type: User
- This methods has an empty request body
- output: HttpCreds
-
GetInviteLinkState
- auth type: Admin
- input: GetInviteTokenStateRequest
- output: GetInviteTokenStateResponse
-
GetLNURLChannelLink
- auth type: User
- This methods has an empty request body
- output: LnurlLinkResponse
-
GetLiveDebitRequests
- auth type: User
- This methods has an empty request body
- output: LiveDebitRequest
-
GetLiveManageRequests
- auth type: User
- This methods has an empty request body
- output: LiveManageRequest
-
GetLiveUserOperations
- auth type: User
- This methods has an empty request body
- output: LiveUserOperation
-
GetLndForwardingMetrics
- auth type: Metrics
- input: LndMetricsRequest
- output: LndForwardingMetrics
-
GetLndMetrics
- auth type: Metrics
- input: LndMetricsRequest
- output: LndMetrics
-
GetLnurlPayLink
- auth type: User
- This methods has an empty request body
- output: LnurlLinkResponse
-
GetLnurlWithdrawLink
- auth type: User
- This methods has an empty request body
- output: LnurlLinkResponse
-
GetManageAuthorizations
- auth type: User
- This methods has an empty request body
- output: ManageAuthorizations
-
GetMigrationUpdate
- auth type: User
- This methods has an empty request body
- output: MigrationUpdate
-
GetPaymentState
- auth type: User
- input: GetPaymentStateRequest
- output: PaymentState
-
GetProvidersDisruption
- auth type: Metrics
- This methods has an empty request body
- output: ProvidersDisruption
-
GetSeed
- auth type: Admin
- This methods has an empty request body
- output: LndSeed
-
GetSingleBundleMetrics
- auth type: Metrics
- input: SingleMetricReq
- output: BundleData
-
GetSingleUsageMetrics
- auth type: Metrics
- input: SingleMetricReq
- output: UsageMetricTlv
-
GetTransactionSwapQuotes
- auth type: User
- input: TransactionSwapRequest
- output: TransactionSwapQuoteList
-
GetUsageMetrics
- auth type: Metrics
- input: LatestUsageMetricReq
- output: UsageMetrics
-
GetUserInfo
- auth type: User
- This methods has an empty request body
- output: UserInfo
-
GetUserOffer
- auth type: User
- input: OfferId
- output: OfferConfig
-
GetUserOfferInvoices
- auth type: User
- input: GetUserOfferInvoicesReq
- output: OfferInvoices
-
GetUserOffers
- auth type: User
- This methods has an empty request body
- output: UserOffers
-
GetUserOperations
- auth type: User
- input: GetUserOperationsRequest
- output: GetUserOperationsResponse
-
LinkNPubThroughToken
- auth type: GuestWithPub
- input: LinkNPubThroughTokenRequest
- This methods has an empty response body
-
ListAdminInvoiceSwaps
- auth type: Admin
- This methods has an empty request body
- output: InvoiceSwapsList
-
ListAdminTxSwaps
- auth type: Admin
- This methods has an empty request body
- output: TxSwapsList
-
ListChannels
- auth type: Admin
- This methods has an empty request body
- output: LndChannels
-
ListTxSwaps
- auth type: User
- This methods has an empty request body
- output: TxSwapsList
-
LndGetInfo
- auth type: Admin
- input: LndGetInfoRequest
- output: LndGetInfoResponse
-
NewAddress
- auth type: User
- input: NewAddressRequest
- output: NewAddressResponse
-
NewInvoice
- auth type: User
- input: NewInvoiceRequest
- output: NewInvoiceResponse
-
NewProductInvoice
- auth type: User
- the request url query can take the following string items:
- id
- This methods has an empty request body
- output: NewInvoiceResponse
-
OpenChannel
- auth type: Admin
- input: OpenChannelRequest
- output: OpenChannelResponse
-
PayAddress
- auth type: User
- input: PayAddressRequest
- output: PayAddressResponse
-
PayAdminInvoiceSwap
- auth type: Admin
- input: PayAdminInvoiceSwapRequest
- output: AdminInvoiceSwapResponse
-
PayAdminTransactionSwap
- auth type: Admin
- input: PayAdminTransactionSwapRequest
- output: AdminTxSwapResponse
-
PayInvoice
- auth type: User
- input: PayInvoiceRequest
- output: PayInvoiceResponse
-
PingSubProcesses
- auth type: Metrics
- This methods has an empty request body
- This methods has an empty response body
-
RefundAdminInvoiceSwap
- auth type: Admin
- input: RefundAdminInvoiceSwapRequest
- output: AdminInvoiceSwapResponse
-
ResetDebit
- auth type: User
- input: DebitOperation
- This methods has an empty response body
-
ResetManage
- auth type: User
- input: ManageOperation
- This methods has an empty response body
-
ResetMetricsStorages
- auth type: Metrics
- This methods has an empty request body
- This methods has an empty response body
-
RespondToDebit
- auth type: User
- input: DebitResponse
- This methods has an empty response body
-
SubToWebRtcCandidates
- auth type: Metrics
- This methods has an empty request body
- output: WebRtcCandidate
-
SubmitWebRtcMessage
- auth type: Metrics
- input: WebRtcMessage
- output: WebRtcAnswer
-
UpdateCallbackUrl
- auth type: User
- input: CallbackUrl
- output: CallbackUrl
-
UpdateChannelPolicy
- auth type: Admin
- input: UpdateChannelPolicyRequest
- This methods has an empty response body
-
UpdateUserOffer
- auth type: User
- input: OfferConfig
- This methods has an empty response body
-
UseInviteLink
- auth type: GuestWithPub
- input: UseInviteLinkRequest
- This methods has an empty response body
-
UserHealth
- auth type: User
- This methods has an empty request body
- output: UserHealthState
-
ZipMetricsStorages
- auth type: Metrics
- This methods has an empty request body
- output: ZippedMetrics
HTTP API DEFINITION
Supported HTTP Auths
These are the supported http auth types, to give different type of access to the API users
-
Admin:
- expected context content
- admin_id: string
- expected context content
-
App:
- expected context content
- app_id: string
- expected context content
-
Guest:
- expected context content
-
GuestWithPub:
- expected context content
- app_id: string
- pub: string
- expected context content
-
Metrics:
- expected context content
- app_id: string
- operator_id: string
- expected context content
-
User:
- expected context content
- app_id: string
- app_user_id: string
- user_id: string
- expected context content
HTTP Methods
These are the http methods the client implements to communicate with the API
-
AddApp
- auth type: Admin
- http method: post
- http route: /api/admin/app/add
- input: AddAppRequest
- output: AuthApp
-
AddAppInvoice
- auth type: App
- http method: post
- http route: /api/app/add/invoice
- input: AddAppInvoiceRequest
- output: NewInvoiceResponse
-
AddAppUser
- auth type: App
- http method: post
- http route: /api/app/user/add
- input: AddAppUserRequest
- output: AppUser
-
AddAppUserInvoice
- auth type: App
- http method: post
- http route: /api/app/user/add/invoice
- input: AddAppUserInvoiceRequest
- output: NewInvoiceResponse
-
AddPeer
- auth type: Admin
- http method: post
- http route: /api/admin/peer
- input: AddPeerRequest
- This methods has an empty response body
-
AddProduct
- auth type: User
- http method: post
- http route: /api/user/product/add
- input: AddProductRequest
- output: Product
-
AddUserOffer
- auth type: User
- http method: post
- http route: /api/user/offer/add
- input: OfferConfig
- output: OfferId
-
AuthApp
- auth type: Admin
- http method: post
- http route: /api/admin/app/auth
- input: AuthAppRequest
- output: AuthApp
-
AuthorizeManage
- auth type: User
- http method: post
- http route: /api/user/manage/authorize
- input: ManageAuthorizationRequest
- output: ManageAuthorization
-
BanDebit
- auth type: User
- http method: post
- http route: /api/user/debit/ban
- input: DebitOperation
- This methods has an empty response body
-
BanUser
- auth type: Admin
- http method: post
- http route: /api/admin/user/ban
- input: BanUserRequest
- output: BanUserResponse
-
BatchUser
- auth type: User
- http method: post
- http route: /api/user/batch
- This methods has an empty request body
- This methods has an empty response body
-
BumpTx
- auth type: Admin
- http method: post
- http route: /api/admin/tx/bump
- input: BumpTx
- This methods has an empty response body
-
CloseChannel
- auth type: Admin
- http method: post
- http route: /api/admin/channel/close
- input: CloseChannelRequest
- output: CloseChannelResponse
-
CreateOneTimeInviteLink
- auth type: Admin
- http method: post
- http route: /api/admin/app/invite/create
- input: CreateOneTimeInviteLinkRequest
- output: CreateOneTimeInviteLinkResponse
-
DecodeInvoice
- auth type: User
- http method: post
- http route: /api/user/invoice/decode
- input: DecodeInvoiceRequest
- output: DecodeInvoiceResponse
-
DeleteUserOffer
- auth type: User
- http method: post
- http route: /api/user/offer/delete
- input: OfferId
- This methods has an empty response body
-
EditDebit
- auth type: User
- http method: post
- http route: /api/user/debit/edit
- input: DebitAuthorizationRequest
- This methods has an empty response body
-
EncryptionExchange
- auth type: Guest
- http method: post
- http route: /api/encryption/exchange
- input: EncryptionExchangeRequest
- This methods has an empty response body
-
EnrollAdminToken
- auth type: User
- http method: post
- http route: /api/guest/npub/enroll/admin
- input: EnrollAdminTokenRequest
- This methods has an empty response body
-
EnrollMessagingToken
- auth type: User
- http method: post
- http route: /api/user/messaging/enroll
- input: MessagingToken
- This methods has an empty response body
-
GetAdminInvoiceSwapQuotes
- auth type: Admin
- http method: post
- http route: /api/admin/swap/invoice/quote
- input: InvoiceSwapRequest
- output: InvoiceSwapQuoteList
-
GetAdminTransactionSwapQuotes
- auth type: Admin
- http method: post
- http route: /api/admin/swap/transaction/quote
- input: TransactionSwapRequest
- output: TransactionSwapQuoteList
-
GetApp
- auth type: App
- http method: post
- http route: /api/app/get
- This methods has an empty request body
- output: Application
-
GetAppUser
- auth type: App
- http method: post
- http route: /api/app/user/get
- input: GetAppUserRequest
- output: AppUser
-
GetAppUserLNURLInfo
- auth type: App
- http method: post
- http route: /api/app/user/lnurl/pay/info
- input: GetAppUserLNURLInfoRequest
- output: LnurlPayInfoResponse
-
GetAppsMetrics
- auth type: Metrics
- http method: post
- http route: /api/reports/apps
- input: AppsMetricsRequest
- output: AppsMetrics
-
GetAssetsAndLiabilities
- auth type: Admin
- http method: post
- http route: /api/admin/assets/liabilities
- input: AssetsAndLiabilitiesReq
- output: AssetsAndLiabilities
-
GetBundleMetrics
- auth type: Metrics
- http method: post
- http route: /api/reports/bundle
- input: LatestBundleMetricReq
- output: BundleMetrics
-
GetDebitAuthorizations
- auth type: User
- http method: get
- http route: /api/user/debit/get
- This methods has an empty request body
- output: DebitAuthorizations
-
GetErrorStats
- auth type: Metrics
- http method: post
- http route: /api/reports/errors
- This methods has an empty request body
- output: ErrorStats
-
GetHttpCreds
- auth type: User
- http method: post
- http route: /api/user/http_creds
- This methods has an empty request body
- output: HttpCreds
-
GetInviteLinkState
- auth type: Admin
- http method: post
- http route: /api/admin/app/invite/get
- input: GetInviteTokenStateRequest
- output: GetInviteTokenStateResponse
-
GetLNURLChannelLink
- auth type: User
- http method: post
- http route: /api/user/lnurl_channel/url
- This methods has an empty request body
- output: LnurlLinkResponse
-
GetLiveDebitRequests
- auth type: User
- http method: post
- http route: /api/user/debit/sub
- This methods has an empty request body
- output: LiveDebitRequest
-
GetLiveManageRequests
- auth type: User
- http method: post
- http route: /api/user/manage/sub
- This methods has an empty request body
- output: LiveManageRequest
-
GetLiveUserOperations
- auth type: User
- http method: post
- http route: /api/user/operations/sub
- This methods has an empty request body
- output: LiveUserOperation
-
GetLndForwardingMetrics
- auth type: Metrics
- http method: post
- http route: /api/reports/lnd/forwarding
- input: LndMetricsRequest
- output: LndForwardingMetrics
-
GetLndMetrics
- auth type: Metrics
- http method: post
- http route: /api/reports/lnd
- input: LndMetricsRequest
- output: LndMetrics
-
GetLnurlPayInfo
- auth type: Guest
- http method: get
- http route: /api/guest/lnurl_pay/info
- the request url query can take the following string items:
- k1
- This methods has an empty request body
- output: LnurlPayInfoResponse
-
GetLnurlPayLink
- auth type: User
- http method: get
- http route: /api/user/lnurl_pay/link
- This methods has an empty request body
- output: LnurlLinkResponse
-
GetLnurlWithdrawInfo
- auth type: Guest
- http method: get
- http route: /api/guest/lnurl_withdraw/info
- the request url query can take the following string items:
- k1
- This methods has an empty request body
- output: LnurlWithdrawInfoResponse
-
GetLnurlWithdrawLink
- auth type: User
- http method: get
- http route: /api/user/lnurl_withdraw/link
- This methods has an empty request body
- output: LnurlLinkResponse
-
GetManageAuthorizations
- auth type: User
- http method: get
- http route: /api/user/manage/get
- This methods has an empty request body
- output: ManageAuthorizations
-
GetMigrationUpdate
- auth type: User
- http method: post
- http route: /api/user/migrations/sub
- This methods has an empty request body
- output: MigrationUpdate
-
GetNPubLinkingState
- auth type: App
- http method: post
- http route: /api/app/user/npub/state
- input: GetNPubLinking
- output: NPubLinking
-
GetPaymentState
- auth type: User
- http method: post
- http route: /api/user/payment/state
- input: GetPaymentStateRequest
- output: PaymentState
-
GetProvidersDisruption
- auth type: Metrics
- http method: post
- http route: /api/metrics/providers/disruption
- This methods has an empty request body
- output: ProvidersDisruption
-
GetSeed
- auth type: Admin
- http method: get
- http route: /api/admin/seed
- This methods has an empty request body
- output: LndSeed
-
GetSingleBundleMetrics
- auth type: Metrics
- http method: post
- http route: /api/reports/bundle/single
- input: SingleMetricReq
- output: BundleData
-
GetSingleUsageMetrics
- auth type: Metrics
- http method: post
- http route: /api/reports/usage/single
- input: SingleMetricReq
- output: UsageMetricTlv
-
GetTransactionSwapQuotes
- auth type: User
- http method: post
- http route: /api/user/swap/transaction/quote
- input: TransactionSwapRequest
- output: TransactionSwapQuoteList
-
GetUsageMetrics
- auth type: Metrics
- http method: post
- http route: /api/reports/usage
- input: LatestUsageMetricReq
- output: UsageMetrics
-
GetUserInfo
- auth type: User
- http method: post
- http route: /api/user/info
- This methods has an empty request body
- output: UserInfo
-
GetUserOffer
- auth type: User
- http method: post
- http route: /api/user/offer/get
- input: OfferId
- output: OfferConfig
-
GetUserOfferInvoices
- auth type: User
- http method: post
- http route: /api/user/offer/get/invoices
- input: GetUserOfferInvoicesReq
- output: OfferInvoices
-
GetUserOffers
- auth type: User
- http method: get
- http route: /api/user/offers/get
- This methods has an empty request body
- output: UserOffers
-
GetUserOperations
- auth type: User
- http method: post
- http route: /api/user/operations
- input: GetUserOperationsRequest
- output: GetUserOperationsResponse
-
HandleLnurlAddress
- auth type: Guest
- http method: get
- http route: /.well-known/lnurlp/:address_name
- the request url params are the following string items:
- address_name
- This methods has an empty request body
- output: LnurlPayInfoResponse
-
HandleLnurlPay
- auth type: Guest
- http method: get
- http route: /api/guest/lnurl_pay/handle
- the request url query can take the following string items:
- amount
- k1
- lnurl
- nostr
- This methods has an empty request body
- output: HandleLnurlPayResponse
-
HandleLnurlWithdraw
- auth type: Guest
- http method: get
- http route: /api/guest/lnurl_withdraw/handle
- the request url query can take the following string items:
- k1
- pr
- This methods has an empty request body
- This methods has an empty response body
-
Health
- auth type: Guest
- http method: get
- http route: /api/health
- This methods has an empty request body
- This methods has an empty response body
-
LinkNPubThroughToken
- auth type: GuestWithPub
- http method: post
- http route: /api/guest/npub/link
- input: LinkNPubThroughTokenRequest
- This methods has an empty response body
-
ListAdminInvoiceSwaps
- auth type: Admin
- http method: post
- http route: /api/admin/swap/invoice/list
- This methods has an empty request body
- output: InvoiceSwapsList
-
ListAdminTxSwaps
- auth type: Admin
- http method: post
- http route: /api/admin/swap/transaction/list
- This methods has an empty request body
- output: TxSwapsList
-
ListChannels
- auth type: Admin
- http method: get
- http route: /api/admin/channels
- This methods has an empty request body
- output: LndChannels
-
ListTxSwaps
- auth type: User
- http method: post
- http route: /api/user/swap/transaction/list
- This methods has an empty request body
- output: TxSwapsList
-
LndGetInfo
- auth type: Admin
- http method: post
- http route: /api/admin/lnd/getinfo
- input: LndGetInfoRequest
- output: LndGetInfoResponse
-
NewAddress
- auth type: User
- http method: post
- http route: /api/user/chain/new
- input: NewAddressRequest
- output: NewAddressResponse
-
NewInvoice
- auth type: User
- http method: post
- http route: /api/user/invoice/new
- input: NewInvoiceRequest
- output: NewInvoiceResponse
-
NewProductInvoice
- auth type: User
- http method: get
- http route: /api/user/product/get/invoice
- the request url query can take the following string items:
- id
- This methods has an empty request body
- output: NewInvoiceResponse
-
OpenChannel
- auth type: Admin
- http method: post
- http route: /api/admin/channel/open
- input: OpenChannelRequest
- output: OpenChannelResponse
-
PayAddress
- auth type: User
- http method: post
- http route: /api/user/chain/pay
- input: PayAddressRequest
- output: PayAddressResponse
-
PayAdminInvoiceSwap
- auth type: Admin
- http method: post
- http route: /api/admin/swap/invoice/pay
- input: PayAdminInvoiceSwapRequest
- output: AdminInvoiceSwapResponse
-
PayAdminTransactionSwap
- auth type: Admin
- http method: post
- http route: /api/admin/swap/transaction/pay
- input: PayAdminTransactionSwapRequest
- output: AdminTxSwapResponse
-
PayAppUserInvoice
- auth type: App
- http method: post
- http route: /api/app/invoice/pay
- input: PayAppUserInvoiceRequest
- output: PayInvoiceResponse
-
PayInvoice
- auth type: User
- http method: post
- http route: /api/user/invoice/pay
- input: PayInvoiceRequest
- output: PayInvoiceResponse
-
PingSubProcesses
- auth type: Metrics
- http method: post
- http route: /api/metrics/ping
- This methods has an empty request body
- This methods has an empty response body
-
RefundAdminInvoiceSwap
- auth type: Admin
- http method: post
- http route: /api/admin/swap/invoice/refund
- input: RefundAdminInvoiceSwapRequest
- output: AdminInvoiceSwapResponse
-
RequestNPubLinkingToken
- auth type: App
- http method: post
- http route: /api/app/user/npub/token
- input: RequestNPubLinkingTokenRequest
- output: RequestNPubLinkingTokenResponse
-
ResetDebit
- auth type: User
- http method: post
- http route: /api/user/debit/reset
- input: DebitOperation
- This methods has an empty response body
-
ResetManage
- auth type: User
- http method: post
- http route: /api/user/manage/reset
- input: ManageOperation
- This methods has an empty response body
-
ResetMetricsStorages
- auth type: Metrics
- http method: post
- http route: /api/metrics/reset
- This methods has an empty request body
- This methods has an empty response body
-
ResetNPubLinkingToken
- auth type: App
- http method: post
- http route: /api/app/user/npub/token/reset
- input: RequestNPubLinkingTokenRequest
- output: RequestNPubLinkingTokenResponse
-
RespondToDebit
- auth type: User
- http method: post
- http route: /api/user/debit/finish
- input: DebitResponse
- This methods has an empty response body
-
SendAppUserToAppPayment
- auth type: App
- http method: post
- http route: /api/app/internal/pay
- input: SendAppUserToAppPaymentRequest
- This methods has an empty response body
-
SendAppUserToAppUserPayment
- auth type: App
- http method: post
- http route: /api/app/user/internal/pay
- input: SendAppUserToAppUserPaymentRequest
- This methods has an empty response body
-
SetMockAppBalance
- auth type: App
- http method: post
- http route: /api/app/mock/blance/set
- input: SetMockAppBalanceRequest
- This methods has an empty response body
-
SetMockAppUserBalance
- auth type: App
- http method: post
- http route: /api/app/mock/user/blance/set
- input: SetMockAppUserBalanceRequest
- This methods has an empty response body
-
SetMockInvoiceAsPaid
- auth type: Guest
- http method: post
- http route: /api/lnd/mock/invoice/paid
- input: SetMockInvoiceAsPaidRequest
- This methods has an empty response body
-
SubToWebRtcCandidates
- auth type: Metrics
- http method: post
- http route: /api/upgrade/wrtc/candidates
- This methods has an empty request body
- output: WebRtcCandidate
-
SubmitWebRtcMessage
- auth type: Metrics
- http method: post
- http route: /api/upgrade/wrtc
- input: WebRtcMessage
- output: WebRtcAnswer
-
UpdateCallbackUrl
- auth type: User
- http method: post
- http route: /api/user/cb/update
- input: CallbackUrl
- output: CallbackUrl
-
UpdateChannelPolicy
- auth type: Admin
- http method: post
- http route: /api/admin/channel/policy/update
- input: UpdateChannelPolicyRequest
- This methods has an empty response body
-
UpdateUserOffer
- auth type: User
- http method: post
- http route: /api/user/offer/update
- input: OfferConfig
- This methods has an empty response body
-
UseInviteLink
- auth type: GuestWithPub
- http method: post
- http route: /api/guest/invite
- input: UseInviteLinkRequest
- This methods has an empty response body
-
UserHealth
- auth type: User
- http method: post
- http route: /api/user/health
- This methods has an empty request body
- output: UserHealthState
-
ZipMetricsStorages
- auth type: Metrics
- http method: post
- http route: /api/metrics/zip
- This methods has an empty request body
- output: ZippedMetrics
INPUTS AND OUTPUTS
Messages
The content of requests and response from the methods
AddAppInvoiceRequest
- http_callback_url: string
- invoice_req: NewInvoiceRequest
- payer_identifier: string
AddAppRequest
- allow_user_creation: boolean
- name: string
AddAppUserInvoiceRequest
- http_callback_url: string
- invoice_req: NewInvoiceRequest
- offer_string: string *this field is optional
- payer_data: PayerData *this field is optional
- payer_identifier: string
- receiver_identifier: string
- rejectUnauthorized: boolean *this field is optional
- token: string *this field is optional
AddAppUserRequest
- balance: number
- fail_if_exists: boolean
- identifier: string
AddPeerRequest
- host: string
- port: number
- pubkey: string
AddProductRequest
- name: string
- price_sats: number
AdminInvoiceSwapResponse
- tx_id: string
AdminTxSwapResponse
- network_fee: number
- tx_id: string
AppMetrics
- app: Application
- available: number
- fees: number
- invoices: number
- operations: ARRAY of: UserOperation
- received: number
- spent: number
- total_fees: number
- users: UsersInfo
AppUsageMetrics
- app_metrics: MAP with key: string and value: UsageMetricTlv
AppUser
- identifier: string
- info: UserInfo
- max_withdrawable: number
Application
- balance: number
- id: string
- name: string
- npub: string
AppsMetrics
- apps: ARRAY of: AppMetrics
AppsMetricsRequest
- from_unix: number *this field is optional
- include_operations: boolean *this field is optional
- to_unix: number *this field is optional
AssetOperation
- amount: number
- tracked: TrackedOperation *this field is optional
- ts: number
AssetsAndLiabilities
- liquidity_providers: ARRAY of: LiquidityAssetProvider
- lnds: ARRAY of: LndAssetProvider
- users_balance: number
AssetsAndLiabilitiesReq
- limit_invoices: number *this field is optional
- limit_payments: number *this field is optional
- limit_providers: number *this field is optional
AuthApp
- app: Application
- auth_token: string
AuthAppRequest
- allow_user_creation: boolean *this field is optional
- name: string
BanUserRequest
- user_id: string
BanUserResponse
- balance_sats: number
- banned_app_users: ARRAY of: BannedAppUser
BannedAppUser
- app_id: string
- app_name: string
- nostr_pub: string
- user_identifier: string
BeaconData
- avatarUrl: string *this field is optional
- fees: CumulativeFees *this field is optional
- name: string
- nextRelay: string *this field is optional
- type: string
BumpTx
- output_index: number
- sat_per_vbyte: number
- txid: string
BundleData
- available_chunks: ARRAY of: number
- base_64_data: ARRAY of: string
- current_chunk: number
BundleMetric
- app_bundles: MAP with key: string and value: BundleData
BundleMetrics
- apps: MAP with key: string and value: BundleMetric
CallbackUrl
- url: string
ChannelPolicy
- base_fee_msat: number
- fee_rate_ppm: number
- max_htlc_msat: number
- min_htlc_msat: number
- timelock_delta: number
CloseChannelRequest
- force: boolean
- funding_txid: string
- output_index: number
- sat_per_v_byte: number
CloseChannelResponse
- closing_txid: string
ClosedChannel
- capacity: number
- channel_id: string
- close_tx_timestamp: number
- closed_height: number
ClosureMigration
- closes_at_unix: number
CreateOneTimeInviteLinkRequest
- sats: number *this field is optional
CreateOneTimeInviteLinkResponse
- invitation_link: string
CumulativeFees
- serviceFeeBps: number
- serviceFeeFloor: number
DebitAuthorization
- authorized: boolean
- debit_id: string
- npub: string
- rules: ARRAY of: DebitRule
DebitAuthorizationRequest
- authorize_npub: string
- request_id: string *this field is optional
- rules: ARRAY of: DebitRule
DebitAuthorizations
- debits: ARRAY of: DebitAuthorization
DebitExpirationRule
- expires_at_unix: number
DebitOperation
- npub: string
DebitResponse
- npub: string
- request_id: string
- response: DebitResponse_response
DebitRule
- rule: DebitRule_rule
DebitToAuthorize
- invoice: string *this field is optional
- rules: ARRAY of: DebitRule
DecodeInvoiceRequest
- invoice: string
DecodeInvoiceResponse
- amount: number
Empty
EncryptionExchangeRequest
- deviceId: string
- publicKey: string
EnrollAdminTokenRequest
- admin_token: string
ErrorStat
- errors: number
- from_unix: number
- total: number
ErrorStats
FrequencyRule
- amount: number
- interval: IntervalType
- number_of_intervals: number
GetAppUserLNURLInfoRequest
- base_url_override: string
- user_identifier: string
GetAppUserRequest
- user_identifier: string
GetInviteTokenStateRequest
- invite_token: string
GetInviteTokenStateResponse
- used: boolean
GetNPubLinking
- user_identifier: string
GetPaymentStateRequest
- invoice: string
GetProductBuyLinkResponse
- link: string
GetUserOfferInvoicesReq
- include_unpaid: boolean
- offer_id: string
GetUserOperationsRequest
- latestIncomingInvoice: OperationsCursor
- latestIncomingTx: OperationsCursor
- latestIncomingUserToUserPayment: OperationsCursor
- latestOutgoingInvoice: OperationsCursor
- latestOutgoingTx: OperationsCursor
- latestOutgoingUserToUserPayment: OperationsCursor
- max_size: number
GetUserOperationsResponse
- latestIncomingInvoiceOperations: UserOperations
- latestIncomingTxOperations: UserOperations
- latestIncomingUserToUserPayemnts: UserOperations
- latestOutgoingInvoiceOperations: UserOperations
- latestOutgoingTxOperations: UserOperations
- latestOutgoingUserToUserPayemnts: UserOperations
GraphPoint
- x: number
- y: number
HandleLnurlPayResponse
- pr: string
- routes: ARRAY of: Empty
HttpCreds
- token: string
- url: string
InvoiceSwapOperation
- completed_at_unix: number *this field is optional
- failure_reason: string *this field is optional
- operation_payment: UserOperation *this field is optional
- quote: InvoiceSwapQuote
- refund_address: string *this field is optional
- refund_at_unix: number *this field is optional
- refund_tx_id: string *this field is optional
InvoiceSwapQuote
- address: string
- chain_fee_sats: number
- expires_at_block_height: number
- invoice: string
- invoice_amount_sats: number
- paid_at_unix: number
- service_fee_sats: number
- service_url: string
- swap_fee_sats: number
- swap_operation_id: string
- transaction_amount_sats: number
- tx_id: string
InvoiceSwapQuoteList
- quotes: ARRAY of: InvoiceSwapQuote
InvoiceSwapRequest
- amount_sats: number
InvoiceSwapsList
- current_block_height: number
- swaps: ARRAY of: InvoiceSwapOperation
LatestBundleMetricReq
- limit: number *this field is optional
LatestUsageMetricReq
- limit: number *this field is optional
LinkNPubThroughTokenRequest
- token: string
LiquidityAssetProvider
- pubkey: string
- tracked: TrackedLiquidityProvider *this field is optional
LiveDebitRequest
- debit: LiveDebitRequest_debit
- npub: string
- request_id: string
LiveManageRequest
- npub: string
- request_id: string
LiveUserOperation
- latest_balance: number
- operation: UserOperation
LndAssetProvider
- pubkey: string
- tracked: TrackedLndProvider *this field is optional
LndChannels
- open_channels: ARRAY of: OpenChannel
LndForwardingEvent
- amt_in: number
- amt_out: number
- at_unix: number
- chan_id_in: string
- chan_id_out: string
- fee: number
LndForwardingMetrics
- events: ARRAY of: LndForwardingEvent
- total_fees: number
LndGetInfoRequest
- nodeId: number
LndGetInfoResponse
- alias: string
- synced_to_chain: boolean
- synced_to_graph: boolean
- watchdog_barking: boolean
LndMetrics
- nodes: ARRAY of: LndNodeMetrics
LndMetricsRequest
- from_unix: number *this field is optional
- to_unix: number *this field is optional
LndNodeMetrics
- chain_balance: ARRAY of: GraphPoint
- channel_balance: ARRAY of: GraphPoint
- closed_channels: ARRAY of: ClosedChannel
- closing_channels: number
- external_balance: ARRAY of: GraphPoint
- forwarding_events: number
- forwarding_fees: number
- offline_channels: number
- online_channels: number
- open_channels: ARRAY of: OpenChannel
- pending_channels: number
- root_ops: ARRAY of: RootOperation
LndSeed
- seed: ARRAY of: string
LnurlLinkResponse
- k1: string
- lnurl: string
LnurlPayInfoResponse
- allowsNostr: boolean
- callback: string
- maxSendable: number
- metadata: string
- minSendable: number
- nostrPubkey: string
- tag: string
LnurlWithdrawInfoResponse
- balanceCheck: string
- callback: string
- defaultDescription: string
- k1: string
- maxWithdrawable: number
- minWithdrawable: number
- payLink: string
- tag: string
ManageAuthorization
- authorized: boolean
- manage_id: string
- npub: string
ManageAuthorizationRequest
- authorize_npub: string
- ban: boolean
- request_id: string *this field is optional
ManageAuthorizations
- manages: ARRAY of: ManageAuthorization
ManageOperation
- npub: string
MessagingToken
- device_id: string
- firebase_messaging_token: string
MetricsFile
MigrationUpdate
- closure: ClosureMigration *this field is optional
- relays: RelaysMigration *this field is optional
NPubLinking
- state: NPubLinking_state
NewAddressRequest
- addressType: AddressType
NewAddressResponse
- address: string
NewInvoiceRequest
- amountSats: number
- blind: boolean *this field is optional
- expiry: number *this field is optional
- memo: string
- zap: string *this field is optional
NewInvoiceResponse
- invoice: string
OfferConfig
- blind: boolean *this field is optional
- callback_url: string
- createdAtUnix: number
- default_offer: boolean
- label: string
- noffer: string
- offer_id: string
- payer_data: ARRAY of: string
- price_sats: number
- rejectUnauthorized: boolean
- token: string
- updatedAtUnix: number
OfferId
- offer_id: string
OfferInvoice
- amount: number
- data: MAP with key: string and value: string
- invoice: string
- offer_id: string
- paid_at_unix: number
OfferInvoices
- invoices: ARRAY of: OfferInvoice
OpenChannel
- active: boolean
- capacity: number
- channel_id: string
- channel_point: string
- inactive_since_unix: number
- label: string
- lifetime: number
- local_balance: number
- policy: ChannelPolicy *this field is optional
- remote_balance: number
OpenChannelRequest
- close_address: string *this field is optional
- local_funding_amount: number
- node_pubkey: string
- push_sat: number *this field is optional
- sat_per_v_byte: number
OpenChannelResponse
- channel_id: string
OperationsCursor
- id: number
- ts: number
PayAddressRequest
- address: string
- amountSats: number
- satsPerVByte: number
- swap_operation_id: string *this field is optional
PayAddressResponse
- network_fee: number
- operation_id: string
- service_fee: number
- txId: string
PayAdminInvoiceSwapRequest
- no_claim: boolean *this field is optional
- sat_per_v_byte: number
- swap_operation_id: string
PayAdminTransactionSwapRequest
- address: string
- swap_operation_id: string
PayAppUserInvoiceRequest
- amount: number
- debit_npub: string *this field is optional
- expected_fees: CumulativeFees *this field is optional
- invoice: string
- user_identifier: string
PayInvoiceRequest
- amount: number
- debit_npub: string *this field is optional
- expected_fees: CumulativeFees *this field is optional
- invoice: string
PayInvoiceResponse
- amount_paid: number
- latest_balance: number
- network_fee: number
- operation_id: string
- preimage: string
- service_fee: number
PayerData
- data: MAP with key: string and value: string
PaymentState
- amount: number
- internal: boolean
- network_fee: number
- operation_id: string
- paid_at_unix: number
- service_fee: number
Product
- id: string
- name: string
- noffer: string
- price_sats: number
ProviderDisruption
- provider_pubkey: string
- provider_type: string
- since_unix: number
ProvidersDisruption
- disruptions: ARRAY of: ProviderDisruption
PushNotificationEnvelope
- app_npub_hex: string
- encrypted_payload: string
- topic_id: string
PushNotificationPayload
RefundAdminInvoiceSwapRequest
- sat_per_v_byte: number
- swap_operation_id: string
RelaysMigration
- relays: ARRAY of: string
RequestNPubLinkingTokenRequest
- user_identifier: string
RequestNPubLinkingTokenResponse
- token: string
RootOperation
- amount: number
- created_at_unix: number
- op_id: string
- op_type: OperationType
RoutingEvent
- event_type: string
- failure_string: string
- forward_fail_event: boolean
- incoming_amt_msat: number
- incoming_channel_id: number
- incoming_htlc_id: number
- offchain: boolean
- outgoing_amt_msat: number
- outgoing_channel_id: number
- outgoing_htlc_id: number
- settled: boolean
- timestamp_ns: number
SendAppUserToAppPaymentRequest
- amount: number
- from_user_identifier: string
SendAppUserToAppUserPaymentRequest
- amount: number
- from_user_identifier: string
- to_user_identifier: string
SetMockAppBalanceRequest
- amount: number
SetMockAppUserBalanceRequest
- amount: number
- user_identifier: string
SetMockInvoiceAsPaidRequest
- amount: number
- invoice: string
SingleMetricReq
- app_id: string
- metric_type: SingleMetricType
- metrics_name: string
- page: number
- request_id: number *this field is optional
TrackedLiquidityProvider
- balance: number
- invoices: ARRAY of: AssetOperation
- payments: ARRAY of: AssetOperation
TrackedLndProvider
- channels_balance: number
- confirmed_balance: number
- incoming_tx: ARRAY of: AssetOperation
- invoices: ARRAY of: AssetOperation
- outgoing_tx: ARRAY of: AssetOperation
- payments: ARRAY of: AssetOperation
- unconfirmed_balance: number
TrackedOperation
- amount: number
- ts: number
- type: TrackedOperationType
TransactionSwapQuote
- chain_fee_sats: number
- completed_at_unix: number
- expires_at_block_height: number
- invoice_amount_sats: number
- paid_at_unix: number
- service_fee_sats: number
- service_url: string
- swap_fee_sats: number
- swap_operation_id: string
- transaction_amount_sats: number
TransactionSwapQuoteList
- quotes: ARRAY of: TransactionSwapQuote
TransactionSwapRequest
- transaction_amount_sats: number
TxSwapOperation
- address_paid: string *this field is optional
- failure_reason: string *this field is optional
- operation_payment: UserOperation *this field is optional
- quote: TransactionSwapQuote
- tx_id: string *this field is optional
TxSwapsList
- swaps: ARRAY of: TxSwapOperation
UpdateChannelPolicyRequest
- policy: ChannelPolicy
- update: UpdateChannelPolicyRequest_update
UsageMetric
- app_id: string *this field is optional
- auth_in_nano: number
- batch: boolean
- batch_size: number
- handle_in_nano: number
- nostr: boolean
- parsed_in_nano: number
- processed_at_ms: number
- rpc_name: string
- success: boolean
- validate_in_nano: number
UsageMetricTlv
- available_chunks: ARRAY of: number
- base_64_tlvs: ARRAY of: string
- current_chunk: number
UsageMetrics
- apps: MAP with key: string and value: AppUsageMetrics
UseInviteLinkRequest
- invite_token: string
UserHealthState
- downtime_reason: string
UserInfo
- balance: number
- bridge_url: string
- callback_url: string
- max_withdrawable: number
- ndebit: string
- network_max_fee_bps: number
- network_max_fee_fixed: number
- nmanage: string
- noffer: string
- service_fee_bps: number
- topic_id: string
- userId: string
- user_identifier: string
UserOffers
- offers: ARRAY of: OfferConfig
UserOperation
- amount: number
- confirmed: boolean
- identifier: string
- inbound: boolean
- internal: boolean
- network_fee: number
- operationId: string
- paidAtUnix: number
- service_fee: number
- tx_hash: string
- type: UserOperationType
UserOperations
- fromIndex: OperationsCursor
- operations: ARRAY of: UserOperation
- toIndex: OperationsCursor
UsersInfo
- always_been_inactive: number
- balance_avg: number
- balance_median: number
- negative_balance: number
- no_balance: number
- total: number
WebRtcAnswer
- answer: string *this field is optional
WebRtcCandidate
- candidate: string
WebRtcMessage
- message: WebRtcMessage_message
ZippedMetrics
- path: string
Enums
The enumerators used in the messages
AddressType
- NESTED_PUBKEY_HASH
- TAPROOT_PUBKEY
- WITNESS_PUBKEY_HASH
IntervalType
- DAY
- MONTH
- WEEK
OperationType
- CHAIN_OP
- INVOICE_OP
SingleMetricType
- BUNDLE_METRIC
- USAGE_METRIC
TrackedOperationType
- ROOT
- USER
UserOperationType
- INCOMING_INVOICE
- INCOMING_TX
- INCOMING_USER_TO_USER
- OUTGOING_INVOICE
- OUTGOING_TX
- OUTGOING_USER_TO_USER