import type { Agent } from "@dfinity/agent"; import { Principal } from "@dfinity/principal"; import type { DeciderClientOptions } from "./decider/prover.js"; import { HttpDeciderClient } from "./decider/prover.js"; import { StealthCanisterClient } from "./ic/client.js"; import type { TeleportProofClientOptions } from "./operations/teleportProof.js"; import { TeleportProofClient } from "./operations/teleportProof.js"; import type { WasmRuntimeOptions } from "./wasm/index.js"; import { WasmRuntime } from "./wasm/index.js"; /** * Configuration required to instantiate an {@link StealthCanisterClient}. */ export interface StealthClientConfig { /** Dfinity agent used to communicate with canisters. */ agent: Agent; /** Storage canister principal (text or `Principal`). */ storageCanisterId: string | Principal; /** Key manager canister principal (text or `Principal`). */ keyManagerCanisterId: string | Principal; } export interface StealthClientFactoryOptions { /** * Default values applied when creating clients. * @remarks Explicit values provided to {@link StealthClientFactory.create} override these defaults. */ defaults?: Partial; } /** * Factory for creating {@link StealthCanisterClient} instances with optional defaults. */ export declare class StealthClientFactory { private readonly defaults; constructor(defaults?: Partial); /** * Create a new {@link StealthCanisterClient}. * @param config - Partial configuration. Missing required fields are filled from factory defaults. * @throws If required config values are missing after merging defaults. */ create(config?: Partial): StealthCanisterClient; /** * Create a new factory that merges the provided defaults with the current ones. */ withDefaults(defaults: Partial): StealthClientFactory; } type TeleportProofInit = TeleportProofClient | TeleportProofClientOptions | undefined; type DeciderInit = HttpDeciderClient | (DeciderClientOptions & { baseUrl: string; }) | undefined; type StealthFactoryInit = StealthClientFactory | StealthClientFactoryOptions | undefined; /** * Options for constructing a {@link Zerc20Sdk}. * @remarks * Most callers should use {@link createSdk} which creates a default instance. * * You can override sub-components for: * - Sharing a single {@link WasmRuntime} across multiple SDK instances * - Injecting a pre-configured proof client / decider client * - Providing defaults for IC canister IDs / agent */ export interface Zerc20SdkOptions { /** * WASM runtime configuration or a pre-created runtime instance. * @remarks In browsers, make sure the runtime is initialized/ready before use. */ wasm?: WasmRuntime | WasmRuntimeOptions; /** * Teleport proof client configuration or a pre-created client instance. * @remarks If omitted, a default {@link TeleportProofClient} is created using the resolved WASM runtime. */ teleportProofs?: TeleportProofInit; /** * Decider client configuration or a pre-created client instance. * @remarks If provided, the SDK will expose `sdk.decider`. */ decider?: DeciderInit; /** * Stealth client factory or factory options. * @remarks If omitted, a default {@link StealthClientFactory} is created with no defaults. */ stealth?: StealthFactoryInit; } /** * Main SDK entrypoint that bundles WASM, proof, decider, and IC helpers. */ export declare class Zerc20Sdk { readonly wasm: WasmRuntime; readonly teleportProofs: TeleportProofClient; readonly decider?: HttpDeciderClient; readonly stealth: StealthClientFactory; constructor(options?: Zerc20SdkOptions); /** * Create a {@link StealthCanisterClient} (IC canister client). * @remarks This is a convenience wrapper around {@link StealthClientFactory.create}. */ createStealthClient(options?: Partial): StealthCanisterClient; } /** * Create a new {@link Zerc20Sdk} instance. */ export declare function createSdk(options?: Zerc20SdkOptions): Zerc20Sdk; export {}; //# sourceMappingURL=sdk.d.ts.map