const {signTransaction} = useWallet()
const transaction = new Transaction()
const tx = .... //arbitrary anchor program method as transaction
transaction.add(tx)
const signature = signTransaction(transaction) //errors out
How does the signTransaction() function from the wallet adapter work?
https://github.com/solana-labs/wallet-adapter/blob/master/packages/core/react/src/useWallet.ts
It says it takes a transaction and returns a promise but when I try to use it I get the following error.
WalletSignTransactionError: Transaction recentBlockhash required
at PhantomWalletAdapter.signTransaction
I know I can send my transaction a different way but I want to get a signed transaction object without sending it.