Function getTickersPrices

Returns a nice array of pair tickers

Helper method for: Get Ticker Information

   import { getTickersPrices } from 'ts-kraken';

getTickersPrices('BTCUSD,ETHEUR')
.then(([btcUsdTicker, ethEurTicker]) => {
const { price: btcUsdPrice } = btcUsdTicker;
const { price: ethEurPrice } = ethEurTicker;

console.log({ btcUsdPrice, ethEurPrice });
});

getTickersPrices()
.then(allPairsTickers => {
console.table(allPairsTickers);
});
  • Parameters

    • Optionalpairs: string

    Returns Promise<{
        pair: string;
        price: string;
        rawKrakenPayload: {
            a: string[];
            b: string[];
            c: string[];
            h: string[];
            l: string[];
            o: string;
            p: string[];
            t: number[];
            v: string[];
        };
        utcTimestamp: number;
    }[]>