signAndExecuteTransactionBlock method

Future<SuiExecuteTransactionResponse> signAndExecuteTransactionBlock(
  1. SuiAccount signer,
  2. Transaction transaction, {
  3. BuildOptions? options,
  4. SuiTransactionBlockResponseOptions? responseOptions,
  5. @Deprecated('requestType will be ignored by JSON RPC in the future') ExecuteTransaction requestType = ExecuteTransaction.WaitForEffectsCert,
})

Builds, signs (with signer) and executes transaction, returning the full transaction-block response. Pass responseOptions to control which effects/changes are returned.

Implementation

Future<SuiTransactionBlockResponse> signAndExecuteTransactionBlock(
    SuiAccount signer, Transaction transaction,
    {BuildOptions? options,
    SuiTransactionBlockResponseOptions? responseOptions,
    @Deprecated('requestType will be ignored by JSON RPC in the future')
    ExecuteTransaction requestType =
        ExecuteTransaction.WaitForEffectsCert}) async {
  options ??= BuildOptions(client: this);
  options.client ??= this;
  transaction.setSenderIfNotSet(signer.getAddress());
  final transactionBytes = await transaction.build(options);
  final signWithBytes = signer.keyPair.signTransactionBlock(transactionBytes);
  return await executeTransactionBlock(
      signWithBytes.bytes, [signWithBytes.signature],
      options: responseOptions,
      // ignore: deprecated_member_use_from_same_package
      requestType: requestType);
}