Skip to main content
2nd argument to addSignature should be signature, not private key, and private key should not be passed to constructor: https://github.com/solana-labs/solana-web3.js/blob/0252b8a/packages/library-legacy/src/transaction/versioned.ts#L111
Source Link

These are all viable ways to sign a Versioned Transaction:

    let tx = new VersionedTransaction(message, [wallet.payer.secretKey]);
    tx.sign([wallet.payer]);
    tx.addSignature(wallet.publicKey, wallet.payer.secretKeysignature);

These are all viable ways to sign a Versioned Transaction:

    let tx = new VersionedTransaction(message, [wallet.payer.secretKey]);
    tx.sign([wallet.payer]);
    tx.addSignature(wallet.publicKey, wallet.payer.secretKey);

These are all viable ways to sign a Versioned Transaction:

    let tx = new VersionedTransaction(message);
    tx.sign([wallet.payer]);
    tx.addSignature(wallet.publicKey, signature);
Source Link
Whiteseal
  • 3.6k
  • 3
  • 22

These are all viable ways to sign a Versioned Transaction:

    let tx = new VersionedTransaction(message, [wallet.payer.secretKey]);
    tx.sign([wallet.payer]);
    tx.addSignature(wallet.publicKey, wallet.payer.secretKey);