signTransaction
Signs a Sui transaction without executing it. This is useful when you need to collect signatures before execution, or when working with sponsored transactions.Usage
Parameters
| Parameter | Type | Description |
|---|---|---|
transaction | Transaction | The Sui transaction to sign (from @mysten/sui/transactions) |
walletAccount | SuiWalletAccount | The wallet account to sign the transaction with |
client | DynamicClient (optional) | The Dynamic client instance. Only required when using multiple clients. |
Returns
Promise<SuiSignTransactionResult> - A promise that resolves to an object containing:
signature- The transaction signaturebytes- The signed transaction bytes
Errors
| Error | Description |
|---|---|
NotSuiProviderError | Thrown if the wallet account’s provider is not a Sui provider |
Related functions
- signAndExecuteTransaction - Sign and execute a transaction in one step
- getSuiClient - Get the Sui client from a wallet account