Transaction class
Constructors
-
Transaction(int chainTag, String blockRef, String expiration, List<
Clause> clauses, String gasPriceCoef, String gas, String? dependsOn, String nonce, Reserved? reserved) - Construct a Transaction. @param chainTag eg. "1" @param blockRef eg. "0x00000000aabbccdd" @param expiration eg. "32" @param clauses See Clause.java @param gasPriceCoef eg. "128" @param gas eg. "21000" @param dependsOn eg. "0x..." as block ID, or null if not wish to depends on. @param nonce eg. "12345678", as a random positive number max width is 8 bytes. @param reserved See Reserved.java
-
Transaction.fromBytes(Uint8List chainTag, Uint8List blockRef, Uint8List expiration, List clauses, Uint8List gasPriceCoef, Uint8List gas, Uint8List dependsOn, Uint8List nonce, List<
Uint8List> ? reserved)
Properties
- blockRef ↔ CompactFixedBlobKind
-
getter/setter pair
- chainTag ↔ NumericKind
-
getter/setter pair
-
clauses
↔ List<
Clause> -
getter/setter pair
- dependsOn ↔ NullableFixedBlobKind
-
getter/setter pair
- expiration ↔ NumericKind
-
getter/setter pair
- gas ↔ NumericKind
-
getter/setter pair
- gasPriceCoef ↔ NumericKind
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- nonce ↔ NumericKind
-
getter/setter pair
- reserved ↔ Reserved?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- signature ↔ Uint8List?
-
getter/setter pair
Methods
-
clone(
) → Transaction - Clone current tx into a standalone object.
-
encode(
) → Uint8List - Encode a tx into bytes.
-
getDeleagtorAsAddressBytes(
) → Uint8List? - Get the delegator as Address type, in bytes. @return or null.
-
getDelegator(
) → Uint8List? - Get the delegator public key as bytes.
-
getDelegatorAsAddressString(
) → String? - Get the delegator as Address type, in string. @return or null.
-
getId(
) → Uint8List? - Calculate Tx id (32 bytes). @return or null.
-
getIdAsString(
) → String? - Get TX id as "0x..." = 2 chars 0x + 64 chars hex @return or null.
-
getIntrinsicGas(
) → int - Get the rough gas this tx will consume. @return
-
getOriginAsAddressBytes(
) → Uint8List? - Get "origin" of the tx by bytes Address style. Notice: Address != public key.
-
getOriginAsAddressString(
) → String? - Get "origin" of the tx by string Address style. Notice: Address != public key.
-
getOriginAsPublicKey(
) → Uint8List? - Get "origin" of the tx by public key bytes style. @return If can't decode just return null.
-
getSigningHash(
String? delegateFor) → Uint8List - Compute the hash result to be signed. @param delegateFor "0x..." the address to delegate for him or null.
-
isDelegated(
) → bool - Determine if this is a delegated transaction (vip-191)
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
packUnsignedTxBody(
) → List - Pack the objects bytes in a fixed order.
-
toJsonString(
) → String -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
calcDataGas(
Uint8List data) → int - Calculate the gas used by the data section.
-
calcIntrinsicGas(
List< Clause> clauses) → int - Calculate roughly the gas from a list of clauses.
-
decode(
Uint8List data, bool unsigned) → Transaction -
Decode a tx from Uint8List
data. -
fromJsonString(
String txBody) → dynamic
Constants
- delegatedMask → const int