• Preparing search index...
  • The search index is not available
Solana JavaScript SDK
  • Solana JavaScript SDK
  • @solana/options
  • getOptionEncoder

Function getOptionEncoder

  • getOptionEncoder<TFrom, TSize extends number>(
        item: FixedSizeEncoder<TFrom, TSize>,
        config: OptionCodecConfig<NumberEncoder> & {
            noneValue: "zeroes";
            prefix: null;
        },
    ): FixedSizeEncoder<OptionOrNullable<TFrom>, TSize>
  • Creates a encoder for an optional value using the Option<T> type.

    Type Parameters

    • TFrom
    • TSize extends number

    Parameters

    • item: FixedSizeEncoder<TFrom, TSize>

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

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

      A set of config for the encoder.

    Returns FixedSizeEncoder<OptionOrNullable<TFrom>, TSize>

    • Defined in packages/options/src/option-codec.ts:89
  • getOptionEncoder<TFrom>(
        item: FixedSizeEncoder<TFrom>,
        config: OptionCodecConfig<FixedSizeNumberEncoder> & { noneValue: "zeroes" },
    ): FixedSizeEncoder<OptionOrNullable<TFrom>>
  • Creates a encoder for an optional value using the Option<T> type.

    Type Parameters

    • TFrom

    Parameters

    • item: FixedSizeEncoder<TFrom>

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

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

      A set of config for the encoder.

    Returns FixedSizeEncoder<OptionOrNullable<TFrom>>

    • Defined in packages/options/src/option-codec.ts:93
  • getOptionEncoder<TFrom>(
        item: FixedSizeEncoder<TFrom>,
        config: OptionCodecConfig<NumberEncoder> & { noneValue: "zeroes" },
    ): VariableSizeEncoder<OptionOrNullable<TFrom>>
  • Creates a encoder for an optional value using the Option<T> type.

    Type Parameters

    • TFrom

    Parameters

    • item: FixedSizeEncoder<TFrom>

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

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

      A set of config for the encoder.

    Returns VariableSizeEncoder<OptionOrNullable<TFrom>>

    • Defined in packages/options/src/option-codec.ts:97
  • getOptionEncoder<TFrom>(
        item: Encoder<TFrom>,
        config?: OptionCodecConfig<NumberEncoder> & {
            noneValue?: ReadonlyUint8Array;
        },
    ): VariableSizeEncoder<OptionOrNullable<TFrom>>
  • Creates a encoder for an optional value using the Option<T> type.

    Type Parameters

    • TFrom

    Parameters

    • item: Encoder<TFrom>

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

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

      A set of config for the encoder.

    Returns VariableSizeEncoder<OptionOrNullable<TFrom>>

    • Defined in packages/options/src/option-codec.ts:101

Settings

Member Visibility
Solana JavaScript SDK
  • Loading...

Generated using TypeDoc