@exodus/exodus-pricing-client
v1.3.2
Published
Client for fetching current and historical asset prices
Downloads
12,756
Readme
@exodus/exodus-pricing-client
Client for fetching current and historical asset prices.
Usage
To use the client call the factory and pass in required dependencies
import createExodusPricingClient from '@exodus/exodus-pricing-client'
const exodusPricingClient = createExodusPricingClient({
fetch,
pricingServerUrlAtom,
})
// Do things
const historical = await exodusPricingClient.historicalPrice({
assets: ['bitcoin'],
fiatArray: ['EUR'],
granularity: 'week',
limit: 42,
})
const ticker = await exodusPricingClient.ticker({ assets: ['bitcoin'], fiatCurrency: 'EUR' })
const current = await exodusPricingClient.currentPrice({ assets: ['bitcoin'], fiatCurrency: 'EUR' })