Skip to content

ethereumeg/event-lists

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

28 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

event-lists

๐Ÿ“š The Event Lists specification

Schema

Examples of Event Lists

Name Example
minimal YAML / JSON

Javascript/Typescript module

Deno

Deno example

import Ajv from "https://esm.sh/v114/[email protected]";
import addFormats from "https://esm.sh/[email protected]";
import { parse as yamlParse } from "https://deno.land/[email protected]/yaml/mod.ts";
import { schema } from "https://deno.land/x/[email protected]/mod.ts";

const ajv = new Ajv({ strict: false });
addFormats(ajv);
const validate = ajv.compile(schema);

const LIST_YAML_FILE = "./src/0.1/examples/minimal.yaml";

const list = yamlParse(await Deno.readTextFile(LIST_YAML_FILE));

if (!validate(list)) {
  throw validate.errors;
}

console.log("Event List valid");

License

MIT