Skip to content

Commit

Permalink
feat: implement get balance in lnd
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Aug 18, 2023
1 parent 090af16 commit 1f1cf85
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lnd.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ func (svc *LNDService) AuthHandler(c echo.Context) error {
}

func (svc *LNDService) GetBalance(ctx context.Context, senderPubkey string) (balance int64, err error) {
return 0, fmt.Errorf("not implemented")
resp, err := svc.client.WalletBalance(ctx, &lnrpc.WalletBalanceRequest{})

Check failure on line 45 in lnd.go

View workflow job for this annotation

GitHub Actions / build

svc.client.WalletBalance undefined (type *lnd.LNDWrapper has no field or method WalletBalance)

Check failure on line 45 in lnd.go

View workflow job for this annotation

GitHub Actions / build

svc.client.WalletBalance undefined (type *lnd.LNDWrapper has no field or method WalletBalance)
if err != nil {
return 0, err
}
return resp.TotalBalance, nil
}

func (svc *LNDService) MakeInvoice(ctx context.Context, senderPubkey string, amount int64, description string, descriptionHash string, expiry int64) (invoice string, paymentHash string, err error) {
Expand Down

0 comments on commit 1f1cf85

Please sign in to comment.