diff --git a/docs/04-build/02-client-sdks/02-client-ts-sdk.mdx b/docs/04-build/02-client-sdks/02-client-ts-sdk.mdx index 0bb856a8..f7730927 100644 --- a/docs/04-build/02-client-sdks/02-client-ts-sdk.mdx +++ b/docs/04-build/02-client-sdks/02-client-ts-sdk.mdx @@ -91,34 +91,38 @@ export interface RpcMutateResponse { ```typescript export interface SubscriptionsClient { - connect(connectionId?: string): void; + connect(connectionId?: string): Promise; disconnect(connectionId?: string): void; - subscribe(applicationIds: string[], connectionId?: string): void; - unsubscribe(applicationIds: string[], connectionId?: string): void; - addCallback( - callback: (event: NodeEvent) => void, - connectionId?: string, - ): void; + subscribe(contextIds: string[], connectionId?: string): void; + unsubscribe(contextIds: string[], connectionId?: string): void; + addCallback(callback: (event: NodeEvent) => void, connectionId?: string): void; removeCallback( callback: (event: NodeEvent) => void, connectionId?: string, ): void; } -export type NodeEvent = ApplicationEvent; +export type NodeEvent = ContextEvent; -export interface ApplicationEvent { - application_id: ApplicationId; - type: 'TransactionExecuted' | 'PeerJoined'; - data: TransactionExecuted | PeerJoined; +export type ContextEvent = ContextEventPayload & { + contextId: ContextId; } -export interface TransactionExecuted { - hash: string; +type ContextEventPayload = { + type: 'StateMutation', + data: StateMutation, +} | { + type: 'ExecutionEvent', + data: ExecutionEvent, +}; + +export interface StateMutation { + newRoot: string; } -export interface PeerJoined { - peerId: string; +export interface ExecutionEvent { + kind: string, + data: any, } ```