create-leo-app 0.10.0 → 0.11.0

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.
Files changed (29) hide show
  1. package/package.json +1 -2
  2. package/template-build-and-execute-authorization-ts/package.json +1 -1
  3. package/template-extension/package.json +1 -1
  4. package/template-nextjs-ts/package.json +2 -2
  5. package/template-node/package.json +1 -1
  6. package/template-node-credits-aleo-functions-ts/package.json +1 -1
  7. package/template-node-ts/package.json +4 -2
  8. package/template-node-ts/rollup.config.js +1 -0
  9. package/template-node-ts/src/dynamic-dispatch.ts +159 -0
  10. package/template-offline-public-transaction-ts/package.json +1 -1
  11. package/template-react-credits-aleo-functions-ts/package.json +3 -3
  12. package/template-react-leo/package.json +3 -3
  13. package/template-react-ts/package.json +3 -3
  14. package/template-vanilla/package.json +2 -2
  15. package/template-react-managed-worker/.babelrc +0 -6
  16. package/template-react-managed-worker/.eslintrc.cjs +0 -20
  17. package/template-react-managed-worker/README.md +0 -6
  18. package/template-react-managed-worker/_gitignore +0 -24
  19. package/template-react-managed-worker/index.html +0 -88
  20. package/template-react-managed-worker/package.json +0 -41
  21. package/template-react-managed-worker/public/favicon.ico +0 -0
  22. package/template-react-managed-worker/src/App.css +0 -42
  23. package/template-react-managed-worker/src/App.jsx +0 -78
  24. package/template-react-managed-worker/src/assets/aleo.png +0 -0
  25. package/template-react-managed-worker/src/assets/react.svg +0 -1
  26. package/template-react-managed-worker/src/index.css +0 -69
  27. package/template-react-managed-worker/src/main.jsx +0 -10
  28. package/template-react-managed-worker/vite.config.js +0 -21
  29. package/template-react-managed-worker/webpack.config.js +0 -90
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-leo-app",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "license": "GPL-3.0",
6
6
  "collaborators": [
@@ -18,7 +18,6 @@
18
18
  "template-node-credits-aleo-functions-ts",
19
19
  "template-react-credits-aleo-functions-ts",
20
20
  "template-react-leo",
21
- "template-react-managed-worker",
22
21
  "template-react-ts",
23
22
  "template-vanilla",
24
23
  "dist"
@@ -8,7 +8,7 @@
8
8
  "dev": "npm run build && node dist/index.js"
9
9
  },
10
10
  "dependencies": {
11
- "@provablehq/sdk": "^0.10.0"
11
+ "@provablehq/sdk": "^0.11.0"
12
12
  },
13
13
  "devDependencies": {
14
14
  "rimraf": "^6.0.1",
@@ -7,7 +7,7 @@
7
7
  "build": "rimraf static/js && rollup --config"
8
8
  },
9
9
  "devDependencies": {
10
- "@provablehq/sdk": "^0.10.0",
10
+ "@provablehq/sdk": "^0.11.0",
11
11
  "@rollup/plugin-node-resolve": "^16.0.0",
12
12
  "@web/rollup-plugin-import-meta-assets": "^2.2.1",
13
13
  "rimraf": "^6.0.1",
@@ -9,8 +9,8 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "@provablehq/sdk": "^0.10.0",
13
- "next": "15.5.14",
12
+ "@provablehq/sdk": "^0.11.0",
13
+ "next": "15.5.18",
14
14
  "react": "^19.0.0",
15
15
  "react-dom": "^19.0.0",
16
16
  "terser-webpack-plugin": "^5.3.11"
@@ -7,6 +7,6 @@
7
7
  "start": "node index.js"
8
8
  },
9
9
  "dependencies": {
10
- "@provablehq/sdk": "^0.10.0"
10
+ "@provablehq/sdk": "^0.11.0"
11
11
  }
12
12
  }
@@ -8,7 +8,7 @@
8
8
  "start": "npm run build && node dist/index.js"
9
9
  },
10
10
  "dependencies": {
11
- "@provablehq/sdk": "^0.10.0"
11
+ "@provablehq/sdk": "^0.11.0"
12
12
  },
13
13
  "devDependencies": {
14
14
  "rimraf": "^6.0.1",
@@ -5,10 +5,12 @@
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "rimraf dist/js && rollup --config",
8
- "start": "npm run build && node dist/index.js"
8
+ "start": "npm run build && node dist/index.js",
9
+ "start:dynamic-dispatch": "npm run build && node dist/dynamic-dispatch.js",
10
+ "test": "npm run build && node dist/index.js && node dist/dynamic-dispatch.js"
9
11
  },
10
12
  "dependencies": {
11
- "@provablehq/sdk": "^0.10.0"
13
+ "@provablehq/sdk": "^0.11.0"
12
14
  },
13
15
  "devDependencies": {
14
16
  "rimraf": "^6.0.1",
@@ -3,6 +3,7 @@ import typescript from "rollup-plugin-typescript2";
3
3
  export default {
4
4
  input: {
5
5
  index: "./src/index.ts",
6
+ "dynamic-dispatch": "./src/dynamic-dispatch.ts",
6
7
  },
7
8
  output: {
8
9
  dir: `dist`,
@@ -0,0 +1,159 @@
1
+ import {
2
+ Account,
3
+ DynamicRecord,
4
+ initThreadPool,
5
+ ProgramManager,
6
+ RecordPlaintext,
7
+ } from "@provablehq/sdk/testnet.js";
8
+
9
+ await initThreadPool();
10
+
11
+ // --- Programs --- //
12
+
13
+ const DD_CONSTANTS_PROGRAM = `program dd_constants.aleo;
14
+
15
+ function get_value:
16
+ output 42u128 as u128.private;
17
+
18
+ constructor:
19
+ assert.eq true true;
20
+ `;
21
+
22
+ const DD_CALLER_PROGRAM = `program dd_caller.aleo;
23
+
24
+ function call_and_increment:
25
+ input r0 as field.public;
26
+ input r1 as field.public;
27
+ input r2 as field.public;
28
+ call.dynamic r0 r1 r2 into r3 (as u128.private);
29
+ add r3 1u128 into r4;
30
+ output r4 as u128.public;
31
+
32
+ constructor:
33
+ assert.eq true true;
34
+ `;
35
+
36
+ // --- Setup --- //
37
+
38
+ const programManager = new ProgramManager();
39
+ const account = new Account();
40
+ programManager.setAccount(account);
41
+
42
+ // --- Test 1: Dynamic dispatch with plain string inputs --- //
43
+ // The SDK's prepareInputs() should auto-convert bare strings to field elements
44
+ // when the function signature expects `field` type. Users should NOT need to
45
+ // call stringToField() manually.
46
+
47
+ console.log("");
48
+ console.log("// --- Dynamic dispatch: plain string inputs (auto-converted by SDK) --- //");
49
+
50
+ const programInput = "dd_constants";
51
+ const networkInput = "aleo";
52
+ const functionInput = "get_value";
53
+
54
+ console.log(`Inputs: program="${programInput}", network="${networkInput}", function="${functionInput}"`);
55
+
56
+ const start = Date.now();
57
+ const executionResponse = await programManager.run(
58
+ DD_CALLER_PROGRAM,
59
+ "call_and_increment",
60
+ [programInput, networkInput, functionInput],
61
+ true,
62
+ { "dd_constants.aleo": DD_CONSTANTS_PROGRAM },
63
+ );
64
+ const elapsed = Date.now() - start;
65
+
66
+ const outputs = executionResponse.getOutputs();
67
+ console.log(`Execution completed in ${elapsed / 1000}s — outputs: ${outputs}`);
68
+
69
+ // dd_constants/get_value returns 42u128, caller adds 1 -> expect 43u128
70
+ const expected = "43u128";
71
+ if (outputs[0] !== expected) {
72
+ throw new Error(`Expected output ${expected}, got ${outputs[0]}`);
73
+ }
74
+ console.log("PASS: Plain strings auto-converted — users do NOT need stringToField()");
75
+
76
+ // --- Test 2: Dynamic dispatch with dynamic.record input --- //
77
+ // Tests whether a user can pass a RecordPlaintext string as input
78
+ // to a program that expects `dynamic.record`.
79
+
80
+ console.log("");
81
+ console.log("// --- Dynamic dispatch: dynamic.record input (plaintext string) --- //");
82
+
83
+ // A target program that accepts a dynamic.record and returns it.
84
+ const DD_RECORD_READER_PROGRAM = `program dd_record_reader.aleo;
85
+
86
+ function read_owner:
87
+ input r0 as dynamic.record;
88
+ output r0 as dynamic.record;
89
+
90
+ constructor:
91
+ assert.eq true true;
92
+ `;
93
+
94
+ // A caller that dynamically dispatches to dd_record_reader/read_owner with a dynamic.record.
95
+ // The first three field inputs will be auto-converted by prepareInputs().
96
+ const DD_RECORD_CALLER_PROGRAM = `program dd_record_caller.aleo;
97
+
98
+ function call_read_owner:
99
+ input r0 as field.public;
100
+ input r1 as field.public;
101
+ input r2 as field.public;
102
+ input r3 as dynamic.record;
103
+ call.dynamic r0 r1 r2 with r3 (as dynamic.record) into r4 (as dynamic.record);
104
+ output r4 as dynamic.record;
105
+
106
+ constructor:
107
+ assert.eq true true;
108
+ `;
109
+
110
+ // Construct a credits record plaintext.
111
+ const creditsRecord = `{ owner: ${account.address().toString()}.private, microcredits: 1000000u64.private, _nonce: 3634848344765318974603121890869676775499130077229666060613233255327643175219group.public, _version: 1u8.public }`;
112
+
113
+ // Test 2a: Pass raw RecordPlaintext string with bare string field inputs (auto-converted).
114
+ console.log("");
115
+ console.log("Test 2a: Raw RecordPlaintext string + bare string field inputs...");
116
+ const start2a = Date.now();
117
+ const executionResponse2a = await programManager.run(
118
+ DD_RECORD_CALLER_PROGRAM,
119
+ "call_read_owner",
120
+ ["dd_record_reader", "aleo", "read_owner", creditsRecord],
121
+ true,
122
+ { "dd_record_reader.aleo": DD_RECORD_READER_PROGRAM },
123
+ );
124
+ const elapsed2a = Date.now() - start2a;
125
+ const outputs2a = executionResponse2a.getOutputs();
126
+ console.log(`Execution completed in ${elapsed2a / 1000}s — outputs: ${outputs2a}`);
127
+ // Verify the output is a parseable dynamic record.
128
+ const returnedRecord2a = DynamicRecord.fromString(outputs2a[0]);
129
+ if (!returnedRecord2a.owner()) {
130
+ throw new Error("Test 2a: returned dynamic record has no owner");
131
+ }
132
+ console.log("PASS: Raw RecordPlaintext + bare strings accepted");
133
+
134
+ // Test 2b: Pass DynamicRecord.fromRecord().toString() (explicit conversion still works).
135
+ console.log("");
136
+ console.log("Test 2b: DynamicRecord.fromRecord().toString() as dynamic.record input...");
137
+ const recordPlaintext = RecordPlaintext.fromString(creditsRecord);
138
+ const dynamicRecord = DynamicRecord.fromRecord(recordPlaintext);
139
+ const dynamicRecordStr = dynamicRecord.toString();
140
+ const start2b = Date.now();
141
+ const executionResponse2b = await programManager.run(
142
+ DD_RECORD_CALLER_PROGRAM,
143
+ "call_read_owner",
144
+ ["dd_record_reader", "aleo", "read_owner", dynamicRecordStr],
145
+ true,
146
+ { "dd_record_reader.aleo": DD_RECORD_READER_PROGRAM },
147
+ );
148
+ const elapsed2b = Date.now() - start2b;
149
+ const outputs2b = executionResponse2b.getOutputs();
150
+ console.log(`Execution completed in ${elapsed2b / 1000}s — outputs: ${outputs2b}`);
151
+ // Verify the output is a parseable dynamic record.
152
+ const returnedRecord2b = DynamicRecord.fromString(outputs2b[0]);
153
+ if (!returnedRecord2b.owner()) {
154
+ throw new Error("Test 2b: returned dynamic record has no owner");
155
+ }
156
+ console.log("PASS: DynamicRecord plaintext string accepted as input");
157
+
158
+ console.log("");
159
+ console.log("All dynamic dispatch tests passed!");
@@ -8,7 +8,7 @@
8
8
  "dev": "npm run build && node --trace-uncaught dist/index.js"
9
9
  },
10
10
  "dependencies": {
11
- "@provablehq/sdk": "^0.10.0"
11
+ "@provablehq/sdk": "^0.11.0"
12
12
  },
13
13
  "devDependencies": {
14
14
  "rimraf": "^6.0.1",
@@ -11,7 +11,7 @@
11
11
  "preview": "vite preview"
12
12
  },
13
13
  "dependencies": {
14
- "@provablehq/sdk": "^0.10.0",
14
+ "@provablehq/sdk": "^0.11.0",
15
15
  "comlink": "^4.4.2",
16
16
  "react": "^19.0.0",
17
17
  "react-dom": "^19.0.0"
@@ -40,9 +40,9 @@
40
40
  "svg-url-loader": "^8.0.0",
41
41
  "ts-node": "^10.9.2",
42
42
  "typescript": "^5.7.3",
43
- "vite": "^6.3.6",
43
+ "vite": "^6.4.2",
44
44
  "webpack": "^5.104.1",
45
45
  "webpack-cli": "^6.0.1",
46
- "webpack-dev-server": "^5.2.0"
46
+ "webpack-dev-server": "^5.2.4"
47
47
  }
48
48
  }
@@ -12,7 +12,7 @@
12
12
  "install-leo": "./install.sh"
13
13
  },
14
14
  "dependencies": {
15
- "@provablehq/sdk": "^0.10.0",
15
+ "@provablehq/sdk": "^0.11.0",
16
16
  "comlink": "^4.4.2",
17
17
  "react": "^19.0.0",
18
18
  "react-dom": "^19.0.0"
@@ -36,9 +36,9 @@
36
36
  "raw-loader": "^4.0.2",
37
37
  "style-loader": "^4.0.0",
38
38
  "svg-url-loader": "^8.0.0",
39
- "vite": "^6.3.6",
39
+ "vite": "^6.4.2",
40
40
  "webpack": "^5.104.1",
41
41
  "webpack-cli": "^6.0.1",
42
- "webpack-dev-server": "^5.2.0"
42
+ "webpack-dev-server": "^5.2.4"
43
43
  }
44
44
  }
@@ -12,7 +12,7 @@
12
12
  "install-leo": "./install.sh"
13
13
  },
14
14
  "dependencies": {
15
- "@provablehq/sdk": "^0.10.0",
15
+ "@provablehq/sdk": "^0.11.0",
16
16
  "comlink": "^4.4.2",
17
17
  "react": "^19.0.0",
18
18
  "react-dom": "^19.0.0"
@@ -41,9 +41,9 @@
41
41
  "svg-url-loader": "^8.0.0",
42
42
  "ts-node": "^10.9.2",
43
43
  "typescript": "^5.7.3",
44
- "vite": "^6.3.6",
44
+ "vite": "^6.4.2",
45
45
  "webpack": "^5.104.1",
46
46
  "webpack-cli": "^6.0.1",
47
- "webpack-dev-server": "^5.2.0"
47
+ "webpack-dev-server": "^5.2.4"
48
48
  }
49
49
  }
@@ -9,8 +9,8 @@
9
9
  "preview": "vite preview"
10
10
  },
11
11
  "devDependencies": {
12
- "@provablehq/sdk": "^0.10.0",
12
+ "@provablehq/sdk": "^0.11.0",
13
13
  "tslib": "^2.8.1",
14
- "vite": "^6.3.6"
14
+ "vite": "^6.4.2"
15
15
  }
16
16
  }
@@ -1,6 +0,0 @@
1
- {
2
- "presets": [
3
- "@babel/preset-env",
4
- ["@babel/preset-react", { "runtime": "automatic" }]
5
- ]
6
- }
@@ -1,20 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- env: { browser: true, es2020: true },
4
- extends: [
5
- 'eslint:recommended',
6
- 'plugin:react/recommended',
7
- 'plugin:react/jsx-runtime',
8
- 'plugin:react-hooks/recommended',
9
- ],
10
- ignorePatterns: ['dist', '.eslintrc.cjs'],
11
- parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
12
- settings: { react: { version: '18.2' } },
13
- plugins: ['react-refresh'],
14
- rules: {
15
- 'react-refresh/only-export-components': [
16
- 'warn',
17
- { allowConstantExport: true },
18
- ],
19
- },
20
- }
@@ -1,6 +0,0 @@
1
- # React + Aleo + Managed Worker
2
-
3
- > [!NOTE]
4
- > This is an experimental template not recommended for use
5
-
6
- This template provides a minimal setup to get React and Aleo working in Webpack or Vite with HMR and some ESLint rules.
@@ -1,24 +0,0 @@
1
- # Logs
2
- logs
3
- *.log
4
- npm-debug.log*
5
- yarn-debug.log*
6
- yarn-error.log*
7
- pnpm-debug.log*
8
- lerna-debug.log*
9
-
10
- node_modules
11
- dist
12
- dist-ssr
13
- *.local
14
-
15
- # Editor directories and files
16
- .vscode/*
17
- !.vscode/extensions.json
18
- .idea
19
- .DS_Store
20
- *.suo
21
- *.ntvs*
22
- *.njsproj
23
- *.sln
24
- *.sw?
@@ -1,88 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" href="public/favicon.ico" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Aleo + React</title>
8
- <style>
9
- body {
10
- background: #000000;
11
- }
12
- .spinner {
13
- margin: 150px auto 50px auto;
14
- width: 40px;
15
- height: 40px;
16
- position: relative;
17
- text-align: center;
18
-
19
- -webkit-animation: sk-rotate 2s infinite linear;
20
- animation: sk-rotate 2s infinite linear;
21
- }
22
-
23
- .dot1,
24
- .dot2 {
25
- width: 60%;
26
- height: 60%;
27
- display: inline-block;
28
- position: absolute;
29
- top: 0;
30
- background-color: #00C0F9;
31
- border-radius: 100%;
32
-
33
- -webkit-animation: sk-bounce 2s infinite ease-in-out;
34
- animation: sk-bounce 2s infinite ease-in-out;
35
- }
36
-
37
- .dot2 {
38
- top: auto;
39
- bottom: 0;
40
- -webkit-animation-delay: -1s;
41
- animation-delay: -1s;
42
- }
43
-
44
- @-webkit-keyframes sk-rotate {
45
- 100% {
46
- -webkit-transform: rotate(360deg);
47
- }
48
- }
49
- @keyframes sk-rotate {
50
- 100% {
51
- transform: rotate(360deg);
52
- -webkit-transform: rotate(360deg);
53
- }
54
- }
55
-
56
- @-webkit-keyframes sk-bounce {
57
- 0%,
58
- 100% {
59
- -webkit-transform: scale(0);
60
- }
61
- 50% {
62
- -webkit-transform: scale(1);
63
- }
64
- }
65
-
66
- @keyframes sk-bounce {
67
- 0%,
68
- 100% {
69
- transform: scale(0);
70
- -webkit-transform: scale(0);
71
- }
72
- 50% {
73
- transform: scale(1);
74
- -webkit-transform: scale(1);
75
- }
76
- }
77
- </style>
78
- </head>
79
- <body>
80
- <div id="root">
81
- <div class="spinner">
82
- <div class="dot1"></div>
83
- <div class="dot2"></div>
84
- </div>
85
- </div>
86
- <script type="module" src="/src/main.jsx"></script>
87
- </body>
88
- </html>
@@ -1,41 +0,0 @@
1
- {
2
- "name": "aleo-react-managed-worker-starter",
3
- "private": true,
4
- "version": "0.0.0",
5
- "type": "module",
6
- "scripts": {
7
- "dev": "vite",
8
- "build": "webpack --config webpack.config.js",
9
- "build:vite": "vite build",
10
- "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
11
- "preview": "vite preview"
12
- },
13
- "dependencies": {
14
- "@provablehq/sdk": "^0.10.0",
15
- "react": "^19.0.0",
16
- "react-dom": "^19.0.0"
17
- },
18
- "devDependencies": {
19
- "@babel/core": "^7.26.7",
20
- "@babel/preset-env": "^7.26.7",
21
- "@babel/preset-react": "^7.26.3",
22
- "@types/react": "^19.0.8",
23
- "@types/react-dom": "^19.0.3",
24
- "@vitejs/plugin-react": "^4.3.4",
25
- "babel-loader": "^9.2.1",
26
- "copy-webpack-plugin": "^12.0.2",
27
- "css-loader": "^7.1.2",
28
- "eslint": "^9.19.0",
29
- "eslint-plugin-react": "^7.37.4",
30
- "eslint-plugin-react-hooks": "^5.1.0",
31
- "eslint-plugin-react-refresh": "^0.4.18",
32
- "file-loader": "^6.2.0",
33
- "html-webpack-plugin": "^5.6.3",
34
- "style-loader": "^4.0.0",
35
- "svg-url-loader": "^8.0.0",
36
- "vite": "^6.3.6",
37
- "webpack": "^5.104.1",
38
- "webpack-cli": "^6.0.1",
39
- "webpack-dev-server": "^5.2.0"
40
- }
41
- }
@@ -1,42 +0,0 @@
1
- #root {
2
- max-width: 1280px;
3
- margin: 0 auto;
4
- padding: 2rem;
5
- text-align: center;
6
- }
7
-
8
- .logo {
9
- height: 6em;
10
- padding: 1.5em;
11
- will-change: filter;
12
- transition: filter 300ms;
13
- }
14
- .logo:hover {
15
- filter: drop-shadow(0 0 2em #646cffaa);
16
- }
17
- .logo.react:hover {
18
- filter: drop-shadow(0 0 2em #61dafbaa);
19
- }
20
-
21
- @keyframes logo-spin {
22
- from {
23
- transform: rotate(0deg);
24
- }
25
- to {
26
- transform: rotate(360deg);
27
- }
28
- }
29
-
30
- @media (prefers-reduced-motion: no-preference) {
31
- a:nth-of-type(2) .logo {
32
- animation: logo-spin infinite 20s linear;
33
- }
34
- }
35
-
36
- .card {
37
- padding: 2em;
38
- }
39
-
40
- .read-the-docs {
41
- color: #888;
42
- }
@@ -1,78 +0,0 @@
1
- import { useState } from "react";
2
- import reactLogo from "./assets/react.svg";
3
- import aleoLogo from "./assets/aleo.png";
4
- import "./App.css";
5
- import { createAleoWorker } from "@provablehq/sdk";
6
-
7
- const aleoWorker = createAleoWorker();
8
-
9
- function App() {
10
- const [count, setCount] = useState(0);
11
- const [account, setAccount] = useState(null);
12
- const [loading, setLoading] = useState(false);
13
-
14
- const generateAccount = async () => {
15
- const privateKey = await aleoWorker.getPrivateKey();
16
- setAccount(privateKey);
17
- };
18
-
19
- async function execute() {
20
- const hello_hello_program =
21
- "program hello_hello.aleo;\n" +
22
- "\n" +
23
- "function hello:\n" +
24
- " input r0 as u32.public;\n" +
25
- " input r1 as u32.private;\n" +
26
- " add r0 r1 into r2;\n" +
27
- " output r2 as u32.private;\n";
28
-
29
- setLoading(true);
30
- const result = await aleoWorker.run(hello_hello_program,"hello", ["5u32", "5u32"], "APrivateKey1zkp778oUFSck3PZA5xppgp4trFwkkD6xnUXtxcBCfsq4URJ")
31
- setLoading(false);
32
-
33
- alert(JSON.stringify(result));
34
- }
35
-
36
- return (
37
- <>
38
- <div>
39
- <a href="https://provable.com" target="_blank">
40
- <img src={aleoLogo} className="logo" alt="Aleo logo" />
41
- </a>
42
- <a href="https://react.dev" target="_blank">
43
- <img src={reactLogo} className="logo react" alt="React logo" />
44
- </a>
45
- </div>
46
- <h1>Aleo + React</h1>
47
- <div className="card">
48
- <button onClick={() => setCount((count) => count + 1)}>
49
- count is {count}
50
- </button>
51
- <p>
52
- <button onClick={generateAccount}>
53
- {
54
- (account
55
- ? `Account private key is ${JSON.stringify(account)}`
56
- : `Click to generate account`)
57
- }
58
- </button>
59
- </p>
60
- <p>
61
- <button disabled={!account || loading} onClick={execute}>
62
- {loading
63
- ? `Executing...check console for details...`
64
- : `Execute hello_hello.aleo`}
65
- </button>
66
- </p>
67
- <p>
68
- Edit <code>src/App.jsx</code> and save to test HMR
69
- </p>
70
- </div>
71
- <p className="read-the-docs">
72
- Click on the Aleo and React logos to learn more
73
- </p>
74
- </>
75
- );
76
- }
77
-
78
- export default App;
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
@@ -1,69 +0,0 @@
1
- :root {
2
- font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
3
- line-height: 1.5;
4
- font-weight: 400;
5
-
6
- color-scheme: light dark;
7
- color: rgba(255, 255, 255, 0.87);
8
- background-color: #242424;
9
-
10
- font-synthesis: none;
11
- text-rendering: optimizeLegibility;
12
- -webkit-font-smoothing: antialiased;
13
- -moz-osx-font-smoothing: grayscale;
14
- -webkit-text-size-adjust: 100%;
15
- }
16
-
17
- a {
18
- font-weight: 500;
19
- color: #646cff;
20
- text-decoration: inherit;
21
- }
22
- a:hover {
23
- color: #535bf2;
24
- }
25
-
26
- body {
27
- margin: 0;
28
- display: flex;
29
- place-items: center;
30
- min-width: 320px;
31
- min-height: 100vh;
32
- }
33
-
34
- h1 {
35
- font-size: 3.2em;
36
- line-height: 1.1;
37
- }
38
-
39
- button {
40
- border-radius: 8px;
41
- border: 1px solid transparent;
42
- padding: 0.6em 1.2em;
43
- font-size: 1em;
44
- font-weight: 500;
45
- font-family: inherit;
46
- background-color: #1a1a1a;
47
- cursor: pointer;
48
- transition: border-color 0.25s;
49
- }
50
- button:hover {
51
- border-color: #646cff;
52
- }
53
- button:focus,
54
- button:focus-visible {
55
- outline: 4px auto -webkit-focus-ring-color;
56
- }
57
-
58
- @media (prefers-color-scheme: light) {
59
- :root {
60
- color: #213547;
61
- background-color: #ffffff;
62
- }
63
- a:hover {
64
- color: #747bff;
65
- }
66
- button {
67
- background-color: #f9f9f9;
68
- }
69
- }
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import ReactDOM from "react-dom/client";
3
- import App from "./App.jsx";
4
- import "./index.css";
5
-
6
- ReactDOM.createRoot(document.getElementById("root")).render(
7
- <React.StrictMode>
8
- <App />
9
- </React.StrictMode>,
10
- );
@@ -1,21 +0,0 @@
1
- import { defineConfig, searchForWorkspaceRoot } from "vite";
2
- import react from "@vitejs/plugin-react";
3
-
4
- // https://vitejs.dev/config/
5
- export default defineConfig({
6
- assetsInclude: ['**/*.wasm'],
7
- plugins: [react()],
8
- optimizeDeps: {
9
- exclude: ["@provablehq/wasm"],
10
- },
11
- server: {
12
- // Needed if you are linking local packages for development
13
- fs: {
14
- allow: [searchForWorkspaceRoot(process.cwd()), "../../sdk"],
15
- },
16
- headers: {
17
- "Cross-Origin-Opener-Policy": "same-origin",
18
- "Cross-Origin-Embedder-Policy": "require-corp",
19
- },
20
- },
21
- });
@@ -1,90 +0,0 @@
1
- import CopyPlugin from "copy-webpack-plugin";
2
-
3
- import HtmlWebpackPlugin from "html-webpack-plugin";
4
-
5
- import path from "path";
6
-
7
- const appConfig = {
8
- mode: "production",
9
- entry: {
10
- index: "./src/main.jsx",
11
- },
12
- output: {
13
- path: path.resolve("dist"),
14
- filename: "[name].bundle.js",
15
- },
16
- resolve: {
17
- extensions: [".js", ".wasm", ".jsx"],
18
- },
19
- devServer: {
20
- port: 3000,
21
- headers: {
22
- "Cross-Origin-Opener-Policy": "same-origin",
23
- "Cross-Origin-Embedder-Policy": "require-corp",
24
- },
25
- client: {
26
- overlay: false,
27
- },
28
- },
29
- module: {
30
- rules: [
31
- {
32
- test: /\.(js|jsx)$/,
33
- exclude: /nodeModules/,
34
- use: {
35
- loader: "babel-loader",
36
- },
37
- },
38
- {
39
- test: /\.css$/,
40
- use: ["style-loader", "css-loader"],
41
- },
42
- {
43
- test: /\.(png|jpe?g|gif)$/i,
44
- use: [
45
- {
46
- loader: "file-loader",
47
- options: {
48
- name: "[path][name].[ext]",
49
- },
50
- },
51
- ],
52
- },
53
- {
54
- test: /\.svg$/,
55
- use: [
56
- {
57
- loader: "svg-url-loader",
58
- options: {
59
- limit: 8192,
60
- noquotes: true,
61
- },
62
- },
63
- ],
64
- },
65
- ],
66
- },
67
- plugins: [
68
- new CopyPlugin({
69
- patterns: [{ from: "public", to: "public" }],
70
- }),
71
- new HtmlWebpackPlugin({
72
- template: "./index.html",
73
- }),
74
- ],
75
- performance: {
76
- hints: false,
77
- maxAssetSize: 13 * 1024 * 1024, // 12 MiB
78
- maxEntrypointSize: 13 * 1024 * 1024, // 12 MiB
79
- },
80
- stats: {
81
- warnings: false,
82
- },
83
- experiments: {
84
- asyncWebAssembly: true,
85
- topLevelAwait: true,
86
- },
87
- devtool: "source-map",
88
- };
89
-
90
- export default [appConfig];