Skip to content
LogoLogo

commitmentsToVersionedHashes

Transform a list of commitments to their versioned hashes.

Import

import {  } from 'viem'

Usage

import { 
  , 
  , 
   
} from 'viem'
import {  } from './kzg'
 
const  = ({ : '0x1234' })
const  = ({ ,  })
const  = ({  
  ,  
}) 

Returns

Hex[] | ByteArray[]

List of versioned hashes corresponding to the input commitments.

Parameters

commitments

  • Type: Hex[] | ByteArray[]

List of commitments to transform into versioned hashes.

const  = ({ : '0x1234' })
const  = ({ ,  })
const  = ({ 
  ,  
  , 
})

to

  • Type: "bytes" | "hex"

The output type.

const  = ({ : '0x1234' })
const  = ({ ,  })
const  = ({ 
  , 
  : 'bytes'
})
 

version

  • Type: number
  • Default: 1

Version to tag onto the hashes. Defaults to 1.

const  = ({ : '0x1234' })
const  = ({ ,  })
const  = ({ 
  , 
  : 69, 
})