options.vega
Adds an options vega column to an immutable query builder. Calling .vega() without arguments selects dollar vega.
Imports
import { Velo } from 'velo-sdk';Examples
import { Velo, options } from 'velo-sdk';
const velo = new Velo({ apiKey: process.env.VELO_API_KEY! });
const data = await velo.query(
options
.vega({ metric: 'coin' })
.for({
coins: ['BTC'],
})
.over({
last: '1D',
resolution: '1h',
}),
);
const rows = data.rows();Definition
function vega(): OptionsBuilder<C | OptionsVegaColumn<'dollar'>>;
function vega<M extends OptionsVegaMetric>(
options: { readonly metric: M },
): OptionsBuilder<C | OptionsVegaColumn<M>>;Parameters
options
- Type:
{ readonly metric: 'coin' | 'dollar' } - Optional
- Default:
{ metric: 'dollar' }
Selects whether vega is measured in coins or dollars.
Return Type
- Type:
OptionsBuilder<C | OptionsVegaColumn<M>>
Returns a builder typed with the accumulated columns.