I'm trying to use Jupiter API to swap tokens via python, and i used basically same code it's been around in this forum, which is:
swap_instruction = swap_tx_response.json()["swapTransaction"]
raw_tx = solders.transaction.VersionedTransaction.from_bytes(base64.b64decode(swap_instruction))
signature = keypair.sign_message(solders.message.to_bytes_versioned(raw_tx.message))
signed_tx = solders.transaction.VersionedTransaction.populate(raw_tx.message, [signature]) encoded_tx = base64.b64encode(bytes(signed_tx)).decode('utf-8')
headers = { "Content-Type": "application/json" } data = { "jsonrpc": "2.0", "id": 1, "method": "sendTransaction", "params": [ encoded_tx, { "skipPreflight": True, "preflightCommitment": "finalized", "encoding": "base64", "maxRetries": None, "minContextSlot": None } ] } tx_response = httpx.post("rpc_url", headers=headers, json=data)
I'm also running custom "helius RPC" as rpc to send my txs, and i'm finding the problem that some transactions confirm correctly, but others directly doesn't go through the blockchain, showing "no data" in explorer, like this one:
I don't know what could be causing this as im a bit o a noob on solana, so help would be appreciated.