mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-13 16:08:36 -07:00
171 lines
8.5 KiB
JavaScript
171 lines
8.5 KiB
JavaScript
//
|
|
// File auto-generated, any modifications will be overwritten
|
|
//
|
|
|
|
/** @typedef {0} DateIndex */
|
|
/** @typedef {1} DecadeIndex */
|
|
/** @typedef {2} DifficultyEpoch */
|
|
/** @typedef {3} EmptyOutputIndex */
|
|
/** @typedef {4} HalvingEpoch */
|
|
/** @typedef {5} Height */
|
|
/** @typedef {6} InputIndex */
|
|
/** @typedef {7} MonthIndex */
|
|
/** @typedef {8} OpReturnIndex */
|
|
/** @typedef {9} OutputIndex */
|
|
/** @typedef {10} P2AIndex */
|
|
/** @typedef {11} P2MSIndex */
|
|
/** @typedef {12} P2PK33Index */
|
|
/** @typedef {13} P2PK65Index */
|
|
/** @typedef {14} P2PKHIndex */
|
|
/** @typedef {15} P2SHIndex */
|
|
/** @typedef {16} P2TRIndex */
|
|
/** @typedef {17} P2WPKHIndex */
|
|
/** @typedef {18} P2WSHIndex */
|
|
/** @typedef {19} QuarterIndex */
|
|
/** @typedef {20} TxIndex */
|
|
/** @typedef {21} UnknownOutputIndex */
|
|
/** @typedef {22} WeekIndex */
|
|
/** @typedef {23} YearIndex */
|
|
|
|
/** @typedef {DateIndex | DecadeIndex | DifficultyEpoch | EmptyOutputIndex | HalvingEpoch | Height | InputIndex | MonthIndex | OpReturnIndex | OutputIndex | P2AIndex | P2MSIndex | P2PK33Index | P2PK65Index | P2PKHIndex | P2SHIndex | P2TRIndex | P2WPKHIndex | P2WSHIndex | QuarterIndex | TxIndex | UnknownOutputIndex | WeekIndex | YearIndex} Index */
|
|
|
|
export function createVecIdToIndexes() {
|
|
const DateIndex = /** @satisfies {DateIndex} */ (0);
|
|
const DecadeIndex = /** @satisfies {DecadeIndex} */ (1);
|
|
const DifficultyEpoch = /** @satisfies {DifficultyEpoch} */ (2);
|
|
const EmptyOutputIndex = /** @satisfies {EmptyOutputIndex} */ (3);
|
|
const HalvingEpoch = /** @satisfies {HalvingEpoch} */ (4);
|
|
const Height = /** @satisfies {Height} */ (5);
|
|
const InputIndex = /** @satisfies {InputIndex} */ (6);
|
|
const MonthIndex = /** @satisfies {MonthIndex} */ (7);
|
|
const OpReturnIndex = /** @satisfies {OpReturnIndex} */ (8);
|
|
const OutputIndex = /** @satisfies {OutputIndex} */ (9);
|
|
const P2AIndex = /** @satisfies {P2AIndex} */ (10);
|
|
const P2MSIndex = /** @satisfies {P2MSIndex} */ (11);
|
|
const P2PK33Index = /** @satisfies {P2PK33Index} */ (12);
|
|
const P2PK65Index = /** @satisfies {P2PK65Index} */ (13);
|
|
const P2PKHIndex = /** @satisfies {P2PKHIndex} */ (14);
|
|
const P2SHIndex = /** @satisfies {P2SHIndex} */ (15);
|
|
const P2TRIndex = /** @satisfies {P2TRIndex} */ (16);
|
|
const P2WPKHIndex = /** @satisfies {P2WPKHIndex} */ (17);
|
|
const P2WSHIndex = /** @satisfies {P2WSHIndex} */ (18);
|
|
const QuarterIndex = /** @satisfies {QuarterIndex} */ (19);
|
|
const TxIndex = /** @satisfies {TxIndex} */ (20);
|
|
const UnknownOutputIndex = /** @satisfies {UnknownOutputIndex} */ (21);
|
|
const WeekIndex = /** @satisfies {WeekIndex} */ (22);
|
|
const YearIndex = /** @satisfies {YearIndex} */ (23);
|
|
|
|
return /** @type {const} */ ({
|
|
"base-size": [TxIndex],
|
|
"block-count": [Height],
|
|
"block-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
"block-interval-10p": [DateIndex],
|
|
"block-interval-25p": [DateIndex],
|
|
"block-interval-75p": [DateIndex],
|
|
"block-interval-90p": [DateIndex],
|
|
"block-interval-average": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
"block-interval-max": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
"block-interval-median": [DateIndex],
|
|
"block-interval-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
"block-size-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
"block-vbytes-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
"block-weight-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
blockhash: [Height],
|
|
close: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
"close-in-cents": [DateIndex, Height],
|
|
"close-in-sats": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
date: [DateIndex, Height],
|
|
"date-fixed": [Height],
|
|
dateindex: [DateIndex, Height],
|
|
decadeindex: [DecadeIndex, YearIndex],
|
|
difficulty: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
difficultyepoch: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
emptyoutputindex: [EmptyOutputIndex],
|
|
"first-dateindex": [MonthIndex, WeekIndex],
|
|
"first-emptyoutputindex": [Height],
|
|
"first-height": [DateIndex, DifficultyEpoch, HalvingEpoch],
|
|
"first-inputindex": [Height, TxIndex],
|
|
"first-monthindex": [QuarterIndex, YearIndex],
|
|
"first-opreturnindex": [Height],
|
|
"first-outputindex": [Height, TxIndex],
|
|
"first-p2aindex": [Height],
|
|
"first-p2msindex": [Height],
|
|
"first-p2pk33index": [Height],
|
|
"first-p2pk65index": [Height],
|
|
"first-p2pkhindex": [Height],
|
|
"first-p2shindex": [Height],
|
|
"first-p2trindex": [Height],
|
|
"first-p2wpkhindex": [Height],
|
|
"first-p2wshindex": [Height],
|
|
"first-txindex": [Height],
|
|
"first-unknownoutputindex": [Height],
|
|
"first-yearindex": [DecadeIndex],
|
|
halvingepoch: [DateIndex, DecadeIndex, HalvingEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
height: [Height],
|
|
high: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
"high-in-cents": [DateIndex, Height],
|
|
"high-in-sats": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
inputindex: [InputIndex],
|
|
interval: [Height],
|
|
"is-explicitly-rbf": [TxIndex],
|
|
"last-dateindex": [MonthIndex, WeekIndex],
|
|
"last-height": [DateIndex, DifficultyEpoch, HalvingEpoch],
|
|
"last-inputindex": [TxIndex],
|
|
"last-monthindex": [QuarterIndex, YearIndex],
|
|
"last-outputindex": [TxIndex],
|
|
"last-txindex": [Height],
|
|
"last-yearindex": [DecadeIndex],
|
|
low: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
"low-in-cents": [DateIndex, Height],
|
|
"low-in-sats": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
monthindex: [DateIndex, MonthIndex],
|
|
ohlc: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
"ohlc-in-cents": [DateIndex, Height],
|
|
"ohlc-in-sats": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
open: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
"open-in-cents": [DateIndex, Height],
|
|
"open-in-sats": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
opreturnindex: [OpReturnIndex],
|
|
outputindex: [InputIndex, OutputIndex],
|
|
outputtype: [OutputIndex],
|
|
outputtypeindex: [OutputIndex],
|
|
p2abytes: [P2AIndex],
|
|
p2aindex: [P2AIndex],
|
|
p2msindex: [P2MSIndex],
|
|
p2pk33bytes: [P2PK33Index],
|
|
p2pk33index: [P2PK33Index],
|
|
p2pk65bytes: [P2PK65Index],
|
|
p2pk65index: [P2PK65Index],
|
|
p2pkhbytes: [P2PKHIndex],
|
|
p2pkhindex: [P2PKHIndex],
|
|
p2shbytes: [P2SHIndex],
|
|
p2shindex: [P2SHIndex],
|
|
p2trbytes: [P2TRIndex],
|
|
p2trindex: [P2TRIndex],
|
|
p2wpkhbytes: [P2WPKHIndex],
|
|
p2wpkhindex: [P2WPKHIndex],
|
|
p2wshbytes: [P2WSHIndex],
|
|
p2wshindex: [P2WSHIndex],
|
|
quarterindex: [MonthIndex, QuarterIndex],
|
|
rawlocktime: [TxIndex],
|
|
timestamp: [DateIndex, DecadeIndex, DifficultyEpoch, HalvingEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
"timestamp-fixed": [Height],
|
|
"total-block-count": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
"total-block-size": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
"total-block-vbytes": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
"total-block-weight": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
|
"total-size": [Height, TxIndex],
|
|
txid: [TxIndex],
|
|
txindex: [EmptyOutputIndex, OpReturnIndex, P2MSIndex, TxIndex, UnknownOutputIndex],
|
|
txversion: [TxIndex],
|
|
unknownoutputindex: [UnknownOutputIndex],
|
|
value: [OutputIndex],
|
|
vbytes: [Height],
|
|
weekindex: [DateIndex, WeekIndex],
|
|
weight: [Height],
|
|
yearindex: [MonthIndex, YearIndex],
|
|
});
|
|
}
|
|
/** @typedef {ReturnType<typeof createVecIdToIndexes>} VecIdToIndexes */
|
|
/** @typedef {keyof VecIdToIndexes} VecId */
|