import { ContainerType } from "@chainsafe/ssz";
import { Repository } from "@lodestar/db";
import { ssz } from "@lodestar/types";
import { Bucket, getBucketNameByValue } from "../buckets.js";
export const blobSidecarsWrapperSsz = new ContainerType({
    blockRoot: ssz.Root,
    slot: ssz.Slot,
    blobSidecars: ssz.deneb.BlobSidecars,
}, { typeName: "BlobSidecarsWrapper", jsonCase: "eth2" });
export const BLOB_SIDECARS_IN_WRAPPER_INDEX = 44;
/**
 * blobSidecarsWrapper by block root (= hash_tree_root(SignedBeaconBlock.message))
 *
 * Used to store unfinalized BlobSidecars
 */
export class BlobSidecarsRepository extends Repository {
    constructor(config, db) {
        const bucket = Bucket.deneb_blobSidecars;
        super(config, db, bucket, blobSidecarsWrapperSsz, getBucketNameByValue(bucket));
    }
    /**
     * Id is hashTreeRoot of unsigned BeaconBlock
     */
    getId(value) {
        const { blockRoot } = value;
        return blockRoot;
    }
}
//# sourceMappingURL=blobSidecars.js.map