zaply/lightning/lightning.go

23 lines
594 B
Go
Raw Normal View History

2024-12-26 22:46:18 +00:00
package lightning
2024-12-27 00:52:47 +00:00
import "time"
type PaymentRequest string
2024-12-26 22:46:18 +00:00
type Lightning interface {
2024-12-27 00:52:47 +00:00
CreateInvoice(msats int64, description string) (PaymentRequest, error)
GetInvoice(paymentHash string) (*Invoice, error)
2024-12-27 02:54:09 +00:00
IncomingPayments() chan *Invoice
2024-12-27 00:52:47 +00:00
}
type Invoice struct {
2024-12-27 02:54:09 +00:00
PaymentHash string `json:"paymentHash"`
Preimage string `json:"preimage"`
Msats int64 `json:"msats"`
Description string `json:"description"`
PaymentRequest string `json:"paymentRequest"`
CreatedAt time.Time `json:"createdAt"`
ConfirmedAt time.Time `json:"confirmedAt"`
2024-12-26 22:46:18 +00:00
}