62 lines
1.2 KiB
Go
62 lines
1.2 KiB
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 string `json:"msatoshi"`
|
|
Payreq string `json:"payreq"`
|
|
RHash string `json:"rhash"`
|
|
Status string `json:"status"`
|
|
QuotedCurrency string `json:"quoted_currency"`
|
|
QuotedAmount string `json:"quoted_amount"`
|
|
PaidAt time.Time `json:"paid_at"`
|
|
UploadId string `json:"upload_id"`
|
|
}
|