getTransaction
Returns transaction details for a confirmed transaction
getTransaction
POST http://srpc.solapi.pro/?api_key=<api-key>
Request:
const response = await fetch('http://srpc.solapi.pro/?api_key=<api-key>', {
method: 'POST',
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 1,
"method": "getTransaction",
"params": [
"2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv",
"json"
]
}),
});
const data = await response.json();
Response:
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"slot": 430,
"transaction": {
"message": {
"accountKeys": [
"3UVYmECPPMZSCqWKfENfuoTv51fTDTWicX9xmBD2euKe"
],
"header": {
"numReadonlySignedAccounts": 0,
"numReadonlyUnsignedAccounts": 3,
"numRequiredSignatures": 1
},
"instructions": [
{
"accounts": [
1
],
"data": "37u9WtQpcm6ULa3WRQHmj49EPs4if7o9f1jSRVZpm2dvihR9C8jY4NqEwXUbLwx15HBSNcP1",
"programIdIndex": 4
}
],
"recentBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B"
},
"signatures": [
"2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv"
]
},
"meta": {
"err": null,
"fee": 5000,
"innerInstructions": [],
"postBalances": [
499998932500
],
"preBalances": [
499998937500
],
"rewards": [
{
"pubkey": "3UVYmECPPMZSCqWKfENfuoTv51fTDTWicX9xmBD2euKe",
"lamports": 500,
"postBalance": 1000,
"rewardType": "rent"
}
]
}
}
}
Last updated