lint fix wip

This commit is contained in:
Nicolas Cantu 2026-01-06 16:37:26 +01:00
parent cc0f3816fa
commit 0e856d958e
7 changed files with 28 additions and 10 deletions

View File

@ -7,7 +7,7 @@ export function parseZapAmount(event: import('nostr-tools').Event): number {
return amountTag ? Math.floor(parseInt(amountTag, 10) / 1000) : 0
}
export function createZapReceiptSubscription(pool: import('nostr-tools').SimplePool, articlePubkey: string, articleId: string) {
export function createZapReceiptSubscription(pool: import('nostr-tools').SimplePool, articlePubkey: string, articleId: string): import('@/types/nostr-tools-extended').Subscription {
const filters = [
{
kinds: [9735],
@ -41,7 +41,7 @@ export function createZapReceiptPromise(
return new Promise((resolve) => {
let resolved = false
const finalize = (value: string | undefined) => {
const finalize = (value: string | undefined): void => {
if (resolved) {
return
}

View File

@ -100,7 +100,7 @@ export class PlatformTrackingService {
let resolved = false
const sub = createArticleDeliveriesSubscription(pool, articleId, this.platformPubkey)
const finalize = () => {
const finalize = (): void => {
if (resolved) {
return
}
@ -143,7 +143,7 @@ export class PlatformTrackingService {
let resolved = false
const sub = createRecipientDeliveriesSubscription(pool, recipientPubkey, this.platformPubkey)
const finalize = () => {
const finalize = (): void => {
if (resolved) {
return
}

View File

@ -38,7 +38,7 @@ export function parseTrackingEvent(event: Event): ContentDeliveryTracking | null
}
}
export function createArticleDeliveriesSubscription(pool: SimplePool, articleId: string, platformPubkey: string) {
export function createArticleDeliveriesSubscription(pool: SimplePool, articleId: string, platformPubkey: string): import('@/types/nostr-tools-extended').Subscription {
const filters = [
{
kinds: [getTrackingKind()],
@ -51,7 +51,7 @@ export function createArticleDeliveriesSubscription(pool: SimplePool, articleId:
return createSubscription(pool, [relayUrl], filters)
}
export function createRecipientDeliveriesSubscription(pool: SimplePool, recipientPubkey: string, platformPubkey: string) {
export function createRecipientDeliveriesSubscription(pool: SimplePool, recipientPubkey: string, platformPubkey: string): import('@/types/nostr-tools-extended').Subscription {
const filters = [
{
kinds: [getTrackingKind()],

View File

@ -1,7 +1,7 @@
import { getAlbyService } from './alby'
import type { ReviewRewardRequest } from './reviewRewardTypes'
export async function createReviewInvoice(split: { total: number; reviewer: number; platform: number }, request: ReviewRewardRequest) {
export async function createReviewInvoice(split: { total: number; reviewer: number; platform: number }, request: ReviewRewardRequest): Promise<import('@/types/alby').AlbyInvoice> {
const alby = getAlbyService()
await alby.enable()

View File

@ -23,7 +23,7 @@ export async function fetchOriginalReviewEvent(reviewId: string): Promise<Event
let resolved = false
const sub = createSubscription(pool, [relayUrl], filters)
const finalize = (value: Event | null) => {
const finalize = (value: Event | null): void => {
if (resolved) {
return
}

View File

@ -7,7 +7,15 @@ import { getPrimaryRelaySync } from './config'
import { MIN_EVENT_DATE } from './platformConfig'
import { parseObjectId } from './urlGenerator'
function buildReviewTipFilters(articleId?: string, reviewId?: string, authorPubkey?: string, reviewerPubkey?: string) {
function buildReviewTipFilters(articleId?: string, reviewId?: string, authorPubkey?: string, reviewerPubkey?: string): Array<{
kinds: number[]
since?: number
'#p'?: string[]
'#e'?: string[]
'#review_id'?: string[]
'#reviewer'?: string[]
'#kind_type'?: string[]
}> {
const filters: Array<{
kinds: number[]
since?: number

View File

@ -33,7 +33,17 @@ export function buildTrackingData(
authorMainnetAddress: string,
split: { total: number; authorSats: number; platformSats: number },
verification: { confirmed: boolean; confirmations: number }
) {
): {
transactionId: string
authorPubkey: string
authorMainnetAddress: string
amount: number
authorAmount: number
platformCommission: number
timestamp: number
confirmed: boolean
confirmations: number
} {
return {
transactionId,
authorPubkey,