Matches
When a trigger... gets triggered
Every time a Trigger gets triggered it results in the creation of a Match. There is a different Match type for every given Trigger:
EventsTriggerMatch
, ContractsTriggerMatch
and TransactionTriggerMatch
. Here is what they look like:
type TransactionsTriggerMatch implements Match {
UUID: UUID!
createdAt: Timestamp!
trigger: TransactionsTrigger!
decoded: Decoded
block: Block!
transaction: Transaction!
}
the
Decoded
field is defined as follows:type Decoded {
method: Method
arguments: [JSON]
}
and represents the decoded input data used for the specific transaction that matched.
type ContractsTriggerMatch implements Match {
UUID: UUID!
createdAt: Timestamp!
trigger: ContractsTrigger!
contract: Contract
method: Method!
returnedValues: ReturnedValues!
block: Block!
}
contract
is a type that contains information about the matching contract:type Contract {
address: Address!
abi: JSON
}
method
is the name of the function that was invoked on the contract and whose output matched the correspondent Trigger.Lastly,
ReturnedValues
is defined as followtype ReturnedValues {
matched: [JSON!]!
all: [JSON]
}
and contains information on all the values returned by the function call (
all
), as well a the specific value(s) which matched the Trigger description (matched
).type EventsTriggerMatch implements Match {
UUID: UUID!
createdAt: Timestamp!
trigger: EventsTrigger!
decoded: Decoded
log: Log!
block: Block!
transaction: Transaction!
}
the
Decoded
type contains information on the matching Event Name that was emitted, as well as its arguments (the values in the data
and topic
fields)type Decoded {
method: Method
arguments: [JSON]
}
Last modified 3yr ago