I'm trying to send swap transaction in Raydium using Raydium SDK, I made exactly as their demo, and at first when I tried with private RPC it worked and after I wanted to go production and bought expensive RPC those that considered the best, I constantly get error: "Error failed to send transaction: Transaction signature verification failure"
Only the first "if" condition is relevant because it never gets into the "else" condition.
if (iTx instanceof VersionedTransaction) {
iTx.sign([payer]);
const hashInfo = (await connection.getLatestBlockhashAndContext()).value;
iTx.message.recentBlockhash = hashInfo.blockhash;
txids.push(await connection.sendTransaction(iTx, {skipPreflight: false}));
} else {
const hashInfo = (await connection.getLatestBlockhashAndContext()).value;
iTx.message.recentBlockhash = hashInfo.blockhash;
txids.push(await connection.sendTransaction(iTx, [payer], {
maxRetries: 0,
preflightCommitment: "processed"
}));
}
Here is the "payer" variable, the walletPrivateKey is always exists and correct, validated it. Also I printed the "payer" publicKey (wallet address) and it was correct.
const wallet = Keypair.fromSecretKey(bs58.decode(walletPrivateKey || ''));
I'm trying to figure it out what could be the reason but I don't know, also the RPC providers can't understand why it works on 1 RPC and on the 2 other it doesn't work. Will be glad for any assistance to figure it out.
Thanks