Function publicWsSubscription

  • Returns a RxJS Observable for the given public channel. You can call .subscribe() on this Observable to receive data updates.

    Type Parameters

    Parameters

    • __namedParameters: {
          channel: C;
          req_id?: PublicSubscription<C>["req_id"];
      } & PublicSubscriptionParams<C>

    Returns Observable<PublicSubscriptionUpdate<C>>

       import { publicWsSubscription } from 'ts-kraken';

    publicWsSubscription({ channel: 'ticker', params: { symbol: ['BTC/USD'] } })
    .subscribe(({ data: [{ symbol, last }] }) => {
    console.log({ symbol, last });
    });