lnurl

package
v0.0.0-...-45fe538 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1
	// https://stackoverflow.com/a/201378
	USERNAME_VALIDATION_REGEX = "" /* 168-byte string literal not displayed */
	// https://www.rfc-editor.org/errata/eid1690
	MAX_USERNAME_LENGTH = 64
)

Variables

This section is empty.

Functions

func RegisterLnurlPayRouter

func RegisterLnurlPayRouter(router *mux.Router, rootURL *url.URL, store persist.Store, channel channel.WebhookChannel)

Types

type LnurlPayRouter

type LnurlPayRouter struct {
	// contains filtered or unexported fields
}

func (*LnurlPayRouter) HandleInvoice

func (l *LnurlPayRouter) HandleInvoice(w http.ResponseWriter, r *http.Request)

HandleInvoice handles the seconds request of lnurl pay protocol.

func (*LnurlPayRouter) HandleLnurlPay

func (l *LnurlPayRouter) HandleLnurlPay(w http.ResponseWriter, r *http.Request)

HandleLnurlPay handles the initial request of lnurl pay protocol.

func (*LnurlPayRouter) Register

func (s *LnurlPayRouter) Register(w http.ResponseWriter, r *http.Request)

Register adds a registration for a given pubkey and a unique identifier. The key enables the caller to replace existing hook without deleting it.

func (*LnurlPayRouter) Unregister

func (s *LnurlPayRouter) Unregister(w http.ResponseWriter, r *http.Request)

Unregister deletes a registration for a given pubkey and a unique identifier.

type LnurlPayStatus

type LnurlPayStatus struct {
	Status string `json:"status"`
	Reason string `json:"reason"`
}

func NewLnurlPayErrorResponse

func NewLnurlPayErrorResponse(reason string) LnurlPayStatus

func NewLnurlPayOkResponse

func NewLnurlPayOkResponse(reason string) LnurlPayStatus

type LnurlPayWebhookPayload

type LnurlPayWebhookPayload struct {
	Template string                 `json:"template"`
	Data     map[string]interface{} `json:"data"`
}

type RegisterLnurlPayRequest

type RegisterLnurlPayRequest struct {
	Username   *string `json:"username"`
	Time       int64   `json:"time"`
	WebhookUrl string  `json:"webhook_url"`
	Signature  string  `json:"signature"`
}

func (*RegisterLnurlPayRequest) Verify

func (w *RegisterLnurlPayRequest) Verify(pubkey string) error

type RegisterLnurlPayResponse

type RegisterLnurlPayResponse struct {
	Lnurl            string  `json:"lnurl"`
	LightningAddress *string `json:"lightning_address,omitempty"`
}

type UnregisterLnurlPayRequest

type UnregisterLnurlPayRequest struct {
	Time       int64  `json:"time"`
	WebhookUrl string `json:"webhook_url"`
	Signature  string `json:"signature"`
}

func (*UnregisterLnurlPayRequest) Verify

func (w *UnregisterLnurlPayRequest) Verify(pubkey string) error

Jump to

Keyboard shortcuts

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