Skip to content

Commit

Permalink
feat: get_transacitons method
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzolfm committed Oct 19, 2024
1 parent 87c367f commit 71bce71
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ fn main() -> Result<(), std::io::Error> {
tonic_build::configure()
.build_server(false)
.out_dir(BUILD_DIR)
.compile(PROTOS, &[PROTOS_NS])
.compile_protos(PROTOS, &[PROTOS_NS])
}
25 changes: 20 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ use gen::{
lightning_client::LightningClient, AddInvoiceResponse, ChannelAcceptRequest,
ChannelAcceptResponse, ChannelBalanceRequest, ChannelBalanceResponse, CloseChannelRequest,
CloseStatusUpdate, ClosedChannelsRequest, ClosedChannelsResponse, ForwardingHistoryRequest,
ForwardingHistoryResponse, GetInfoRequest, GetInfoResponse, Invoice, ListChannelsRequest,
ListChannelsResponse, ListInvoiceRequest, ListInvoiceResponse, ListPaymentsRequest,
ListPaymentsResponse, NewAddressRequest, NewAddressResponse, PayReq, PayReqString, Payment,
PendingChannelsRequest, PendingChannelsResponse, SendCoinsRequest, SendCoinsResponse,
SendRequest, SendResponse, WalletBalanceRequest, WalletBalanceResponse,
ForwardingHistoryResponse, GetInfoRequest, GetInfoResponse, GetTransactionsRequest,
Invoice, ListChannelsRequest, ListChannelsResponse, ListInvoiceRequest,
ListInvoiceResponse, ListPaymentsRequest, ListPaymentsResponse, NewAddressRequest,
NewAddressResponse, PayReq, PayReqString, Payment, PendingChannelsRequest,
PendingChannelsResponse, SendCoinsRequest, SendCoinsResponse, SendRequest, SendResponse,
TransactionDetails, WalletBalanceRequest, WalletBalanceResponse,
},
routerrpc::{router_client::RouterClient, SendPaymentRequest, TrackPaymentRequest},
};
Expand Down Expand Up @@ -436,6 +437,20 @@ impl Lnd {
.await
.map(Response::into_inner)
}

pub async fn get_transactions(
&self,
req: GetTransactionsRequest,
) -> Result<TransactionDetails, Status> {
let span = span!(self.tracer => "lnrpc". "Lightning" / "GetTransactions");

self.lightning
.clone()
.get_transactions(req)
.with_context(opentelemetry::Context::current_with_span(span))
.await
.map(Response::into_inner)
}
}

impl Lnd {
Expand Down

0 comments on commit 71bce71

Please sign in to comment.