Skip to main content
added 5 characters in body
Source Link
Jimii
  • 7.7k
  • 1
  • 8
  • 22

I think you can just grab the instructions and create a new transaction with them

const V0TxWithLUTV0MessageWithLUT = .... // update with your transaction

let instructions = TransactionMessage.decompile(V0TxWithLUT).instructions;

const messageV0 = new TransactionMessage({
    payerKey: me.publicKey,
    recentBlockhash: (await connection.getLatestBlockhash()).blockhash,
    instructions: [...instructions],
}).compileToV0Message();

let tx = new VersionedTransaction(messageV0);

I think you can just grab the instructions and create a new transaction with them

const V0TxWithLUT = .... // update with your transaction

let instructions = TransactionMessage.decompile(V0TxWithLUT).instructions;

const messageV0 = new TransactionMessage({
    payerKey: me.publicKey,
    recentBlockhash: (await connection.getLatestBlockhash()).blockhash,
    instructions: [...instructions],
}).compileToV0Message();

let tx = new VersionedTransaction(messageV0);

I think you can just grab the instructions and create a new transaction with them

const V0MessageWithLUT = .... // update with your transaction

let instructions = TransactionMessage.decompile(V0TxWithLUT).instructions;

const messageV0 = new TransactionMessage({
    payerKey: me.publicKey,
    recentBlockhash: (await connection.getLatestBlockhash()).blockhash,
    instructions: [...instructions],
}).compileToV0Message();

let tx = new VersionedTransaction(messageV0);
Source Link
Jimii
  • 7.7k
  • 1
  • 8
  • 22

I think you can just grab the instructions and create a new transaction with them

const V0TxWithLUT = .... // update with your transaction

let instructions = TransactionMessage.decompile(V0TxWithLUT).instructions;

const messageV0 = new TransactionMessage({
    payerKey: me.publicKey,
    recentBlockhash: (await connection.getLatestBlockhash()).blockhash,
    instructions: [...instructions],
}).compileToV0Message();

let tx = new VersionedTransaction(messageV0);