There is a transaction which needs to signed by both the sender and the receiver because the receiver is the feePayer in this case (Unstaking function). The transaction is built on the backend and signed with the staking wallet securely (sender). Then the "half-signed" transaction is returned to the frontend where I am trying to have the user (receiver) sign it using @solana/wallet-adapter-react
. But WalletContextState.signTransaction(tx)
is throwing WalletSignTransactionError: t.serialize is not a function
. Does anybody know any common reasons why this function might throw this error?
Add a comment
|
1 Answer
This is a shot in the dark, but have you deserialized the transaction you receive on the frontend back into a Transaction
? Ie. assuming you received serializedTransaction
from the backend, you do:
const tx = Transaction.from(serializedTransaction);
-
Thanks for the response. I went away from this solution because this issue was taking too long to solve. Since then though I found a useful article on how to partially sign a transaction. In his code he shows how to partially sign a transaction before sending it as json data in an API request: riddheshganatra.medium.com/solana-web3-js-a9a7101df457 Commented Dec 7, 2022 at 19:15
-