InputStorePaymentStarsTopup.deserialize constructor

InputStorePaymentStarsTopup.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory InputStorePaymentStarsTopup.deserialize(BinaryReader reader) {
  // Read [InputStorePaymentStarsTopup] fields.
  final flags = reader.readInt32();
  final stars = reader.readInt64();
  final currency = reader.readString();
  final amount = reader.readInt64();
  final hasSpendPurposePeerField = (flags & 1) != 0;
  final spendPurposePeer =
      hasSpendPurposePeerField ? reader.readObject() as InputPeerBase : null;

  // Construct [InputStorePaymentStarsTopup] object.
  final returnValue = InputStorePaymentStarsTopup(
    stars: stars,
    currency: currency,
    amount: amount,
    spendPurposePeer: spendPurposePeer,
  );

  // Now return the deserialized [InputStorePaymentStarsTopup].
  return returnValue;
}