executeTransaction method

Future<SuiExecuteTransactionResponse> executeTransaction({
  1. required Uint8List txnBytes,
  2. required SignatureScheme signatureScheme,
  3. required Uint8List signature,
  4. required PublicKey pubkey,
  5. SuiTransactionBlockResponseOptions? options,
  6. @Deprecated('requestType will be ignored by JSON RPC in the future') ExecuteTransaction requestType = ExecuteTransaction.WaitForEffectsCert,
})

Implementation

Future<SuiExecuteTransactionResponse> executeTransaction({
  required Uint8List txnBytes,
  required SignatureScheme signatureScheme,
  required Uint8List signature,
  required PublicKey pubkey,
  SuiTransactionBlockResponseOptions? options,
  @Deprecated('requestType will be ignored by JSON RPC in the future')
  ExecuteTransaction requestType = ExecuteTransaction.WaitForEffectsCert,
}) async {
  final serializedSig = <int>[];
  serializedSig.add(SIGNATURE_SCHEME_TO_FLAG.schemeToFlag(signatureScheme));
  serializedSig.addAll(signature);
  serializedSig.addAll(pubkey.toRawBytes());
  final result = await executeTransactionBlock(
    base64Encode(txnBytes),
    [base64Encode(serializedSig)],
    options: options ?? SuiTransactionBlockResponseOptions(
      showInput: true,
      showEffects: true,
      showEvents: true,
      showObjectChanges: true,
      showBalanceChanges: true,
    ),
    requestType: requestType,
  );
  return result;
}