import type { Filter } from "./Filters.js"; import type { TrustedEvent, SignedEvent } from "./Events.js"; export declare const toMsats: (sats: number) => number; export declare const fromMsats: (msats: number) => number; export declare const hrpToMillisat: (hrpString: string) => bigint; export declare const getInvoiceAmount: (bolt11: string) => number; export declare const getLnUrl: (address: string) => string | undefined; export type Zapper = { lnurl: string; pubkey?: string; callback?: string; minSendable?: number; maxSendable?: number; nostrPubkey?: string; allowsNostr?: boolean; }; export type Zap = { request: TrustedEvent; response: TrustedEvent; invoiceAmount: number; }; export declare const zapFromEvent: (response: TrustedEvent, zapper: Zapper | undefined) => Zap | undefined; /** * A single recipient of an event's zaps, parsed from a NIP-57 Appendix G `zap` * tag of the form `["zap", , , ]`. */ export type ZapSplit = { pubkey: string; relay?: string; weight: number; }; export type ZapSplitAmount = ZapSplit & { amount: number; }; /** * Resolve an event's zap-split recipients per NIP-57 Appendix G: * * - With no `zap` tags the whole zap goes to the event's author. * - If no recipient carries a weight, the zap is split equally (weight 1 each). * - If weights are only partially present, unweighted recipients drop to weight * 0 (i.e. they should not be zapped). * * Weight-0 recipients are still returned so callers have the full recipient set; * they simply receive 0 from `splitZapAmount`. */ export declare const getZapSplits: (event: TrustedEvent) => ZapSplit[]; /** * Divide `total` (in any integer unit, e.g. millisats) across an event's * zap-split recipients proportionally to their weights. Any rounding remainder * is handed to the highest-weighted recipient so the parts sum back to exactly * `total`. If every weight is 0, nobody is zapped. */ export declare const splitZapAmount: (event: TrustedEvent, total: number) => ZapSplitAmount[]; export type ZapRequestParams = { msats: number; zapper: Zapper; pubkey: string; relays: string[]; content?: string; eventId?: string; anonymous?: boolean; }; export declare const makeZapRequest: ({ msats, zapper, pubkey, relays, content, eventId, anonymous, }: ZapRequestParams) => { kind: number; content: string; tags: string[][]; created_at: number; }; export type RequestInvoiceParams = { zapper: Zapper; event: SignedEvent; }; export declare const requestZap: ({ zapper, event }: RequestInvoiceParams) => Promise<{ invoice: any; error?: undefined; } | { error: any; invoice?: undefined; }>; export type ZapResponseFilterParams = { zapper: Zapper; pubkey: string; eventId?: string; }; export declare const getZapResponseFilter: ({ zapper, pubkey, eventId }: ZapResponseFilterParams) => Filter; //# sourceMappingURL=Zaps.d.ts.map