Contract-level events
The contract-level events stream provides the possibility to subscribe to events emitted by contracts during their execution. dApps rely on these events to know what happened during the contract execution to present this information to their users.
In addition to Casper Event Standard (CES), CSPR.cloud also provides integration with the legacy map-based events implemented as maps containing the event information to the network store, which look like this:
If you are a new developer, we recommend you to use CES when developing your smart contracts. It has become the de facto standard on the network and is already supported by the existing fungible and non-fungible (NFT) token standards, such as CEP-18, CEP-47, and CEP-78.
Properties
The ContractLevelEvent
entity has the following properties:
Property | Type | Description |
---|---|---|
|
| Contract package hash |
|
| Contract hash. Present only for CES events |
|
| Event data in the JSON format. Complex types may lose information because the |
|
| Event data represented as a hexadecimal string, similarly as presented in the deploy transform |
|
| Event name |
Optional properties
Property | Type | Description |
---|---|---|
|
| Raw event data encoded as a hexadecimal string |
Example
Endpoint
Query params
Property | Type | Description |
---|---|---|
|
| Comma-separated contract hashes |
|
| Comma-separated contract package hashes |
Exactly one owner_hash
or contract_package_hash
filter must be provided
Events
Event | Description |
---|---|
| Notifies about new contract event being emitted during a deploy execution |
Response
WebSocketMessage
<ContractLevelEvent>
Example
To learn more, please proceed with an extended example described on the Receiving contract-level events page.
Last updated