import type { Announcement, AnnouncementInput } from "./ic/types.js"; /** * Public SDK type definitions. * @remarks * These interfaces are used by high-level operations, WASM helpers, and proof services. * Most hex strings are expected to be `0x`-prefixed (see `utils/hex` and `utils/branded`). */ export interface SecretAndTweak { /** Secret scalar as hex string. */ secret: string; /** Tweak scalar as hex string. */ tweak: string; } /** * Canonical recipient representation used throughout the protocol. */ export interface GeneralRecipient { /** Destination chain id. */ chainId: bigint; /** Destination EVM address (hex string). */ address: string; /** Recipient tweak (hex string). */ tweak: string; /** Recipient field element representation (hex string). */ fr: string; /** Recipient as uint256 (hex string). */ u256: string; } /** * Burn address artifacts (inputs/outputs) used for private send and receive flows. */ export interface BurnArtifacts { /** Burn address (derived EVM address). */ burnAddress: string; /** Full burn address payload as hex string. */ fullBurnAddress: string; /** Secret used for burn derivation (hex string). */ secret: string; /** Tweak used for burn derivation (hex string). */ tweak: string; /** General recipient derived from `(chainId, address, tweak)`. */ generalRecipient: GeneralRecipient; } /** * Prepared private send (includes derivation and announcement artifacts). */ export interface PreparedPrivateSend { /** Payment advice identifier (hex string). */ paymentAdviceId: string; /** Secret used for burn derivation (hex string). */ secret: string; /** Tweak used for burn derivation (hex string). */ tweak: string; /** Burn address derived for the recipient. */ burnAddress: string; /** Full burn payload as hex string (used for scanning/decoding). */ burnPayload: string; /** General recipient derived from the burn payload. */ generalRecipient: GeneralRecipient; /** Announcement payload to submit to the storage canister. */ announcement: AnnouncementInput; /** Session key used for symmetric encryption. */ sessionKey: Uint8Array; /** Payment advice identifier as bytes. */ paymentAdviceIdBytes: Uint8Array; } /** * Result of private send submission. */ export interface PrivateSendResult { /** Payment advice identifier (hex string). */ paymentAdviceId: string; /** Secret used for burn derivation (hex string). */ secret: string; /** Tweak used for burn derivation (hex string). */ tweak: string; /** Burn address derived for the recipient. */ burnAddress: string; /** Full burn payload as hex string (used for scanning/decoding). */ burnPayload: string; /** General recipient derived from the burn payload. */ generalRecipient: GeneralRecipient; /** Stored announcement as returned from the canister. */ announcement: Announcement; } /** * Single burn address entry used when issuing a batch invoice. */ export interface InvoiceBatchBurnAddress { /** Batch sub-identifier (0-based). */ subId: number; /** Burn address for this sub id. */ burnAddress: string; /** Secret for this burn address (hex string). */ secret: string; /** Tweak for this burn address (hex string). */ tweak: string; } /** * Artifacts produced when issuing an invoice. */ export interface InvoiceIssueArtifacts { /** Invoice identifier (hex string). */ invoiceId: string; /** Recipient address on the primary chain. */ recipientAddress: string; /** Recipient chain id on the primary chain. */ recipientChainId: bigint; /** Derived burn addresses for the invoice (batch). */ burnAddresses: InvoiceBatchBurnAddress[]; /** Human-readable signature message to sign for invoice submission. */ signatureMessage: string; /** Optional storage tag for invoice routing. */ tag?: string; } /** * Minimal announcement data returned by scanner flows. */ export interface ScannedAnnouncement { /** Announcement id in storage canister. */ id: bigint; /** Burn address for this announcement. */ burnAddress: string; /** Full burn address payload as hex string. */ fullBurnAddress: string; /** Created timestamp in nanoseconds. */ createdAtNs: bigint; /** Recipient chain id (decoded from the burn payload). */ recipientChainId: bigint; } /** * Aggregation tree state used to determine which events are eligible for teleport/redeem. */ export interface AggregationTreeState { /** Latest aggregation sequence number. */ latestAggSeq: bigint; /** Aggregation root as hex string. */ aggregationRoot: string; /** Snapshot of per-chain roots as hex strings. */ snapshot: string[]; /** Mapping of chain to transfer tree index (same order as `chainIds`). */ transferTreeIndices: bigint[]; /** Chain ids included in the aggregation state. */ chainIds: bigint[]; } /** * Merkle proof for a single global teleport event. */ export interface GlobalTeleportProof { /** Merkle siblings as hex strings. */ siblings: string[]; /** Leaf index in the global transfer tree. */ leafIndex: bigint; } /** * Global teleport proof coupled with the corresponding indexed event. */ export interface GlobalTeleportProofWithEvent extends GlobalTeleportProof { event: IndexedEvent; } /** * Transfer event as returned by the indexer. */ export interface IndexedEvent { /** Event index in the chain's transfer tree. */ eventIndex: bigint; /** Sender address/field (protocol-specific representation). */ from: string; /** Receiver address (burn address). */ to: string; /** Transfer value (token smallest unit). */ value: bigint; /** Ethereum block number for the event. */ ethBlockNumber: bigint; } /** * Proof artifacts produced by the single teleport prover. */ export interface SingleTeleportArtifacts { /** ABI-encoded proof calldata for on-chain verification. */ proofCalldata: string; /** Public inputs as hex strings. */ publicInputs: string[]; /** Merkle tree depth used by the circuit. */ treeDepth: number; } /** * Input parameters for creating a single teleport proof. */ export interface SingleTeleportParams { aggregationState: AggregationTreeState; /** Recipient field element (hex string). */ recipientFr: string; /** Secret (hex string). */ secretHex: string; event: IndexedEvent; proof: GlobalTeleportProof; } /** * Input parameters for the Nova batch prover. */ export interface NovaProverInput { aggregationState: AggregationTreeState; /** Recipient field element (hex string). */ recipientFr: string; /** Secret (hex string). */ secretHex: string; proofs: readonly GlobalTeleportProof[]; events: readonly IndexedEvent[]; } /** * Output produced by the Nova prover. */ export interface NovaProverOutput { /** IVC proof bytes to submit to the decider service. */ ivcProof: Uint8Array; /** Final state field elements as hex strings. */ finalState: string[]; /** Number of steps executed in the prover. */ steps: number; } export interface TokenEntryConfig { label: string; tokenAddress: string; verifierAddress: string; minterAddress?: string; chainId: bigint; deployedBlockNumber: bigint; rpcUrls: readonly string[]; legacyTx?: boolean; } export interface HubEntryConfig { hubAddress: string; chainId: bigint; rpcUrls: readonly string[]; } /** * Transfer events grouped by chain. */ export interface ChainEvents { /** Chain id for this group. */ chainId: bigint; /** Indexed transfer events. */ events: IndexedEvent[]; } /** * Events split by eligibility against an aggregation tree state. */ export interface EventsWithEligibility { /** Events that are eligible for proof generation/redeem. */ eligible: IndexedEvent[]; /** Events that are currently ineligible (pending aggregation). */ ineligible: IndexedEvent[]; } /** * Events split by eligibility for a specific chain. */ export interface SeparatedChainEvents { /** Chain id for this group. */ chainId: bigint; events: EventsWithEligibility; } /** * Local teleport proof returned by the indexer for an eligible event. */ export interface LocalTeleportProof { /** Transfer tree index used for this proof. */ treeIndex: bigint; /** Corresponding indexed event. */ event: IndexedEvent; /** Merkle siblings as hex strings. */ siblings: string[]; } /** * Local teleport proofs grouped by chain id. */ export interface ChainLocalTeleportProofs { chainId: bigint; proofs: LocalTeleportProof[]; } /** * Parameters for fetching aggregation tree state from the indexer. */ export interface FetchAggregationTreeStateParams { /** Optional block span used when querying the indexer (performance tuning). */ eventBlockSpan?: number | bigint; hub: HubEntryConfig; token: TokenEntryConfig; } /** * Parameters for fetching transfer events from the indexer. */ export interface FetchTransferEventsParams { /** Base URL for the indexer service. */ indexerUrl: string; /** Token entries to query across chains. */ tokens: readonly TokenEntryConfig[]; /** Burn addresses to filter events by. */ burnAddresses: readonly string[]; /** Optional per-request fetch limit. */ indexerFetchLimit?: number; } /** * Parameters for separating events into eligible vs ineligible sets. */ export interface SeparateEventsByEligibilityParams { aggregationState: AggregationTreeState; events: readonly ChainEvents[]; } /** * Parameters for fetching local teleport Merkle proofs from the indexer. */ export interface FetchLocalTeleportProofsParams { indexerUrl: string; token: TokenEntryConfig; treeIndex: bigint | number; events: readonly IndexedEvent[]; } /** * Parameters for generating global teleport Merkle proofs from local proofs. */ export interface GenerateGlobalTeleportProofsParams { aggregationState: AggregationTreeState; chains: readonly ChainLocalTeleportProofs[]; } //# sourceMappingURL=types.d.ts.map