Actions

What to do when you have a match

Once a trigger is triggered, HAL supports several different kinds of actions that can be invoked:

  • Webhook, which calls a non-authenticated webhook passing the decoded data for the current context (info about the match) via POST

  • Email, which sends an email using a template system that allows you to use all the current context variables in the body or subject

  • Slack, which allows you to post messages on Slack using either the official HAL Slack App, or by providing a custom web hook if you want to use your own Slack integration (more info here).

  • Telegram, which allows you to have your own Telegram bot to post messages on private chats and public channels (more info about Telegram bots here).

  • Twitter, which allows you to let HAL tweet on your behalf (or on behalf of your twitter bot)

  • Discord, which allows you to post on any channel on your Discord server (or any channel you have the token for)

Webhook actions

The syntax is super easy:

{
"type": "Webhook",
"attributes": {
"uri": "https//www.foo.bar"
}
}

Email actions

The object structure is:

{
"type": "Email",
"attributes": {
"body": "This tx has a Value higher than 10: it's $Value$ !",
"subject": "Alert related to tx $TransactionHash$",
"to": [
"alex@hal.xyz",
"!my_variable",
"!my_array_of_addresses[4]"
]
}
}

Slack actions

{
"type": "Slack",
"attributes": {
"uri": "https://hooks.slack.com/services/xxx/yyy/zzz",
"body": "Lorem ipsum..."
}
}

You can use the official HAL Slack App, or you can provide a custom web hook. More info here.

Telegram actions

{
type: Telegram,
attributes: {
body: "Lorem ipsum...",
chatid: "@mychannel",
format: "HTML",
token: "secret"
}
}

Twitter actions

{
type: Twitter,
attributes: {
status: "hello tweet",
token: "my token",
secret: "my secret"
}
}

Discord Actions

{
type: Discord,
attributes: {
body: "body",
discordURI: "discord URI"
}
}