Transaction class

Annotations
  • @freezed

Constructors

Transaction({@AddressJsonConverter() Address? address, Balance? balance, int? chainLength, @Default([]) List<CrossValidationStamp> crossValidationStamps, Data? data, @Default([]) List<TransactionInput> inputs, String? originSignature, @AddressJsonConverter() Address? previousAddress, String? previousPublicKey, String? previousSignature, String? type, ValidationStamp? validationStamp, @Default(cVersion) int version})
const
factory
Transaction.fromJson(Map<String, dynamic> json)
factory

Properties

address Address?
  • Address: hash of the new generated public key for the given transaction
  • no setterinherited
    balance Balance?
  • Balance represents a ledger balance
  • no setterinherited
    chainLength int?
  • Length of the chain
  • no setterinherited
    copyWith → $TransactionCopyWith<Transaction>
    Create a copy of Transaction with the given fields replaced by the non-null parameter values.
    no setterinherited
    crossValidationStamps List<CrossValidationStamp>
  • Cross validation stamps: endorsements of the validation stamp from the coordinator
  • no setterinherited
    data Data?
  • Data: transaction data zone (identity, keychain, smart contract, etc.)
  • no setterinherited
    hashCode int
    The hash code for this object.
    no setterinherited
    inputs List<TransactionInput>
  • TransactionInput represents the inputs from the transaction
  • no setterinherited
    originSignature String?
  • Origin signature: signature from the device which originated the transaction (used in the Proof of work)
  • no setterinherited
    previousAddress Address?
  • Previous address
  • no setterinherited
    previousPublicKey String?
  • Previous public key: previous generated public key matching the previous signature
  • no setterinherited
    previousSignature String?
  • Previous signature: signature from the previous public key
  • no setterinherited
    runtimeType Type
    A representation of the runtime type of the object.
    no setterinherited
    type String?
  • Type: transaction type
  • no setterinherited
    validationStamp ValidationStamp?
  • ValidationStamp: coordinator work result
  • no setterinherited
    version int
  • Version: version of the transaction (used for backward compatiblity)
  • no setterinherited

    Methods

    addOwnership(String secret, List<AuthorizedKey> authorizedKeys) Transaction
    Add an ownership with a secret and its authorized public keys @param {String} secret Secret encrypted (hexadecimal) @param {List
    addRecipient(String to, {String? action, List<Object>? args}) Transaction
    Add recipient to the transaction (with a named action) @param {String} to Recipient address (hexadecimal) @param {string} action The named action @param {List
    addTokenTransfer(String to, int amount, String tokenAddress, {int tokenId = 0}) Transaction
    Add a token transfer to the transaction @param {String} to Address of the recipient (hexadecimal) @param {int} amount Amount of token to transfer @param {String} tokenAddress Address of token to spend (hexadecimal) @param {int} tokenId ID of the token to use (default to 0)
    addUCOTransfer(String to, int amount) Transaction
    Add a UCO transfer to the transaction @param {String} to Address of the recipient (hexadecimal) @param {int} amount Amount of UCO to transfer
    build(String seed, int index, {String? curve = 'ed25519', String? hashAlgo = 'sha256', bool isSeedHexa = true}) → ({KeyPair keyPair, Transaction transaction})
    Generate the transaction address, keys and signatures @param {String} seed Transaction chain seed (hexadecimal or binary buffer) @param {int} 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
    noSuchMethod(Invocation invocation) → dynamic
    Invoked when a nonexistent method or property is accessed.
    inherited
    originSign(String privateKey) Transaction
    Sign the transaction with an origin private key @param {String} originPv Origin Private Key (hexadecimal)
    originSignaturePayload() Uint8List
    previousSignaturePayload() Uint8List
    Generate the payload for the previous signature by encoding address, type and data
    setAddress(Address address) Transaction
    Set the transaction builder with address (required for originSign) @param {Address} to Address
    setCode(String code) Transaction
    Add smart contract code to the transaction @param {String} code Smart contract code
    setContent(String content) Transaction
    Add a content to the transaction @param {String} content Hosted content
    setOriginSignature(String originSignature) Transaction
    Set the the transaction with an origin private key @param {String} to originSignature
    setPreviousSignatureAndPreviousPublicKey(String prevSign, String prevPubKey) Transaction
    Set the transaction builder with Previous Publickey and Previous Signature @param {String} to Previous Signature (hexadecimal) @param {String} to Previous PublicKey (hexadecimal)
    toJson() Map<String, dynamic>
    Serializes this Transaction to a JSON map.
    inherited
    toString() String
    A string representation of this object.
    inherited

    Operators

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

    Static Methods

    initData() Data