> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# signAndExecuteTransactionBlock (Sui)

# signAndExecuteTransactionBlock

> **Deprecated:** This function is deprecated. Use [signAndExecuteTransaction](/javascript/reference/sui/sign-and-execute-transaction) instead.

Signs and executes a Sui transaction block in a single step.

## Usage

```javascript theme={"system"}
import { signAndExecuteTransactionBlock, isSuiWalletAccount } from "@dynamic-labs-sdk/sui";
import { getPrimaryWalletAccount } from "@dynamic-labs-sdk/client";
import { Transaction } from "@mysten/sui/transactions";

const walletAccount = getPrimaryWalletAccount();

if (walletAccount && isSuiWalletAccount(walletAccount)) {
  const tx = new Transaction();
  tx.transferObjects(
    [tx.object("0x...")],
    tx.pure.address(recipientAddress)
  );

  const result = await signAndExecuteTransactionBlock({
    transactionBlock: tx,
    walletAccount,
    options: {
      showEffects: true,
      showEvents: true,
    },
  });

  console.log("Transaction digest:", result.digest);
}
```

## Parameters

| Parameter          | Type                                            | Description                                                                                                                               |
| ------------------ | ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `transactionBlock` | `Transaction`                                   | The Sui transaction block to sign and execute                                                                                             |
| `walletAccount`    | `SuiWalletAccount`                              | The wallet account to sign the transaction with                                                                                           |
| `options`          | `SuiTransactionBlockResponseOptions` (optional) | The fields to return in the execution response (e.g., transaction, effects, events). By default, only the transaction digest is returned. |
| `requestType`      | `ExecuteTransactionRequestType` (optional)      | The request type to use for the transaction execution                                                                                     |
| `client`           | `DynamicClient` (optional)                      | The Dynamic client instance. Only required when using multiple clients.                                                                   |

## Returns

`Promise<SuiSignAndExecuteTransactionBlockResult>` - A promise that resolves to an object containing the transaction result.

## Errors

| Error                       | Description                                                   |
| --------------------------- | ------------------------------------------------------------- |
| `NotSuiProviderError`       | Thrown if the wallet account's provider is not a Sui provider |
| `MethodNotImplementedError` | Thrown if the wallet provider does not implement this method  |

## Related functions

* [signAndExecuteTransaction](/javascript/reference/sui/sign-and-execute-transaction) - The recommended replacement for this function
* [signTransactionBlock](/javascript/reference/sui/sign-transaction-block) - Sign a transaction block without executing
