> ## 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](https://docs.dynamic.xyz/docs/javascript/reference/sui/sign-and-execute-transaction.md) 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: `showBalanceChanges`, `showEffects`, `showEvents`, `showInput`, `showObjectChanges`, `showRawEffects`, `showRawInput`. By default, only the transaction digest is returned. |
| `requestType` | `SuiExecuteTransactionRequestType` (optional) | The request type to use for the transaction execution: `'WaitForEffectsCert'` or `'WaitForLocalExecution'` |
| `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](https://docs.dynamic.xyz/docs/javascript/reference/sui/sign-and-execute-transaction.md) - The recommended replacement for this function
* [signTransactionBlock](https://docs.dynamic.xyz/docs/javascript/reference/sui/sign-transaction-block.md) - Sign a transaction block without executing


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.