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 } }) }); Copy
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 } }) });
Reference: Get Recent Spreads
Example