Skip to content

Alerts ​

Alerts enable Warps to trigger notifications based on execution status. This is critical for giving users feedback on asynchronous blockchain operations.

Structure ​

Alerts are defined in the root-level alerts object.

json
{
  "alerts": {
    "alert_id": {
      "label": "Internal Label",
      "trigger": "on_success",
      "subject": "Notification Title",
      "body": "Notification body text",
      "action": "optional-warp-id"
    }
  }
}

Properties ​

PropertyTypeRequiredDescription
labelWarpText✅Internal name for the alert.
triggerstring✅When to fire (see below).
subjectWarpText✅The title of the notification.
bodyWarpText✅The main content. Supports variables.
actionstring❌Warp ID to navigate to if clicked.

Triggers ​

TriggerDescription
on_successFires only if all actions in the Warp complete successfully.
on_failureFires if any action fails or the user rejects the transaction.
on_completeFires regardless of the outcome (success or failure).

Examples ​

Success Notification ​

json
{
  "alerts": {
    "tx_confirmed": {
      "label": "Success",
      "trigger": "on_success",
      "subject": "Payment Sent",
      "body": "Successfully sent {{amount}} to {{recipient}}."
    }
  }
}

Failure Notification ​

json
{
  "alerts": {
    "tx_failed": {
      "label": "Error",
      "trigger": "on_failure",
      "subject": "Transaction Failed",
      "body": "The transaction could not be completed. Please try again."
    }
  }
}

Actionable Notification ​

Linking to another Warp (e.g., a dashboard) upon success.

json
{
  "alerts": {
    "stake_done": {
      "label": "Staking Complete",
      "trigger": "on_success",
      "subject": "Staked Successfully",
      "body": "Your funds are now earning rewards.",
      "action": "view-staking-dashboard"
    }
  }
}

Localization ​

Like other text fields, alerts support full localization.

json
{
  "subject": {
    "en": "Payment Sent",
    "es": "Pago Enviado"
  }
}