Function privateWsSubscription

  • Returns a Promise of a RxJS Observable for the given private channel. You can call .subscribe() on the resolved Observable to receive data updates.

    Type Parameters

    Parameters

    • __namedParameters: {
          channel: C;
          req_id?: PrivateSubscription<C>["req_id"];
      } & PrivateSubscriptionParams<C>
    • OptionaltokenOrKeys: string | ApiCredentials

    Returns Promise<Observable<PrivateSubscriptionUpdate<C>>>

       import { privateWsSubscription } from 'ts-kraken';

    privateWsSubscription({
    channel: 'balances',
    params: { snapshot: true }

    }).then(balancesObservable$ => {
    balancesObservable$.subscribe(({ data: balancesData }) => {
    console.log({ balancesData });
    });
    });