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

Function getUnionDecoder

  • getUnionDecoder<const TVariants extends readonly Decoder<any>[]>(
        variants: TVariants,
        getIndexFromBytes: (bytes: ReadonlyUint8Array, offset: number) => number,
    ): Decoder<GetDecoderTypeFromVariants<TVariants>>
  • Creates a union decoder from the provided array of decoder.

    Type Parameters

    • const TVariants extends readonly Decoder<any>[]

    Parameters

    • variants: TVariants

      The variant decoders of the union.

    • getIndexFromBytes: (bytes: ReadonlyUint8Array, offset: number) => number

      A function that returns the index of the variant from the byte array.

    Returns Decoder<GetDecoderTypeFromVariants<TVariants>>

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

Settings

Member Visibility
Solana JavaScript SDK
  • Loading...

Generated using TypeDoc