@traittech/traits-validator-2 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/dist/cjs/index.d.ts +7 -0
- package/dist/cjs/index.js +48 -0
- package/dist/cjs/types.d.ts +8 -0
- package/dist/cjs/types.js +2 -0
- package/dist/esm/index.d.ts +7 -0
- package/dist/esm/index.js +25 -0
- package/dist/esm/types.d.ts +8 -0
- package/dist/esm/types.js +1 -0
- package/dist/schemes/metadata_schema.json +41 -0
- package/dist/schemes/registry.json +714 -0
- package/package.json +39 -0
- package/schemes/metadata_schema.json +41 -0
- package/schemes/registry.json +714 -0
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@traittech/traits-validator-2",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "dist/esm/index.js",
|
|
7
|
+
"module": "dist/esm/index.js",
|
|
8
|
+
"types": "dist/esm/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/esm/index.js",
|
|
12
|
+
"require": "./dist/cjs/index.js",
|
|
13
|
+
"types": "./dist/esm/index.d.ts"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"schemes",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build:schemes": "node ./scripts/build-schemes.mjs",
|
|
23
|
+
"build:esm": "tsc -p tsconfig.esm.json",
|
|
24
|
+
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
25
|
+
"build:copy-schemes": "node ./scripts/copy-schemes.mjs",
|
|
26
|
+
"build": "npm run build:schemes && npm run build:esm && npm run build:cjs && npm run build:copy-schemes",
|
|
27
|
+
"test": "vitest run"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"ajv": "^8.17.1",
|
|
31
|
+
"ajv-formats": "^3.0.1"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "^22.10.1",
|
|
35
|
+
"typescript": "^5.9.2",
|
|
36
|
+
"vitest": "^1.6.0"
|
|
37
|
+
},
|
|
38
|
+
"sideEffects": false
|
|
39
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://trevo-finance.github.io/trevo-traits-registry/traits/metadata_schema.json",
|
|
3
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
"title": "Metadata of on-chain entity",
|
|
5
|
+
"description": "Metadata of an on-chain entity, such as token, NFT, AppAgent etc.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"metadata_id": {
|
|
9
|
+
"description": "The identifier of the document with metadata. Depending on the context, this can be an identifier of on-chain entity, that metadata annotates. Or it can be an application-specific identifier.",
|
|
10
|
+
"type": "string",
|
|
11
|
+
"minLength": 5,
|
|
12
|
+
"maxLength": 128
|
|
13
|
+
},
|
|
14
|
+
"title": {
|
|
15
|
+
"description": "The human readable title of the document with metadata.",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"minLength": 5,
|
|
18
|
+
"maxLength": 128
|
|
19
|
+
},
|
|
20
|
+
"description": {
|
|
21
|
+
"description": "The human readable description of the metadata document.",
|
|
22
|
+
"type": "string",
|
|
23
|
+
"maxLength": 1024
|
|
24
|
+
},
|
|
25
|
+
"traits": {
|
|
26
|
+
"description": "The list of traits supported by on-chain entity, that is annotated with this metadata document.",
|
|
27
|
+
"type": "object",
|
|
28
|
+
"minProperties": 1,
|
|
29
|
+
"propertyNames": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"minLength": 5,
|
|
32
|
+
"maxLength": 128
|
|
33
|
+
},
|
|
34
|
+
"patternProperties": {
|
|
35
|
+
"^.*$": { "type": "object" }
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"required": [ "metadata_id", "title", "traits" ],
|
|
40
|
+
"additionalProperties": false
|
|
41
|
+
}
|