/** * Candid type definitions for ICP canister interaction. * These types match the canister interface (snake_case) and are internal implementation details. * * @remarks * Most SDK consumers should not import this module directly. Use {@link StealthCanisterClient} * and the higher-level operations in `src/operations/*`. */ import { ActorMethod } from "@dfinity/agent"; import type { CanisterResult } from "./types.js"; export type KeyManagerActor = { get_view_public_key: ActorMethod<[Uint8Array], CanisterResult>; request_encrypted_view_key: ActorMethod<[ EncryptedViewKeyRequestCandid ], CanisterResult>; get_max_nonce: ActorMethod<[Uint8Array], CanisterResult>; }; export type StorageActor = { submit_announcement: ActorMethod<[AnnouncementInputCandid], CanisterResult>; submit_invoice: ActorMethod<[InvoiceSubmissionCandid], CanisterResult>; list_invoices: ActorMethod<[Uint8Array, string], CanisterResult>; list_announcements: ActorMethod<[[] | [bigint], [] | [number], string], AnnouncementPageCandid>; list_announcements_by_time: ActorMethod<[ [] | [bigint], [] | [number], string ], AnnouncementPageByTimeCandid>; get_announcement: ActorMethod<[bigint], [] | [AnnouncementCandid]>; }; export interface AnnouncementInputCandid { ibe_ciphertext: Uint8Array; ciphertext: Uint8Array; nonce: Uint8Array; tag: string; } export interface EncryptedViewKeyRequestCandid { address: Uint8Array; transport_public_key: Uint8Array; expiry_ns: bigint; nonce: bigint; signature: Uint8Array; } export interface InvoiceSubmissionCandid { invoice_id: Uint8Array; signature: Uint8Array; tag: string; } export interface AnnouncementCandid { id: bigint; ibe_ciphertext: Uint8Array; ciphertext: Uint8Array; nonce: Uint8Array; created_at_ns: bigint; tag: string; } export interface AnnouncementPageCandid { announcements: AnnouncementCandid[]; next_id: [] | [bigint]; } export interface AnnouncementPageByTimeCandid { announcements: AnnouncementCandid[]; next_ts: [] | [bigint]; } /** * Unwraps a canister result, handling both Ok/Err and ok/err variants. * @param result - Result union returned by canister method. * @param method - Method name used for error context. * @throws {@link StealthError} if the result is an error variant. * @throws {@link StealthError} if the variant is unknown. */ export declare function unwrapResult(result: CanisterResult, method: string): T; //# sourceMappingURL=candid.d.ts.map