@puzzlehq/aleo-wasm-web 0.6.12 → 0.6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -0
- package/package.json +37 -22
- package/aleo_wasm.d.ts +0 -1854
- package/aleo_wasm.js +0 -4380
- package/aleo_wasm_bg.wasm +0 -0
- package/snippets/aleo-wasm-7414781f25a5869a/inline0.js +0 -41
package/README.md
CHANGED
|
@@ -4,3 +4,61 @@ To build and publish WASM pacakges for nodejs and web:
|
|
|
4
4
|
- Run `./build-puzzle.sh`
|
|
5
5
|
- Push your changes so the package number stays up to date
|
|
6
6
|
|
|
7
|
+
[![github]](https://github.com/ProvableHQ/sdk) [![crates-io]](https://crates.io/crates/aleo-wasm) [![docs-rs]](https://docs.rs/aleo-wasm/latest/aleo-wasm/)
|
|
8
|
+
|
|
9
|
+
[github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
|
|
10
|
+
[crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
|
|
11
|
+
[docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
|
|
12
|
+
|
|
13
|
+
# Aleo Wasm
|
|
14
|
+
|
|
15
|
+
Aleo JavaScript and WebAssembly bindings for building zero-knowledge web applications.
|
|
16
|
+
|
|
17
|
+
`Rust` compiles easily to `WebAssembly`, but creating the glue code necessary to use compiled WebAssembly binaries
|
|
18
|
+
from other languages such as JavaScript is a challenging task. `wasm-bindgen` is a tool that simplifies this process by
|
|
19
|
+
auto-generating JavaScript bindings to Rust code that has been compiled into WebAssembly.
|
|
20
|
+
|
|
21
|
+
This crate uses `wasm-bindgen` to create JavaScript bindings to Aleo source code so that it can be used to create zero-knowledge proofs directly within web browsers and `Node.js`.
|
|
22
|
+
|
|
23
|
+
Functionality exposed by this crate includes:
|
|
24
|
+
* Aleo account management objects
|
|
25
|
+
* Aleo primitives such as `Records`, `Programs`, and `Transactions` and their associated helper methods
|
|
26
|
+
* A `ProgramManager` object that contains methods for authoring, deploying, and interacting with Aleo programs
|
|
27
|
+
|
|
28
|
+
More information on these concepts can be found at the [Aleo Developer Hub](https://developer.aleo.org/concepts).
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
The [rollup-plugin-rust](https://github.com/wasm-tool/rollup-plugin-rust/) tool is used to compile the Rust code in this crate into JavaScript
|
|
33
|
+
modules which can be imported into other JavaScript projects.
|
|
34
|
+
|
|
35
|
+
#### Installation
|
|
36
|
+
|
|
37
|
+
Follow the [installation instructions](https://github.com/wasm-tool/rollup-plugin-rust/#installation) on the rollup-plugin-rust README.
|
|
38
|
+
|
|
39
|
+
### Build Instructions
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
yarn build
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This will produce `.js` and `.wasm` files inside of the `dist` folder.
|
|
46
|
+
|
|
47
|
+
## Testing
|
|
48
|
+
|
|
49
|
+
Run tests in Node.js
|
|
50
|
+
```bash
|
|
51
|
+
wasm-pack test --node
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Run tests in a browser
|
|
55
|
+
```bash
|
|
56
|
+
wasm-pack test --[firefox/chrome/safari]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Building Web Apps
|
|
60
|
+
|
|
61
|
+
Further documentation and tutorials as to how to use the modules built from this crate to build web apps will be built
|
|
62
|
+
in the future. However, in the meantime, the [provable.tools](https://provable.tools) website is a good
|
|
63
|
+
example of how to use these modules to build a web app. Its source code can be found in the
|
|
64
|
+
[Aleo SDK](https://github.com/ProvableHQ/sdk) repo in the `website` folder.
|
package/package.json
CHANGED
|
@@ -1,32 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@puzzlehq/aleo-wasm-web",
|
|
3
|
+
"version": "0.6.13",
|
|
4
|
+
"description": "Wasm build for the SDK",
|
|
3
5
|
"collaborators": [
|
|
4
6
|
"The Aleo Team <hello@aleo.org>"
|
|
5
7
|
],
|
|
6
|
-
"description": "WebAssembly based toolkit for developing zero knowledge applications with Aleo",
|
|
7
|
-
"version": "0.6.12",
|
|
8
8
|
"license": "GPL-3.0",
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"browser": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": "./dist/index.js",
|
|
15
|
+
"./worker.js": "./dist/worker.js"
|
|
12
16
|
},
|
|
13
17
|
"files": [
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"snippets/"
|
|
18
|
-
],
|
|
19
|
-
"module": "aleo_wasm.js",
|
|
20
|
-
"homepage": "https://aleo.org",
|
|
21
|
-
"types": "aleo_wasm.d.ts",
|
|
22
|
-
"sideEffects": [
|
|
23
|
-
"./snippets/*"
|
|
18
|
+
"dist",
|
|
19
|
+
"LICENSE.md",
|
|
20
|
+
"README.md"
|
|
24
21
|
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/ProvableHQ/sdk.git"
|
|
25
|
+
},
|
|
25
26
|
"keywords": [
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
"Aleo",
|
|
28
|
+
"Blockchain",
|
|
29
|
+
"Zero-Knowledge",
|
|
30
|
+
"ZK"
|
|
31
|
+
],
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/ProvableHQ/sdk/issues"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://github.com/ProvableHQ/sdk#readme",
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "rimraf dist && rollup -c rollup.config.js && cpr js/types dist && rimraf dist/wasm*",
|
|
38
|
+
"prepublish": "yarn build",
|
|
39
|
+
"test": "node test.js"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@wasm-tool/rollup-plugin-rust": "^2.4.2",
|
|
43
|
+
"cpr": "^3.0.1",
|
|
44
|
+
"rimraf": "^5.0.1",
|
|
45
|
+
"rollup": "^3.27.2"
|
|
46
|
+
}
|
|
47
|
+
}
|