TransactionBlock class
Methods
add (dynamic transaction )
→ TransactionResult
Add a transaction to the transaction block.
build ([BuildOptions ? options ])
→ Future <Uint8List >
Build the transaction to BCS bytes.
getDigest (BuildOptions options )
→ Future <String >
Derive transaction digest
isBuilderCallArg (dynamic arg )
→ 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
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
object (dynamic value )
→ Map <String , dynamic >
Add a new object input to the transaction.
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
pure (dynamic value , [String ? type ])
→ Map <String , dynamic >
Add a new non-object input to the transaction.
pureAddress (String address )
→ Map <String , dynamic >
pureBase64 (String value )
→ Map <String , dynamic >
pureBool (bool value )
→ Map <String , dynamic >
pureBytes (Uint8List value )
→ Map <String , dynamic >
pureHex (String hex )
→ Map <String , dynamic >
pureInt (int value , [String type = BCS.U64 ])
→ Map <String , dynamic >
pureString (String str )
→ Map <String , dynamic >
pureVector <T > (List <T > vector , String type )
→ Map <String , dynamic >
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 <Map <String , dynamic > > amounts )
→ TransactionResult
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 )
→ TransactionBlock
Converts from a serialized transaction format to a Transaction
class.
There are two supported serialized formats:
fromBytes (Uint8List bytes )
→ TransactionBlock
fromKind (dynamic serialized )
→ TransactionBlock
Converts from a serialize transaction kind (built with build({ onlyTransactionKind: true })
) to a Transaction
class.
Supports either a byte array, or base64-encoded bytes.