# ArtifactFormatDefinition

Defined in: [packages/wire/src/artifact-format.ts:10](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/wire/src/artifact-format.ts#L10)

What one module declares, once, about the binary artifact it writes and reads.

## Type Parameters

### Kind

`Kind` *extends* `string`

### Failure

`Failure` *extends* [`KnotkitError`](/reference/knotkit/errors/classes/knotkiterror/)

### InvalidInputCode

`InvalidInputCode` *extends* `string`

## Properties

### name

> `readonly` **name**: `string`

Defined in: [packages/wire/src/artifact-format.ts:16](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/wire/src/artifact-format.ts#L16)

How messages name the artifact, such as `heap` or `segmented-trie`.

***

### magic

> `readonly` **magic**: `Uint8Array`

Defined in: [packages/wire/src/artifact-format.ts:18](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/wire/src/artifact-format.ts#L18)

The four bytes that identify the owning module.

***

### payloadVersion

> `readonly` **payloadVersion**: `number`

Defined in: [packages/wire/src/artifact-format.ts:20](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/wire/src/artifact-format.ts#L20)

The one payload version this release writes and reads. The number is the module’s; the comparison is wire’s.

***

### kindTags

> `readonly` **kindTags**: `Readonly`<`Record`<`Kind`, `number`>>

Defined in: [packages/wire/src/artifact-format.ts:22](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/wire/src/artifact-format.ts#L22)

The byte each kind is written as. A tag is part of the wire contract, so it is never reused or renumbered.

***

### sectionTags

> `readonly` **sectionTags**: readonly `number`\[]

Defined in: [packages/wire/src/artifact-format.ts:24](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/wire/src/artifact-format.ts#L24)

The section tags the module reads. Any other tag is validated and skipped without a copy.

***

### wrongFormatHint?

> `readonly` `optional` **wrongFormatHint?**: `string`

Defined in: [packages/wire/src/artifact-format.ts:26](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/wire/src/artifact-format.ts#L26)

Where a value that is not bytes belongs, appended to the `wrong-format` message.

***

### parseError

> `readonly` **parseError**: (`code`, `detail`) => `Failure`

Defined in: [packages/wire/src/artifact-format.ts:28](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/wire/src/artifact-format.ts#L28)

Builds the module’s parse error from the code it owns for a wire failure reason.

#### Parameters

##### code

[`WireFailureCode`](/reference/knotkit/wire/type-aliases/wirefailurecode/)

##### detail

`string`

#### Returns

`Failure`

***

### serializationCodes

> `readonly` **serializationCodes**: [`WireSerializationCodeMap`](/reference/knotkit/wire/type-aliases/wireserializationcodemap/)<`InvalidInputCode`>

Defined in: [packages/wire/src/artifact-format.ts:30](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/wire/src/artifact-format.ts#L30)

The module’s translation of each wire caller-contract code raised while writing.

***

### invalidInputError

> `readonly` **invalidInputError**: (`code`, `detail`) => [`KnotkitError`](/reference/knotkit/errors/classes/knotkiterror/)

Defined in: [packages/wire/src/artifact-format.ts:32](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/wire/src/artifact-format.ts#L32)

Builds the module’s invalid-input error from a translated code.

#### Parameters

##### code

`InvalidInputCode`

##### detail

`string`

#### Returns

[`KnotkitError`](/reference/knotkit/errors/classes/knotkiterror/)
