Skip to main content

LexeNodeRunApi

Trait LexeNodeRunApi 

Source
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§

Source

async fn status_run(&self, user_pk: UserPk) -> Result<Status, NodeApiError>

GET /lexe/status [UserPkStruct] -> Status

Source

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.

Source

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.

Source

async fn shutdown_run(&self, user_pk: UserPk) -> Result<Empty, NodeApiError>

GET /lexe/shutdown [UserPkStruct] -> Empty

Not to be confused with LexeMegaApi::shutdown_mega.

Source

async fn create_invoice( &self, req: CreateInvoiceRequest, ) -> Result<CreateInvoiceResponse, NodeApiError>

POST /lexe/create_invoice CreateInvoiceRequest -> CreateInvoiceResponse

Source

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.

Implementors§