DHL types
| Type | Holds | Notes |
|---|---|---|
Int | A signed integer | Money as an integer of minor units (amount_minor) |
Decimal, Decimal(scale=2) | A fixed-point decimal | JSON carries it as a string |
Ratio | A ratio | |
Bool | true or false | |
Text, Text(len=200) | Text, at most len bytes | Always give a length |
Email | An email address | |
Currency | A three-letter currency code ("EUR") | Contracts holding money cannot be buffered |
Timestamp | A point in time | |
Duration | A length of time | |
Identity | A 32-byte identity (a person, organisation, space, agent or record id) | Lowercase hex in JSON |
GeoPoint | A latitude and longitude | |
Enum(a,b,c) | One of the listed names | |
Ref<Aggregate> | A reference to a record | |
SubjectRef<Aggregate> | A reference to a record at a revision ({id, seq}) | Used for delegation evidence and child records |
Struct<Name> | A struct value | |
List<T>, List<T>(capacity=16) | A list | Declare a capacity for lists carried by commands |
Map<K, V>, Map<K, V>(capacity=N) | A map | |
T? | Optional | Int?, Timestamp? |
In JSON
Integers, timestamps, durations and decimals travel as decimal strings so nothing loses precision in JavaScript. Identities are lowercase hex. A SubjectRef is {"id": "…", "seq": "…"}. Keep these representations in clients.