This questions is about the contents of an operation in the API responses from the node. I'm trying to identify all transactions in a given operation.
Should I always scan for transactions in every operation returned for a block or are there some scenarios where that isn't possible?
For example, is it possible for an operation with a endorsement to include a transaction in its contents? Here's a sample JSON that I made up to represent the example:
{
"protocol": "PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP",
"chain_id": "NetXgtSLGNJvNye",
"hash": "ooUykPzNucdysptCM4FKVhSW9k3WcXFKYhBy9GGTGfPZd7VrByR",
"branch": "BLScMeAbnkVCfWpqSL26yS7nymoc5pHibXPaG8vAiY8NijPs8ph",
"contents": [
{
"kind": "endorsement",
"level": 202960,
"metadata": {
"balance_updates": [
{
"kind": "contract",
"contract": "tz1YCABRTa6H8PLKx2EtDWeCGPaKxUhNgv47",
"change": "-128000000"
},
{
"kind": "freezer",
"category": "deposits",
"delegate": "tz1YCABRTa6H8PLKx2EtDWeCGPaKxUhNgv47",
"level": 99,
"change": "128000000"
},
{
"kind": "freezer",
"category": "rewards",
"delegate": "tz1YCABRTa6H8PLKx2EtDWeCGPaKxUhNgv47",
"level": 99,
"change": "2000000"
}
],
"delegate": "tz1YCABRTa6H8PLKx2EtDWeCGPaKxUhNgv47",
"slots": [
13,
12
]
}
},
{
"kind": "transaction",
"source": "tz1NKVAxzJusWgKewn4LEViPSQVRE5Kg6XFV",
"fee": "0",
"counter": "2",
"gas_limit": "105968",
"storage_limit": "0",
"amount": "0",
"destination": "KT1WPEis2WhAc2FciM2tZVn8qe6pCBe9HkDp",
"parameters": {
"prim": "Right",
"args": [
{
"prim": "None"
}
]
},
"metadata": {
"balance_updates": [],
"operation_result": {
"status": "applied",
"storage": {
"prim": "Pair",
"args": [
]
},
"consumed_gas": "105868",
"storage_size": "5157"
}
}
}
],
"signature": "signoVkqnvViqwNSpdf8fykaguasvzCxWYQry5hPT5nciAoFYRGxsRBTLDxeeDbVDQGGtyGJGazPtWJXiXZ9pi7hjeiJMnct"
}