Skip to content
Français

defineBinaryArtifact

import { defineBinaryArtifact } from "@elie-laloum/outpost";

Declare a named, versioned contract for Uint8Array payloads, copied on publish and on read. Throws when name or version is empty or longer than 1024 characters.

Complete example and detailed rules.

  • optionsRequired
    ArtifactContractOptions
    Contract name and version.
  • options.nameRequired
    string
    Contract name, nonempty and at most 1024 characters. A read requires the same name.
  • options.versionRequired
    string
    Contract version you choose, nonempty and at most 1024 characters. A read requires the same version, so change it when the format changes.

ArtifactContract<Uint8Array<ArrayBufferLike>>

export declare function defineBinaryArtifact(
  options: ArtifactContractOptions,
): ArtifactContract<Uint8Array>;