# Interface: ContractContext\<B\>

Defined in: [packages/core/src/records/contract-builder.ts:243](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L243)

What a contract reads (spec 09 §5.2), and the functions it calls

## Type Parameters

| Type Parameter |
| ------ |
| <a id="type-parameter-b"></a> `B` |

## Properties

| Property | Modifier | Type | Description | Defined in |
| ------ | ------ | ------ | ------ | ------ |
| <a id="property-author"></a> `author` | `readonly` | [`StrExpr`](https://minca.dev/api/core/interfaces/StrExpr.md) | The writer's account | [packages/core/src/records/contract-builder.ts:255](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L255) |
| <a id="property-body"></a> `body` | `readonly` | [`Expr`](https://minca.dev/api/core/type-aliases/Expr.md)\<`B`\> | - | [packages/core/src/records/contract-builder.ts:244](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L244) |
| <a id="property-cited"></a> `cited` | `readonly` | \<`L`\>(`ids`, `collection`) => [`ListExpr`](https://minca.dev/api/core/interfaces/ListExpr.md)\<[`Cited`](https://minca.dev/api/core/interfaces/Cited.md)\<`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](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L265) |
| <a id="property-collection"></a> `collection` | `readonly` | [`StrExpr`](https://minca.dev/api/core/interfaces/StrExpr.md) | - | [packages/core/src/records/contract-builder.ts:253](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L253) |
| <a id="property-createdat"></a> `createdAt` | `readonly` | [`StrExpr`](https://minca.dev/api/core/interfaces/StrExpr.md) | What the writer's clock said, which nothing checks | [packages/core/src/records/contract-builder.ts:259](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L259) |
| <a id="property-creator"></a> `creator` | `readonly` | [`StrExpr`](https://minca.dev/api/core/interfaces/StrExpr.md) | The account that wrote the record's first version | [packages/core/src/records/contract-builder.ts:257](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L257) |
| <a id="property-has"></a> `has` | `readonly` | (`field`) => [`BoolExpr`](https://minca.dev/api/core/interfaces/BoolExpr.md) | `has(body.note)`: whether a field is there | [packages/core/src/records/contract-builder.ts:280](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L280) |
| <a id="property-hash"></a> `hash` | `readonly` | (`value`) => [`StrExpr`](https://minca.dev/api/core/interfaces/StrExpr.md) | 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](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L278) |
| <a id="property-key"></a> `key` | `readonly` | [`StrExpr`](https://minca.dev/api/core/interfaces/StrExpr.md) | The record's key | [packages/core/src/records/contract-builder.ts:250](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L250) |
| <a id="property-link"></a> `link` | `readonly` | (`rel`) => [`StrExpr`](https://minca.dev/api/core/interfaces/StrExpr.md) | What this version's first link with that role points at, or null | [packages/core/src/records/contract-builder.ts:274](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L274) |
| <a id="property-links"></a> `links` | `readonly` | [`ListExpr`](https://minca.dev/api/core/interfaces/ListExpr.md)\<`LinkValue`\> | This version's links, each `{ rel, to }` | [packages/core/src/records/contract-builder.ts:248](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L248) |
| <a id="property-member"></a> `member` | `readonly` | (`did`) => [`BoolExpr`](https://minca.dev/api/core/interfaces/BoolExpr.md) | Whether an account is a member, as of this version | [packages/core/src/records/contract-builder.ts:276](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L276) |
| <a id="property-prev"></a> `prev` | `readonly` | [`VersionExpr`](https://minca.dev/api/core/interfaces/VersionExpr.md)\<`B`\> | The version before, or null on a first version: `prev.eq(null)` | [packages/core/src/records/contract-builder.ts:246](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L246) |
| <a id="property-raw"></a> `raw` | `readonly` | \<`T`\>(`cel`) => [`Expr`](https://minca.dev/api/core/type-aliases/Expr.md)\<`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](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L288) |
| <a id="property-seq"></a> `seq` | `readonly` | [`IntExpr`](https://minca.dev/api/core/interfaces/IntExpr.md) | This version's place in the record, an int | [packages/core/src/records/contract-builder.ts:252](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L252) |
| <a id="property-versions"></a> `versions` | `readonly` | (`ids`) => [`ListExpr`](https://minca.dev/api/core/interfaces/ListExpr.md)\<[`Cited`](https://minca.dev/api/core/interfaces/Cited.md)\<`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](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L270) |
| <a id="property-when"></a> `when` | `readonly` | \<`R`\>(`test`, `then`, `otherwise`) => `R` | `test ? then : otherwise` | [packages/core/src/records/contract-builder.ts:282](https://github.com/leifriksheim/minca/blob/main/core/src/records/contract-builder.ts#L282) |
