Reference: Get Recent Trades
import { publicRestRequest } from 'ts-kraken'; publicRestRequest({ url: 'Trades', params: { pair: 'BTCUSD', count: 1 } // Fetch last trade only, default `count` if not passed is 1000. }).then(rawData => { const [pairKey] = Object.keys(rawData); const [[lastTradePrice]] = rawData[pairKey]; console.log({ [pairKey]: lastTradePrice }); }); Copy
import { publicRestRequest } from 'ts-kraken'; publicRestRequest({ url: 'Trades', params: { pair: 'BTCUSD', count: 1 } // Fetch last trade only, default `count` if not passed is 1000. }).then(rawData => { const [pairKey] = Object.keys(rawData); const [[lastTradePrice]] = rawData[pairKey]; console.log({ [pairKey]: lastTradePrice }); });
Reference: Get Recent Trades
Example