Transaction class
Methods
add (dynamic transaction )
→ TransactionResult
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
isReceivingType (dynamic type )
→ bool
isUsedAsMutable (TransactionBlockDataBuilder transactionData , int index )
→ bool
isUsedAsReceiving (TransactionBlockDataBuilder transactionData , int index )
→ bool
makeMoveVec ({required dynamic objects , String ? type })
→ TransactionResult
mergeCoins (Map <String , dynamic > destination , List <Map <String , dynamic > > 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 >
Add a new object input to the transaction using the fully-resolved object reference.
If you only have an object ID, use builder.object(id)
instead.
publish (List <String > 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 >
resolveObjectReferences (BuildOptions options )
→ Future <void >
serialize ()
→ String
Serialize the transaction to a string so that it can be sent to a separate context.
This is different from build
in that it does not serialize to BCS bytes, and instead
uses a separate format that is unique to the transaction builder. This allows
us to serialize partially-complete transactions, that can then be completed and
built in a separate context.
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 it has not already been set.
This is useful for sponsored transaction flows where the sender may not be the same as the signer address.
sharedObjectRef (SuiObject args )
→ Map <String , dynamic >
Add a new shared object input to the transaction using the fully-resolved shared object reference.
If you only have an object ID, use builder.object(id)
instead.
sign (SignOptions options )
→ Future <SignatureWithBytes >
Build the transaction to BCS bytes, and sign it with the provided keypair.
splitCoins (Map <String , dynamic > coin , List amounts )
→ TransactionResult
toJson ([SerializeTransactionOptions ? options ])
→ String
toString ()
→ String
A string representation of this object.
inherited
transferObjects (List objects , dynamic address )
→ TransactionResult
upgrade ({required List <String > modules , required List <String > dependencies , required String packageId , required dynamic ticket })
→ TransactionResult
Static Methods
from (String serialized )
→ Transaction
Converts from a serialized transaction format to a Transaction
class.
There are two supported serialized formats:
fromBytes (Uint8List bytes )
→ Transaction
fromKind (dynamic serialized )
→ Transaction
Converts from a serialize transaction kind (built with build({ onlyTransactionKind: true })
) to a Transaction
class.
Supports either a byte array, or base64-encoded bytes.