Skip to main content

Doc autogenerated from onflow/sdk/src/transport/subscribe/subscribe.ts

subscribe

Subscribe to a topic and decode the data.

Import


_10
import { subscribe } from "@onflow/sdk"

Parameters

options

  • Type: SubscribeParams

_10
export type SubscribeParams<T extends SubscriptionTopic> = {
_10
topic: T
_10
args: SubscriptionArgs<T>
_10
onData: (data: SubscriptionData<T>) => void
_10
onError: (error: Error) => void
_10
}

opts (optional)

  • Type: SdkTransport;
  • Description: - Additional options for the subscription.

Returns

Subscription


Rate this page