pub trait LexeNodeRunApi {
// Required methods
async fn status_run(&self, user_pk: UserPk) -> Result<Status, NodeApiError>;
async fn resync(&self, req: ResyncRequest) -> Result<Empty, NodeApiError>;
async fn test_event(&self, op: &TestEventOp) -> Result<Empty, NodeApiError>;
async fn shutdown_run(&self, user_pk: UserPk) -> Result<Empty, NodeApiError>;
async fn create_invoice(
&self,
req: CreateInvoiceRequest,
) -> Result<CreateInvoiceResponse, NodeApiError>;
async fn nwc_request(
&self,
req: NwcRequest,
) -> Result<NostrSignedEvent, NodeApiError>;
}Expand description
Defines the API the node exposes to the Lexe operators at run time.
NOTE: For performance, this API does not use TLS! This API should only contain methods for limited operational and lifecycle management endpoints.
Required Methods§
Sourceasync fn status_run(&self, user_pk: UserPk) -> Result<Status, NodeApiError>
async fn status_run(&self, user_pk: UserPk) -> Result<Status, NodeApiError>
GET /lexe/status [UserPkStruct] -> Status
Sourceasync fn resync(&self, req: ResyncRequest) -> Result<Empty, NodeApiError>
async fn resync(&self, req: ResyncRequest) -> Result<Empty, NodeApiError>
POST /lexe/resync ResyncRequest -> Empty
Triggers an immediate resync of BDK and LDK. Optionally full sync the BDK wallet. Returns only once sync has either completed or timed out.
Sourceasync fn test_event(&self, op: &TestEventOp) -> Result<Empty, NodeApiError>
async fn test_event(&self, op: &TestEventOp) -> Result<Empty, NodeApiError>
POST /lexe/test_event TestEventOp -> Empty
Calls the corresponding TestEventReceiver method.
This endpoint can only be called by one caller at any one time.
Does nothing and returns an error if called in prod.
Sourceasync fn shutdown_run(&self, user_pk: UserPk) -> Result<Empty, NodeApiError>
async fn shutdown_run(&self, user_pk: UserPk) -> Result<Empty, NodeApiError>
GET /lexe/shutdown [UserPkStruct] -> Empty
Not to be confused with LexeMegaApi::shutdown_mega.
Sourceasync fn create_invoice(
&self,
req: CreateInvoiceRequest,
) -> Result<CreateInvoiceResponse, NodeApiError>
async fn create_invoice( &self, req: CreateInvoiceRequest, ) -> Result<CreateInvoiceResponse, NodeApiError>
POST /lexe/create_invoice CreateInvoiceRequest ->
CreateInvoiceResponse
Sourceasync fn nwc_request(
&self,
req: NwcRequest,
) -> Result<NostrSignedEvent, NodeApiError>
async fn nwc_request( &self, req: NwcRequest, ) -> Result<NostrSignedEvent, NodeApiError>
POST /lexe/nwc_request NwcRequest -> NostrSignedEvent
Processes an encrypted NWC request from the nostr-bridge. The node will decrypt the request, execute the command, and return an encrypted response.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.