Search…
Triggers
What can you trigger with HAL?
HAL currently supports 3 types of trigger:
  • Watch contracts - State changes of specific smart contracts’ variables (exposed via getter functions) or any kind of value returned by a view Solidity/Vyper function. You can use this to track what happens in any contract you care about.
  • Watch transactions - Triggers based on Ethereum transactions. You can use basic filters (from, to, gas, gas price, value, nonce) or, in the case of a transaction to a smart contract, advanced multi-filters based on any parameter (arrays’ specific indexes included). It works even if that smart contract doesn't handle events/the events you would like to trigger.
  • Watch events - Triggers based on Ethereum Events. You can apply filters to both indexed and not-indexed parameters of the selected event.
Trigger is a general purpose interface:
1
interface Trigger {
2
UUID: UUID!
3
name: String!
4
type: TriggerType!
5
createdAt: Timestamp!
6
updatedAt: Timestamp
7
isActive: Boolean!
8
matchesCount: Int
9
# Actions
10
actions: [Action!]!
11
}
Copied!
TriggerType can be:
1
enum TriggerType {
2
ContractsTrigger
3
EventsTrigger
4
TransactionsTrigger
5
}
Copied!
and is implemented adding a statement describing the conditions of that specific TriggerType.
For example, for Watch transactions:
1
type TransactionsTrigger implements Trigger {
2
UUID: UUID!
3
name: String!
4
type: TriggerType!
5
createdAt: Timestamp!
6
updatedAt: Timestamp
7
isActive: Boolean!
8
matchesCount: Int!
9
# Actions
10
actions: [Action!]!
11
# Custom TransactionsTrigger fields
12
statement: TransactionsTriggerStatement!
13
}
Copied!
Copy link