ApiCoreInterfaces
Interface: ContractContext\<B\>
Defined in: packages/core/src/records/contract-builder.ts:243
What a contract reads (spec 09 §5.2), and the functions it calls
Type Parameters
| Type Parameter |
|---|
B |
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
author | readonly | StrExpr | The writer's account | packages/core/src/records/contract-builder.ts:255 |
body | readonly | Expr<B> | - | packages/core/src/records/contract-builder.ts:244 |
cited | readonly | <L>(ids, collection) => ListExpr<Cited<BodyIn<L>>> | The versions cited by these ids that are in collection, typed from its schema: cited(body.votes, vote). Versions of any other collection are left out, so a claim can't pass on something else cited in their place. | packages/core/src/records/contract-builder.ts:265 |
collection | readonly | StrExpr | - | packages/core/src/records/contract-builder.ts:253 |
createdAt | readonly | StrExpr | What the writer's clock said, which nothing checks | packages/core/src/records/contract-builder.ts:259 |
creator | readonly | StrExpr | The account that wrote the record's first version | packages/core/src/records/contract-builder.ts:257 |
has | readonly | (field) => BoolExpr | has(body.note): whether a field is there | packages/core/src/records/contract-builder.ts:280 |
hash | readonly | (value) => StrExpr | The content id of a value's canonical JSON; of a body, its bodyHash. For commit-then-reveal | packages/core/src/records/contract-builder.ts:278 |
key | readonly | StrExpr | The record's key | packages/core/src/records/contract-builder.ts:250 |
link | readonly | (rel) => StrExpr | What this version's first link with that role points at, or null | packages/core/src/records/contract-builder.ts:274 |
links | readonly | ListExpr<LinkValue> | This version's links, each { rel, to } | packages/core/src/records/contract-builder.ts:248 |
member | readonly | (did) => BoolExpr | Whether an account is a member, as of this version | packages/core/src/records/contract-builder.ts:276 |
prev | readonly | VersionExpr<B> | The version before, or null on a first version: prev.eq(null) | packages/core/src/records/contract-builder.ts:246 |
raw | readonly | <T>(cel) => Expr<T> | CEL written by hand, for what the builder doesn't cover: map literals, math.greatest, string(), uint values. Its type is yours to say, as in raw<boolean>('…') | packages/core/src/records/contract-builder.ts:288 |
seq | readonly | IntExpr | This version's place in the record, an int | packages/core/src/records/contract-builder.ts:252 |
versions | readonly | (ids) => ListExpr<Cited<unknown>> | The versions cited by these ids, in order: generic until narrowed with .of(collection). cited is usually what you want | packages/core/src/records/contract-builder.ts:270 |
when | readonly | <R>(test, then, otherwise) => R | test ? then : otherwise | packages/core/src/records/contract-builder.ts:282 |