mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 14:49:58 -07:00
global: rename some indexes
This commit is contained in:
@@ -64,14 +64,14 @@ function initPackages() {
|
||||
const imports = {
|
||||
async signals() {
|
||||
return import("../packages/solid-signals/wrapper.js").then(
|
||||
(d) => d.default
|
||||
(d) => d.default,
|
||||
);
|
||||
},
|
||||
async lightweightCharts() {
|
||||
return window.document.fonts.ready.then(() =>
|
||||
import("../packages/lightweight-charts/wrapper.js").then(
|
||||
(d) => d.default
|
||||
)
|
||||
(d) => d.default,
|
||||
),
|
||||
);
|
||||
},
|
||||
async leanQr() {
|
||||
@@ -79,7 +79,7 @@ function initPackages() {
|
||||
},
|
||||
async ufuzzy() {
|
||||
return import("../packages/ufuzzy/v1.0.18/script.js").then(
|
||||
({ default: d }) => d
|
||||
({ default: d }) => d,
|
||||
);
|
||||
},
|
||||
};
|
||||
@@ -587,7 +587,7 @@ function createUtils() {
|
||||
window.history.pushState(
|
||||
null,
|
||||
"",
|
||||
`${pathname}?${urlParams.toString()}`
|
||||
`${pathname}?${urlParams.toString()}`,
|
||||
);
|
||||
} catch (_) {}
|
||||
},
|
||||
@@ -604,7 +604,7 @@ function createUtils() {
|
||||
window.history.replaceState(
|
||||
null,
|
||||
"",
|
||||
`${pathname}?${urlParams.toString()}`
|
||||
`${pathname}?${urlParams.toString()}`,
|
||||
);
|
||||
} catch (_) {}
|
||||
},
|
||||
@@ -1138,23 +1138,23 @@ function createUtils() {
|
||||
case /** @satisfies {OutputIndex} */ (9):
|
||||
return "outputindex";
|
||||
case /** @satisfies {P2AIndex} */ (10):
|
||||
return "p2aindex";
|
||||
return "p2aaddressindex";
|
||||
case /** @satisfies {P2MSIndex} */ (11):
|
||||
return "p2msindex";
|
||||
return "p2msoutputindex";
|
||||
case /** @satisfies {P2PK33Index} */ (12):
|
||||
return "p2pk33index";
|
||||
return "p2pk33addressindex";
|
||||
case /** @satisfies {P2PK65Index} */ (13):
|
||||
return "p2pk65index";
|
||||
return "p2pk65addressindex";
|
||||
case /** @satisfies {P2PKHIndex} */ (14):
|
||||
return "p2pkhindex";
|
||||
return "p2pkhaddressindex";
|
||||
case /** @satisfies {P2SHIndex} */ (15):
|
||||
return "p2shindex";
|
||||
return "p2shaddressindex";
|
||||
case /** @satisfies {P2TRIndex} */ (16):
|
||||
return "p2trindex";
|
||||
return "p2traddressindex";
|
||||
case /** @satisfies {P2WPKHIndex} */ (17):
|
||||
return "p2wpkhindex";
|
||||
return "p2wpkhaddressindex";
|
||||
case /** @satisfies {P2WSHIndex} */ (18):
|
||||
return "p2wshindex";
|
||||
return "p2wshaddressindex";
|
||||
case /** @satisfies {QuarterIndex} */ (19):
|
||||
return "quarterindex";
|
||||
case /** @satisfies {TxIndex} */ (20):
|
||||
@@ -1251,8 +1251,8 @@ function createUtils() {
|
||||
today.getUTCDate(),
|
||||
0,
|
||||
0,
|
||||
0
|
||||
)
|
||||
0,
|
||||
),
|
||||
);
|
||||
},
|
||||
/**
|
||||
@@ -1339,7 +1339,7 @@ function createUtils() {
|
||||
*/
|
||||
function getNumberOfDaysBetweenTwoDates(oldest, youngest) {
|
||||
return Math.round(
|
||||
Math.abs((youngest.getTime() - oldest.getTime()) / date.ONE_DAY_IN_MS)
|
||||
Math.abs((youngest.getTime() - oldest.getTime()) / date.ONE_DAY_IN_MS),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1558,7 +1558,7 @@ function createVecsResources(signals, utils) {
|
||||
const fetchedRecord = signals.createSignal(
|
||||
/** @type {Map<string, {loading: boolean, at: Date | null, vec: Signal<T[] | null>}>} */ (
|
||||
new Map()
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
return {
|
||||
@@ -1608,7 +1608,7 @@ function createVecsResources(signals, utils) {
|
||||
index,
|
||||
id,
|
||||
from,
|
||||
to
|
||||
to,
|
||||
)
|
||||
);
|
||||
fetched.at = new Date();
|
||||
@@ -1869,7 +1869,7 @@ function initWebSockets(signals, utils) {
|
||||
|
||||
window.document.addEventListener(
|
||||
"visibilitychange",
|
||||
reinitWebSocketIfDocumentNotHidden
|
||||
reinitWebSocketIfDocumentNotHidden,
|
||||
);
|
||||
|
||||
window.document.addEventListener("online", reinitWebSocket);
|
||||
@@ -1878,7 +1878,7 @@ function initWebSockets(signals, utils) {
|
||||
ws?.close();
|
||||
window.document.removeEventListener(
|
||||
"visibilitychange",
|
||||
reinitWebSocketIfDocumentNotHidden
|
||||
reinitWebSocketIfDocumentNotHidden,
|
||||
);
|
||||
window.document.removeEventListener("online", reinitWebSocket);
|
||||
live.set(false);
|
||||
@@ -1904,7 +1904,7 @@ function initWebSockets(signals, utils) {
|
||||
symbol: ["BTC/USD"],
|
||||
interval: 1440,
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1933,7 +1933,7 @@ function initWebSockets(signals, utils) {
|
||||
|
||||
/** @type {ReturnType<typeof createWebsocket<CandlestickData>>} */
|
||||
const kraken1dCandle = createWebsocket((callback) =>
|
||||
krakenCandleWebSocketCreator(callback)
|
||||
krakenCandleWebSocketCreator(callback),
|
||||
);
|
||||
|
||||
kraken1dCandle.open();
|
||||
@@ -1992,7 +1992,7 @@ function main() {
|
||||
}
|
||||
|
||||
const frame = window.document.getElementById(
|
||||
/** @type {string} */ (input.value)
|
||||
/** @type {string} */ (input.value),
|
||||
);
|
||||
|
||||
if (!frame) {
|
||||
@@ -2090,23 +2090,23 @@ function main() {
|
||||
|
||||
function initDark() {
|
||||
const preferredColorSchemeMatchMedia = window.matchMedia(
|
||||
"(prefers-color-scheme: dark)"
|
||||
"(prefers-color-scheme: dark)",
|
||||
);
|
||||
const dark = signals.createSignal(
|
||||
preferredColorSchemeMatchMedia.matches
|
||||
preferredColorSchemeMatchMedia.matches,
|
||||
);
|
||||
preferredColorSchemeMatchMedia.addEventListener(
|
||||
"change",
|
||||
({ matches }) => {
|
||||
dark.set(matches);
|
||||
}
|
||||
},
|
||||
);
|
||||
return dark;
|
||||
}
|
||||
const dark = initDark();
|
||||
|
||||
const qrcode = signals.createSignal(
|
||||
/** @type {string | null} */ (null)
|
||||
/** @type {string | null} */ (null),
|
||||
);
|
||||
|
||||
function createLastHeightResource() {
|
||||
@@ -2117,7 +2117,7 @@ function main() {
|
||||
lastHeight.set(h);
|
||||
},
|
||||
/** @satisfies {Height} */ (5),
|
||||
"height"
|
||||
"height",
|
||||
);
|
||||
}
|
||||
fetchLastHeight();
|
||||
@@ -2161,10 +2161,10 @@ function main() {
|
||||
const owner = signals.getOwner();
|
||||
|
||||
const chartOption = signals.createSignal(
|
||||
/** @type {ChartOption | null} */ (null)
|
||||
/** @type {ChartOption | null} */ (null),
|
||||
);
|
||||
const simOption = signals.createSignal(
|
||||
/** @type {SimulationOption | null} */ (null)
|
||||
/** @type {SimulationOption | null} */ (null),
|
||||
);
|
||||
|
||||
let previousElement = /** @type {HTMLElement | undefined} */ (
|
||||
@@ -2210,9 +2210,9 @@ function main() {
|
||||
webSockets,
|
||||
vecsResources,
|
||||
vecIdToIndexes,
|
||||
})
|
||||
)
|
||||
)
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
firstTimeLoadingChart = false;
|
||||
@@ -2233,8 +2233,8 @@ function main() {
|
||||
vecsResources,
|
||||
option,
|
||||
vecIdToIndexes,
|
||||
})
|
||||
)
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
firstTimeLoadingTable = false;
|
||||
@@ -2258,9 +2258,9 @@ function main() {
|
||||
signals,
|
||||
utils,
|
||||
vecsResources,
|
||||
})
|
||||
)
|
||||
)
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
firstTimeLoadingSimulation = false;
|
||||
@@ -2289,7 +2289,7 @@ function main() {
|
||||
createMobileSwitchEffect();
|
||||
|
||||
utils.dom.onFirstIntersection(elements.aside, () =>
|
||||
signals.runWithOwner(owner, initSelectedFrame)
|
||||
signals.runWithOwner(owner, initSelectedFrame),
|
||||
);
|
||||
}
|
||||
initSelected();
|
||||
@@ -2369,7 +2369,7 @@ function main() {
|
||||
if (indexes?.length) {
|
||||
const maxIndex = Math.min(
|
||||
(order || indexes).length - 1,
|
||||
minIndex + RESULTS_PER_PAGE - 1
|
||||
minIndex + RESULTS_PER_PAGE - 1,
|
||||
);
|
||||
|
||||
list = Array(maxIndex - minIndex + 1);
|
||||
@@ -2445,7 +2445,7 @@ function main() {
|
||||
haystack,
|
||||
needle,
|
||||
undefined,
|
||||
infoThresh
|
||||
infoThresh,
|
||||
);
|
||||
|
||||
if (!result?.[0]?.length || !result?.[1]) {
|
||||
@@ -2453,7 +2453,7 @@ function main() {
|
||||
haystack,
|
||||
needle,
|
||||
outOfOrder,
|
||||
infoThresh
|
||||
infoThresh,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2462,7 +2462,7 @@ function main() {
|
||||
haystack,
|
||||
needle,
|
||||
outOfOrder,
|
||||
infoThresh
|
||||
infoThresh,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2471,7 +2471,7 @@ function main() {
|
||||
haystack,
|
||||
needle,
|
||||
outOfOrder,
|
||||
infoThresh
|
||||
infoThresh,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2480,7 +2480,7 @@ function main() {
|
||||
haystack,
|
||||
needle,
|
||||
undefined,
|
||||
infoThresh
|
||||
infoThresh,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2489,7 +2489,7 @@ function main() {
|
||||
haystack,
|
||||
needle,
|
||||
outOfOrder,
|
||||
infoThresh
|
||||
infoThresh,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2572,7 +2572,7 @@ function main() {
|
||||
|
||||
shareDiv.hidden = false;
|
||||
});
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
initShare();
|
||||
@@ -2596,7 +2596,7 @@ function main() {
|
||||
utils.storage.write(barWidthLocalStorageKey, String(width));
|
||||
} else {
|
||||
elements.main.style.width = elements.style.getPropertyValue(
|
||||
"--default-main-width"
|
||||
"--default-main-width",
|
||||
);
|
||||
utils.storage.remove(barWidthLocalStorageKey);
|
||||
}
|
||||
@@ -2633,9 +2633,9 @@ function main() {
|
||||
window.addEventListener("mouseleave", setResizeFalse);
|
||||
}
|
||||
initDesktopResizeBar();
|
||||
})
|
||||
)
|
||||
)
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
main();
|
||||
|
||||
Reference in New Issue
Block a user