Reference: Get Recent Spreads

   import { publicRestRequest } from 'ts-kraken';

publicRestRequest({
url: 'Spread',
params: { pair: 'BTCUSD' }
}).then(rawData => {
const [pairKey] = Object.keys(rawData);
const [,lastBid, lastAsk] = rawData[pairKey].pop();

console.log({ [pairKey]: { lastBid, lastAsk } })
});

Index

Type Aliases