# serializeScalarSketchJson

> **serializeScalarSketchJson**(`sketch`): [`ScalarSketchJson`](/reference/knotkit/scalar-sketch/wire/type-aliases/scalarsketchjson/)

Defined in: [packages/scalar-sketch/src/serialization/json.ts:69](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/scalar-sketch/src/serialization/json.ts#L69)

Serialize exact scalar-sketch state into the stable logical JSON shape. Object keys are inserted in the documented canonical order, while unsigned 64-bit values use canonical decimal strings.

## Parameters

### sketch

[`ScalarSketch`](/reference/knotkit/scalar-sketch/type-aliases/scalarsketch/)

## Returns

[`ScalarSketchJson`](/reference/knotkit/scalar-sketch/wire/type-aliases/scalarsketchjson/)

## Throws

With `FOREIGN_STRUCTURE` or `WRONG_FAMILY` when the value was not produced by this package.
