RawTransaction class

A raw serializable transaction class, used to generate transactions to broadcast to the network.

Algorand's msgpack encoding follows to following rules -

  1. Every integer must be encoded to the smallest type possible (0-255->8bit, 256-65535->16bit, etx)
  2. All fields names must be sorted
  3. All empty and 0 fields should be omitted
  4. Every positive number must be encoded as uint
  5. Binary blob should be used for binary data and string for strings
Implementers
Annotations
  • @JsonSerializable(fieldRename: FieldRename.kebab)

Constructors

RawTransaction({required int? fee, required int? firstValid, required Uint8List? genesisHash, required int? lastValid, required Address? sender, required String? type, required String? genesisId, required Uint8List? group, required Uint8List? lease, required Uint8List? note, required Address? rekeyTo})
RawTransaction.fromJson(Map<String, dynamic> json)
factory

Properties

fee int?
Paid by the sender to the FeeSink to prevent denial-of-service. The minimum fee on Algorand is currently 1000 microAlgos. This field cannot be combined with flat fee.
getter/setter pair
firstValid int?
The first round for when the transaction is valid. If the transaction is sent prior to this round it will be rejected by the network.
final
genesisHash Uint8List?
The hash of the genesis block of the network for which the transaction is valid. See the genesis hash for MainNet, TestNet, and BetaNet.
final
genesisId String?
The human-readable string that identifies the network for the transaction. The genesis ID is found in the genesis block.
final
group Uint8List?
The group specifies that the transaction is part of a group and, if so, specifies the hash of the transaction group.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
id String
Get the transaction id. The encoded transaction is hashed using sha512/256 and base32 encoded.
no setter
lastValid int?
The ending round for which the transaction is valid. After this round, the transaction will be rejected by the network.
final
lease Uint8List?
A lease enforces mutual exclusion of transactions. If this field is nonzero, then once the transaction is confirmed, it acquires the lease identified by the (Sender, Lease) pair of the transaction until the LastValid round passes.
getter/setter pair
note Uint8List?
Any data up to 1000 bytes.
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
rawId Uint8List
Get the binary representation of the transaction id. The encoded transaction is hashed using sha512/256 without base32 encoding
no setter
rekeyTo Address?
Specifies the authorized address. This address will be used to authorize all future transactions. TODO Change key
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sender Address?
The address of the account that pays the fee and amount.
final
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
type String?
Specifies the type of transaction. This value is automatically generated using any of the developer tools.
final

Methods

assignGroupId(Uint8List groupId) → void
Assign a group id to this transaction. GroupId is the id generated by the SDK.
export(String filePath) Future<File>
Export the transaction to a file. This creates a new File with the given filePath and streams the encoded transaction to it.
getEncodedTransaction() Uint8List
Get the encoded representation of the transaction with a prefix suitable for signing.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setFeeByFeePerByte(int feePerByte) Future
Sets the transaction fee according to feePerByte * estimateTxSize.
sign(Account account) Future<SignedTransaction>
Sign the transaction with the given account.
toBase64() String
Get the base64-encoded representation of the transaction..
toBytes() Uint8List
Get the bytes of this transaction.
toJson() Map<String, dynamic>
toMessagePack() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

MIN_TX_FEE_UALGOS → const int
The minimum transaction fees (in micro algos).
TX_PREFIX → const String
The prefix for a transaction.