mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-01 01:50:00 -07:00
general: snapshot
This commit is contained in:
@@ -12,22 +12,24 @@ export function createScaleDatasets<Scale extends ResourceScale>({
|
||||
type Key = keyof typeof groupedKeysToURLPath;
|
||||
type ResourceData = ReturnType<typeof createResourceDataset<Scale>>;
|
||||
|
||||
type ResourceDatasets = Record<Exclude<Key, "ohlc">, ResourceData>;
|
||||
type ResourceDatasets = Record<Exclude<Key, "price">, ResourceData>;
|
||||
|
||||
const datasets = groupedKeysToURLPath as any as ResourceDatasets;
|
||||
|
||||
for (const key in groupedKeysToURLPath) {
|
||||
if ((key as Key) !== "ohlc") {
|
||||
datasets[key as unknown as Exclude<Key, "ohlc">] = createResourceDataset({
|
||||
scale,
|
||||
path: groupedKeysToURLPath[key as Key] as any,
|
||||
});
|
||||
if ((key as Key) !== "price") {
|
||||
datasets[key as unknown as Exclude<Key, "price">] = createResourceDataset(
|
||||
{
|
||||
scale,
|
||||
path: groupedKeysToURLPath[key as Key] as any,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const price = createResourceDataset<Scale, OHLC>({
|
||||
scale,
|
||||
path: `/${scale}-to-ohlc`,
|
||||
path: `/${scale}-to-price`,
|
||||
});
|
||||
|
||||
Object.assign(datasets, { price });
|
||||
|
||||
Reference in New Issue
Block a user