diff --git a/controllers/balance.ctrl.go b/controllers/balance.ctrl.go index 8aac71f..4fc1e64 100644 --- a/controllers/balance.ctrl.go +++ b/controllers/balance.ctrl.go @@ -1,10 +1,12 @@ package controllers import ( + "context" "net/http" "github.com/bumi/lndhub.go/lib" "github.com/labstack/echo/v4" + "github.com/lightningnetwork/lnd/lnrpc" ) // BalanceController : BalanceController struct @@ -14,6 +16,13 @@ type BalanceController struct{} func (BalanceController) Balance(c echo.Context) error { ctx := c.(*lib.LndhubContext) c.Logger().Warn(ctx.User.ID) + lndClient := *ctx.LndClient + getInfo, err := lndClient.GetInfo(context.TODO(), &lnrpc.GetInfoRequest{}) + if err != nil { + panic(err) + } + c.Logger().Infof("Connected to LND: %s - %s", getInfo.Alias, getInfo.IdentityPubkey) + return c.JSON(http.StatusOK, echo.Map{ "BTC": echo.Map{ "AvailableBalance": 1,