SDK — API Reference
Primary Classes & Functions
PreFlightInterceptor
constructor(options: PreFlightInterceptorOptions)check(call: ContractCall): Promise<PreFlightDecision>— Returnsadmissible | blocked | undeterminedwithout broadcasting.assertAllowed(call: ContractCall): Promise<AdmissibleDecision>— Asserts call is allowed or throwsGuardBlockedError.
CostPreChecker
constructor(options: CostPreCheckerOptions)check(call: ContractCall): Promise<CostPreCheckResult>— Evaluates cost against ceilings without broadcasting.
GuardTelemetryListener
constructor(options: GuardTelemetryListenerOptions)watch(signal?: AbortSignal): AsyncIterable<GuardEventPage>— Tails live diagnostic and ledger events.
Utility Exports
policyToScVal(policy: GuardPolicy): xdr.ScVal— Serializes policy draft into Soroban ScVal struct.decodeCheckResult(val: xdr.ScVal): CheckResult— DecodesAllowedorBlocked(reason).explainReason(reason: string | number): string— Converts contract reason codes to human explanations.isDeadManFrozen(status: AccountStatus | null, policy: GuardPolicy | null): boolean— Evaluates heartbeat expiry status.
