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

Function getNullableEncoder

  • getNullableEncoder<TFrom, TSize extends number>(
        item: FixedSizeEncoder<TFrom, TSize>,
        config: NullableCodecConfig<NumberEncoder> & {
            noneValue: "zeroes";
            prefix: null;
        },
    ): FixedSizeEncoder<TFrom | null, TSize>
  • Creates a encoder for an optional value using null as the None value.

    Type Parameters

    • TFrom
    • TSize extends number

    Parameters

    • item: FixedSizeEncoder<TFrom, TSize>

      The encoder to use for the value that may be present.

    • config: NullableCodecConfig<NumberEncoder> & { noneValue: "zeroes"; prefix: null }

      A set of config for the encoder.

    Returns FixedSizeEncoder<TFrom | null, TSize>

    • Defined in packages/codecs-data-structures/dist/types/nullable.d.ts:44
  • getNullableEncoder<TFrom>(
        item: FixedSizeEncoder<TFrom>,
        config: NullableCodecConfig<FixedSizeNumberEncoder> & {
            noneValue: "zeroes";
        },
    ): FixedSizeEncoder<TFrom | null>
  • Creates a encoder for an optional value using null as the None value.

    Type Parameters

    • TFrom

    Parameters

    • item: FixedSizeEncoder<TFrom>

      The encoder to use for the value that may be present.

    • config: NullableCodecConfig<FixedSizeNumberEncoder> & { noneValue: "zeroes" }

      A set of config for the encoder.

    Returns FixedSizeEncoder<TFrom | null>

    • Defined in packages/codecs-data-structures/dist/types/nullable.d.ts:48
  • getNullableEncoder<TFrom>(
        item: FixedSizeEncoder<TFrom>,
        config: NullableCodecConfig<NumberEncoder> & { noneValue: "zeroes" },
    ): VariableSizeEncoder<TFrom | null>
  • Creates a encoder for an optional value using null as the None value.

    Type Parameters

    • TFrom

    Parameters

    • item: FixedSizeEncoder<TFrom>

      The encoder to use for the value that may be present.

    • config: NullableCodecConfig<NumberEncoder> & { noneValue: "zeroes" }

      A set of config for the encoder.

    Returns VariableSizeEncoder<TFrom | null>

    • Defined in packages/codecs-data-structures/dist/types/nullable.d.ts:51
  • getNullableEncoder<TFrom>(
        item: Encoder<TFrom>,
        config?: NullableCodecConfig<NumberEncoder> & {
            noneValue?: ReadonlyUint8Array;
        },
    ): VariableSizeEncoder<TFrom | null>
  • Creates a encoder for an optional value using null as the None value.

    Type Parameters

    • TFrom

    Parameters

    • item: Encoder<TFrom>

      The encoder to use for the value that may be present.

    • Optionalconfig: NullableCodecConfig<NumberEncoder> & { noneValue?: ReadonlyUint8Array }

      A set of config for the encoder.

    Returns VariableSizeEncoder<TFrom | null>

    • Defined in packages/codecs-data-structures/dist/types/nullable.d.ts:54

Settings

Member Visibility
Solana JavaScript SDK
  • Loading...

Generated using TypeDoc