signAndExecuteTransactionBlock method

Future<SuiTransactionBlockResponse> 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,
})

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,
    requestType: requestType
  );
}