@fairmint/canton-node-sdk
Version:
Canton Node SDK
14 lines • 913 B
TypeScript
import { z } from 'zod';
import { type BaseClient } from '../BaseClient';
import { type WebSocketHandlers, type WebSocketSubscription } from '../ws';
export interface WebSocketOperationConfig<Params, RequestMessage, InboundMessage> {
paramsSchema: z.ZodSchema<Params>;
buildPath: (params: Params, apiUrl: string, client: BaseClient) => string;
buildRequestMessage: (params: Params, client: BaseClient) => RequestMessage | Promise<RequestMessage>;
transformInbound?: (msg: InboundMessage) => InboundMessage;
}
export declare function createWebSocketOperation<Params, RequestMessage, InboundMessage>(config: WebSocketOperationConfig<Params, RequestMessage, InboundMessage>): new (client: BaseClient) => {
client: BaseClient;
subscribe: (params: Params, handlers: WebSocketHandlers<InboundMessage>) => Promise<WebSocketSubscription>;
};
//# sourceMappingURL=WebSocketOperationFactory.d.ts.map