import type { StreamInstance } from '../instance.js' import type { Topic } from '../types.js' export interface SubscribeInput { readonly topics: readonly Topic[] } export interface SubscribeOutput { subscribed: Topic[] } export type Subscribe = ( input: Readonly ) => Promise export const createSubscribe = ( instance: Readonly ): Subscribe => { return async ({ topics }) => { return instance.request({ method: 'subscribe', params: { topics }, }) } }