@provablehq/sdk
Version:
A Software Development Kit (SDK) for Zero-Knowledge Transactions
48 lines (47 loc) • 2.09 kB
TypeScript
import { OwnedFilter } from "./ownedFilter.js";
/**
* Error thrown when a record scanner request fails (e.g. /register/encrypted).
* Includes HTTP status so callers can handle 422 vs 500 etc.
*/
export declare class RecordScannerRequestError extends Error {
readonly status: number;
constructor(message: string, status: number);
}
/** Error thrown when findCreditsRecord or findCreditsRecords is called but decryption is not enabled on the record scanner. */
export declare class DecryptionNotEnabledError extends Error {
readonly filter?: OwnedFilter;
constructor(message: string, filter?: OwnedFilter);
}
/** Error thrown when findCreditsRecord or findCreditsRecords is called but no view key for the UUID is stored in viewKeys or the account. */
export declare class ViewKeyNotStoredError extends Error {
readonly uuid?: string;
readonly filter?: OwnedFilter;
constructor(message: string, uuid?: string, filter?: OwnedFilter);
}
/** Error thrown when no record matches the supplied search filter (e.g. findCreditsRecord / findCreditsRecords). */
export declare class RecordNotFoundError extends Error {
readonly filter?: OwnedFilter;
constructor(message: string, filter?: OwnedFilter);
}
/** Error thrown when no UUID is configured, the UUID is invalid, or a record scanner request fails due to an invalid UUID/response. */
export declare class UUIDError extends Error {
readonly uuid?: string;
readonly filter?: OwnedFilter;
constructor(message: string, uuid?: string, filter?: OwnedFilter);
}
/** General error payload returned from record-scanner endpoints on failure. */
export interface RecordScannerErrorBody {
/** Raw error text returned by the service. */
message: string;
/** HTTP status code from the response. */
status: number;
}
/**
* Failure variant shared by record-scanner result types.
* Use with a success interface to form a discriminated union (e.g. Success | RecordScannerFailure).
*/
export interface RecordScannerFailure {
ok: false;
status: number;
error: RecordScannerErrorBody;
}