marketCaps.history
Builds an immutable, validated request for the latest supply and market-cap data. No request is sent until the builder is passed to velo.query() or iteration begins through velo.stream().
Imports
import { Velo } from 'velo-sdk';Examples
import { Velo, marketCaps } from 'velo-sdk';
const velo = new Velo({ apiKey: process.env.VELO_API_KEY! });
const caps = await velo.query(
marketCaps.history({ coins: ['BTC', 'ETH'] }),
);Definition
function history(
params: MarketCapsParams,
): MarketCapsHistoryBuilder;Parameters
params
- Type:
MarketCapsParams
params.coins
- Type:
readonly string[]
One or more coin symbols.
Return Type
- Type:
MarketCapsHistoryBuilder
Returns an immutable request builder. Passing it to velo.query() resolves to MarketCap[]: an array of matching market-cap snapshots, or an empty array when no snapshots match. Passing it to velo.stream() yields MarketCap items.
MarketCap
| Property | Type | Description |
|---|---|---|
coin | string | The Velo-normalized coin symbol. |
time | number | Snapshot time as a Unix timestamp in milliseconds. |
circ | `number | null` |
circ_dollars | `number | null` |
fdv | `number | null` |
fdv_dollars | `number | null` |