2

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?

1 Answer 1

2

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);
2
  • 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
    – Brad Gyemi
    Commented Dec 7, 2022 at 19:15
  • @BradGyemi, Do we have a way to solve this?
    – Anon
    Commented May 2 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.