• Preparing search index...
  • The search index is not available
Solana JavaScript SDK
  • Solana JavaScript SDK
  • @solana/codecs-data-structures
  • getLiteralUnionCodec

Function getLiteralUnionCodec

  • getLiteralUnionCodec<const TVariants extends readonly Variant[]>(
        variants: TVariants,
    ): FixedSizeCodec<
        GetTypeFromVariants<TVariants>,
        GetTypeFromVariants<TVariants>,
        1,
    >
  • Creates a literal union codec.

    Type Parameters

    • const TVariants extends readonly Variant[]

    Parameters

    • variants: TVariants

      The variant codecs of the literal union.

    Returns FixedSizeCodec<
        GetTypeFromVariants<TVariants>,
        GetTypeFromVariants<TVariants>,
        1,
    >

    • Defined in packages/codecs-data-structures/src/literal-union.ts:118
  • getLiteralUnionCodec<
        const TVariants extends readonly Variant[],
        TSize extends number,
    >(
        variants: TVariants,
        config: LiteralUnionCodecConfig<NumberCodec> & {
            size: FixedSizeNumberCodec<TSize>;
        },
    ): FixedSizeCodec<
        GetTypeFromVariants<TVariants>,
        GetTypeFromVariants<TVariants>,
        TSize,
    >
  • Creates a literal union codec.

    Type Parameters

    • const TVariants extends readonly Variant[]
    • TSize extends number

    Parameters

    • variants: TVariants

      The variant codecs of the literal union.

    • config: LiteralUnionCodecConfig<NumberCodec> & { size: FixedSizeNumberCodec<TSize> }

      A set of config for the codec.

    Returns FixedSizeCodec<
        GetTypeFromVariants<TVariants>,
        GetTypeFromVariants<TVariants>,
        TSize,
    >

    • Defined in packages/codecs-data-structures/src/literal-union.ts:121
  • getLiteralUnionCodec<const TVariants extends readonly Variant[]>(
        variants: TVariants,
        config?: LiteralUnionCodecConfig<NumberCodec>,
    ): VariableSizeCodec<GetTypeFromVariants<TVariants>>
  • Creates a literal union codec.

    Type Parameters

    • const TVariants extends readonly Variant[]

    Parameters

    • variants: TVariants

      The variant codecs of the literal union.

    • Optionalconfig: LiteralUnionCodecConfig<NumberCodec>

      A set of config for the codec.

    Returns VariableSizeCodec<GetTypeFromVariants<TVariants>>

    • Defined in packages/codecs-data-structures/src/literal-union.ts:125

Settings

Member Visibility
Solana JavaScript SDK
  • Loading...

Generated using TypeDoc