import { StealthCanisterClient } from "../ic/client.js"; import { InvoiceIssueArtifacts } from "../types.js"; /** * Parameters for preparing an invoice issue. * * This generates a unique invoice ID (32 bytes), derives burn addresses, and * produces the EIP-191 signature message that should be signed by the issuer. */ export interface InvoiceIssueParams { /** ICP stealth client used to query existing invoices and submit new ones. */ client: StealthCanisterClient; /** 32-byte seed as 0x-hex string. */ seedHex: string; /** Recipient EVM address (0x-prefixed, 20 bytes). */ recipientAddress: string; /** Recipient chain ID (EVM chain ID). */ recipientChainId: number | bigint; /** Whether to create a batch invoice (multiple burn addresses). */ isBatch: boolean; /** Optional storage tag used to namespace invoices. */ tag?: string; /** RNG override for testing/determinism. Must return exactly `length` bytes. */ randomBytes?: (length: number) => Uint8Array; /** Maximum number of attempts to find a unique invoice ID (default: 8). */ maxRetries?: number; } /** * Prepare invoice issue artifacts for the recipient. * * @returns Invoice ID, derived burn addresses, and the signature message to sign. * @throws Error if a unique invoice ID cannot be generated within `maxRetries`. */ export declare function prepareInvoiceIssue(params: InvoiceIssueParams): Promise; /** * Extract the embedded chain ID from a 32-byte invoice ID. * * @throws Error if `invoiceBytes` is not 32 bytes. */ export declare function extractChainIdFromInvoiceBytes(invoiceBytes: Uint8Array): bigint; /** * Extract the embedded chain ID from a 32-byte invoice ID hex string. * * @throws Error if the invoice ID is not 32 bytes. */ export declare function extractChainIdFromInvoiceHex(invoiceIdHex: string): bigint; /** * Returns true if the invoice ID represents a single (non-batch) invoice. * * Single invoices have bit 7 of byte 0 set (`0x80`). * * @throws Error if `invoiceBytes` is not 32 bytes. */ export declare function isSingleInvoiceBytes(invoiceBytes: Uint8Array): boolean; /** * Returns true if the invoice ID hex string represents a single (non-batch) invoice. * * @throws Error if the invoice ID is not 32 bytes. */ export declare function isSingleInvoiceHex(invoiceIdHex: string): boolean; /** * Submit an invoice to the storage canister. * * @param client - Stealth client instance. * @param invoiceIdHex - 32-byte invoice ID as 0x-hex string. * @param signature - Signature over the message produced by `prepareInvoiceIssue`. * @param tag - Optional storage tag (defaults to `DEFAULT_ZSTORAGE_TAG`). */ export declare function submitInvoice(client: StealthCanisterClient, invoiceIdHex: string, signature: Uint8Array, tag?: string): Promise; /** * List invoice IDs for a given owner address. * * @param chainId - Optional filter for a specific chain ID embedded in invoice IDs. * @returns Invoice IDs as 0x-hex strings. */ export declare function listInvoices(client: StealthCanisterClient, ownerAddress: string, chainId?: number | bigint, tag?: string): Promise; //# sourceMappingURL=invoice.d.ts.map