AccountChangeAuthorizationSettings.deserialize constructor

AccountChangeAuthorizationSettings.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory AccountChangeAuthorizationSettings.deserialize(BinaryReader reader) {
  // Read [AccountChangeAuthorizationSettings] fields.
  final flags = reader.readInt32();
  final confirmed = (flags & 8) != 0;
  final hash = reader.readInt64();
  final encryptedRequestsDisabled =
      (flags & 1) != 0 ? reader.readBool() : null;
  final callRequestsDisabled = (flags & 2) != 0 ? reader.readBool() : null;

  // Construct [AccountChangeAuthorizationSettings] object.
  final returnValue = AccountChangeAuthorizationSettings(
    confirmed: confirmed,
    hash: hash,
    encryptedRequestsDisabled: encryptedRequestsDisabled,
    callRequestsDisabled: callRequestsDisabled,
  );

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