• Preparing search index...
  • The search index is not available
Solana JavaScript SDK
  • Solana JavaScript SDK
  • @solana/codecs
  • addCodecSentinel

Function addCodecSentinel

  • addCodecSentinel<TFrom, TTo>(
        codec: FixedSizeCodec<TFrom, TTo>,
        sentinel: ReadonlyUint8Array,
    ): FixedSizeCodec<TFrom, TTo>
  • Creates a Codec that writes a Uint8Array sentinel after the encoded value and, when decoding, continues reading until the sentinel is found.

    Note that, if the sentinel is found in the encoded value or not found in the byte array to decode, an error is thrown.

    Type Parameters

    • TFrom
    • TTo

    Parameters

    • codec: FixedSizeCodec<TFrom, TTo>
    • sentinel: ReadonlyUint8Array

    Returns FixedSizeCodec<TFrom, TTo>

    • Defined in packages/codecs-core/dist/types/add-codec-sentinel.d.ts:25
  • addCodecSentinel<TFrom, TTo>(
        codec: Codec<TFrom, TTo>,
        sentinel: ReadonlyUint8Array,
    ): VariableSizeCodec<TFrom, TTo>
  • Creates a Codec that writes a Uint8Array sentinel after the encoded value and, when decoding, continues reading until the sentinel is found.

    Note that, if the sentinel is found in the encoded value or not found in the byte array to decode, an error is thrown.

    Type Parameters

    • TFrom
    • TTo

    Parameters

    • codec: Codec<TFrom, TTo>
    • sentinel: ReadonlyUint8Array

    Returns VariableSizeCodec<TFrom, TTo>

    • Defined in packages/codecs-core/dist/types/add-codec-sentinel.d.ts:26

Settings

Member Visibility
Solana JavaScript SDK
  • Loading...

Generated using TypeDoc