import type { ErrorType } from '../../errors/utils.js'; import type { BlobSidecars } from '../../types/eip4844.js'; import type { Kzg } from '../../types/kzg.js'; import type { ByteArray, Hex } from '../../types/misc.js'; import type { OneOf } from '../../types/utils.js'; import { type BlobsToCommitmentsErrorType } from './blobsToCommitments.js'; import { type blobsToProofsErrorType } from './blobsToProofs.js'; import { type ToBlobsErrorType } from './toBlobs.js'; type To = 'hex' | 'bytes'; export type ToBlobSidecarsParameters = { /** Return type. */ to?: to | To | undefined; } & OneOf<{ /** Data to transform into blobs. */ data: data | Hex | ByteArray; /** KZG implementation. */ kzg: Kzg; } | { /** Blobs. */ blobs: blobs | readonly Hex[] | readonly ByteArray[]; /** Commitment for each blob. */ commitments: _blobsType | readonly Hex[] | readonly ByteArray[]; /** Proof for each blob. */ proofs: _blobsType | readonly Hex[] | readonly ByteArray[]; }>; export type ToBlobSidecarsReturnType = (to extends 'bytes' ? BlobSidecars : never) | (to extends 'hex' ? BlobSidecars : never); export type ToBlobSidecarsErrorType = BlobsToCommitmentsErrorType | ToBlobsErrorType | blobsToProofsErrorType | ErrorType; /** * Transforms arbitrary data (or blobs, commitments, & proofs) into a sidecar array. * * @example * ```ts * import { toBlobSidecars, stringToHex } from 'viem' * * const sidecars = toBlobSidecars({ data: stringToHex('hello world') }) * ``` * * @example * ```ts * import { * blobsToCommitments, * toBlobs, * blobsToProofs, * toBlobSidecars, * stringToHex * } from 'viem' * * const blobs = toBlobs({ data: stringToHex('hello world') }) * const commitments = blobsToCommitments({ blobs, kzg }) * const proofs = blobsToProofs({ blobs, commitments, kzg }) * * const sidecars = toBlobSidecars({ blobs, commitments, proofs }) * ``` */ export declare function toBlobSidecars(parameters: ToBlobSidecarsParameters): ToBlobSidecarsReturnType; export {}; //# sourceMappingURL=toBlobSidecars.d.ts.map