• Preparing search index...
  • The search index is not available
Solana JavaScript SDK
  • Solana JavaScript SDK
  • @solana/web3.js
  • addEncoderSentinel

Function addEncoderSentinel

  • addEncoderSentinel<TFrom>(
        encoder: FixedSizeEncoder<TFrom>,
        sentinel: ReadonlyUint8Array,
    ): FixedSizeEncoder<TFrom>
  • Creates an encoder that writes a Uint8Array sentinel after the encoded value. This is useful to delimit the encoded value when being read by a decoder.

    Note that, if the sentinel is found in the encoded value, an error is thrown.

    Type Parameters

    • TFrom

    Parameters

    • encoder: FixedSizeEncoder<TFrom>
    • sentinel: ReadonlyUint8Array

    Returns FixedSizeEncoder<TFrom>

    • Defined in packages/codecs-core/dist/types/add-codec-sentinel.d.ts:9
  • addEncoderSentinel<TFrom>(
        encoder: Encoder<TFrom>,
        sentinel: ReadonlyUint8Array,
    ): VariableSizeEncoder<TFrom>
  • Creates an encoder that writes a Uint8Array sentinel after the encoded value. This is useful to delimit the encoded value when being read by a decoder.

    Note that, if the sentinel is found in the encoded value, an error is thrown.

    Type Parameters

    • TFrom

    Parameters

    • encoder: Encoder<TFrom>
    • sentinel: ReadonlyUint8Array

    Returns VariableSizeEncoder<TFrom>

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

Settings

Member Visibility
Solana JavaScript SDK
  • Loading...

Generated using TypeDoc