Skip to content

Commit

Permalink
Update invoice.go
Browse files Browse the repository at this point in the history
  • Loading branch information
believethehype committed Mar 26, 2023
1 parent cb7e04e commit 6f4ee0a
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/nfnt/resize"

"github.com/fiatjaf/go-lnurl"
"github.com/fiatjaf/makeinvoice"
)

func metaData(params *Params) lnurl.Metadata {
Expand Down Expand Up @@ -82,42 +81,42 @@ func makeInvoice(
) (bolt11 string, err error) {
// prepare params

var backend makeinvoice.BackendParams
var backend BackendParams
switch params.Kind {
case "sparko":
backend = makeinvoice.SparkoParams{
backend = SparkoParams{
Host: params.Host,
Key: params.Key,
}
case "lnd":
backend = makeinvoice.LNDParams{
backend = LNDParams{
Host: params.Host,
Macaroon: params.Key,
}
case "lnbits":
backend = makeinvoice.LNBitsParams{
backend = LNBitsParams{
Host: params.Host,
Key: params.Key,
}
case "lnpay":
backend = makeinvoice.LNPayParams{
backend = LNPayParams{
PublicAccessKey: params.Pak,
WalletInvoiceKey: params.Waki,
}
case "eclair":
backend = makeinvoice.EclairParams{
backend = EclairParams{
Host: params.Host,
Password: "",
}
case "commando":
backend = makeinvoice.CommandoParams{
backend = CommandoParams{
Host: params.Host,
NodeId: params.NodeId,
Rune: params.Rune,
}
}

mip := makeinvoice.Params{
mip := LNParams{
Msatoshi: int64(msat),
Backend: backend,

Expand All @@ -142,7 +141,7 @@ func makeInvoice(
}

// actually generate the invoice
bolt11, err = makeinvoice.MakeInvoice(mip)
bolt11, err = MakeInvoice(mip)

log.Debug().Int("msatoshi", msat).
Interface("backend", backend).
Expand Down

0 comments on commit 6f4ee0a

Please sign in to comment.