Blnk Watch rules define how transactions are evaluated. Each rule describes a pattern to look for and what should happen when that pattern matches. Rules operate only on transactions. They don’t monitor balances, ledgers, or identities. If you need extra business context (e.g. KYC tier, promo code), pass it on the transaction asDocumentation Index
Fetch the complete documentation index at: https://docs.blnkfinance.com/llms.txt
Use this file to discover all available pages before exploring further.
meta_data and reference it in the rule.
Watch scripts
Rules are written as watch scripts: plain-text files with the.ws extension.
Watch loads these scripts from a designated folder (by default watch_scripts), compiles them, and turns them into the rules that run against each transaction.
When you add or change a .ws file in that folder, Watch picks up the change and updates the active rule set.
Rule anatomy
Every rule has two core parts: when (the pattern) and then (the outcome). The rest of this section walks through each piece and where to learn more. A simple, complete rule looks like this:HighValueUSD.ws
| Part | What it does | Example |
|---|---|---|
rule | Stable identifier for the rule; use a name that describes the pattern | HighValueUSD |
when | Condition to look for in the transaction. | amount > 4000 and currency == "USD" |
then | Outcome when the condition is met. | review |
score | Rule-level risk weight; you define the scale. | 0.5 |
reason | Human-readable explanation for why the rule triggered; used for debugging and audits. | "USD transaction exceeds 4,000" |
Keep in mind: When you need information that isn’t part of the transaction payload, include it in
meta_data first. A rule can use meta_data.kyc_tier or meta_data.promo_code only if your app sends those values with the transaction.Rule syntax
First, you declare the rule. The name afterrule must be a single identifier in camelCase or snake_case (e.g. HighValueUSD, burst_to_same_destination) and should describe the pattern or control so it’s clear in logs and audits.
ruleName.ws
ruleName.ws
ruleName.ws
ruleName.ws