mirror of
https://github.com/bumi/lntip
synced 2026-02-17 06:27:49 +00:00
Add endpoint to get ne onchain BTC address
This commit is contained in:
9
lnme.go
9
lnme.go
@@ -102,6 +102,15 @@ func main() {
|
||||
return c.JSON(http.StatusOK, invoice)
|
||||
})
|
||||
|
||||
e.POST("/v1/newaddress", func(c echo.Context) error {
|
||||
address, err := lnClient.NewAddress()
|
||||
if err != nil {
|
||||
stdOutLogger.Printf("Error getting a new BTC address: %s", err)
|
||||
return c.JSON(http.StatusInternalServerError, "Error getting address")
|
||||
}
|
||||
return c.JSON(http.StatusOK, address)
|
||||
})
|
||||
|
||||
e.GET("/v1/invoice/:invoiceId", func(c echo.Context) error {
|
||||
invoiceId := c.Param("invoiceId")
|
||||
invoice, err := lnClient.GetInvoice(invoiceId)
|
||||
|
||||
Reference in New Issue
Block a user