• Converts a bigint number into a 256-bit big-endian (U256BE) representation as a Uint8Array.

    Parameters

    • bigIntNumber: bigint

      The bigint number to be converted to a 256-bit big-endian format.

    Returns Uint8Array<ArrayBuffer>

    A Uint8Array representing the 256-bit big-endian encoded value.

    If the number is out of range for a 256-bit unsigned integer.

    const bigIntValue = BigInt('123456789012345678901234567890');
    const u256Bytes = toU256BE(bigIntValue);
    console.log(u256Bytes);