1
// Sign the transaction
  const feePayer = USER_KEYPAIR;

  const deserializedTx = Transaction.from(Buffer.from(swapTransaction, 'base64'));
  deserializedTx.partialSign(feePayer);

  const txnSignature = await SOLANA_CONNECTION.sendRawTransaction(deserializedTx.serialize());

  console.log("Transaction Signature:", txnSignature);
AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAIDUGl5q+Zq0zIL42LyEvJYGbgUEYxxIsulpFm8AHhnB1qFOEtZ+D4Ilypv9Ww690rn/cD8kbUh9Ao9xYuxB21S7iiHZpJZ1Uy9xq1yiOta3BcBOI7Dv+jmETs0W7Leny+Aqd7CAAxlFNBQ5o72mru11WL5P+3Va+9S+k0ShjN/T3k9id6bJBs2RJCCo23cMqkn/SEvyBCeAxr8skWXhg1pegAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMGRm/lIRcy/+ytunLDm+e8jOW7xfcSayxDmzpAAAAABHnVW/IxwG7udMVuzmgVB/2xst6j9I5RArHNola8E48G3fbh12Whk9nL4UbO63msHLSF7V9bN5E6jPWFfv8AqU9LbA5BCP0qaiR46uCsxZ2yG7Tt9RHBYs9gLR4MCQH7jJclj04kifG7PRApFI4NgwtaE5na/xCEBI572Nvp+FmUybJQtABckCxdkxgGpl0F9Df2Wu25KNb8vPIFQ0coHLQ/+if11/ZKdMCbHylYed5LCas238ndUUsyGqezjOXo6ujdgssg4zarX6kEeMXqLFhWmVceu3DMN0Rs96k6QIUHBgAFAsBcFQAKBgABABcFCAEBBQIAAQwCAAAA6QMAAAAAAAAIAQEBEQoGAAMACwUIAQEHHwgJAAECBAMXCwcHDAcaCBYZDhESGBAVFA8NExsCBAkkwSCbM0HWnIEHAQAAAAdkAAHpAwAAAAAAAAOzViAAAAAAMgAACAMBAAABCQHlye8UzleS8b2iRTpEDZ4XD4kpF/YtPybePM42c0r5cApHPzxBRj5DPUI6BQUOFxQ7
Error: Versioned messages must be deserialized with VersionedMessage.deserialize()

Question: How to deserialize encoded transaction?

P.S. It works with other encoded transactions, but not with my. Example of the correct one:

AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDA+Z8BRyNDL30G+lsh0lwSNNhbnN6HAnoyUtyAiN7Pg+OUK2wQtYmX3uHnIO2htEANdTK9dP12UzWjFk+hpR4qAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAiOec80h+J5X8oUoZEmnxVj+E8V+0O4Nr9ly+Fu2D+8cBAgIAAQwCAAAAAOH1BQAAAAA=
1
  • Is there something wrong with calling VersionedTransaction.deserialize? The error message seems to lead you towards doing that
    – Jon C
    Commented Nov 16, 2023 at 14:14

1 Answer 1

2

According to the error, you are sending decoding a versioned message, ie, The version generally signifies the specifics of the layout of the message or instructions in it, if put in normal terms. And it tells you to use the VersionedMessage.decode(), but I don't think there is a function for it, as it is automatically handled, so my guess would be that there is some issue with the message serialization, or due to some dependency version incompatibility.

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.