Skip to content

Commit

Permalink
Etherlink events do not trigger the OperationResulted event
Browse files Browse the repository at this point in the history
  • Loading branch information
timothymcmackin committed Jan 8, 2025
1 parent f10debe commit 626cfa7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 9 additions & 1 deletion docs/unity/calling-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Calling contracts with the Unity SDK
sidebar_label: Calling contracts
authors: Tim McMackin
last_update:
date: 7 January 2025
date: 8 January 2025
---

Smart contracts are backend programs that run on blockchains.
Expand Down Expand Up @@ -31,6 +31,8 @@ Therefore, to call a Tezos smart contract, you need:

To call a contract, make sure that you are connected to a Beacon wallet.
Then create an `OperationRequest` object with that information and pass it to the `TezosAPI.RequestOperation()` method.
To get the result of the operation, you can await the return value of the `TezosAPI.RequestOperation()` method or use the `TezosAPI.OperationResulted` event.

For example, this code calls a contract and passes the parameter `5` to its `increment` entrypoint.
When the transaction completes successfully, it logs the hash of the transaction.
You can use this hash to look up information about the transaction in a [block explorer](/developing/information/block-explorers).
Expand Down Expand Up @@ -303,6 +305,12 @@ To call an Etherlink smart contract, you need:
- The parameter to pass to the entrypoint
- An amount of XTZ to send with the transaction, which can be zero or more

:::note

Calls to Etherlink smart contracts do not run the `TezosAPI.OperationResulted` event.

:::

The Unity SDK uses the [Reown SDK](https://reown.com/), so before you can access Etherlink, you must set up Reown:

1. At https://cloud.reown.com, create a Reown project and get its ID.
Expand Down
5 changes: 3 additions & 2 deletions docs/unity/reference/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Unity SDK events
sidebar_label: Events
authors: Tim McMackin
last_update:
date: 13 November 2024
date: 8 January 2025
---

The Tezos Unity SDK uses events that you can add listeners to.
Expand Down Expand Up @@ -54,7 +54,8 @@ Runs when a social wallet disconnects.

## `OperationResulted`

Runs when an operation succeeds or fails and returns an object that includes the hash of the transaction.
Runs when a Tezos operation succeeds or fails and returns an object that includes the hash of the transaction.
This event does not run for Etherlink operations.

## `SigningResulted`

Expand Down

0 comments on commit 626cfa7

Please sign in to comment.