{"_id":"@amanita-labs/cardano-governance-metadata","_rev":"4-b80921a7377ec25d2ce4e85a5cd8a8a7","name":"@amanita-labs/cardano-governance-metadata","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@amanita-labs/cardano-governance-metadata","version":"0.1.0","license":"Apache-2.0","_id":"@amanita-labs/cardano-governance-metadata@0.1.0","maintainers":[{"name":"ryun1","email":"rye_williams@btopenworld.com"}],"homepage":"https://github.com/amanita-labs/governance-metadata#readme","bugs":{"url":"https://github.com/amanita-labs/governance-metadata/issues"},"dist":{"shasum":"9cf12b2f52b9fbde0d14ca91258c307976d355c6","tarball":"https://registry.npmjs.org/@amanita-labs/cardano-governance-metadata/-/cardano-governance-metadata-0.1.0.tgz","fileCount":127,"integrity":"sha512-AvjV9IE/fNFLmBCvW+lvn6c1tduOFVbSo/Khiou/zkJn1VSnly4UE4/vt/+6fz/Tg+LlahmvZg+TRK96Em7UDw==","signatures":[{"sig":"MEUCIQCkOguDHBFhi8NdRwHB3q6gVqAR5F0jL1fCfvw/H2bhkAIgdKPUwL5TQLlJXhamgqwYIAW2Ijp55Yl73RMfiXdy8qA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6037518},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./cip100":{"types":"./dist/cip100/index.d.ts","default":"./dist/cip100/index.js"},"./cip108":{"types":"./dist/cip108/index.d.ts","default":"./dist/cip108/index.js"},"./cip119":{"types":"./dist/cip119/index.d.ts","default":"./dist/cip119/index.js"},"./cip136":{"types":"./dist/cip136/index.d.ts","default":"./dist/cip136/index.js"},"./cip169":{"types":"./dist/cip169/index.d.ts","default":"./dist/cip169/index.js"}},"gitHead":"8f82a4359fdbd8d45860fcc5d7709e915af19437","scripts":{"lint":"biome check ./src","test":"bun test","build":"bun run build:esm && bun run build:types","clean":"rm -rf dist","build:esm":"bun build ./src/index.ts --outdir ./dist --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip100/index.ts --outdir ./dist/cip100 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip108/index.ts --outdir ./dist/cip108 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip119/index.ts --outdir ./dist/cip119 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip136/index.ts --outdir ./dist/cip136 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip169/index.ts --outdir ./dist/cip169 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs","test:watch":"bun test --watch","type-check":"tsc --noEmit","build:types":"tsc --project tsconfig.build.json --emitDeclarationOnly","prepublishOnly":"bun run clean && bun run build && bun test"},"_npmUser":{"name":"ryun1","email":"rye_williams@btopenworld.com"},"repository":{"url":"git+https://github.com/amanita-labs/governance-metadata.git","type":"git"},"_npmVersion":"10.2.0","description":"TypeScript library for fetching, parsing, validating, and verifying Cardano governance metadata (CIP-100, CIP-108, CIP-119, CIP-136, CIP-169)","directories":{},"sideEffects":false,"_nodeVersion":"21.1.0","dependencies":{"zod":"^3.24.2","jsonld":"^8.3.3","blakejs":"^1.2.1","@noble/ed25519":"^2.2.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"bun-types":"^1.2.5","typescript":"^5.7.3","@types/jsonld":"^1.5.15","@biomejs/biome":"^1.9.4","@emurgo/cardano-serialization-lib-nodejs":"^14.1.2"},"peerDependencies":{"@emurgo/cardano-serialization-lib-asmjs":"*","@emurgo/cardano-serialization-lib-nodejs":"*","@emurgo/cardano-serialization-lib-browser":"*"},"peerDependenciesMeta":{"@emurgo/cardano-serialization-lib-asmjs":{"optional":true},"@emurgo/cardano-serialization-lib-nodejs":{"optional":true},"@emurgo/cardano-serialization-lib-browser":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/cardano-governance-metadata_0.1.0_1778264118798_0.7252492163656998","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@amanita-labs/cardano-governance-metadata","version":"0.1.1","license":"Apache-2.0","_id":"@amanita-labs/cardano-governance-metadata@0.1.1","maintainers":[{"name":"ryun1","email":"rye_williams@btopenworld.com"}],"homepage":"https://github.com/amanita-labs/governance-metadata#readme","bugs":{"url":"https://github.com/amanita-labs/governance-metadata/issues"},"dist":{"shasum":"366c61407623b1351d46949c891d1bbb928f880a","tarball":"https://registry.npmjs.org/@amanita-labs/cardano-governance-metadata/-/cardano-governance-metadata-0.1.1.tgz","fileCount":118,"integrity":"sha512-hlVjHP95O+nwo1zCAQXu3qtHw546UUe4XVZNTxfZJO6E1f3O9X4JJ/IZ4xFTlmpejPh6WO+e8G1Xm0OD61I93g==","signatures":[{"sig":"MEQCIFmrRbzUK6bN8LmRiiYCdrTp6GbhzAgZB/BoHzblRj/fAiBoKFRqxRpHn4ZTVghPTxfOvWyfrxI1aRvmX7JOWTapIg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6444083},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./cip100":{"types":"./dist/cip100/index.d.ts","default":"./dist/cip100/index.js"},"./cip108":{"types":"./dist/cip108/index.d.ts","default":"./dist/cip108/index.js"},"./cip119":{"types":"./dist/cip119/index.d.ts","default":"./dist/cip119/index.js"},"./cip136":{"types":"./dist/cip136/index.d.ts","default":"./dist/cip136/index.js"},"./cip169":{"types":"./dist/cip169/index.d.ts","default":"./dist/cip169/index.js"}},"gitHead":"5e3c7a1a4f03d67c19c13f53e9a427cfe719b623","scripts":{"lint":"biome check ./src","test":"bun test","build":"bun run build:esm && bun run build:types","clean":"rm -rf dist","build:esm":"bun build ./src/index.ts --outdir ./dist --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip100/index.ts --outdir ./dist/cip100 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip108/index.ts --outdir ./dist/cip108 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip119/index.ts --outdir ./dist/cip119 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip136/index.ts --outdir ./dist/cip136 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip169/index.ts --outdir ./dist/cip169 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs","test:watch":"bun test --watch","type-check":"tsc --noEmit","build:types":"tsc --project tsconfig.build.json --emitDeclarationOnly","prepublishOnly":"bun run clean && bun run build && bun test"},"_npmUser":{"name":"ryun1","email":"rye_williams@btopenworld.com"},"repository":{"url":"git+https://github.com/amanita-labs/governance-metadata.git","type":"git"},"_npmVersion":"10.2.0","description":"TypeScript library for fetching, parsing, validating, and verifying Cardano governance metadata (CIP-100, CIP-108, CIP-119, CIP-136, CIP-169)","directories":{},"sideEffects":false,"_nodeVersion":"21.1.0","dependencies":{"zod":"^3.24.2","cbor2":"^2.3.0","jsonld":"^8.3.3","blakejs":"^1.2.1","@noble/ed25519":"^2.2.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"bun-types":"^1.2.5","typescript":"^5.7.3","@types/jsonld":"^1.5.15","@biomejs/biome":"^1.9.4","@emurgo/cardano-serialization-lib-nodejs":"^14.1.2"},"peerDependencies":{"@emurgo/cardano-serialization-lib-asmjs":"*","@emurgo/cardano-serialization-lib-nodejs":"*","@emurgo/cardano-serialization-lib-browser":"*"},"peerDependenciesMeta":{"@emurgo/cardano-serialization-lib-asmjs":{"optional":true},"@emurgo/cardano-serialization-lib-nodejs":{"optional":true},"@emurgo/cardano-serialization-lib-browser":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/cardano-governance-metadata_0.1.1_1780789661274_0.7013417672479088","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@amanita-labs/cardano-governance-metadata","version":"0.1.2","license":"Apache-2.0","_id":"@amanita-labs/cardano-governance-metadata@0.1.2","maintainers":[{"name":"ryun1","email":"rye_williams@btopenworld.com"}],"homepage":"https://github.com/amanita-labs/governance-metadata#readme","bugs":{"url":"https://github.com/amanita-labs/governance-metadata/issues"},"dist":{"shasum":"e55f427fffdf841ec130ac6b7953cf331fcb1ae0","tarball":"https://registry.npmjs.org/@amanita-labs/cardano-governance-metadata/-/cardano-governance-metadata-0.1.2.tgz","fileCount":118,"integrity":"sha512-NI26dVQFszfTcZIgzVfuaFQlgzcizRcPoHbZBAAlmCBTxJq+U7/Sv4/6bux2yhYZsPQ2EW2WvXTACLLfpAW+xA==","signatures":[{"sig":"MEQCIAg0zMXk7XATnIQCIps4KIzRJZOArgaPn5yuPzxal+tVAiAXmI87/BH2drKCk7h13TtgCPAXg8tInAs1RjLthUzMVw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6448498},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./cip100":{"types":"./dist/cip100/index.d.ts","default":"./dist/cip100/index.js"},"./cip108":{"types":"./dist/cip108/index.d.ts","default":"./dist/cip108/index.js"},"./cip119":{"types":"./dist/cip119/index.d.ts","default":"./dist/cip119/index.js"},"./cip136":{"types":"./dist/cip136/index.d.ts","default":"./dist/cip136/index.js"},"./cip169":{"types":"./dist/cip169/index.d.ts","default":"./dist/cip169/index.js"}},"gitHead":"ec910fbbac4c0d2e43f29c3ec3f199a4da6fab0c","scripts":{"lint":"biome check ./src","test":"bun test","build":"bun run build:esm && bun run build:types","clean":"rm -rf dist","build:esm":"bun build ./src/index.ts --outdir ./dist --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip100/index.ts --outdir ./dist/cip100 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip108/index.ts --outdir ./dist/cip108 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip119/index.ts --outdir ./dist/cip119 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip136/index.ts --outdir ./dist/cip136 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip169/index.ts --outdir ./dist/cip169 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs","test:watch":"bun test --watch","type-check":"tsc --noEmit","build:types":"tsc --project tsconfig.build.json --emitDeclarationOnly","prepublishOnly":"bun run clean && bun run build && bun test"},"_npmUser":{"name":"ryun1","email":"rye_williams@btopenworld.com"},"repository":{"url":"git+https://github.com/amanita-labs/governance-metadata.git","type":"git"},"_npmVersion":"10.2.0","description":"TypeScript library for fetching, parsing, validating, and verifying Cardano governance metadata (CIP-100, CIP-108, CIP-119, CIP-136, CIP-169)","directories":{},"sideEffects":false,"_nodeVersion":"21.1.0","dependencies":{"zod":"^3.24.2","cbor2":"^2.3.0","jsonld":"^8.3.3","blakejs":"^1.2.1","@noble/ed25519":"^2.2.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"bun-types":"^1.2.5","typescript":"^5.7.3","@types/jsonld":"^1.5.15","@biomejs/biome":"^1.9.4","@emurgo/cardano-serialization-lib-nodejs":"^14.1.2"},"peerDependencies":{"@emurgo/cardano-serialization-lib-asmjs":"*","@emurgo/cardano-serialization-lib-nodejs":"*","@emurgo/cardano-serialization-lib-browser":"*"},"peerDependenciesMeta":{"@emurgo/cardano-serialization-lib-asmjs":{"optional":true},"@emurgo/cardano-serialization-lib-nodejs":{"optional":true},"@emurgo/cardano-serialization-lib-browser":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/cardano-governance-metadata_0.1.2_1780866336202_0.05255766502688597","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@amanita-labs/cardano-governance-metadata","version":"0.1.3","description":"TypeScript library for fetching, parsing, validating, and verifying Cardano governance metadata (CIP-100, CIP-108, CIP-119, CIP-136, CIP-169)","type":"module","sideEffects":false,"main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./cip100":{"types":"./dist/cip100/index.d.ts","default":"./dist/cip100/index.js"},"./cip108":{"types":"./dist/cip108/index.d.ts","default":"./dist/cip108/index.js"},"./cip119":{"types":"./dist/cip119/index.d.ts","default":"./dist/cip119/index.js"},"./cip136":{"types":"./dist/cip136/index.d.ts","default":"./dist/cip136/index.js"},"./cip169":{"types":"./dist/cip169/index.d.ts","default":"./dist/cip169/index.js"}},"engines":{"node":">=18"},"scripts":{"build":"bun run build:esm && bun run build:types && bun run check:dist","check:dist":"node scripts/check-dist-exports.mjs","build:esm":"bun build ./src/index.ts --outdir ./dist --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip100/index.ts --outdir ./dist/cip100 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip108/index.ts --outdir ./dist/cip108 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip119/index.ts --outdir ./dist/cip119 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip136/index.ts --outdir ./dist/cip136 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs && bun build ./src/cip169/index.ts --outdir ./dist/cip169 --format esm --target node --external jsonld --external blakejs --external @noble/ed25519 --external zod --external @emurgo/cardano-serialization-lib-nodejs --external @emurgo/cardano-serialization-lib-browser --external @emurgo/cardano-serialization-lib-asmjs","build:types":"tsc --project tsconfig.build.json --emitDeclarationOnly","test":"bun test","test:watch":"bun test --watch","type-check":"tsc --noEmit","lint":"biome check ./src","clean":"rm -rf dist","prepublishOnly":"bun run clean && bun run build && bun test"},"dependencies":{"@noble/ed25519":"^2.2.3","blakejs":"^1.2.1","cbor2":"^2.3.0","jsonld":"^8.3.3","zod":"^3.24.2"},"devDependencies":{"@biomejs/biome":"^1.9.4","@emurgo/cardano-serialization-lib-nodejs":"^14.1.2","@types/jsonld":"^1.5.15","bun-types":"^1.2.5","typescript":"^5.7.3"},"peerDependencies":{"@emurgo/cardano-serialization-lib-asmjs":"*","@emurgo/cardano-serialization-lib-browser":"*","@emurgo/cardano-serialization-lib-nodejs":"*"},"peerDependenciesMeta":{"@emurgo/cardano-serialization-lib-asmjs":{"optional":true},"@emurgo/cardano-serialization-lib-browser":{"optional":true},"@emurgo/cardano-serialization-lib-nodejs":{"optional":true}},"publishConfig":{"access":"public"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/amanita-labs/governance-metadata.git"},"_id":"@amanita-labs/cardano-governance-metadata@0.1.3","gitHead":"f82b32b3c7d08dba13ae58e62c418c5200f867fb","bugs":{"url":"https://github.com/amanita-labs/governance-metadata/issues"},"homepage":"https://github.com/amanita-labs/governance-metadata#readme","_nodeVersion":"21.1.0","_npmVersion":"10.2.0","dist":{"integrity":"sha512-6yf+z1xy032kO1tjD0KKC/0S2gAwTol04i+FbUPSNJUGIetdckTjzqRNC9krLp4V0I1w6FVYTa9XslVoxeesBg==","shasum":"f6c2a216759088c53b08253158d7ddce8dfa60e0","tarball":"https://registry.npmjs.org/@amanita-labs/cardano-governance-metadata/-/cardano-governance-metadata-0.1.3.tgz","fileCount":118,"unpackedSize":6457283,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC4DCZjH/r/f7jlt5x7VDs5uwCDQAo70w1mxhxrFI4l5AIhAN8hYctz/S9IGR+ppVkMTYqgIH/ot3o27nUW+7mgSZCm"}]},"_npmUser":{"name":"ryun1","email":"rye_williams@btopenworld.com"},"directories":{},"maintainers":[{"name":"ryun1","email":"rye_williams@btopenworld.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cardano-governance-metadata_0.1.3_1781312083036_0.7795867416418663"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-08T18:15:18.671Z","modified":"2026-06-13T00:54:43.302Z","0.1.0":"2026-05-08T18:15:19.024Z","0.1.1":"2026-06-06T23:47:41.427Z","0.1.2":"2026-06-07T21:05:36.393Z","0.1.3":"2026-06-13T00:54:43.179Z"},"bugs":{"url":"https://github.com/amanita-labs/governance-metadata/issues"},"license":"Apache-2.0","homepage":"https://github.com/amanita-labs/governance-metadata#readme","repository":{"type":"git","url":"git+https://github.com/amanita-labs/governance-metadata.git"},"description":"TypeScript library for fetching, parsing, validating, and verifying Cardano governance metadata (CIP-100, CIP-108, CIP-119, CIP-136, CIP-169)","maintainers":[{"name":"ryun1","email":"rye_williams@btopenworld.com"}],"readme":"# @amanita-labs/cardano-governance-metadata\n\nTypeScript library for fetching, parsing, validating, and verifying Cardano governance metadata.\n\nSupports [CIP-100](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0100) and its extensions:\n\n| Standard | Description | Spec |\n|----------|-------------|------|\n| CIP-100 | Governance Metadata (base) | [cardano-foundation/CIPs/CIP-0100](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0100) |\n| CIP-108 | Governance Actions | [cardano-foundation/CIPs/CIP-0108](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0108) |\n| CIP-119 | DRep Registration | [cardano-foundation/CIPs/CIP-0119](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0119) |\n| CIP-136 | Constitutional Committee Votes | [cardano-foundation/CIPs/CIP-0136](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0136) |\n| CIP-169 | On-Chain Effects (cross-cutting; layered on any of the above) | [cardano-foundation/CIPs#1101 (draft)](https://github.com/cardano-foundation/CIPs/pull/1101) |\n\n> CIP-169 is in draft until PR [#1101](https://github.com/cardano-foundation/CIPs/pull/1101) is merged. Pin a specific version of this library if you depend on a specific draft revision.\n\nSee also: [`docs/architecture.md`](./docs/architecture.md) for design notes, [`docs/examples/`](./docs/examples/) for runnable examples, and [`CHANGELOG.md`](./CHANGELOG.md) for release notes.\n\n## Install\n\n```bash\nbun add @amanita-labs/cardano-governance-metadata\n```\n\n## Quick Start\n\n### Resolve metadata from a URI\n\nGiven any governance metadata URI, `resolve()` will fetch it, detect which CIP standard it conforms to, validate it, verify signatures, and report any extra fields:\n\n```typescript\nimport { resolve } from \"@amanita-labs/cardano-governance-metadata\";\n\nconst result = await resolve(\n  \"ipfs://QmExampleCid\",\n  { anchorHash: \"7b7d4a28...\" },  // optional on-chain anchor hash\n);\n\nif (result.success) {\n  const { cipStandard, document, extraFields, verification } = result.data;\n\n  console.log(`Detected: ${cipStandard}`);  // \"CIP-119\"\n  console.log(`Document:`, document);\n  console.log(`Anchor hash valid:`, verification?.anchorHash?.valid);\n  console.log(`Signatures valid:`, verification?.valid);\n\n  // Extra fields not defined by the detected CIP are preserved and reported\n  if (extraFields.length > 0) {\n    console.warn(\"Unknown fields found:\");\n    for (const field of extraFields) {\n      console.warn(`  ${field.path}:`, field.value);\n    }\n  }\n}\n```\n\n### Parse a governance metadata document\n\n```typescript\nimport { cip100, detectCipStandard } from \"@amanita-labs/cardano-governance-metadata\";\n\nconst json = `{\n  \"@context\": { ... },\n  \"hashAlgorithm\": \"blake2b-256\",\n  \"authors\": [],\n  \"body\": {\n    \"comment\": \"I support this proposal because...\"\n  }\n}`;\n\nconst result = cip100.parse(json);\n\nif (result.success) {\n  console.log(result.data.body.comment);\n} else {\n  console.error(result.error.message);\n}\n```\n\n### Detect which CIP standard a document uses\n\n```typescript\nimport { detectCipStandard, cip108, cip119, cip136 } from \"@amanita-labs/cardano-governance-metadata\";\n\nconst doc = JSON.parse(rawJson);\nconst standard = detectCipStandard(doc);\n\nswitch (standard) {\n  case \"CIP-108\": {\n    const result = cip108.parse(doc);\n    if (result.success) {\n      console.log(result.data.body.title);\n      console.log(result.data.body.abstract);\n    }\n    break;\n  }\n  case \"CIP-119\": {\n    const result = cip119.parse(doc);\n    if (result.success) {\n      console.log(result.data.body.givenName);\n      console.log(result.data.body.objectives);\n    }\n    break;\n  }\n  case \"CIP-136\": {\n    const result = cip136.parse(doc);\n    if (result.success) {\n      console.log(result.data.body.summary);\n      console.log(result.data.body.rationaleStatement);\n    }\n    break;\n  }\n}\n```\n\n### Build (construct) a document\n\nEach CIP module exports a `build()` factory — the inverse of `parse()`. You supply the `body` (and optionally `authors`); `build()` injects the canonical `@context` URL and `hashAlgorithm: \"blake2b-256\"`, validates the result against the same schema `validate()` uses, and returns the typed document plus a pretty-printed JSON string. A successful build is guaranteed to round-trip through `parse()`.\n\n```typescript\nimport { cip108 } from \"@amanita-labs/cardano-governance-metadata\";\n\nconst result = cip108.build({\n  body: {\n    title: \"Increase K parameter to 1000\",\n    abstract: \"Raise the desired number of pools...\",\n    motivation: \"Greater decentralization...\",\n    rationale: \"Simulations show...\",\n  },\n  // authors, context, hashAlgorithm are all optional\n});\n\nif (result.success) {\n  const { doc, json } = result.data;  // doc: typed Cip108Document, json: string\n  console.log(json);                  // ready to publish (IPFS/Arweave/HTTPS)\n}\n```\n\n`@context` and `hashAlgorithm` are overridable per call (`build({ body, context, hashAlgorithm })`). Witnesses are out of scope — callers compose `authors[]` themselves, with or without populated witnesses. The same shape works for `cip100.build`, `cip119.build`, and `cip136.build`.\n\n#### Build a CIP-169 on-chain payload\n\n`cip169.build` validates an `OnChain` payload (a proposal procedure, certificate, or voting-procedures array) and returns `{ payload, json }`. Use the `cip169.actions` helpers to construct the inner `gov_action` / certificate / voter values without hand-writing tags, then nest the payload under any base CIP's `body.onChain`:\n\n```typescript\nimport { cip108, cip169 } from \"@amanita-labs/cardano-governance-metadata\";\n\nconst onChain = cip169.build({\n  deposit: \"100000000000\",\n  reward_account: \"stake1u...\",\n  gov_action: cip169.actions.treasuryWithdrawals({\n    rewards: [{ key: \"stake1u...\", value: \"1000000\" }],\n  }),\n});\n\nif (onChain.success) {\n  // Nest the validated payload into a full CIP-108 document\n  const doc = cip108.build({\n    body: {\n      title: \"Treasury withdrawal request\",\n      abstract: \"Withdraw 1 ADA from the treasury.\",\n      motivation: \"...\",\n      rationale: \"...\",\n      onChain: onChain.data.payload,\n    },\n  });\n}\n```\n\nAction helpers cover every Conway governance action and the no-anchor certificate/voting shapes: `infoAction`, `parameterChange`, `hardForkInitiation`, `treasuryWithdrawals`, `noConfidence`, `updateCommittee`, `newConstitution`, `registerDrep`, `updateDrep`, `resignCommitteeCold`, and `votingProcedures`. They are pure type-narrowed constructors — validation happens when `cip169.build` (or the enclosing `cipNNN.build`) checks the assembled payload.\n\n### Validate a DRep registration (CIP-119)\n\n```typescript\nimport { cip119 } from \"@amanita-labs/cardano-governance-metadata\";\n\nconst result = cip119.validate({\n  \"@context\": { /* ... */ },\n  hashAlgorithm: \"blake2b-256\",\n  body: {\n    givenName: \"Ada Lovelace\",\n    objectives: \"Improve on-chain governance tooling\",\n    motivations: \"Passionate about decentralized decision-making\",\n    qualifications: \"5 years in Cardano development\",\n    paymentAddress: \"addr1q...\",\n    references: [\n      { \"@type\": \"Link\", label: \"Twitter\", uri: \"https://twitter.com/example\" },\n    ],\n  },\n});\n\nif (!result.success) {\n  for (const issue of result.error.issues) {\n    console.error(`${issue.path}: ${issue.message}`);\n  }\n}\n```\n\n### Validate a governance action (CIP-108)\n\n```typescript\nimport { cip108 } from \"@amanita-labs/cardano-governance-metadata\";\n\nconst result = cip108.validate({\n  \"@context\": { /* ... */ },\n  hashAlgorithm: \"blake2b-256\",\n  body: {\n    title: \"Increase K parameter to 100,000\",  // max 80 chars\n    abstract: \"This proposal aims to...\",        // max 2500 chars\n    motivation: \"The current K parameter...\",\n    rationale: \"By increasing K we achieve...\",\n  },\n});\n\nif (result.success) {\n  console.log(\"Valid governance action metadata\");\n}\n```\n\n### Fetch and verify metadata from a URI\n\n```typescript\nimport { cip100 } from \"@amanita-labs/cardano-governance-metadata\";\n\n// Verify against an on-chain anchor hash\nconst result = await cip100.verify(\n  { uri: \"https://example.com/metadata.jsonld\" },\n  { anchorHash: \"7b7d4a28a599bbb8c08b239be2645fa82d63a848320bf4760b07d86fcf1aabdc\" },\n);\n\nif (result.success) {\n  const { anchorHash, witnesses, valid } = result.data;\n\n  console.log(\"Overall valid:\", valid);\n  console.log(\"Anchor hash match:\", anchorHash?.valid);\n\n  for (const w of witnesses) {\n    console.log(`Author ${w.authorName}: signature ${w.signatureValid ? \"valid\" : \"INVALID\"}`);\n  }\n}\n```\n\n### Fetch from IPFS or Arweave\n\n```typescript\nimport { fetchMetadata } from \"@amanita-labs/cardano-governance-metadata\";\n\n// IPFS\nconst ipfsResult = await fetchMetadata(\"ipfs://QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco\");\n\n// Arweave\nconst arResult = await fetchMetadata(\"ar://some-tx-id\");\n\n// Custom IPFS gateway\nconst customResult = await fetchMetadata(\"ipfs://QmXyz...\", {\n  ipfsGateway: \"https://gateway.pinata.cloud/ipfs/{cid}\",\n});\n\nif (ipfsResult.success) {\n  const text = new TextDecoder().decode(ipfsResult.data);\n  const parsed = cip100.parse(text);\n}\n```\n\n### Verify a CC vote rationale (CIP-136)\n\n```typescript\nimport { cip136 } from \"@amanita-labs/cardano-governance-metadata\";\n\nconst result = cip136.parse({\n  \"@context\": { /* ... */ },\n  hashAlgorithm: \"blake2b-256\",\n  authors: [{ name: \"CC Member\", witness: { /* ... */ } }],\n  body: {\n    summary: \"Constitutional - aligns with Article 3, Section 5\",\n    rationaleStatement: \"After thorough review, this governance action...\",\n    precedentDiscussion: \"Similar proposals in the past have...\",\n    conclusion: \"We vote Yes on constitutional grounds.\",\n    internalVote: {\n      constitutional: 5,\n      unconstitutional: 1,\n      abstain: 1,\n    },\n    references: [\n      { \"@type\": \"RelevantArticles\", label: \"Article 3\", uri: \"https://...\" },\n    ],\n  },\n});\n\nif (result.success) {\n  const { internalVote } = result.data.body;\n  console.log(`Vote: ${internalVote?.constitutional} for, ${internalVote?.unconstitutional} against`);\n}\n```\n\n### CIP-169: bind metadata to its on-chain effect\n\nCIP-169 introduces an optional `body.onChain` property that cryptographically binds metadata to the exact `ProposalProcedure` / `VotingProcedure` / DRep cert it describes — closing metadata-replay and multi-author-misattachment gaps. The library decodes Conway transactions itself (via the Cardano Serialization Library) and self-verifies the binding.\n\n#### Setup: register a CSL build (one-time)\n\n```typescript\nimport * as CSL from \"@emurgo/cardano-serialization-lib-nodejs\";\nimport { cip169 } from \"@amanita-labs/cardano-governance-metadata\";\n\n// Pick the CSL build that matches your environment:\n//   @emurgo/cardano-serialization-lib-nodejs   (Node)\n//   @emurgo/cardano-serialization-lib-browser  (Browser)\n//   @emurgo/cardano-serialization-lib-asmjs    (universal, slower)\n//   @dcspark/cardano-multiplatform-lib-*        (CML — also accepted via duck-typing)\ncip169.setCardanoSerializationLib(CSL);\n```\n\n#### 1. Diff two metadata documents (no transaction needed)\n\n`compareOnChain` strips self-referential anchors per spec, then deep-equals the two onChain values:\n\n```typescript\nconst draftProposal = {\n  deposit: \"100000000000\",\n  reward_account: \"stake1u...\",\n  gov_action: { tag: \"treasury_withdrawals_action\", rewards: [/* ... */] },\n};\nconst submittedProposal = { ...draftProposal, anchor: { /* self-anchor — stripped */ } };\n\nconst r = cip169.compareOnChain(draftProposal, submittedProposal);\nif (r.success && r.data.equal) console.log(\"identical\");\nelse if (r.success) console.error(\"differences:\", r.data.differences);\n```\n\nSee the runnable example: [`docs/examples/cip169-compare.ts`](./docs/examples/cip169-compare.ts).\n\n#### 2. Verify against a single-action Conway transaction\n\n```typescript\nconst v = await cip169.verifyAgainstTx(metadataDocument, txCborHex);\nif (v.success && v.data.matched) {\n  console.log(\"matched:\", v.data.selectorUsed);\n} else if (v.success) {\n  console.error(\"mismatch at:\", v.data.differences);\n}\n```\n\nSee the runnable example: [`docs/examples/cip169-verify-tx.ts`](./docs/examples/cip169-verify-tx.ts).\n\n#### 3. Multi-action transactions: select which item to verify against\n\nWhen a tx carries multiple proposals/certs/voting procedures, pass a `selector`:\n\n```typescript\nconst v = await cip169.verifyAgainstTx(metadataDocument, txCborHex, {\n  selector: { kind: \"proposalProcedure\", index: 1 },  // 0-based\n});\n// kinds: \"proposalProcedure\" | \"certificate\" | \"votingProcedures\"\n// Without index, the library errors with ONCHAIN_SELECTOR_AMBIGUOUS if more\n// than one candidate of the chosen kind exists.\n```\n\n`verifyAgainstTx` decodes only the three transaction-body fields CIP-169 binds (`certs`, `voting_procedures`, `voting_proposals`). Self-referential anchors are stripped per spec.\n\nThe lower-level `cip169.compareOnChain(metadataOnChain, alreadyDecodedAction)` and `cip169.decodeConwayTx(txBytes)` are also exported for callers who need to drive each step themselves.\n\n### Resolving JSON-LD `@context` URIs\n\nMany real metadata documents ship `@context` as a single URI string instead of an inlined object — for example, the CIP-169 PR examples use:\n\n```json\n\"@context\": \"https://github.com/cardano-foundation/CIPs/blob/master/CIP-0169/cip-0169.common.jsonld\"\n```\n\nThe library bundles every CIP context (CIP-100/108/119/136/169) under both `raw.githubusercontent.com/...` and `github.com/.../blob/...` URLs and resolves them offline during canonicalization.\n\nBy default, an unknown `@context` URI errors with `MISSING_CONTEXT` rather than silently fetching it (which would make signature verification non-reproducible). To allow other URIs, pass `contextOptions`:\n\n```typescript\nimport { resolve, registerContext } from \"@amanita-labs/cardano-governance-metadata\";\n\n// Option 1: register a context up front (e.g. an Intersect-MBO-hosted schema)\nregisterContext(\n  \"https://intersectmbo.github.io/governance-actions/v1.1.0/schemas/hard-fork-initiation/common.jsonld\",\n  await loadLocalJsonld(),\n);\n\n// Option 2: per-call allowlist (globs supported)\nconst r = await resolve(\"ipfs://...\", {\n  contextOptions: {\n    policy: \"allowlist\",\n    allowlist: [\"https://intersectmbo.github.io/governance-actions/v*/**\"],\n    overrides: { /* exact-URL → context object */ },\n  },\n});\n\n// Option 3: opt into network fetches (caches results)\nawait resolve(\"ipfs://...\", { contextOptions: { policy: \"fetch\" } });\n```\n\n## Subpath Imports\n\nImport only the CIP module you need for smaller bundles:\n\n```typescript\nimport { parse, validate, verify } from \"@amanita-labs/cardano-governance-metadata/cip119\";\nimport type { Cip119Document } from \"@amanita-labs/cardano-governance-metadata/cip119\";\n```\n\nAvailable subpaths: `/cip100`, `/cip108`, `/cip119`, `/cip136`, `/cip169`\n\n## API\n\nEvery CIP module exports the same core functions:\n\n### `build(input)`\n\nConstruct a document from a `body` (the inverse of `parse`). Injects the canonical `@context` URL and `hashAlgorithm` default, validates against the CIP schema, and returns the typed document plus a pretty-printed JSON string.\n\n```typescript\n// CIP-100/108/119/136\nbuild(input: {\n  body: CipBody;\n  authors?: Author[];\n  context?: unknown;            // defaults to the canonical CIP @context URL\n  hashAlgorithm?: HashAlgorithm; // defaults to \"blake2b-256\"\n}): Result<{ doc: CipDocument; json: string }>\n\n// CIP-169 (validates an OnChain payload to nest under body.onChain)\ncip169.build(input: OnChain): Result<{ payload: OnChain; json: string }>\n```\n\nCIP-169 also exports `cip169.actions` — pure type-narrowed factories for the inner `gov_action` / certificate / voter values.\n\n### `parse(input, options?)`\n\nParse a JSON string or object into a typed document with schema validation.\n\n```typescript\nparse(input: string | object, options?: { skipValidation?: boolean }): Result<CipDocument>\n```\n\n### `validate(document)`\n\nValidate an unknown object against the CIP schema. Returns typed data on success or validation issues on failure.\n\n```typescript\nvalidate(document: unknown): Result<CipDocument>\n```\n\n### `verify(input, options?)`\n\nFull verification pipeline: fetch, anchor hash check, JSON-LD canonicalization, and ed25519 signature verification.\n\n```typescript\nverify(\n  input: { uri: string } | { rawBytes: Uint8Array } | { document: object },\n  options?: {\n    anchorHash?: string;          // on-chain anchor hash to verify against\n    skipWitnessVerification?: boolean;\n    fetchOptions?: FetchOptions;\n  },\n): Promise<Result<VerificationResult>>\n```\n\n### `resolve(uri, options?)`\n\nAll-in-one: fetch metadata from a URI, detect the CIP standard, validate, and verify signatures. Extra fields not defined by the detected CIP are preserved in the document and listed separately in `extraFields`.\n\n```typescript\nresolve(\n  uri: string,\n  options?: {\n    anchorHash?: string;\n    skipVerification?: boolean;\n    fetchOptions?: FetchOptions;\n  },\n): Promise<Result<ResolvedMetadata>>\n```\n\n```typescript\ninterface ResolvedMetadata {\n  cipStandard: \"CIP-100\" | \"CIP-108\" | \"CIP-119\" | \"CIP-136\";\n  extensions: (\"CIP-169\")[];           // cross-cutting extensions detected on the body\n  document: Record<string, unknown>;   // full document with extra fields preserved\n  rawBytes: Uint8Array;\n  extraFields: ExtraFieldInfo[];       // fields not defined by the detected CIP\n  verification?: VerificationResult;   // anchor hash + signature results\n}\n```\n\n### `detectCipStandard(document)`\n\nDetect which CIP standard a document conforms to based on its body fields.\n\n```typescript\ndetectCipStandard(document: object): \"CIP-100\" | \"CIP-108\" | \"CIP-119\" | \"CIP-136\" | null\n```\n\n### `fetchMetadata(uri, options?)`\n\nFetch raw metadata bytes from HTTPS, IPFS, or Arweave URIs.\n\n```typescript\nfetchMetadata(uri: string, options?: FetchOptions): Promise<Result<Uint8Array>>\n```\n\n## Result Type\n\nAll functions return a discriminated union instead of throwing:\n\n```typescript\ntype Result<T, E = Error> =\n  | { success: true; data: T }\n  | { success: false; error: E };\n```\n\n## Error Handling\n\nErrors include a machine-readable `code` for programmatic matching:\n\n```typescript\nimport { ErrorCode } from \"@amanita-labs/cardano-governance-metadata\";\n\nconst result = cip108.parse(input);\nif (!result.success) {\n  switch (result.error.code) {\n    case ErrorCode.INVALID_JSON:\n      // malformed JSON\n      break;\n    case ErrorCode.SCHEMA_VALIDATION_FAILED:\n      // schema validation failed - check result.error.issues\n      break;\n  }\n}\n```\n\n## Troubleshooting\n\n**`CSL_NOT_INITIALIZED`** — A CIP-169 function tried to decode a transaction but no CSL build was registered. Install one of the CSL flavors as a peer dependency and call `cip169.setCardanoSerializationLib(CSL)` once at startup.\n\n**`MISSING_CONTEXT`** when canonicalizing — The document's JSON-LD `@context` URL is neither bundled nor matched by your `contextOptions`. Either register the context up front (`registerContext(url, doc)`), allowlist it (`contextOptions.allowlist`), or — only if you trust the source — set `contextOptions.policy = \"fetch\"`. The library refuses to fetch unknown contexts by default because doing so would make signature verification non-reproducible.\n\n**`FETCH_TIMEOUT`** / `FETCH_FAILED` — The fetcher hit its timeout (default 30s) or got a non-2xx response. Override with `fetchOptions: { timeout, fetch, ipfsGateway, arweaveGateway, signal }`.\n\n**`ANCHOR_HASH_MISMATCH`** — The blake2b-256 hash of the raw fetched bytes did not match the `anchorHash` you supplied. Common causes: the publisher hashed the document *before* canonicalization; the gateway returned different bytes (e.g. trailing whitespace from a CDN); the on-chain hash was registered against a different version. The anchor hash is over **raw bytes** of the metadata file, not over the canonicalized form.\n\n**Witness `signatureValid: false`** — The author's signature did not match the canonical body hash. Per CIP-100 the signature is over `blake2b256(canonicalize({\"@context\": ..., body}))`. For `witnessAlgorithm: \"ed25519\"`, the hex of that hash is what's signed. For `\"CIP-8\"` / `\"CIP-0008\"` (COSE_Sign1 envelope), the library decodes the envelope, binds `payload === blake2b256(canonical body)`, then verifies the inner ed25519 signature over the Sig_structure. The signing tool must use the same `@context` mapping the verifier uses. Check `result.witnesses[i].unsupportedReason` for diagnostics on structural failures (malformed CBOR, `hashed: true` payload mode, etc.).\n\n## License\n\nApache-2.0\n","readmeFilename":"README.md"}