{"id":24066299,"url":"https://github.com/rainlanguage/meta","last_synced_at":"2026-06-06T20:31:25.476Z","repository":{"id":152462658,"uuid":"623678272","full_name":"rainlanguage/meta","owner":"rainlanguage","description":"Utility library for Rain Protocol's metadata.","archived":false,"fork":false,"pushed_at":"2023-11-16T19:08:29.000Z","size":717,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-20T18:51:35.049Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rainlanguage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-04-04T21:21:38.000Z","updated_at":"2023-04-04T23:22:38.000Z","dependencies_parsed_at":"2023-11-07T20:51:58.482Z","dependency_job_id":"8733181e-deeb-4216-b706-d38683d9cbbf","html_url":"https://github.com/rainlanguage/meta","commit_stats":null,"previous_names":["rainlanguage/meta","rainprotocol/meta"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/rainlanguage/meta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainlanguage%2Fmeta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainlanguage%2Fmeta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainlanguage%2Fmeta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainlanguage%2Fmeta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rainlanguage","download_url":"https://codeload.github.com/rainlanguage/meta/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainlanguage%2Fmeta/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33999579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-09T11:39:56.141Z","updated_at":"2026-06-06T20:31:25.448Z","avatar_url":"https://github.com/rainlanguage.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rain Protocol Meta\nUtility library for Rain Protocol's metadata.\nAlso provides the schemas generated from typescript types for Rain Protocol's metadata such as op meta and contract meta. (uses [ts-json-schema-generator](https://www.npmjs.com/package/ts-json-schema-generator))\n\n## Usage\nInstall the package with following: \n```bash\nnpm install @rainprotocol/meta\n```\nor \n```bash\nyarn add @rainprotocol/meta\n```\n\nSchemas can used in vscode to automatically validate a json file when you specify it in vscode workspace setting:\n- Create a folder `.vscode` in your workspace and make a new file `settings.json`. (skip this if these are already present)\n- Add the following to the `settings.json`:\n```json\n{\n  \"json.schemas\": [\n    {\n      \"fileMatch\": [\"*.op.meta.json\"],\n      \"url\": \"./node_modules/@rainprotocol/meta/schemas/op.meta.schema.json\"\n    },\n    {\n      \"fileMatch\": [\"*.contract.meta.json\"],\n      \"url\": \"./node_modules/@rainprotocol/meta/schemas/contract.meta.schema.json\"\n    }\n  ]\n}\n```\nyou can specify what files will be validated automatically by providing a glob pattern for `fileMatch`.\nSee the `./example` folder content for some examples.\n\u003cbr\u003e\n\nSchemas can also be imported and used programmatically:\n```typescript\nimport { OpMetaSchema, ContractMetaSchema } from \"@rainprotocol/meta\";\n```\n\nFor getting an op meta from subgraph:\n```typescript\n// importing\nimport { getOpMetaFromSg } from \"@rainprotocol/meta\";\n\n// get opmeta\nconst opmeta = await getOpMetaFromSg(deployerAddress, networkOrChainIdOrSgUrl)\n```\n\u003cbr\u003e\n\nTo validate a meta against generated schemas:\n```typescript\n// importing\nimport { validateMeta, metaFromBytes, OpMetaSchema } from \"@rainprotocol/meta\";\n\n// convert \"opmeta\" from previous guide which is is bytes from (hex string) to op meta as object\nconst opmetaObj = metaFromBytes(opmeta);\n\n// to validate the opmeta object against the OpMetaSchema\nvalidateMeta(opmetaObj, OpMetaSchema);\n\n// alternatively \"metaFromBytes()\" can perform the validation internally if the schema is provided as second arg\nconst opmetaObj = metaFromBytes(opmeta, OpMetaSchema);\n```\n\u003cbr\u003e\n\n## Developers Guide\nClone the repo and then install all the dependencies:\n```bash\nnpm install\n```\nThere is `prepare` hook that will compile and generate the schemas after installing the deps.\nVersions of the generated schemas (schema `$id` field) are specified at the beginning of their types file with the following form:\n```typescript\n// specify the version of the meta in the following line\n// version 0.0.0\n```\nModify the digits for specifying the version for the generated schema.\n\nTo generate the schemas:\n```bash\nnpm run gen-schema\n```\n\nTo run the tests:\n```bash\nnpm test\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frainlanguage%2Fmeta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frainlanguage%2Fmeta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frainlanguage%2Fmeta/lists"}