Interface IArvoContract<TUri, TType, TVersions, TMetaData>

Defines the structure of an Arvo contract, including its identifier, type, and versioned schemas.

interface IArvoContract<TUri, TType, TVersions, TMetaData> {
    description: null | string;
    metadata: TMetaData;
    type: TType;
    uri: TUri;
    versions: TVersions;
}

Type Parameters

  • TUri extends string = string

    The unique URI identifier for the contract

  • TType extends string = string

    The event type that the contract's handler accepts

  • TVersions extends Record<ArvoSemanticVersion, {
        accepts: z.ZodTypeAny;
        emits: Record<string, z.ZodTypeAny>;
    }> = Record<ArvoSemanticVersion, {
        accepts: z.ZodTypeAny;
        emits: Record<string, z.ZodTypeAny>;
    }>

    A record of versioned schemas, mapping semantic versions to their accept/emit schemas

  • TMetaData extends Record<string, any> = Record<string, any>

    Optional metadata type

Properties

description: null | string

Optional description providing context about the contract or its handler

metadata: TMetaData

The contract metadata

type: TType

The event type that this contract's handler accepts

uri: TUri

The unique URI identifier for this contract

versions: TVersions

A record mapping semantic versions to their corresponding schemas