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:
contract_package_hash
string(64)
Contract package hash
data
JSON
Event data in the JSON format. Complex types may lose information because the CLValue
type is wider that JSON. Please, use raw_data
in such a case
raw_data
string
Event data represented as a hexadecimal string, similarly as presented in the deploy transform
name
string
Event name
Optional properties
raw_data
string
Raw event data encoded as a hexadecimal string
Example
Endpoint
Query params
contract_hash
string
Comma-separated contract hashes
contract_package_hash
string
Comma-separated contract package hashes
Exactly one owner_hash
or contract_package_hash
filter must be provided
Events
emitted
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