Skip to main content
Version: 16.2.0

Contract Event Logging


Contract events is a way for contracts to deliver event-like information to third-party (off-chain) applications. It can be emitted by using the EMIT instruction in Michelson.

For more details and examples of how the EMIT instruction works, refer to this article.

Subscribing to Events in Taquito

Taquito provides a simple way for users to subscribe to certain events on the blockchain via the PollingSubscribeProvider.



const Tezos = new TezosToolkit(RPC_URL);
shouldObservableSubscriptionRetry: true,
pollingIntervalMilliseconds: 1500
try {
const sub ={
tag: 'tagName',
excludeFailedOperations: true
sub.on('data', console.log);
} catch (e) {
  • tag is the tag string that was defined in the smart contract with the EMIT instruction
  • address is the address of the smart contract that was called
  • excludeFailedOperations: In rare cases, events from failed operations can be received by the subscriber. You can use this field to filter out these events (if you pass true to this field, only events from successful operations will be received)

If you would like to subscribe to any event that goes through, you can call subscribeEvent() as is without any parameters


The output of the subscribeEvent method will look something like this:

"opHash": "oopRTC5iNxssoC5dAz54u7uthUz6xBayaSPcLXhkLwHGjuS7Bos",
"blockHash": "BLCTEDjZDtuUcYxmSPXHn3XrKruub4NF4mzTgR2EbpPRFN7JzDV",
"level": 313647,
"kind": "event",
"source": "KT1ACmSCoRsA69zHnv5mMBC4vdcxbFJpHRoo",
"nonce": 0,
"type": {
"prim": "or",
"args": [
"prim": "nat"
"prim": "string"
"tag": "first",
"payload": {
"prim": "Left",
"args": [
"int": "10"
"result": {
"status": "applied",
"consumed_milligas": "1000000"

Provide detailed feedback