@fairmint/canton-node-sdk
Version:
Canton Node SDK
46 lines • 1.62 kB
TypeScript
/**
* Shared utility for building eventFormat configuration used across multiple Ledger JSON API operations. This module
* provides a consistent way to construct the complex eventFormat structure from simple parameters.
*/
export interface EventFormatBuilderParams {
/** List of parties to scope the filter. At least one party is required. */
parties: string[];
/** Optional template filters applied server-side. */
templateIds?: string[] | undefined;
/** Include created event blob in TemplateFilter results (default false). */
includeCreatedEventBlob?: boolean | undefined;
}
type FilterCumulative = Array<{
identifierFilter: {
TemplateFilter: {
value: {
templateId: string;
includeCreatedEventBlob: boolean;
};
};
};
} | {
identifierFilter: {
WildcardFilter: {
value: {
includeCreatedEventBlob: boolean;
};
};
};
}>;
/**
* Builds the eventFormat object structure used in various Ledger JSON API operations. This centralizes the logic for
* creating filtersByParty configurations from simple parameters.
*
* @param params - Configuration parameters for building the event format
* @returns An eventFormat object ready to be used in API requests
* @throws Error if no parties are provided
*/
export declare function buildEventFormat(params: EventFormatBuilderParams): {
verbose: boolean;
filtersByParty: Record<string, {
cumulative: FilterCumulative;
}>;
};
export {};
//# sourceMappingURL=event-format-builder.d.ts.map