openvibe-sdk/trust

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

From types/trust.d.ts (browser build available). Declarations are shown verbatim.

type TrustAgeBand

export type TrustAgeBand = 'under_1h' | 'under_1d' | 'under_7d' | 'under_30d' | '30d_plus';

interface AccountTrustSignals

export interface AccountTrustSignals {
    kind: 'account';
    age_band: TrustAgeBand;
    account_age_hours: number;
    account_age_days: number;
    passkey: boolean;
    linked_accounts: number;
    active_30d: boolean;
    email_verified: boolean;
    verified: boolean;
    verified_by: Array<'passkey' | 'linked_account' | '30_days_active'>;
}

interface GuestTrustSignals

export interface GuestTrustSignals {
    kind: 'guest';
    age_band: TrustAgeBand;
    age_hours: number;
    age_days: number;
    sessions?: number;
    networks_seen: number;
    guests_from_same_networks_24h: number;
    banned?: boolean;
    restricted?: boolean;
    converted: boolean;
}

type TrustSignals

export type TrustSignals = AccountTrustSignals | GuestTrustSignals;

const AGE_BANDS

export declare const AGE_BANDS: readonly TrustAgeBand[];

interface TrustClient

export interface TrustClient {
    me(): Promise<TrustSignals>;
    of(subject: string): Promise<TrustSignals>;
}

function createTrustClient

export declare function createTrustClient(options: {
    networkUrl?: string;
    getToken: () => string | Promise<string>;
    fetchImpl?: (input: string, init?: { headers?: Record<string, string> }) => Promise<{ ok: boolean; status: number; json(): Promise<unknown> }>;
}): TrustClient;

function isNew

export declare function isNew(signals: TrustSignals, options: { hours: number }): boolean;

function atLeast

export declare function atLeast(signals: TrustSignals, band: TrustAgeBand): boolean;