📃Smart Contracts

Learn how to monitor specific events or activities happening within a smart contract

Notifications for smart contract interactions use the graphql event type. This event type can be used to monitor token swaps, contract deployments, deposits into a lending protocol, votes cast in a DAO, and more. With event- and topic-level parameters, you have the functionality at your finger tips to build notifications on nuanced, smart contract interactions.

Event Type: graphql

To create a GraphQL event type, send a POST request to the /api/v1/nodefy/notifications/ endpoint with the following JSON payload:

Example Request:

    "external_user_id": "user123",
    "channel": "EMAIL",
    "notification_name": "Your Mint from Factory Contract",
    "delivery_location": "creator@art.com",
    "event_details": {
        "network": "BASE_MAINNET",
        "event_type": "GRAPHQL",
        "addresses": ["0x60a2...a7c6"],
        "graphql": {
            "topic_2": "0x2a29fb...9a888"

Required graphql Parameter:

  • addresses: An array containing the smart contract address(es) to monitor. This address identifies the contract from which you want to receive event notifications.

Optional graphql Parameters:

  • graphql Object: An object to further specify the event using GraphQL query parameters:

    • topic_0: The event signature (topic0) to filter for specific events.

    • topic_1, topic_2, topic_3: Additional indexed topics to further filter events.

GraphQL Event Filters

You can apply more specific filters on GraphQL events using our filter system. Filters allow you to capture events based on transaction parameters such as the fromAddress, toAddress, and value. Refer to the "Using Filters" section for more information.

Last updated