Skip to content

Blobs.toCommitments

Compute commitments from a list of Blobs.Blobs.

Imports

Named
import { Blobs } from 'ox'

Examples

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

Configuring Return Type

It is possible to configure the return type with the as option.

import { Blobs } from 'ox'
import { kzg } from './kzg'
 
const blobs = Blobs.from('0xdeadbeef')
const commitments = Blobs.toCommitments(blobs, {
  as: 'Bytes', 
  kzg,
})
[Uint8Array [ ... ], Uint8Array [ ... ]]

Definition

function toCommitments<blobs, as>(
  blobs: blobs | Blobs<Bytes.Bytes> | Blobs<Hex.Hex>,
  options: toCommitments.Options<as>,
): toCommitments.ReturnType<as>

Source: src/core/Blobs.ts

Parameters

blobs

  • Type: blobs | Blobs<Bytes.Bytes> | Blobs<Hex.Hex>

The Blobs.Blobs to transform to commitments.

options

  • Type: toCommitments.Options<as>

Options.

options.as

  • Type: "Bytes" | "Hex" | as
  • Optional

Return type.

options.kzg

  • Type: Pick

KZG implementation.

Return Type

The commitments.

toCommitments.ReturnType<as>