getLamportsDecoder function

Decoder<Lamports> getLamportsDecoder(
  1. Decoder<Object?> innerDecoder
)

Returns a decoder that converts an array of bytes representing a number to a Lamports value using the provided innerDecoder.

The inner decoder determines how many bits are used to decode the numeric value. It can be a decoder for BigInt (e.g. u64) or int (e.g. u8, u16).

Implementation

Decoder<Lamports> getLamportsDecoder(Decoder<Object?> innerDecoder) {
  if (innerDecoder is Decoder<BigInt>) {
    return _lamportsDecoderForBigInt(innerDecoder);
  }
  return _lamportsDecoderForInt(innerDecoder as Decoder<int>);
}