import type { components } from './generated/ledger-api.ts'; /** Commands to submit to the ledger */ export type JsCommands = components['schemas']['JsCommands']; /** A single command */ export type Command = components['schemas']['Command']; /** Response from submit-and-wait operation */ export type SubmitAndWaitResponse = components['schemas']['SubmitAndWaitResponse']; /** Full transaction response including all events */ export type JsSubmitAndWaitForTransactionResponse = components['schemas']['JsSubmitAndWaitForTransactionResponse']; /** A single transaction from the ledger */ export type JsTransaction = components['schemas']['JsTransaction']; /** Request to get active contracts */ export type GetActiveContractsRequest = components['schemas']['GetActiveContractsRequest']; /** Response containing active contracts */ export type JsGetActiveContractsResponse = components['schemas']['JsGetActiveContractsResponse']; /** An active contract on the ledger */ export type JsActiveContract = components['schemas']['JsActiveContract']; /** An event created by a contract */ export type CreatedEvent = components['schemas']['CreatedEvent']; /** Error returned by Canton API */ export type JsCantonError = components['schemas']['JsCantonError']; /** Filter for transactions */ export type TransactionFilter = components['schemas']['TransactionFilter']; /** Format for events in responses */ export type EventFormat = components['schemas']['EventFormat']; /** Filter for templates */ export type TemplateFilter = components['schemas']['TemplateFilter']; /** Wildcard filter for matching patterns */ export type WildcardFilter = components['schemas']['WildcardFilter']; /** Information about a connected synchronizer */ export type ConnectedSynchronizer = components['schemas']['ConnectedSynchronizer']; /** Response containing connected synchronizers */ export type GetConnectedSynchronizersResponse = components['schemas']['GetConnectedSynchronizersResponse']; /** * Configuration for the Canton Ledger API client */ export interface CantonClientConfig { /** Base URL of the Canton JSON Ledger API (e.g., http://localhost:7575) */ baseUrl: string; /** JWT for authentication */ jwt: string; /** Request timeout in milliseconds */ timeout?: number; /** Abort signal for cancelling in-flight requests (e.g., from Chain.abort) */ signal?: AbortSignal; } /** * Create a typed Canton Ledger API client */ export declare function createCantonClient(config: CantonClientConfig): { /** * Submit a command and wait for completion * @returns The update ID and completion offset */ submitAndWait(commands: JsCommands): Promise; /** * Submit a command and wait for the full transaction response * @returns The transaction with all created/archived events */ submitAndWaitForTransaction(commands: JsCommands, eventFormat?: EventFormat): Promise; /** * Query active contracts on the ledger * @returns Array of active contracts matching the filter */ getActiveContracts(request: GetActiveContractsRequest, options?: { limit?: number; }): Promise; /** * Get the current ledger end offset */ getLedgerEnd(): Promise<{ offset: number; }>; /** * List known parties on the participant */ listParties(options?: { filterParty?: string; }): Promise; /** * Get the participant ID */ getParticipantId(): Promise; /** * Get the list of synchronizers the participant is currently connected to */ getConnectedSynchronizers(): Promise; /** * Check if the ledger API is alive */ isAlive(): Promise; /** * Check if the ledger API is ready */ isReady(): Promise; /** * Fetch a transaction by its update ID without requiring a known party. * Uses `filtersForAnyParty` with a wildcard so all visible events are returned. * @param updateId - The update ID (Canton transaction hash) * @returns The full `JsTransaction` including all events */ getTransactionById(updateId: string): Promise; /** * Get update by ID * @param updateId - The update ID returned from submit-and-wait * @param party - The party ID to filter events for * @returns The full update with all events */ getUpdateById(updateId: string, party: string): Promise; }; /** * Type alias for the Canton client instance */ export type CantonClient = ReturnType; /** * Send a GET request * * @param baseUrl - The base URL of the Canton API. * @param path - The endpoint path to send the request to. * @param headers - HTTP headers to include in the request. * @param timeoutMs - Timeout for the request in milliseconds. * @param queryParams - Optional query parameters to append to the URL. * @returns A promise resolving to the parsed response of type T. * @throws {@link CantonApiError} If the request fails or the response is not OK. */ export declare function get(baseUrl: string, path: string, headers: Record, timeoutMs: number, queryParams?: Record, retries?: number, signal?: AbortSignal): Promise; /** * Send a POST request * * @param baseUrl - The base URL of the Canton API. * @param path - The endpoint path to send the request to. * @param headers - HTTP headers to include in the request. * @param timeoutMs - Timeout for the request in milliseconds. * @param body - The request payload to send as JSON. * @param queryParams - Optional query parameters to append to the URL. * @returns A promise resolving to the parsed response of type T. * @throws {@link CantonApiError} If the request fails or the response is not OK. */ export declare function post(baseUrl: string, path: string, headers: Record, timeoutMs: number, body: unknown, queryParams?: Record, retries?: number, signal?: AbortSignal): Promise; //# sourceMappingURL=client.d.ts.map