sigit.io/src/types/relay.ts

233 lines
5.1 KiB
TypeScript

export interface RelaySet {
read: string[]
write: string[]
}
export type RelayMap = {
[key: string]: {
read: boolean
write: boolean
}
}
export interface RelayStats {
relays: number
pubKeys: number
users: number
trusted_users: number
events: number
posts: number
zaps: number
zap_amount: number
daily: RelayDailyStats
daily_totals: RelayDailyTotals
relay_stats: RelayStats
}
export interface RelayStats {
user_picks: RelayUserPicksStats
written: RelayWrittenStats
}
export interface RelayWrittenStats {
last_week: RelayLastWeekStats[]
}
export interface RelayLastWeekStats {
d: string
p: number
ps: number
e: number
es: number
}
export interface RelayUserPicksStats {
read_relays: RelayReadStats[]
write_relays: RelayReadStats[]
}
export interface RelayReadStats {
d: string
r: number
w: number
rs: number
ws: number
}
export interface RelayDailyTotals {
datasets: RelayDailyTotalStatsDataset
}
export interface RelayDailyTotalStatsDataset {
kind_0: RelayItemStats[]
kind_1: RelayItemStats[]
kind_2: RelayItemStats[]
kind_3: RelayItemStats[]
kind_5: RelayItemStats[]
kind_6: RelayItemStats[]
kind_7: RelayItemStats[]
kind_1984: RelayItemStats[]
kind_9735: RelayItemStats[]
kind_1063: RelayItemStats[]
kind_6969: RelayItemStats[]
kind_9802: RelayItemStats[]
kind_30000: RelayItemStats[]
kind_30001: RelayItemStats[]
kind_30008: RelayItemStats[]
kind_30009: RelayItemStats[]
kind_30017: RelayItemStats[]
kind_30018: RelayItemStats[]
kind_30023: RelayItemStats[]
kind_31337: RelayItemStats[]
totals: RelayItemStats[]
new_profiles: RelayItemStats[]
new_pubkeys: RelayItemStats[]
new_contact_lists: RelayItemStats[]
new_ln: RelayItemStats[]
new_users: RelayItemStats[]
total_zap_amount: RelayItemStats[]
zappers: RelayItemStats[]
zapped_pubkeys: RelayItemStats[]
zapped_events: RelayItemStats[]
zap_providers: RelayItemStats[]
}
export interface RelayDailyStats {
datasets: RelayDailyStatsDataset
}
export interface RelayDailyStatsDataset {
kind_0: RelayItemStats[]
kind_1: RelayItemStats[]
kind_2: RelayItemStats[]
kind_3: RelayItemStats[]
kind_5: RelayItemStats[]
kind_6: RelayItemStats[]
kind_7: RelayItemStats[]
kind_1984: RelayItemStats[]
kind_9735: RelayItemStats[]
kind_1063: RelayItemStats[]
kind_6969: RelayItemStats[]
kind_9802: RelayItemStats[]
kind_30000: RelayItemStats[]
kind_30001: RelayItemStats[]
kind_30008: RelayItemStats[]
kind_30009: RelayItemStats[]
kind_30017: RelayItemStats[]
kind_30018: RelayItemStats[]
kind_30023: RelayItemStats[]
kind_31337: RelayItemStats[]
totals: RelayItemStats[]
new_profiles: RelayItemStats[]
new_pubkeys: RelayItemStats[]
new_contact_lists: RelayItemStats[]
new_ln: RelayItemStats[]
new_users: RelayItemStats[]
max_zap_amount: RelayItemStats[]
avg_zap_amount: RelayItemStats[]
total_zap_amount: RelayItemStats[]
active_pubkeys: RelayItemStats[]
active_pubkeys_total: RelayItemStats[]
active_pubkeys_week: RelayItemStats[]
active_pubkeys_total_week: RelayItemStats[]
active_relays: RelayItemStats[]
zappers: RelayItemStats[]
zapped_pubkeys: RelayItemStats[]
zapped_events: RelayItemStats[]
zap_providers: RelayItemStats[]
retention: RelayRetentionStats
}
export interface RelayRetentionStats {
all: RelayRetentionAll[]
tr: RelayRetentionAll[]
bio: RelayRetentionAll[]
all_curves: RelayRetentionAllCurve[]
tr_curves: RelayRetentionAllCurve[]
bio_curves: RelayRetentionAllCurve[]
}
export interface RelayRetentionAllCurve {
day: number
'2023-02': number
'2023-03': number
'2023-04': number
'2023-05': number
'2023-06': number
'2023-07': number
}
export interface RelayRetentionAll {
d: string
signups: number
retained: number
retd_posts: number
retd_replies: number
retd_reposts: number
retd_likes: number
retd_liked: number
retd_liked_pubkeys: number
retd_replied: number
retd_replied_pubkeys: number
retd_zaps_received: number
retd_zaps_received_msats: number
retd_zaps_sent: number
retd_zaps_sent_msats: number
retd_following: number
retd_followers: number
lost_posts: number
lost_replies: number
lost_reposts: number
lost_likes: number
lost_liked: number
lost_liked_pubkeys: number
lost_replied: number
lost_replied_pubkeys: number
lost_zaps_received: number
lost_zaps_received_msats: number
lost_zaps_sent: number
lost_zaps_sent_msats: number
lost_following: number
lost_followers: number
}
export interface RelayItemStats {
d: string // date
c: number // count
}
export interface RelayFee {
amount: number
unit: string
}
export interface RelayInfo {
name: string
description: string
pubkey: string
contact: string
supported_nips: number[]
software: string
version: string
limitation?: { [key: string]: number | boolean }
fees?: { [key: string]: RelayFee[] }
}
export interface RelayInfoObject {
[key: string]: RelayInfo
}
export interface RelayInfoItem {
uri: string
info: RelayInfo
}
export enum RelayConnectionState {
Connected = 'Connected',
NotConnected = 'Failed to connect'
}
export interface RelayConnectionStatus {
[key: string]: RelayConnectionState
}