Skip to content

Commit

Permalink
feat: add wallet balance to lnd wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Aug 18, 2023
1 parent ffa831a commit 6878c48
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions lnd/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
type LightningClientWrapper interface {
ListChannels(ctx context.Context, req *lnrpc.ListChannelsRequest, options ...grpc.CallOption) (*lnrpc.ListChannelsResponse, error)
SendPaymentSync(ctx context.Context, req *lnrpc.SendRequest, options ...grpc.CallOption) (*lnrpc.SendResponse, error)
WalletBalance(ctx context.Context, req *lnrpc.WalletBalanceRequest, options ...grpc.CallOption) (*lnrpc.WalletBalanceResponse, error)
AddInvoice(ctx context.Context, req *lnrpc.Invoice, options ...grpc.CallOption) (*lnrpc.AddInvoiceResponse, error)
SubscribeInvoices(ctx context.Context, req *lnrpc.InvoiceSubscription, options ...grpc.CallOption) (SubscribeInvoicesWrapper, error)
SubscribePayment(ctx context.Context, req *routerrpc.TrackPaymentRequest, options ...grpc.CallOption) (SubscribePaymentWrapper, error)
Expand Down
4 changes: 4 additions & 0 deletions lnd/lnd.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ func (wrapper *LNDWrapper) SendPaymentSync(ctx context.Context, req *lnrpc.SendR
return wrapper.client.SendPaymentSync(ctx, req, options...)
}

func (wrapper *LNDWrapper) WalletBalance(ctx context.Context, req *lnrpc.WalletBalanceRequest, options ...grpc.CallOption) (*lnrpc.WalletBalanceResponse, error) {
return wrapper.client.WalletBalance(ctx, req, options...)
}

func (wrapper *LNDWrapper) AddInvoice(ctx context.Context, req *lnrpc.Invoice, options ...grpc.CallOption) (*lnrpc.AddInvoiceResponse, error) {
return wrapper.client.AddInvoice(ctx, req, options...)
}
Expand Down
4 changes: 4 additions & 0 deletions lnd/lnd_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ func (cluster *LNDCluster) SendPaymentSync(ctx context.Context, req *lnrpc.SendR
return cluster.ActiveNode.SendPaymentSync(ctx, req, options...)
}

func (cluster *LNDCluster) WalletBalance(ctx context.Context, req *lnrpc.WalletBalanceRequest, options ...grpc.CallOption) (*lnrpc.WalletBalanceResponse, error) {
return cluster.ActiveNode.WalletBalance(ctx, req, options...)
}

func (cluster *LNDCluster) AddInvoice(ctx context.Context, req *lnrpc.Invoice, options ...grpc.CallOption) (*lnrpc.AddInvoiceResponse, error) {
return cluster.ActiveNode.AddInvoice(ctx, req, options...)
}
Expand Down

0 comments on commit 6878c48

Please sign in to comment.