contract-examples.ts
This file
Path
packages/protocol/test/contract-examples.ts
18 lines · 453 bytes · TypeScript
Last changed by
Merge build/comments-cli-protocol-checks into mainoscabrielbefore adoptionc86204f
History of this fileTake it
12345678910111213141516171819import { Schema } from "effect";
import wire from "./fixtures/contracts.json" with { type: "json" };
export const Example = Schema.Struct({ payload: Schema.Json, success: Schema.Json,});
export type Example = typeof Example.Type;
const Fixture = Schema.Struct({ examples: Schema.Record(Schema.String, Example),});
export const examples: ReadonlyMap<string, Example> = new Map( Object.entries(Schema.decodeSync(Fixture)(wire).examples));