AccountCreateContract.deserialize constructor

AccountCreateContract.deserialize(
  1. List<int> bytes
)

Implementation

factory AccountCreateContract.deserialize(List<int> bytes) {
  final decode = TronProtocolBufferImpl.decode(bytes);
  return AccountCreateContract(
    /// Transaction initiator address
    ownerAddress: TronAddress.fromBytes(decode.getField(1)),

    /// Account address to be activated
    accountAddress: TronAddress.fromBytes(decode.getField(2)),

    /// Account type. The external account type is Normal, and this field will not be displayed in the return value
    type: decode
            .getResult(3)
            ?.to<AccountType, int>((e) => AccountType.fromValue(e)) ??
        AccountType.normal,
  );
}