gagliardetto / solana-go

Go SDK library and RPC client for the Solana Blockchain
Apache License 2.0
823 stars 245 forks source link

Versioned transaction #211

Open jerempjerem opened 4 months ago

jerempjerem commented 4 months ago

How can I create a versioned (v0) transaction like in js :


const messageV0 = new TransactionMessage({
        payerKey: SIGNER_WALLET.publicKey,
        recentBlockhash: latestBlockhash.blockhash,
        instructions: txInstructions
    }).compileToV0Message();
    console.log("   ✅ - Compiled Transaction Message");
    const transaction = new VersionedTransaction(messageV0);
anri217 commented 4 months ago

Have u already finded the decision?

1oid commented 3 months ago

I have the same question

SC4RECOIN commented 3 months ago

you can pass a lookup table as an option when creating the txn

tx, err := solana.NewTransaction(
            instructions,
        block.Blockhash,
        solana.TransactionPayer(user.PublicKey()),
        solana.TransactionAddressTables(transactionAddressTables),
    )