{"_id":"@codoma/nodes-from-trezoaanchor","name":"@codoma/nodes-from-trezoaanchor","dist-tags":{"latest":"1.3.8"},"versions":{"1.3.8":{"name":"@codoma/nodes-from-trezoaanchor","version":"1.3.8","description":"Node specifications and helpers for the Codama standard","exports":{"types":"./dist/types/index.d.ts","react-native":"./dist/index.react-native.mjs","browser":{"import":"./dist/index.browser.mjs","require":"./dist/index.browser.cjs"},"node":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"}},"browser":{"./dist/index.node.cjs":"./dist/index.browser.cjs","./dist/index.node.mjs":"./dist/index.browser.mjs"},"main":"./dist/index.node.cjs","module":"./dist/index.node.mjs","react-native":"./dist/index.react-native.mjs","types":"./dist/types/index.d.ts","type":"commonjs","sideEffects":false,"keywords":["trezoa","framework","standard","specifications"],"dependencies":{"@trezoa/codecs":"^5.1.0","@noble/hashes":"^2.0.1","@codama/errors":"1.5.0","@codama/nodes":"1.5.0","@codama/visitors":"1.5.0"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/codama-idl/codama.git"},"bugs":{"url":"http://github.com/codama-idl/codama/issues"},"browserslist":["supports bigint and not dead","maintained node versions"],"scripts":{"build":"rimraf dist && tsup && tsc -p ./tsconfig.declarations.json","dev":"vitest --project node","lint":"eslint . && prettier --check .","lint:fix":"eslint --fix . && prettier --write .","test":"pnpm test:types && pnpm test:treeshakability && pnpm test:unit","test:treeshakability":"for file in dist/index.*.mjs; do agadoo $file; done","test:types":"tsc --noEmit","test:unit":"vitest run"},"_id":"@codoma/nodes-from-trezoaanchor@1.3.8","homepage":"https://github.com/codama-idl/codama#readme","_nodeVersion":"24.11.1","_npmVersion":"11.7.0","dist":{"integrity":"sha512-GTwnYUuQMLjPKDJ/0l6YYdIIjD6+NuIwuXL0mjG3oRAV+qETOQ5uFGF5o5PGHRUU+qhyfQeeoMNJxCQ2hnnmsA==","shasum":"23a57608ca8180865bdbbee3b41ea688f323a471","tarball":"https://registry.npmjs.org/@codoma/nodes-from-trezoaanchor/-/nodes-from-trezoaanchor-1.3.8.tgz","fileCount":115,"unpackedSize":684672,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCpwxr/yj1CtbD9cDLfwRE6k1fal3PP/gk/OVpzjlNXzAIgCSQ/ssHZm/TRKsSOWaAO58/jcNxF0CjkLBVUIxhEC2o="}]},"_npmUser":{"name":"trezoaflare","email":"trezoa@sterlingcorellc.com"},"directories":{},"maintainers":[{"name":"trezoaflare","email":"trezoa@sterlingcorellc.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nodes-from-trezoaanchor_1.3.8_1767236046093_0.5045256580545638"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-01T02:54:05.999Z","1.3.8":"2026-01-01T02:54:06.259Z","modified":"2026-01-01T02:54:06.571Z"},"maintainers":[{"name":"trezoaflare","email":"trezoa@sterlingcorellc.com"}],"description":"Node specifications and helpers for the Codama standard","homepage":"https://github.com/codama-idl/codama#readme","keywords":["trezoa","framework","standard","specifications"],"repository":{"type":"git","url":"git+https://github.com/codama-idl/codama.git"},"bugs":{"url":"http://github.com/codama-idl/codama/issues"},"license":"MIT","readme":"# Codama ➤ Nodes From TrezoaAnchor\n\n[![npm][npm-image]][npm-url]\n[![npm-downloads][npm-downloads-image]][npm-url]\n\n[npm-downloads-image]: https://img.shields.io/npm/dm/@codoma/nodes-from-trezoaanchor.svg?style=flat\n[npm-image]: https://img.shields.io/npm/v/@codoma/nodes-from-trezoaanchor.svg?style=flat&label=%40codama%2Fnodes-from-trezoaanchor\n[npm-url]: https://www.npmjs.com/package/@codoma/nodes-from-trezoaanchor\n\nThis package converts TrezoaAnchor IDLs from various versions into Codama IDLs.\n\n## Installation\n\n```sh\npnpm install @codoma/nodes-from-trezoaanchor\n```\n\n> [!NOTE]\n>\n> - This package is **not** included in the main [`codama`](../library) package.\n> - If `metadata.origin` is not set on the IDL, it is assumed to be `\"trezoaanchor\"`. If you are trying to parse a Shank IDL, be sure that origin is set to `\"shank\"` so discriminators can be set correctly.\n\n## Functions\n\n### `rootNodeFromTrezoaAnchor(trezoaanchorIdl)`\n\nThis function takes a valid TrezoaAnchor IDL and returns a `RootNode`.\n\n```js\n// node ./codama.mjs\nimport { rootNodeFromTrezoaAnchor } from '@codoma/nodes-from-trezoaanchor';\nimport { createFromRoot } from 'codama';\nimport { readFileSync } from 'node:fs';\nimport path from 'path';\n\n// Read the content of your IDL file.\nconst trezoaanchorIdlPath = path.join(__dirname, 'target', 'idl', 'trezoaanchor_program.json');\nconst trezoaanchorIdl = JSON.parse(readFileSync(trezoaanchorIdlPath, 'utf-8'));\n\n// Parse it into a Codama IDL.\nconst codama = createFromRoot(rootNodeFromTrezoaAnchor(trezoaanchorIdl));\n```\n","readmeFilename":"README.md","_rev":"1-98350199eff7defb40bd8c8e8ad61624"}