{"id":31923866,"url":"https://github.com/chainsafe/webzjs","last_synced_at":"2025-10-13T23:58:24.778Z","repository":{"id":255595584,"uuid":"839027827","full_name":"ChainSafe/WebZjs","owner":"ChainSafe","description":"A fully-featured javascript/typescript library for interacting with the Zcash network from the browser","archived":false,"fork":false,"pushed_at":"2025-10-01T15:01:46.000Z","size":10826,"stargazers_count":28,"open_issues_count":12,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-02T02:53:35.558Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChainSafe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-06T20:23:14.000Z","updated_at":"2025-10-01T21:47:32.000Z","dependencies_parsed_at":"2024-09-16T19:29:46.361Z","dependency_job_id":"ef31fee4-7686-461e-86a5-3baab959ad94","html_url":"https://github.com/ChainSafe/WebZjs","commit_stats":null,"previous_names":["chainsafe/webzjs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ChainSafe/WebZjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2FWebZjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2FWebZjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2FWebZjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2FWebZjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChainSafe","download_url":"https://codeload.github.com/ChainSafe/WebZjs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2FWebZjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017175,"owners_count":26086019,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"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-10-13T23:58:16.858Z","updated_at":"2025-10-13T23:58:24.774Z","avatar_url":"https://github.com/ChainSafe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebZjs\n\n![GitHub License](https://img.shields.io/github/license/ChainSafe/WebZjs)\n![Static Badge](https://img.shields.io/badge/ReadTheDocs-green?link=https%3A%2F%2Fchainsafe.github.io%2FWebZjs%2F)\n\nA javascript client library for building Zcash browser wallets\n\n## Overview\n\nWebZjs aims to make it simple to securely interact with Zcash from within the browser. This is primarily to support the development of web wallets and browser plugins. \n\nBeing a private blockchain Zcash places a lot more demands on the wallet than a public blockchain like Ethereum. WebZjs uses everything at its disposal to give efficient sync times and a good user experience.\n\n## Quickstart\n\nAdd the `@chainsafe/webzjs-wallet` package to your javascript project.\n\nBefore using the library it is important to initialize the Wasm module and the thread pool.\n\n\u003e [!IMPORTANT]\n\u003e Make sure you call these functions exactly once.\n\u003e Failing to call them or calling them more than once per page load will result in an error\n\n```javascript\nimport initWasm, { initThreadPool, WebWallet } from \"@chainsafe/webzjs-wallet\";\n\ninitWasm();\ninitThreadPool(8); // can set any number of threads here, ideally match it to window.navigator.hardwareConcurrency\n```\n\nOnce this has been done we can create a WebWallet instance. You can theoretically have multiple of these per application but most cases will only want one. A single wallet can handle multiple Zcash accounts.\n\n\u003e [!IMPORTANT]\n\u003e When constructing a WebWallet it requires a lightwalletd URL. To work in the web these need to be a special gRPC-web proxy to a regular lightwalletd instance. Using an unproxied URL (e.g. https://zec.rocks) will NOT work. ChainSafe currently hosts a gRPC-web lightwalletd proxy and it is easy to deploy more. You can also run your own proxy locally by running `docker-compose up` in this repo.\n\n```javascript\nlet wallet = new WebWallet(\"main\", \"https://zcash-mainnet.chainsafe.dev\", 1);\n```\n\nOnce you have a wallet instance it needs an account. Accounts can be added in a number of different ways. Here an account will be added from a 24 word seed phrase\n\n```javascript\nawait wallet.create_account(\"\u003c24 words here\u003e\", 0, birthdayHeight);\n```\n\nand once an account is added the wallet can sync to the network.\n\n```javascript\nawait wallet.sync();\n```\n\nThe sync process can take a long time depending on the wallet age and usage. This runs in a webworker so will not block the main. It is safe to trigger the sync process and then interact with the wallet using other methods while the sync runs in the background.\n\nFor more details check out the hosted docs at https://chainsafe.github.io/WebZjs/\n\n## Building\n\n### Prerequisites\n\n- [Rust and Cargo](https://www.rust-lang.org/tools/install)\n- This repo uses [just](https://github.com/casey/just) as a command runner. Please install this first.\n- [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/)\n- Requires clang 17 or later\n    - On Mac this can be installed by updating LLVM using your preferred package manager (e.g. macports, brew)\n- Tested with Rust nightly-2024-08-07\n\n### Building WebZjs\n\nThis just script uses wasm-pack to build a web-ready copy of `webzjs-wallet` and `webzjs-keys` into the `packages` directory \n\n```shell\njust build\n```\n\n#### Prerequisites\n\n[Install yarn](https://yarnpkg.com/getting-started/install)\n\n### Building\n\nFirst build WebZjs with\n\n```shell\njust build\n```\n\nInstall js dependencies with\n\n```shell\nyarn\n```\n\n## Development\n\n### Building and running WebZjs Zcash Snap locally\n\n```shell\ncd packages/snap\nyarn build:local\nyarn serve\n```\n\n### Building and running WebZjs Web-wallet locally\n\n```shell\ncd packages/web-wallet\nyarn build\nyarn dev\n```\n\n### Dev Build\n\n![webzjs.chainsafe.dev](https://webzjs.chainsafe.dev/)\n\n### Testing\n\n\n## Known Issues\n\nWeb Wallet may have trouble wasm instantiating. Please refresh the app in that case.\n\n## Security Warnings\n\nThese libraries are currently under development, have received no reviews or audit, and come with no guarantees whatsoever.\n\n## License\n\nAll code in this workspace is licensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally\nsubmitted for inclusion in the work by you, as defined in the Apache-2.0\nlicense, shall be dual licensed as above, without any additional terms or\nconditions.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainsafe%2Fwebzjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchainsafe%2Fwebzjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainsafe%2Fwebzjs/lists"}