4

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"
}
4

From my understanding, yes and no. There are four groups of operations:

  1. Baking - endorsements
  2. Voting - proposals and ballots
  3. Annonymous - seed_nonce_revelation, double_bake/endorse, activate_account
  4. Manager - reveal, delegation, transaction, origination

I believe you can combine different operations from the same group.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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