Skip to content

Commit

Permalink
getting info about the event operation
Browse files Browse the repository at this point in the history
  • Loading branch information
timothymcmackin committed Jan 10, 2024
1 parent a9b66b5 commit b8939ae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/smart-contracts/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ When a client calls the `reset` entrypoint, it emits an event that is tagged wit

Smart contracts cannot respond to events.

Taquito includes tools to listen for and respond to events.
Off-chain applications can listen for and respond to events by monitoring the event operations in blocks.

For example, Taquito includes tools to listen for and respond to events.
For example, this code listens for events from the contract with the address `contractAddress` and the tag `tagName`:

```javascript
Expand Down Expand Up @@ -147,6 +149,9 @@ Note that the address field is returned as a byte value.
To convert the bytes to an address, use the `encodePubKey` function in `@taquito/utils`.
<!-- I reported this to the Taquito people and they are asking the core team if the RPC node could return the address as an address instead of as bytes. -->

You can see the complete content of the event operation by looking up the operation hash in a block explorer.
For example, to see the operation in the previous example, look up the operation `onw8EwWVnZbx2yBHhL72ECRdCPBbw7z1d5hVCJxp7vzihVELM2m`.

## Implementation details

- Michelson: [Contract events](https://tezos.gitlab.io/alpha/event.html)
Expand Down

0 comments on commit b8939ae

Please sign in to comment.