lnurl

package
v0.0.0-...-f7ac7ac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PayRequestTag  = "payRequest"
	Endpoint       = ".well-known/lnurlp"
	MinSendable    = 1000 // mSat
	MaxSendable    = 1_000_000_000
	CommentAllowed = 2000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Invoice

type Invoice struct {
	*telegram.Invoice
	Comment            string       `json:"comment"`
	User               *lnbits.User `json:"user"`
	CreatedAt          time.Time    `json:"created_at"`
	Paid               bool         `json:"paid"`
	PaidAt             time.Time    `json:"paid_at"`
	From               string       `json:"from"`
	Nip57Receipt       nostr.Event  `json:"nip57_receipt"`
	Nip57ReceiptRelays []string     `json:"nip57_receipt_relays"`
}

func (Invoice) Key

func (lnurlInvoice Invoice) Key() string

type LNURLPayParamsCustom

type LNURLPayParamsCustom struct {
	lnurl.LNURLResponse
	Callback        string               `json:"callback"`
	Tag             string               `json:"tag"`
	MaxSendable     int64                `json:"maxSendable"`
	MinSendable     int64                `json:"minSendable"`
	EncodedMetadata string               `json:"metadata"`
	CommentAllowed  int64                `json:"commentAllowed"`
	PayerData       *lnurl.PayerDataSpec `json:"payerData,omitempty"`
	AllowNostr      bool                 `json:"allowsNostr,omitempty"`
	NostrPubKey     string               `json:"nostrPubkey,omitempty"`
	Metadata        lnurl.Metadata       `json:"-"`
}

we have our custom LNURLPayParams response object here because we want to add nostr nip57 fields to it

type Lnurl

type Lnurl struct {
	WebhookServer string
	// contains filtered or unexported fields
}

func New

func New(bot *telegram.TipBot) Lnurl

func (Lnurl) DescriptionHash

func (w Lnurl) DescriptionHash(metadata lnurl.Metadata, payerData string) (string, error)

DescriptionHash is the SHA256 hash of the metadata

func (Lnurl) Handle

func (w Lnurl) Handle(writer http.ResponseWriter, request *http.Request)

func (Lnurl) Nip57DescriptionHash

func (w Lnurl) Nip57DescriptionHash(zapEventSerialized string) string

DescriptionHash is the SHA256 hash of the metadata

type NostrEvent

type NostrEvent struct {
	ID        string    `json:"id"`
	PubKey    string    `json:"pubkey"`
	CreatedAt time.Time `json:"created_at"`
	Kind      int       `json:"kind"`
	Tags      Tags      `json:"tags"`
	Content   string    `json:"content"`
	Sig       string    `json:"sig"`
}

type Tag

type Tag []string

type Tags

type Tags []Tag

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL