Epoch Protocol Docs
  • Epoch Protocol - Overview
  • What is Epoch Protocol - An Introduction
  • 📄Litepaper
  • Blog
  • Links
  • Account Abstraction
    • ERC 4337
      • Operations
    • Benefits
    • Use-cases
      • Examples
    • More Readings
  • Use Epoch Protocol Automation dApp
    • How to use Epoch Protocol for Intent Automation
    • Onboarding
    • Connect to Dapp
    • Record a transaction
    • Bonus Add NFT Action
    • Execute Transaction right now
    • Time-Based triggers
    • Token Received Trigger
    • Reporting a bug and common fixes
  • Use Epoch SDK
    • Getting Started
    • Intent Automation Module
      • Epoch Bundler
      • Epoch SDK
      • Triggers
      • Examples
        • How to Initialise the Epoch SDK
        • How to Get User's SC Wallet Address
        • Check If User's SC Wallet is Deployed or Not
        • Deploy User's SC Wallet if not Deployed
        • Schedule Token Payment
        • Schedule ETH Transfer on Event Trigger
    • Contracts
Powered by GitBook
On this page
  • Event-Based Trigger
  • Time-Based Trigger
  • Every Block Trigger
  • Off-Chain Webooks Trigger

Was this helpful?

  1. Use Epoch SDK
  2. Intent Automation Module

Triggers

Event-Based Trigger

A trigger event can be passed to advancedUserOperation, in this, a contract address, event signature, and an evaluation statement can be specified.

Contract Address

The address of the contract to listen to the events

Event Signature

The ABI of the event which you wanna trigger the event on

Evaluation Statement

An evaluation statement can be a small mathematical operation, you can use +, -, *, /, <=, >=, and == to calculate or evaluate something from an event. For example in the below snippet event emits reserve0 and reserve1, for this, we can write an evaluation statement like

const evaluationStatement = `:reserve1: / :reserve0: <= ${somerationumber}`;

{
  ...signedUserOp,
  advancedUserOperation: {
    triggerEvent: {
      contractAddress: "0x123",
      eventSignature: "event Sync(uint112 reserve0, uint112 reserve1);",
      evaluationStatement
    }
  }
}

Time-Based Trigger

Transactions can also be sent based on specific time, executionStartWindow and executionEndWindow need to be specified which is compared with the block-time of a chain.

{
    ...signedUserOp,
    executionTimeWindow : {
        executionWindowStart: 12341234,
        executionWindowEnd: 12312123
    }
}

Every Block Trigger

Coming Soon...

Off-Chain Webooks Trigger

Coming Soon...
PreviousEpoch SDKNextExamples

Last updated 11 months ago

Was this helpful?

Check full example

Check full example

here
here