/** * fw-gate-sdk — Flying Whale Gate SDK * Drop-in module for any bot. 50 lines. Zero dependencies. * * Usage: * import { evaluate, guard, badge, verify } from './fw-gate-sdk'; * * const gate = await evaluate({ pair, action, amount, caller_id }, signedTx); * if (!guard(gate)) return; // aborts if non_executable * console.log(badge(gate)); // "✅ FW Gate: viable (88%) → /gate/verify/fw-gate-xxxx" */ export declare const FW_GATE_URL = "https://fwgate.io"; export interface GateResult { gate_id: string; gate_verdict: 'viable' | 'degraded' | 'non_executable'; execution_feasibility: number; risk: 'low' | 'medium' | 'high' | 'critical'; confidence: number; reason: string; regime: string; timestamp: number; data_quality: string; verify_url: string; note: string; certificate: { gate_id: string; execution_feasibility: number; cert_hash: string; legal: string; evaluation: { gate_verdict: string; risk_score: number; viability: string; confidence: number; }; }; } export interface GateParams { pair: string; action: string; amount: number; venue?: string; caller_id: string; } /** * Evaluate execution feasibility before any trade. * Costs 1000 μSTX. Returns a signed GateCertificate. * * @param params - Trade intent (pair, action, amount, caller_id) * @param payment - Signed STX tx hex (X-PAYMENT) OR base64 PaymentPayloadV2 (payment-signature) * @param headerType - Which x402 header format to use (default: 'x-payment') */ export declare function evaluate(params: GateParams, payment: string, headerType?: 'x-payment' | 'payment-signature'): Promise; /** * Verify any certificate — FREE, public. * Use after storing cert_hash with trade record. */ export declare function verify(gateId: string): Promise<{ gate_id: string; authentic: boolean; expired: boolean; certificate: GateResult['certificate']; }>; /** * Decision gate — returns true = proceed, false = halt. * Drop before any execution call. */ export declare function guard(result: GateResult, options?: { minFeasibility?: number; onNonExecutable?: (r: GateResult) => void; onDegraded?: (r: GateResult) => void; }): boolean; /** One-line badge for bot output / logs */ export declare function badge(result: GateResult): string; /** Structured audit record — attach to every trade */ export declare function auditRecord(result: GateResult): Record; /** Register your bot once — free. Shows up in /gate/stats as active integration. */ export declare function register(params: { name: string; caller_id: string; type?: 'bot' | 'protocol' | 'router' | 'dex_bot' | 'risk-module' | 'other'; description?: string; risk_profile?: 'aggressive' | 'moderate' | 'conservative'; }): Promise<{ integration_id: string; message: string; }>; //# sourceMappingURL=fw-gate-sdk.d.ts.map