1

Im using this python script to retrieve this version 0 transaction:

import requests

url = 'http://api.mainnet-beta.solana.com/'
headers = {'Content-Type': 'application/json'}

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getConfirmedTransaction",
    "params": [
        "5HbX6YFiQJsUhG1RM6YN8KNNY86rEpRJpG9WUWJmirAeiby5B6b6nH5qK43xctCxhecLKCmdKzuA1uFqFrLMfALg",
        {"encoding": "json", "maxSupportedTransactionVersion": 0}
    ]
}

response = requests.post(url, json=payload, headers=headers)

if response.status_code == 200:
    print(response.json())
else:
    print("Failed. Status code:", response.status_code)

As you can see im using the maxSupportedVersion: 0 parameter and therefore should be able to call version 0 transactions. Regardless this script only works on legacy transactions, while im getting this error on version 0 transactions:

{'jsonrpc': '2.0', 'error': {'code': -32015, 'message': 'Transaction version (0) is not supported by the requesting client. Please try the request again with the following configuration parameter: "maxSupportedTransactionVersion": 0'}, 'id': 1}

Ive tried using different RPCs. Does anybody have any idea why im still getting this error?

1 Answer 1

0

getConfirmedTransaction has been deprecated, so I don't think it supports versioned transactions: https://solana.com/docs/rpc/deprecated/getconfirmedtransaction

Try simply using getTransaction:

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getTransaction",
    "params": [
        "5HbX6YFiQJsUhG1RM6YN8KNNY86rEpRJpG9WUWJmirAeiby5B6b6nH5qK43xctCxhecLKCmdKzuA1uFqFrLMfALg",
        {"encoding": "json", "maxSupportedTransactionVersion": 0}
    ]
}
1
  • Yes, my bad forgot about this question, this is the solution.
    – sup no
    Commented May 5 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.