Skip to content

Welshman Docs / @welshman/domain / Zapper

Class: Zapper ​

Defined in: other/Zapper.ts:30

Constructors ​

Constructor ​

new Zapper(values): Zapper

Defined in: other/Zapper.ts:39

Parameters ​

values ​

ZapperValues

Returns ​

Zapper

Properties ​

allowsNostr? ​

optional allowsNostr: boolean

Defined in: other/Zapper.ts:37


callback? ​

optional callback: string

Defined in: other/Zapper.ts:34


lnurl ​

lnurl: string

Defined in: other/Zapper.ts:31


maxSendable? ​

optional maxSendable: number

Defined in: other/Zapper.ts:36


minSendable? ​

optional minSendable: number

Defined in: other/Zapper.ts:35


nostrPubkey ​

nostrPubkey: string

Defined in: other/Zapper.ts:33


pubkey ​

pubkey: string

Defined in: other/Zapper.ts:32

Methods ​

getResponseFilter() ​

getResponseFilter(pubkey, eventId?): Filter

Defined in: other/Zapper.ts:91

Parameters ​

pubkey ​

string

eventId? ​

string

Returns ​

Filter


validate() ​

validate(receipt): undefined | Zap

Defined in: other/Zapper.ts:56

Validate a parsed kind-9735 zap receipt against this zapper per NIP-57 and, if it checks out, return the reconstructed Zap. Returns undefined when the receipt is malformed or fails validation:

  • Missing/malformed zap request or bolt11 invoice
  • Invoice amount doesn't match the requested amount
  • Self-zap (request author is the zapper's own pubkey)
  • lnurl mismatch (if the request carried an lnurl tag)
  • Receipt not signed by the zapper's nostr pubkey

Parameters ​

receipt ​

ZapReceiptReader

Returns ​

undefined | Zap