general: snapshot

This commit is contained in:
k
2024-07-20 23:13:41 +02:00
parent d8a5b4a2e6
commit a145b35ad1
100 changed files with 5402 additions and 2967 deletions

View File

@@ -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 });