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

Function combineCodec

  • combineCodec<TFrom, TTo, TSize extends number>(
        encoder: FixedSizeEncoder<TFrom, TSize>,
        decoder: FixedSizeDecoder<TTo, TSize>,
    ): FixedSizeCodec<TFrom, TTo, TSize>
  • Combines an encoder and a decoder into a codec. The encoder and decoder must have the same fixed size, max size and description. If a description is provided, it will override the encoder and decoder descriptions.

    Type Parameters

    • TFrom
    • TTo
    • TSize extends number

    Parameters

    • encoder: FixedSizeEncoder<TFrom, TSize>
    • decoder: FixedSizeDecoder<TTo, TSize>

    Returns FixedSizeCodec<TFrom, TTo, TSize>

    • Defined in packages/codecs-core/src/combine-codec.ts:26
  • combineCodec<TFrom, TTo>(
        encoder: VariableSizeEncoder<TFrom>,
        decoder: VariableSizeDecoder<TTo>,
    ): VariableSizeCodec<TFrom, TTo>
  • Combines an encoder and a decoder into a codec. The encoder and decoder must have the same fixed size, max size and description. If a description is provided, it will override the encoder and decoder descriptions.

    Type Parameters

    • TFrom
    • TTo

    Parameters

    • encoder: VariableSizeEncoder<TFrom>
    • decoder: VariableSizeDecoder<TTo>

    Returns VariableSizeCodec<TFrom, TTo>

    • Defined in packages/codecs-core/src/combine-codec.ts:30
  • combineCodec<TFrom, TTo>(
        encoder: Encoder<TFrom>,
        decoder: Decoder<TTo>,
    ): Codec<TFrom, TTo>
  • Combines an encoder and a decoder into a codec. The encoder and decoder must have the same fixed size, max size and description. If a description is provided, it will override the encoder and decoder descriptions.

    Type Parameters

    • TFrom
    • TTo

    Parameters

    • encoder: Encoder<TFrom>
    • decoder: Decoder<TTo>

    Returns Codec<TFrom, TTo>

    • Defined in packages/codecs-core/src/combine-codec.ts:34

Settings

Member Visibility
Solana JavaScript SDK
  • Loading...

Generated using TypeDoc