- Intégration mempool.space pour vérification transactions Bitcoin : - Service MempoolSpaceService avec API mempool.space - Vérification sorties et montants pour sponsoring - Vérification confirmations - Attente confirmation avec polling - Récupération adresses Lightning depuis profils Nostr : - Service LightningAddressService - Support lud16 et lud06 (NIP-19) - Cache avec TTL 1 heure - Intégré dans paymentPolling et reviewReward - Mise à jour événements Nostr pour avis rémunérés : - Publication événement avec tags rewarded et reward_amount - Parsing tags dans parseReviewFromEvent - Vérification doublons - Tracking sponsoring sur Nostr : - Service SponsoringTrackingService - Événements avec commissions et confirmations - Intégration vérification mempool.space Toutes les fonctionnalités de split sont maintenant opérationnelles. Seuls les transferts Lightning réels nécessitent un nœud Lightning.
95 lines
2.2 KiB
TypeScript
95 lines
2.2 KiB
TypeScript
import type { Event } from 'nostr-tools'
|
|
|
|
export interface NostrProfile {
|
|
pubkey: string
|
|
name?: string
|
|
about?: string
|
|
picture?: string
|
|
nip05?: string
|
|
lud16?: string // Lightning address (user@domain.com)
|
|
lud06?: string // LNURL format
|
|
}
|
|
|
|
export type ArticleCategory = 'science-fiction' | 'scientific-research' | 'author-presentation'
|
|
|
|
export type KindType =
|
|
| 'article'
|
|
| 'series'
|
|
| 'review'
|
|
| 'purchase'
|
|
| 'review_tip'
|
|
| 'sponsoring'
|
|
|
|
export interface MediaRef {
|
|
url: string
|
|
type: 'image' | 'video'
|
|
}
|
|
|
|
export interface Article {
|
|
id: string
|
|
pubkey: string
|
|
title: string
|
|
preview: string
|
|
content: string
|
|
createdAt: number
|
|
zapAmount: number
|
|
paid: boolean
|
|
invoice?: string // BOLT11 invoice from event tags (if author created one)
|
|
paymentHash?: string // Payment hash from event tags
|
|
category?: ArticleCategory // Category of the article
|
|
isPresentation?: boolean // True if this is an author presentation article
|
|
mainnetAddress?: string // Bitcoin mainnet address for sponsoring (presentation articles only)
|
|
totalSponsoring?: number // Total sponsoring received in sats (presentation articles only)
|
|
authorPresentationId?: string // ID of the author's presentation article (for standard articles)
|
|
seriesId?: string // Series event id
|
|
bannerUrl?: string // NIP-95 banner
|
|
media?: MediaRef[] // Embedded media (NIP-95)
|
|
kindType?: KindType
|
|
}
|
|
|
|
export interface AuthorPresentationArticle extends Article {
|
|
category: 'author-presentation'
|
|
isPresentation: true
|
|
mainnetAddress: string
|
|
totalSponsoring: number
|
|
}
|
|
|
|
export interface Series {
|
|
id: string
|
|
pubkey: string
|
|
title: string
|
|
description: string
|
|
preview: string
|
|
coverUrl?: string
|
|
category: ArticleCategory
|
|
totalSponsoring?: number
|
|
totalPayments?: number
|
|
kindType?: KindType
|
|
}
|
|
|
|
export interface Review {
|
|
id: string
|
|
articleId: string
|
|
authorPubkey: string
|
|
reviewerPubkey: string
|
|
content: string
|
|
createdAt: number
|
|
title?: string
|
|
rewarded?: boolean
|
|
rewardAmount?: number
|
|
kindType?: KindType
|
|
}
|
|
|
|
export interface ZapRequest {
|
|
event: Event
|
|
amount: number
|
|
targetPubkey: string
|
|
targetEventId?: string
|
|
}
|
|
|
|
export interface NostrConnectState {
|
|
connected: boolean
|
|
pubkey: string | null
|
|
profile: NostrProfile | null
|
|
}
|