Skip to main content
import { StateRoot } from 'voltaire-effect'
import { Effect } from 'effect'

// From various inputs
const root = yield* StateRoot.from('0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421')
const fromBytes = yield* StateRoot.from(new Uint8Array(32))
const fromBigInt = yield* StateRoot.from(0n)

// Empty root (all zeros)
const emptyRoot = StateRoot.empty()

API

FunctionSignature
from(input) => Effect<StateRootType, InvalidLengthError>
empty() => StateRootType (32 zero bytes)
StateRootSchemaAccepts string, Uint8Array, bigint, number