Transaction class
Transaction represents a unitary transaction in the ArchEthic network.
Constructors
-
Transaction({String? address, Balance? balance, int? chainLength, List<
CrossValidationStamp> ? crossValidationStamps, Data? data, List<TransactionInput> ? inputs, String? originSignature, String? previousPublicKey, String? previousSignature, required String? type, ValidationStamp? validationStamp, int? version = cVersion}) -
Transaction.fromJson(Map<
String, dynamic> json) -
factory
Properties
- address ↔ String?
-
- Address: hash of the new generated public key for the given transaction
getter/setter pair - balance ↔ Balance?
-
- Balance represents a ledger balance
getter/setter pair - chainLength ↔ int?
-
- Length of the chain
getter/setter pair -
crossValidationStamps
↔ List<
CrossValidationStamp> ? -
- Cross validation stamps: endorsements of the validation stamp from the coordinator
getter/setter pair - data ↔ Data?
-
- Data: transaction data zone (identity, keychain, smart contract, etc.)
getter/setter pair - hashCode → int
-
The hash code for this object.
no setterinherited
-
inputs
↔ List<
TransactionInput> ? -
TransactionInput
represents the inputs from the transactiongetter/setter pair - originSignature ↔ String?
-
- Origin signature: signature from the device which originated the transaction (used in the Proof of work)
getter/setter pair - previousPublicKey ↔ String?
-
- Previous public key: previous generated public key matching the previous signature
getter/setter pair - previousSignature ↔ String?
-
- Previous signature: signature from the previous public key
getter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type ↔ String?
-
- Type: transaction type
getter/setter pair - validationStamp ↔ ValidationStamp?
-
- ValidationStamp: coordinator work result
getter/setter pair - version ↔ int?
-
- Version: version of the transaction (used for backward compatiblity)
getter/setter pair
Methods
-
addAuthorizedKey(
dynamic publicKey, dynamic encryptedSecretKey) → Transaction - Add an authorized public key for secret decryption to the transaction with its encrypted secret key @param {String | Uint8List} publicKey Authorized public key (hexadecimal or or binary buffer) @param {String | Uint8List} encryptedSecretKey Encrypted secret key for the given public key (hexadecimal or binary buffer)
-
addNFTTransfer(
dynamic to, double amount, dynamic nftAddress) → Transaction - Add a NFT transfer to the transaction @param {String | Uint8List} to Address of the recipient (hexadecimal or binary buffer) @param {double} amount Amount of UCO to transfer @param {String | Uint8List} nftAddress Address of NFT to spend (hexadecimal or binary buffer)
-
addRecipient(
dynamic to) → Transaction - Add recipient to the transaction @param {String | Uint8List} to Recipient address (hexadecimal or binary buffer)
-
addUCOTransfer(
dynamic to, double amount) → Transaction - Add a UCO transfer to the transaction @param {String | Uint8List} to Address of the recipient (hexadecimal or binary buffer) @param {double} amount Amount of UCO to transfer
-
build(
dynamic seed, int index, String curve, {String hashAlgo = 'sha256'}) → Transaction - Generate the transaction address, keys and signatures @param {String | Uint8List} seed Transaction chain seed (hexadecimal or binary buffer) @param {Integer} index Number of transaction on the chain @param {String} curve Elliptic curve to use for the key generation @param {String} hashAlgo Hash algorithm to use for the address generation
-
convertToJSON(
) → String - Convert the transaction in JSON
-
hexAuthorizedKeys(
List< AuthorizedKey> authorizedKeys) → Map -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
originSign(
dynamic privateKey) → Transaction - Sign the transaction with an origin private key @param {String | Uint8List} originPv Origin Private Key (hexadecimal or binary buffer)
-
originSignaturePayload(
) → Uint8List -
previousSignaturePayload(
) → Uint8List - Generate the payload for the previous signature by encoding address, type and data
-
setCode(
String code) → Transaction - Add smart contract code to the transaction @param {String} code Smart contract code
-
setContent(
dynamic content) → Transaction - Add a content to the transaction @param {String | Uint8List} content Hosted content
-
setSecret(
dynamic secret) → Transaction - Add a secret to the transaction @param {String | Uint8List} secret Secret encrypted (hexadecimal or binary buffer)
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getQLFields(
) → String -
initData(
) → Data