Epoch Protocol Docs
Ask or search…
K

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
}
}
}
Check full example here

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
}
}
Check full example here

Every Block Trigger

Coming Soon...

Off-Chain Webooks Trigger

Coming Soon...