When using Privy’s server-side SDKs to sign transactions, you can use the authorization context to
automatically sign requests. Learn more about signing on the
server.
Use the
signTransaction method exported from the useSignTransaction hook to sign a transaction with a Solana wallet.Usage
Parameters
Uint8Array
required
The encoded transaction to be signed.
ConnectedStandardSolanaWallet
required
The Solana wallet to use for signing the transaction.
SolanaChain
Type of all Solana chains supported by Privy.
SolanaSignTransactionOptions & {uiOptions?: SendTransactionModalUIOptions}
Additional options for signing the transaction.
Response
Uint8Array
The signed transaction that can be sent to the network.
External wallets that only support signing (not sign-and-send)
To send a transaction signed by one of these wallets, attach the returned signature to the original compiled transaction before encoding and submitting it. Below is a complete example using@solana/kit:
