signTransaction
Signs a Stellar transaction XDR using the connected wallet. The wallet provider handles the actual signing via its native API (e.g. Freighter, Lobstr, OneKey).Usage
Building a Transaction XDR
Use the@stellar/stellar-sdk to build a transaction before signing:
Parameters
| Parameter | Type | Description |
|---|---|---|
transactionXdr | string | The base64-encoded transaction envelope XDR to sign |
walletAccount | StellarWalletAccount | The wallet account to sign the transaction with |
client | DynamicClient | (optional) The Dynamic client instance. Only required when using multiple Dynamic clients |
Returns
Promise<{ signedXdr: string }> - A promise that resolves to an object containing the signed transaction XDR.
Errors
| Error | Description |
|---|---|
NotStellarProviderError | Thrown if the wallet account’s provider is not a Stellar provider |
React
Related functions
- addStellarExtension - Add Stellar support to your client
- isStellarWalletAccount - Check if a wallet account is a Stellar account