@nimiq/core-web v1.6.2
Nimiq web client
This client is a very light client that only includes the necessary dependencies and constructs to compile a client to WebAssembly and to run it in a web browser. This is a web-client intended to be used in web browsers only (no WASI support). Although it can be built for other targets, it will panic if it is executed outside a web browser.
Building the example
To build the client, the recommended way is to use wasm-pack
. This tool can be obtained using:
cargo install wasm-pack
or via their website. Once installed, the client can be built from this directory:
wasm-pack build --target web --weak-refs
Note The
--weak-refs
flag is available since wasm-pack v0.11.0. For older versions prefix the command withWASM_BINDGEN_WEAKREF=1
instead. Check your installed version withwasm-pack --version
.
The above command will compile the Rust code to WebAssembly and generate the corresponding JS bindings required to run the client in a web browser.
After the client has been built, this directory can be served with a web server
(e.g. python3 -m http.server
) and then the index.html
file can be loaded from e.g. http://localhost:8000.
Publishing to NPM
Warning You must be using wasm-pack version >= 0.11.0.
To publish this package to NPM, run this command:
wasm-pack build --release --weak-refs --scope nimiq --out-dir dist && \
sed -i 's/@nimiq\/nimiq-web-client/@nimiq\/core-web/g' dist/package.json && \
cd dist && \
npm publish --tag next && \
cd ..
17 days ago
17 days ago
19 days ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
5 months ago
8 months ago
10 months ago
6 months ago
6 months ago
8 months ago
8 months ago
9 months ago
10 months ago
8 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago