Skip to content

make Lnd properties public ?  #36

@Asone

Description

@Asone

As i'm digging into the lib i'm trying to figure out why the Lnd properties are no directly accessible and exposed through some kind of proxy methods instead.

For example :

lnd-rs/src/lib.rs

Lines 211 to 227 in d1595d1

pub async fn list_invoices(
&mut self,
pending_only: bool,
index_offset: u64,
num_max_invoices: u64,
reversed: bool,
) -> Result<ListInvoiceResponse, Status> {
self.lightning
.list_invoices(ListInvoiceRequest {
pending_only,
index_offset,
num_max_invoices,
reversed,
})
.await
.map(Response::into_inner)
}

would be exactly the same as writing some kind of :

        let list_invoice_request = ListInvoiceRequest{
            pending_only: true,
            index_offset: 0 as u64,
            num_max_invoices: u64,
            reversed: false
        };

        let list_invoice_response = mylndclient.lightning.list_invoices(list_invoice_request).await.unwrap().into_inner();

if the sub-clients were publicly accessible.

I do undestand that the proxy methods unwraps the result of the requests to provide with the inner response directly, however i feel like a limitation to not have access to the direct clients as it makes use of the client impossible for the methods that are not proxified.

Maybe those clients could be made public which does not appear incompatible to providing the proxy methods ?

PR Proposal here : #37

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions