/**
 * Nod Pass SDK for TypeScript / JavaScript — no dependencies. Node 18+, Deno, Bun and browsers.
 *
 *   import { Nod, Refused } from "./nodpass.mjs";
 *   const nod = new Nod({ key: "stk_..." });                 // booking system key
 *   try {
 *     const receipt = await nod.authoriseBooking({ nodId, agent: "atlas", counterparty: "courier9",
 *       action: "book freight", amount: 3950, ref: "FX-2291" });
 *     // place the booking only after a receipt
 *   } catch (e) { if (e instanceof Refused) console.log("don't book:", e.message); else throw e; }
 *
 *   const event = await Nod.verifyWebhook(secret, rawBody, req.headers["nod-signature"]);
 *
 * Docs: https://nodpass.org/docs
 */
export declare const VERSION = "1.0.0";
export declare class NodError extends Error {
    status: number;
    constructor(status: number, message: string);
}
/** Nod's rules refused the action (HTTP 403). Do not proceed. */
export declare class Refused extends NodError {
    constructor(message: string);
}
export interface Passport {
    agent_id: string;
    name: string;
    proof_of_authority: {
        acts_for: string;
        owner: string;
        owner_verified: boolean;
        verified_by: string | null;
        may: string[];
        limit: number | null;
        currency: string;
    };
    proof_of_performance: {
        confirmed_jobs: number;
        disputes: number;
        distinct_counterparties: number;
    };
    trust: {
        independent_confirmations: number;
        independent_companies: number;
        trust_score: number;
        flags: string[];
    };
    [k: string]: unknown;
}
export interface NodRequest {
    nod_id: string;
    status: "pending" | "nodded" | "declined";
    binding: string;
    auto_reason: string | null;
    expires: string;
}
export interface NodStatus {
    id: string;
    status: "pending" | "nodded" | "declined";
    ref: string;
    counterparty: string;
    amount: number;
    currency: string;
    action: string;
    decided_by: string | null;
    auto: number;
    used: number;
    expires: string;
    binding: string;
}
export interface Receipt {
    action_id: string;
    receipt: string;
}
export interface WebhookEvent {
    id: string;
    type: string;
    created: string;
    data: Record<string, unknown>;
}
export interface NodOptions {
    key?: string;
    base?: string;
    timeoutMs?: number;
}
export declare class Nod {
    readonly key?: string;
    readonly base: string;
    readonly timeoutMs: number;
    constructor(opts?: NodOptions);
    private call;
    passport(agentId: string): Promise<Passport>;
    agentCard(agentId: string): Promise<Record<string, unknown>>;
    verifyMessage(code: string): Promise<Record<string, unknown>>;
    ask(a: {
        counterparty: string;
        action: string;
        amount: number;
        ref: string;
        reason?: string;
        currency?: string;
    }): Promise<NodRequest>;
    nodStatus(nodId: string): Promise<NodStatus>;
    waitForNod(nodId: string, timeoutMs?: number, everyMs?: number): Promise<NodStatus>;
    mandate(nodId: string): Promise<Record<string, unknown>>;
    signMessage(m: {
        to: string;
        body: string;
        channel?: "email" | "call" | "message";
        subject?: string;
    }): Promise<Record<string, unknown>>;
    /** Call before placing an agent-made booking. Throws Refused unless it exactly matches an unused, nodded nod. */
    authoriseBooking(b: {
        nodId: string;
        agent: string;
        counterparty: string;
        action: string;
        amount: number;
        ref: string;
        currency?: string;
    }): Promise<Receipt>;
    /** type: placed (supplier's system) | delivered | disputed (receiving side). */
    reportOutcome(actionId: string, type: "placed" | "delivered" | "disputed" | "claimed_delivered", note?: string): Promise<{
        outcome_id: string;
        counts: boolean;
    }>;
    inbox(): Promise<Record<string, unknown>[]>;
    /** Check a Nod webhook. `body` must be the raw request body. Returns the event or throws. */
    static verifyWebhook(secret: string, body: string | Uint8Array, signatureHeader: string, toleranceSec?: number): Promise<WebhookEvent>;
}
