Skip to content

Blobs.toSidecars

Transforms Blobs.Blobs into a Blobs.BlobSidecars array.

Imports

Named
import { Blobs } from 'ox'

Examples

import { Blobs } from 'ox'
import { kzg } from './kzg'
 
const blobs = Blobs.from('0xdeadbeef')
const sidecars = Blobs.toSidecars(blobs, { kzg })

You can also provide your own commitments and proofs if you do not want toSidecars to compute them.

import { Blobs } from 'ox'
import { kzg } from './kzg'
 
const blobs = Blobs.from('0xdeadbeef')
const commitments = Blobs.toCommitments(blobs, { kzg })
const proofs = Blobs.toProofs(blobs, { commitments, kzg })
 
const sidecars = Blobs.toSidecars(blobs, { commitments, kzg, proofs })

Definition

function toSidecars<blobs>(
  blobs: blobs,
  options: toSidecars.Options<blobs>,
): toSidecars.ReturnType<blobs>

Source: src/core/Blobs.ts

Parameters

blobs

  • Type: blobs

The Blobs.Blobs to transform into Blobs.BlobSidecars.

options

  • Type: toSidecars.Options<blobs>

Options.

options.commitments

  • Type: readonly 0x${string}[] | readonly Uint8Array[] | blobs

Commitment for each blob.

options.kzg

  • Type: Kzg
  • Optional

options.proofs

  • Type: readonly 0x${string}[] | readonly Uint8Array[] | blobs

Proof for each blob.

Return Type

The Blobs.BlobSidecars.

toSidecars.ReturnType<blobs>