/** * Core type definitions for Pulse Protocol. * * Every detector returns a `DetectorResult`. Every scan returns a `Verdict`. * Verdicts are immutable and signed once published to the public feed. */ interface PulseConfig { /** Helius API key (free tier works). Get one at https://helius.xyz */ heliusApiKey: string; /** Twitter/X API key. Any compatible provider. */ xApiKey: string; /** Override the Solana RPC endpoint. Defaults to Helius. */ rpcUrl?: string; /** Override the public feed endpoint. Defaults to the official feed. */ feedUrl?: string; /** Optional ed25519 secret key (hex) for signing verdicts you publish. */ signingKey?: string; /** Fetch timeout in ms. Defaults to 30000. */ timeout?: number; /** Max retries on transient network failures. Defaults to 2. */ maxRetries?: number; } interface ScanInput { /** X / Twitter handle without the leading `@`. */ handle: string; /** Solana wallet address (base58). */ wallet: string; } interface ScanOptions { /** Do not publish the verdict to the public feed. Defaults to false. */ noPost?: boolean; /** Override the default verdict thresholds. */ thresholds?: { autonomous: number; hybrid: number; }; /** Per-detector weight overrides (useful for research). */ weights?: Partial>; /** Only run a subset of detectors. Defaults to all five. */ only?: DetectorName[]; } type VerdictKind = "AUTONOMOUS" | "HYBRID" | "HUMAN"; type DetectorName = "cadence" | "onchain" | "voice" | "timing" | "correlation"; interface DetectorResult { detector: DetectorName; score: number; samples: number; notes: string[]; runtime_ms: number; } interface SignalBundle { posting_cadence: number; onchain_cadence: number; voice_consistency: number; timing_anomalies: number; correlation: number; } interface Verdict { id: string; target: ScanInput; verdict: VerdictKind; confidence: number; aggregate_score: number; signals: SignalBundle; detectors: DetectorResult[]; scanned_at: number; version: string; } interface PublicVerdict extends Verdict { signature: string; commitment: string; posted_at: number; feed_url: string; } export type { DetectorResult as D, PulseConfig as P, ScanInput as S, Verdict as V, ScanOptions as a, PublicVerdict as b, SignalBundle as c, VerdictKind as d };