Intents
Saline Intent Cheat Sheet
Concept | Purpose | Constructor / Syntax |
---|---|---|
Restriction | Assert a relation between two expressions (< , <= , == , >= , > ) | Restriction(lhs, Relation.LE, rhs) |
Signature | Require a valid signature from pubkey | Signature("nacl:0x…") |
All | Logical AND – every child intent must hold | All([intent₁, intent₂, …]) |
Any | Logical M‑of‑N / OR – at least threshold children must hold | Any(threshold, [intent₁, …]) |
Temporary | Intent valid only before (or after) a Unix timestamp | Temporary(expiry_ts, available_after, intent) |
Finite | Limit an intent to a maximum number of uses | Finite(max_uses, intent) |
Expressions
Expression | Meaning / Evaluates to |
---|---|
Lit(value) | Literal constant (number, string, etc.) |
Balance(token) | Token balance of the host account |
Receive(token) | Amount of token received in the tx |
Send(token) | Amount of token sent in the tx |
Arithmetic2(op, lhs, rhs) | Arithmetic on two expressions (Add , Sub , Mul , Div ) |
Operator Shorthands (optional)
Operator | Expands to | Example |
---|---|---|
& | All([...]) | A & B & C |
| | Any(1,[...]) | A | B |
< <= > >= | Restriction | Send(Token.BTC) >= 1 |
+ − * / | Arithmetic2 | Send(Token.ETH) * 2 |