{"id":13524492,"url":"https://github.com/justblender/candid-parser-wasm","last_synced_at":"2025-04-01T02:31:50.320Z","repository":{"id":221988634,"uuid":"755943049","full_name":"justblender/candid-parser-wasm","owner":"justblender","description":"JavaScript/TypeScript bindings for \"candid_parser\", compiled to WebAssembly","archived":false,"fork":false,"pushed_at":"2024-02-13T17:25:31.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-02T06:16:48.194Z","etag":null,"topics":["candid","candid-parser","icp","internet-computer","wasm","webassembly"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/candid-parser-wasm","language":"Rust","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/justblender.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,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-11T14:40:50.000Z","updated_at":"2024-02-29T09:11:56.000Z","dependencies_parsed_at":"2024-02-13T18:38:03.911Z","dependency_job_id":null,"html_url":"https://github.com/justblender/candid-parser-wasm","commit_stats":null,"previous_names":["justblender/candid-parser-wasm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justblender%2Fcandid-parser-wasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justblender%2Fcandid-parser-wasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justblender%2Fcandid-parser-wasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justblender%2Fcandid-parser-wasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justblender","download_url":"https://codeload.github.com/justblender/candid-parser-wasm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222693039,"owners_count":17024034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["candid","candid-parser","icp","internet-computer","wasm","webassembly"],"created_at":"2024-08-01T06:01:10.586Z","updated_at":"2024-11-02T08:31:54.077Z","avatar_url":"https://github.com/justblender.png","language":"Rust","funding_links":[],"categories":["Candid"],"sub_categories":["Candid implementations"],"readme":"# candid-parser-wasm\n\nThis package provides bindings to (and helper functions for) the `candid_parser` crate.\n\n![version][version-image]\n![downloads][dl-image]\n\n## Features\n- Read all actor functions along with their signature (mode, argument and return types);\n- Encode or decode the arguments of a (shared) actor function into `Uint8Array` or `string`;\n- Serialize Candid into a JSON string.\n\n## Installation\n\n`npm install candid-parser-wasm`\n\n## Usage\n\n\u003e [!IMPORTANT] \n\u003e Before you can use this library in your Vite app, it is recommended that you first install `vite-plugin-wasm`.\n\n```js\nimport { parseCandid } from \"candid-parser-wasm\";\n\n// TIP: You can use `fetchCandid` from `@dfinity/agent`\n// to fetch Candid source for a given canister ID on-demand.\n\nconst parser = parseCandid(`\n  service : {\n    hello : (text) -\u003e (text) query;\n  };\n`);\n\nconst encoded: Uint8Array = parser.encodeIdlArgs(\"hello\", '(\"world\")');\n//    ^ `Uint8Array` with encoded bytes\n\nconst decoded: string = parser.decodeIdlArgs(\"hello\", encoded);\n//    ^ (\"world\")\n\nconst functions: Record\u003cstring, any\u003e = parser.getFunctions();\n//    ^ { hello: {modes: [{ kind: \"query\" }], args: [\"text\"], rets: [\"text\"]} }\n\nconst json: string = parser.toJSON();\n//    ^ fully serialized IDL in a JSON string\n```\n\n## Contributing\n\nContributions are welcome. Please submit your pull requests or open issues to propose changes or report bugs.\n\n[version-image]: https://img.shields.io/npm/v/candid-parser-wasm\n[dl-image]: https://img.shields.io/npm/dw/candid-parser-wasm\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustblender%2Fcandid-parser-wasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustblender%2Fcandid-parser-wasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustblender%2Fcandid-parser-wasm/lists"}