Transaction class

Constructors

Transaction([Transaction? transaction])

Properties

blockData TransactionDataV1
no setter
gas Map<String, dynamic>
Returns an argument for the gas coin, to be used in a transaction.
no setter
hashCode int
The hash code for this object.
no setterinherited
pure Pure
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(dynamic transaction) TransactionResult
addIntentResolver(String intent, IntentResolver resolver) → void
Registers an async resolver for a named intent ($Intent command). The resolver runs during build, replacing its intent commands with concrete ones. Registering the same intent twice with a different resolver throws.
build([BuildOptions? options]) Future<Uint8List>
Build the transaction to BCS bytes.
getData() TransactionData
getDigest(BuildOptions options) Future<String>
Derive transaction digest
isBuilderCallArg(dynamic arg) bool
isPreparedForSerialization({List<String>? supportedIntents}) bool
Whether the transaction has no unresolved $Intent commands (other than those in supportedIntents) — i.e. it can be serialized to JSON as-is.
isReceivingType(dynamic type) bool
isUsedAsMutable(TransactionBlockDataBuilder transactionData, int index) bool
isUsedAsReceiving(TransactionBlockDataBuilder transactionData, int index) bool
makeMoveVec({required dynamic objects, String? type}) TransactionResult
mergeCoins(dynamic destination, List sources) TransactionResult
moveCall(String target, {List? typeArguments, List? arguments}) TransactionResult
normalizeInputs(BuildOptions options) Future<void>
normalizeRawArgument(dynamic arg, BcsType schema) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
object(dynamic value) Map<String, dynamic>
objectId(String value) Map<String, dynamic>
objectRef(SuiObjectRef args) Map<String, dynamic>
Adds an object input from a fully-resolved object reference (use object(id) for an ID).
prepareForSerialization([SerializeTransactionOptions? options]) Future<void>
Resolves intents so the transaction can be serialized to JSON, without requiring gas/sender/object versions (unlike build). Intents named in SerializeTransactionOptions.supportedIntents are left for the recipient.
publish(List modules, List<String> dependencies) TransactionResult
pureAddress(String address) Map<String, dynamic>
pureBool(bool value) Map<String, dynamic>
pureInt(int value, [String type = LegacyBCS.U64]) Map<String, dynamic>
pureString(String str) Map<String, dynamic>
pureVector(List value, [String type = LegacyBCS.U64]) Map<String, dynamic>
receivingRef(SuiObjectRef args) Map<String, dynamic>
Adds a receiving object input from a fully-resolved object reference.
resolveObjectReferences(BuildOptions options) Future<void>
serialize() String
Serializes to a JSON string (not BCS bytes), so an incomplete transaction can be passed around and finished elsewhere.
setExpiration(int? epoch) → void
setGasBudget(BigInt budget) → void
setGasOwner(String owner) → void
setGasPayment(List<SuiObjectRef> payments) → void
setGasPrice(BigInt price) → void
setSender(String sender) → void
setSenderIfNotSet(String sender) → void
Sets the sender only if not already set. Useful for sponsored transactions.
sharedObjectRef(SharedObjectRef args) Map<String, dynamic>
Adds a shared object input from a resolved shared object reference (use object(id) for an ID).
sign(SignOptions options) Future<SignatureWithBytes>
Build the transaction to BCS bytes, and sign it with the provided keypair.
splitCoins(dynamic coin, List amounts) TransactionResult
toGrpcTransaction() Transaction
toJson([SerializeTransactionOptions? options]) String
toJsonAsync([SerializeTransactionOptions? options]) Future<String>
Resolves intents and serializes the transaction to a JSON string. Use this instead of the synchronous toJson when the transaction contains intents (e.g. coinWithBalance).
toString() String
A string representation of this object.
inherited
transferObjects(List objects, dynamic address) TransactionResult
upgrade({required List modules, required List<String> dependencies, required String packageId, required dynamic ticket}) TransactionResult

Operators

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

Static Methods

from(String serialized) Transaction
Builds a Transaction from a serialized format: either a Transaction_serialize string, or base64-encoded BCS transaction data.
fromBytes(Uint8List bytes) Transaction
fromKind(dynamic serialized) Transaction
Builds a Transaction from a serialized transaction kind (byte array or base64).