Templating

How our templating system works

We recently rolled out a new templating system based on Go Template. It will be soon hidden away by a new UI, but for now you have full access to the raw templating engine.

You can access the following fields, as well as using all the power of Go Templates to write conditions, loops etc.

Watch a Transaction

Watch a Contract

Specific fields for a Watch a Contract trigger are:

Watch an Event

Specific fields for Watch an Event trigger are:

Custom Functions

We also support a bunch of handy custom functions:

A more complex example

You can leverage the full power of Go Templates, thus using if/else statements, for loops and so on. This is an example that combines some of the features discussed above:

{{ if eq .Contract.EventParameters.to "0xcd95b32c98423172e04b1c76841e5a73f4532a7f" }}
	the amount in DAI is {{ fromWei .Contract.EventParameters.value 18 }}
{{ else }}
	{{ range .Contract.EventParameters.arrayParam }}
		looping through: {{ . }}
	{{ end }}
{{ end }}

Last updated