signTransaction
Signs an Aptos transaction without submitting it to the network. This is useful when you need to collect signatures before submitting, or when working with multi-signature transactions.Usage
Parameters
| Parameter | Type | Description |
|---|---|---|
transaction | AnyRawTransaction | The transaction to sign |
walletAccount | AptosWalletAccount | The wallet account to sign the transaction with |
asFeePayer | boolean (optional) | Whether to sign as the fee payer |
client | DynamicClient (optional) | The Dynamic client instance. Only required when using multiple clients. |
Returns
Promise<{ signature: AptosSignTransactionOutput }> - A promise that resolves to an object containing the signature output.
Errors
| Error | Description |
|---|---|
NotAptosProviderError | Thrown if the wallet account’s provider is not an Aptos provider |
Related functions
- signAndSubmitTransaction - Sign and submit a transaction in one step
- getAptosClient - Get the Aptos client from a wallet account