import { Repository } from "@lodestar/db";
import { bytesToInt } from "@lodestar/utils";
import { Bucket, getBucketNameByValue } from "../buckets.js";
import { blobSidecarsWrapperSsz } from "./blobSidecars.js";
/**
 * blobSidecarsWrapper by slot
 *
 * Used to store finalized BlobSidecars
 */
export class BlobSidecarsArchiveRepository extends Repository {
    constructor(config, db) {
        const bucket = Bucket.deneb_blobSidecarsArchive;
        super(config, db, bucket, blobSidecarsWrapperSsz, getBucketNameByValue(bucket));
    }
    // Handle key as slot
    getId(value) {
        return value.slot;
    }
    decodeKey(data) {
        return bytesToInt(super.decodeKey(data), "be");
    }
}
//# sourceMappingURL=blobSidecarsArchive.js.map