Returns a token string required for WebsocketV2 usage. Helper method for: Get Websockets Token
import { getWsAuthToken, privateWsSubscription } from 'ts-kraken'; getWsAuthToken().then(async token => { console.log({ token }) const balances$ = await privateWsSubscription({ channel: 'balances', params: { snapshot: true } }, token) // Pass token here to save time as the library won't need to fetch one internally! balances$.subscribe(({data}) => { console.table(data) }) }).catch(error => { console.log({ error }) }); Copy
import { getWsAuthToken, privateWsSubscription } from 'ts-kraken'; getWsAuthToken().then(async token => { console.log({ token }) const balances$ = await privateWsSubscription({ channel: 'balances', params: { snapshot: true } }, token) // Pass token here to save time as the library won't need to fetch one internally! balances$.subscribe(({data}) => { console.table(data) }) }).catch(error => { console.log({ error }) });
You don't need to generate this token to use any method from PrivateWs as they will automatically inject one on-the-fly for you.
Optional
Returns a token string required for WebsocketV2 usage. Helper method for: Get Websockets Token
Example
Remarks
You don't need to generate this token to use any method from PrivateWs as they will automatically inject one on-the-fly for you.