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

Function getOptionCodec

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

    Type Parameters

    • TFrom
    • TTo
    • TSize extends number

    Parameters

    • item: FixedSizeCodec<TFrom, TTo, TSize>

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

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

      A set of config for the codec.

    Returns FixedSizeCodec<OptionOrNullable<TFrom>, Option<TTo>, TSize>

    • Defined in packages/options/dist/types/option-codec.d.ts:83
  • getOptionCodec<TFrom, TTo = TFrom>(
        item: FixedSizeCodec<TFrom, TTo>,
        config: OptionCodecConfig<FixedSizeNumberCodec> & { noneValue: "zeroes" },
    ): FixedSizeCodec<OptionOrNullable<TFrom>, Option<TTo>>
  • Creates a codec for an optional value using the Option<T> type.

    Type Parameters

    • TFrom
    • TTo = TFrom

    Parameters

    • item: FixedSizeCodec<TFrom, TTo>

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

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

      A set of config for the codec.

    Returns FixedSizeCodec<OptionOrNullable<TFrom>, Option<TTo>>

    • Defined in packages/options/dist/types/option-codec.d.ts:87
  • getOptionCodec<TFrom, TTo = TFrom>(
        item: FixedSizeCodec<TFrom, TTo>,
        config: OptionCodecConfig<NumberCodec> & { noneValue: "zeroes" },
    ): VariableSizeCodec<OptionOrNullable<TFrom>, Option<TTo>>
  • Creates a codec for an optional value using the Option<T> type.

    Type Parameters

    • TFrom
    • TTo = TFrom

    Parameters

    • item: FixedSizeCodec<TFrom, TTo>

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

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

      A set of config for the codec.

    Returns VariableSizeCodec<OptionOrNullable<TFrom>, Option<TTo>>

    • Defined in packages/options/dist/types/option-codec.d.ts:90
  • getOptionCodec<TFrom, TTo = TFrom>(
        item: Codec<TFrom, TTo>,
        config?: OptionCodecConfig<NumberCodec> & {
            noneValue?: ReadonlyUint8Array;
        },
    ): VariableSizeCodec<OptionOrNullable<TFrom>, Option<TTo>>
  • Creates a codec for an optional value using the Option<T> type.

    Type Parameters

    • TFrom
    • TTo = TFrom

    Parameters

    • item: Codec<TFrom, TTo>

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

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

      A set of config for the codec.

    Returns VariableSizeCodec<OptionOrNullable<TFrom>, Option<TTo>>

    • Defined in packages/options/dist/types/option-codec.d.ts:93

Settings

Member Visibility
Solana JavaScript SDK
  • Loading...

Generated using TypeDoc