You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bit4sat/ln/invoice.go

59 lines
1020 B
Go

package ln
import (
"time"
)
type Currency int
const (
CurMSat Currency = iota
CurSat
CurBTC
CurUSD
CurEur
)
const (
LNChargeAPIEnv = "LN_CHARGE_API"
LNChargeTokenEnv = "LN_CHARGE_TOKEN"
InfoEndpoint = "info"
InvoiceEndpoint = "invoice"
PollInvoiceEndpoint = "invoice"
)
var (
LNCEndpoint string
LNChargeToken string
)
var (
CurrencyString = map[Currency]string{
CurUSD: "USD",
CurSat: "SAT",
CurBTC: "BTC",
CurMSat: "MSAT",
CurEur: "EUR",
}
CurrencyID = map[string]Currency{
"USD": CurUSD,
"SAT": CurSat,
"MSAT": CurMSat,
"BTC": CurBTC,
"EUR": CurEur,
}
)
type Invoice struct {
Id string `json:"id"`
CreatedAt time.Time `json:"created_at"`
Description string `json:"description"`
ExpiresAt time.Time `json:"expires_at"`
Msatoshi int `json:"msatoshi"`
Payreq string `json:"payreq"`
RHash string `json:"r_hash"`
Status string `json:"status"`
UploadId string `json:"upload_id"`
}