Merge branch 'main' into payinvoice

* main:
  Correct style
  Add blank routes required for bluewallet
This commit is contained in:
Michael Bumann
2022-01-20 14:28:26 +01:00
3 changed files with 14 additions and 3 deletions

View File

@@ -29,3 +29,7 @@ func (controller *BlankController) GetPending(c echo.Context) error {
return c.JSON(http.StatusOK, &addresses)
}
func (controller *BlankController) Home(c echo.Context) error {
return c.JSON(http.StatusOK, "")
}

View File

@@ -3,7 +3,6 @@ package controllers
import (
"net/http"
"github.com/getAlby/lndhub.go/db/models"
"github.com/getAlby/lndhub.go/lib/service"
"github.com/labstack/echo/v4"
)
@@ -16,6 +15,12 @@ func NewGetTXSController(svc *service.LndhubService) *GetTXSController {
}
// GetTXS : Get TXS Controller
func (GetTXSController) GetTXS(c echo.Context) error {
return c.JSON(http.StatusOK, &models.Invoice{})
func (controller *GetTXSController) GetTXS(c echo.Context) error {
transactions := []string{}
return c.JSON(http.StatusOK, &transactions)
}
func (controller *GetTXSController) GetUserInvoices(c echo.Context) error {
transactions := []string{}
return c.JSON(http.StatusOK, &transactions)
}

View File

@@ -119,6 +119,7 @@ func main() {
secured.POST("/addinvoice", controllers.NewAddInvoiceController(svc).AddInvoice)
secured.POST("/payinvoice", controllers.NewPayInvoiceController(svc).PayInvoice)
secured.GET("/gettxs", controllers.NewGetTXSController(svc).GetTXS)
secured.GET("/getuserinvoices", controllers.NewGetTXSController(svc).GetUserInvoices)
secured.GET("/checkpayment/:payment_hash", controllers.NewCheckPaymentController(svc).CheckPayment)
secured.GET("/balance", controllers.NewBalanceController(svc).Balance)
secured.GET("/getinfo", controllers.NewGetInfoController(svc).GetInfo)
@@ -127,6 +128,7 @@ func main() {
blankController := controllers.NewBlankController(svc)
secured.GET("/getbtc", blankController.GetBtc)
secured.GET("/getpending", blankController.GetPending)
e.GET("/", blankController.Home)
// Start server
go func() {