Operations

GET https://api.tzpro.io/explorer/op/{hash|id}
The operations endpoint returns info about a single operation or a list of related operations. Because Tezos supports batch operations (multiple operations sharing the same hash) and internal operations (created by smart contract calls in response to a transaction) this endpoint always returns an array of operation objects. In many cases this array contains one element only. Use the optional prim (boolean) parameter to embed Michelson primitive trees with smart contract calls. Use meta (boolean) to add optional account metadata.

HTTP Response

Field
Description
id uint64
Global unique id.
hash hash
Operation hash.
type enum
Operation type.
block hash
Block hash at which the operation was included on-chain.
time datetime
Block time at which the operation was included on-chain.
height int64
Block height at which the operation was included on-chain.
cycle int64
Cycle in which the operation was included on-chain.
counter int64
Unique sender account 'nonce' value.
op_n int64
In block operation counter.
op_p int64
Tezos RPC operation list position.
status enum
Operation status applied, failed, backtracked, skipped.
is_success bool
Flag indicating operation was successfully applied.
is_contract bool
Flag indicating smart-contract calls.
is_event bool
Flag indicating an event, i.e. state changes that don't have an operation hash such as bake, unfreeze, seed_slash, airdrop, invoice, migration, subsidy, deposit, reward, bonus.
is_internal bool
Flag indicating if this operation was sent be a smart contract.
is_rollup bool
Flag indicating this is a rollup related operation.
gas_limit int64
Caller-defined gas limit.
gas_used int64
Gas used by the operation.
storage_limit int64
Caller-defined storage limit.
storage_paid int64
Part of the storage the operation paid for.
volume money
Amount of tokens transferred in tz. In denunciation operations, this field contains the accuser reward, in delegation operations this field contains the initially delegated balance.
fee money
Fees paid in tez. In denunciation operations, this field contains the offender loss as negative value.
reward money
Rewards earned in tez. In denunciation operations, this field contains the offender loss as negative value.
deposit money
Amount of deposited tokens in tez. In denunciation operations, this field contains the offender loss as negative value.
burned money
Amount of burned tokens in tez.
data polymorph
Extra type-dependent operation data. See below.
errors array
Native Tezos RPC errors.
parameters object
Call parameters as embedded JSON object, contract-only.
script object
Embedded Micheline script on originations.
storage object
Updated contract storage as embedded JSON object, contract-only. Optional, use storage=1 to add.
big_map_diff object
Inserted, updated or deleted bigmap entries as embedded JSON object, contract-only. Optional, use storage=1 to add.
value object
Micheline data for global constants.
code_hash bytes
Short hash to uniquely identify the receiver contract, first 8 bytes of the SHA256 hash over binary encoded Michelson script code.
sender hash
Operation sender (note some event types have no sender).
receiver hash
Transaction receiver, may be empty. For activation the source account is referenced when the activation merged coins from a second blinded account (i.e. when a fundraiser signed up twice). For delegation the previous delegate is referenced.
source hash
In internal operations, source is the original signer of the outer transaction.
creator hash
Contains contract creator on origination. For nonce_revelation the actual seed publisher is referenced.
baker hash
New baker, only used by origination and delegation. When empty for a delegation the operation was a withdrawal.
previous_baker hash
On re-delegations, contains the previous baker.
accuser hash
For double bake/endorse this is the account who sent the accusation.
offender hash
For double bake/endorse this is the account who was slashed.
level int64
Rollup level, rollup ops only.
power int64
Endorsing power (in number of slots), (pre)endorsement only.
limit money
Deposits limit, set deposit limit op only.
solution bytes
VDF operation solution bytes
proof bytes
VDF operation proof bytes
confirmations int64
Number of blocks following the inclusion of this operation. Usually 6 blocks are OK to consider an operation final (not subject to reorg).
metadata object
Use meta=1 to embed optional account metadata for sender, receiver, delegate, creator. May be empty if no account has metadata defined.
events array
List of emitted on-chain events. Kathmandu+
ticket_updates array
List of emitted ticket updates. Lima+

Event Object

Field
Description
contract hash
Event emitter contract
type object
Micheline encoded event type
payload object
Micheline encoded value
tag string
Event tag defined by the contract author
type_hash hash
Unique type hash as uint64 in hex format. Hash is sha256(type_no_annots)

Ticket Update Object

Field
Description
ticketer hash
Ticket issuer contract
type object
Micheline encoded ticket type
content object
Micheline encoded ticket content
account hash
Owner account of the ticket
amount bigint
Amount of tickets owned by account

List of Supported Operation Types

  • activation
  • double_baking
  • double_endorsement
  • double_preendorsement
  • nonce_revelation
  • transaction
  • origination
  • delegation
  • reveal
  • endorsement
  • preendorsement
  • proposal
  • ballot
  • register_constant
  • deposits_limit Ithaca+
  • bake event
  • unfreeze event
  • seed_slash event
  • airdrop event
  • invoice event
  • migration event
  • subsidy event
  • deposit event Ithaca+
  • reward event Ithaca+
  • bonus event Ithaca+
  • rollup_origination Jakarta+
  • rollup_transaction Jakarta+
  • vdf_revelation Kathmandu+
  • increase_paid_storage Kathmandu+
  • drain_delegate Lima+
  • update_consensus_key Lima+

Decoding Operation Data

Some operations contain extra data in the string field data. Format depends on the operation type.
Operation
Data Type
Specification
activation
string
hex(secret),blinded-address
endorsement
uint
32bit big-endian bitmask identifying endorsed slots
ballot
string
proposal-hash,ballot (yay, nay, pass)
proposals
string
comma-separated list or proposal hashes
reveal
string
public key hash
nonce_revelation
string
level,hex(nonce)
double_baking
object
Original JSON object of double signed block headers
double_endorsemnt
object
Original JSON object of double signed endorsements
double_preendorsement
object
Original JSON object of double signed endorsements
vdf_revelation
string
Original hex string, a concatenation of solution and proof
update_consensus_key
string
The new consensus key as base58 string

Example Request

curl "https://api.tzstats.com/explorer/op/opSrt7oYHDTZcfGnhNt3BzGrrCQf364VuYmKo5ZQVQRfTnczjnf"import (
import (
"context"
"blockwatch.cc/tzstats-go"
"blockwatch.cc/tzgo/tezos"
)
// get all members of the operation group identified by hash
opGroup, err := tzstats.DefaultClient.GetOp(
context.Background(),
tezos.MustParseOpHash("opSrt7oYHDTZcfGnhNt3BzGrrCQf364VuYmKo5ZQVQRfTnczjnf"),
tzstats.NewOpParams(),
)

Example Response

[{
"id":66314240022,
"hash": "opSrt7oYHDTZcfGnhNt3BzGrrCQf364VuYmKo5ZQVQRfTnczjnf",
"type": "transaction",
"block": "BL1PGezBat3BX1N2rnk1qycTJbCXdWJwYoGBChyeFyYJABGLyZ9",
"time": "2020-06-25T06:18:19Z",
"height": 1011875,
"cycle": 247,
"counter": 2187104,
"op_n": 22,
"op_p": 3,
"status": "applied",
"is_success": true,
"gas_limit": 15385,
"gas_used": 10207,
"storage_limit": 257,
"volume": 0.040128,
"fee": 0.001792,
"sender": "tz1Ywgcavxq9D6hL32Q2AQWHAux9MrWqGoZC",
"receiver": "tz1ijyJy2QncvgDKZJARDgPqEYVRk6yTE5d7",
"confirmations": 1224432
},
// ...
]