Accept TrustedEvent in zaps

This commit is contained in:
Jon Staab
2024-06-11 08:12:57 -07:00
parent 2da73989e4
commit 3696282a9f
+4 -4
View File
@@ -1,5 +1,5 @@
import type {Event} from 'nostr-tools'
import {hexToBech32} from '@welshman/lib' import {hexToBech32} from '@welshman/lib'
import type {TrustedEvent} from './Events'
import {Tags} from "./Tags" import {Tags} from "./Tags"
const DIVISORS = { const DIVISORS = {
@@ -81,12 +81,12 @@ export type Zapper = {
} }
export type Zap = { export type Zap = {
request: Event request: TrustedEvent
response: Event, response: TrustedEvent,
invoiceAmount: number invoiceAmount: number
} }
export const zapFromEvent = (response: Event, zapper: Zapper) => { export const zapFromEvent = (response: TrustedEvent, zapper: Zapper) => {
const responseMeta = Tags.fromEvent(response).asObject() const responseMeta = Tags.fromEvent(response).asObject()
let zap: Zap let zap: Zap