create-leo-app 0.7.2 → 0.7.3
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/package.json +10 -2
- package/template-extension/README.md +4 -0
- package/template-extension/package.json +15 -0
- package/template-extension/rollup.config.js +21 -0
- package/template-extension/src/offscreen.js +1 -0
- package/template-extension/src/service_worker.js +20 -0
- package/template-extension/src/worker.js +34 -0
- package/template-extension/static/manifest.json +16 -0
- package/template-extension/static/offscreen.html +9 -0
- package/template-nextjs-ts/README.md +19 -0
- package/template-nextjs-ts/_gitignore +35 -0
- package/template-nextjs-ts/next-env.d.ts +5 -0
- package/template-nextjs-ts/next.config.js +32 -0
- package/template-nextjs-ts/node_modules/@types/node/LICENSE +21 -0
- package/template-nextjs-ts/node_modules/@types/node/README.md +15 -0
- package/template-nextjs-ts/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/template-nextjs-ts/node_modules/@types/node/assert.d.ts +1040 -0
- package/template-nextjs-ts/node_modules/@types/node/async_hooks.d.ts +541 -0
- package/template-nextjs-ts/node_modules/@types/node/buffer.d.ts +2301 -0
- package/template-nextjs-ts/node_modules/@types/node/child_process.d.ts +1544 -0
- package/template-nextjs-ts/node_modules/@types/node/cluster.d.ts +578 -0
- package/template-nextjs-ts/node_modules/@types/node/console.d.ts +452 -0
- package/template-nextjs-ts/node_modules/@types/node/constants.d.ts +19 -0
- package/template-nextjs-ts/node_modules/@types/node/crypto.d.ts +4524 -0
- package/template-nextjs-ts/node_modules/@types/node/dgram.d.ts +596 -0
- package/template-nextjs-ts/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
- package/template-nextjs-ts/node_modules/@types/node/dns/promises.d.ts +476 -0
- package/template-nextjs-ts/node_modules/@types/node/dns.d.ts +864 -0
- package/template-nextjs-ts/node_modules/@types/node/dom-events.d.ts +124 -0
- package/template-nextjs-ts/node_modules/@types/node/domain.d.ts +170 -0
- package/template-nextjs-ts/node_modules/@types/node/events.d.ts +931 -0
- package/template-nextjs-ts/node_modules/@types/node/fs/promises.d.ts +1245 -0
- package/template-nextjs-ts/node_modules/@types/node/fs.d.ts +4317 -0
- package/template-nextjs-ts/node_modules/@types/node/globals.d.ts +503 -0
- package/template-nextjs-ts/node_modules/@types/node/globals.global.d.ts +1 -0
- package/template-nextjs-ts/node_modules/@types/node/http.d.ts +1908 -0
- package/template-nextjs-ts/node_modules/@types/node/http2.d.ts +2418 -0
- package/template-nextjs-ts/node_modules/@types/node/https.d.ts +550 -0
- package/template-nextjs-ts/node_modules/@types/node/index.d.ts +89 -0
- package/template-nextjs-ts/node_modules/@types/node/inspector.d.ts +3696 -0
- package/template-nextjs-ts/node_modules/@types/node/module.d.ts +315 -0
- package/template-nextjs-ts/node_modules/@types/node/net.d.ts +999 -0
- package/template-nextjs-ts/node_modules/@types/node/os.d.ts +495 -0
- package/template-nextjs-ts/node_modules/@types/node/package.json +217 -0
- package/template-nextjs-ts/node_modules/@types/node/path.d.ts +191 -0
- package/template-nextjs-ts/node_modules/@types/node/perf_hooks.d.ts +934 -0
- package/template-nextjs-ts/node_modules/@types/node/process.d.ts +1879 -0
- package/template-nextjs-ts/node_modules/@types/node/punycode.d.ts +117 -0
- package/template-nextjs-ts/node_modules/@types/node/querystring.d.ts +153 -0
- package/template-nextjs-ts/node_modules/@types/node/readline/promises.d.ts +150 -0
- package/template-nextjs-ts/node_modules/@types/node/readline.d.ts +540 -0
- package/template-nextjs-ts/node_modules/@types/node/repl.d.ts +430 -0
- package/template-nextjs-ts/node_modules/@types/node/sea.d.ts +153 -0
- package/template-nextjs-ts/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/template-nextjs-ts/node_modules/@types/node/stream/promises.d.ts +83 -0
- package/template-nextjs-ts/node_modules/@types/node/stream/web.d.ts +521 -0
- package/template-nextjs-ts/node_modules/@types/node/stream.d.ts +1707 -0
- package/template-nextjs-ts/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/template-nextjs-ts/node_modules/@types/node/test.d.ts +1874 -0
- package/template-nextjs-ts/node_modules/@types/node/timers/promises.d.ts +97 -0
- package/template-nextjs-ts/node_modules/@types/node/timers.d.ts +240 -0
- package/template-nextjs-ts/node_modules/@types/node/tls.d.ts +1217 -0
- package/template-nextjs-ts/node_modules/@types/node/trace_events.d.ts +197 -0
- package/template-nextjs-ts/node_modules/@types/node/tty.d.ts +208 -0
- package/template-nextjs-ts/node_modules/@types/node/url.d.ts +952 -0
- package/template-nextjs-ts/node_modules/@types/node/util.d.ts +2298 -0
- package/template-nextjs-ts/node_modules/@types/node/v8.d.ts +808 -0
- package/template-nextjs-ts/node_modules/@types/node/vm.d.ts +924 -0
- package/template-nextjs-ts/node_modules/@types/node/wasi.d.ts +181 -0
- package/template-nextjs-ts/node_modules/@types/node/worker_threads.d.ts +694 -0
- package/template-nextjs-ts/node_modules/@types/node/zlib.d.ts +539 -0
- package/template-nextjs-ts/package.json +24 -0
- package/template-nextjs-ts/public/aleo.svg +8 -0
- package/template-nextjs-ts/public/next.svg +1 -0
- package/template-nextjs-ts/src/app/favicon.ico +0 -0
- package/template-nextjs-ts/src/app/globals.css +126 -0
- package/template-nextjs-ts/src/app/layout.tsx +22 -0
- package/template-nextjs-ts/src/app/page.module.css +160 -0
- package/template-nextjs-ts/src/app/page.tsx +94 -0
- package/template-nextjs-ts/src/app/worker.ts +47 -0
- package/template-nextjs-ts/tsconfig.json +27 -0
- package/template-node/README.md +5 -0
- package/template-node/_gitignore +24 -0
- package/template-node/package.json +12 -0
- package/template-node-ts/README.md +5 -0
- package/template-node-ts/_gitignore +24 -0
- package/template-node-ts/package.json +19 -0
- package/template-node-ts/rollup.config.js +19 -0
- package/template-node-ts/src/index.ts +65 -0
- package/template-node-ts/tsconfig.json +15 -0
- package/template-offline-public-transaction-ts/README.md +52 -0
- package/template-offline-public-transaction-ts/_gitignore +24 -0
- package/template-offline-public-transaction-ts/package.json +19 -0
- package/template-offline-public-transaction-ts/rollup.config.js +19 -0
- package/template-offline-public-transaction-ts/src/helpers.ts +70 -0
- package/template-offline-public-transaction-ts/src/index.ts +171 -0
- package/template-offline-public-transaction-ts/tsconfig.json +15 -0
- package/template-react-leo/.babelrc +6 -0
- package/template-react-leo/.eslintrc.cjs +20 -0
- package/template-react-leo/README.md +90 -0
- package/template-react-leo/_gitignore +24 -0
- package/template-react-leo/_headers +3 -0
- package/template-react-leo/helloworld/.env.example +2 -0
- package/template-react-leo/helloworld/README.md +13 -0
- package/template-react-leo/helloworld/build/main.aleo +7 -0
- package/template-react-leo/helloworld/build/program.json +6 -0
- package/template-react-leo/helloworld/inputs/helloworld.in +4 -0
- package/template-react-leo/helloworld/program.json +6 -0
- package/template-react-leo/helloworld/src/main.leo +7 -0
- package/template-react-leo/index.html +88 -0
- package/template-react-leo/install.sh +30 -0
- package/template-react-leo/package.json +44 -0
- package/template-react-leo/public/favicon.ico +0 -0
- package/template-react-leo/src/App.css +42 -0
- package/template-react-leo/src/App.jsx +103 -0
- package/template-react-leo/src/assets/aleo.svg +5 -0
- package/template-react-leo/src/assets/react.svg +1 -0
- package/template-react-leo/src/index.css +69 -0
- package/template-react-leo/src/main.jsx +10 -0
- package/template-react-leo/src/workers/AleoWorker.js +20 -0
- package/template-react-leo/src/workers/worker.js +72 -0
- package/template-react-leo/vite.config.js +16 -0
- package/template-react-leo/webpack.config.js +102 -0
- package/template-react-managed-worker/.babelrc +6 -0
- package/template-react-managed-worker/.eslintrc.cjs +20 -0
- package/template-react-managed-worker/README.md +8 -0
- package/template-react-managed-worker/_gitignore +24 -0
- package/template-react-managed-worker/index.html +88 -0
- package/template-react-managed-worker/package.json +41 -0
- package/template-react-managed-worker/public/favicon.ico +0 -0
- package/template-react-managed-worker/src/App.css +42 -0
- package/template-react-managed-worker/src/App.jsx +78 -0
- package/template-react-managed-worker/src/assets/aleo.png +0 -0
- package/template-react-managed-worker/src/assets/react.svg +1 -0
- package/template-react-managed-worker/src/index.css +69 -0
- package/template-react-managed-worker/src/main.jsx +10 -0
- package/template-react-managed-worker/vite.config.js +20 -0
- package/template-react-managed-worker/webpack.config.js +90 -0
- package/template-react-ts/.babelrc +7 -0
- package/template-react-ts/.eslintrc.cjs +20 -0
- package/template-react-ts/README.md +90 -0
- package/template-react-ts/_gitignore +24 -0
- package/template-react-ts/_headers +3 -0
- package/template-react-ts/helloworld/.env.example +2 -0
- package/template-react-ts/helloworld/README.md +13 -0
- package/template-react-ts/helloworld/build/main.aleo +7 -0
- package/template-react-ts/helloworld/build/program.json +6 -0
- package/template-react-ts/helloworld/inputs/helloworld.in +4 -0
- package/template-react-ts/helloworld/program.json +6 -0
- package/template-react-ts/helloworld/src/main.leo +7 -0
- package/template-react-ts/index.html +88 -0
- package/template-react-ts/install.sh +30 -0
- package/template-react-ts/node_modules/@types/node/LICENSE +21 -0
- package/template-react-ts/node_modules/@types/node/README.md +15 -0
- package/template-react-ts/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/template-react-ts/node_modules/@types/node/assert.d.ts +1040 -0
- package/template-react-ts/node_modules/@types/node/async_hooks.d.ts +541 -0
- package/template-react-ts/node_modules/@types/node/buffer.d.ts +2301 -0
- package/template-react-ts/node_modules/@types/node/child_process.d.ts +1544 -0
- package/template-react-ts/node_modules/@types/node/cluster.d.ts +578 -0
- package/template-react-ts/node_modules/@types/node/console.d.ts +452 -0
- package/template-react-ts/node_modules/@types/node/constants.d.ts +19 -0
- package/template-react-ts/node_modules/@types/node/crypto.d.ts +4524 -0
- package/template-react-ts/node_modules/@types/node/dgram.d.ts +596 -0
- package/template-react-ts/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
- package/template-react-ts/node_modules/@types/node/dns/promises.d.ts +476 -0
- package/template-react-ts/node_modules/@types/node/dns.d.ts +864 -0
- package/template-react-ts/node_modules/@types/node/dom-events.d.ts +124 -0
- package/template-react-ts/node_modules/@types/node/domain.d.ts +170 -0
- package/template-react-ts/node_modules/@types/node/events.d.ts +931 -0
- package/template-react-ts/node_modules/@types/node/fs/promises.d.ts +1245 -0
- package/template-react-ts/node_modules/@types/node/fs.d.ts +4317 -0
- package/template-react-ts/node_modules/@types/node/globals.d.ts +503 -0
- package/template-react-ts/node_modules/@types/node/globals.global.d.ts +1 -0
- package/template-react-ts/node_modules/@types/node/http.d.ts +1908 -0
- package/template-react-ts/node_modules/@types/node/http2.d.ts +2418 -0
- package/template-react-ts/node_modules/@types/node/https.d.ts +550 -0
- package/template-react-ts/node_modules/@types/node/index.d.ts +89 -0
- package/template-react-ts/node_modules/@types/node/inspector.d.ts +3696 -0
- package/template-react-ts/node_modules/@types/node/module.d.ts +315 -0
- package/template-react-ts/node_modules/@types/node/net.d.ts +999 -0
- package/template-react-ts/node_modules/@types/node/os.d.ts +495 -0
- package/template-react-ts/node_modules/@types/node/package.json +217 -0
- package/template-react-ts/node_modules/@types/node/path.d.ts +191 -0
- package/template-react-ts/node_modules/@types/node/perf_hooks.d.ts +934 -0
- package/template-react-ts/node_modules/@types/node/process.d.ts +1879 -0
- package/template-react-ts/node_modules/@types/node/punycode.d.ts +117 -0
- package/template-react-ts/node_modules/@types/node/querystring.d.ts +153 -0
- package/template-react-ts/node_modules/@types/node/readline/promises.d.ts +150 -0
- package/template-react-ts/node_modules/@types/node/readline.d.ts +540 -0
- package/template-react-ts/node_modules/@types/node/repl.d.ts +430 -0
- package/template-react-ts/node_modules/@types/node/sea.d.ts +153 -0
- package/template-react-ts/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/template-react-ts/node_modules/@types/node/stream/promises.d.ts +83 -0
- package/template-react-ts/node_modules/@types/node/stream/web.d.ts +521 -0
- package/template-react-ts/node_modules/@types/node/stream.d.ts +1707 -0
- package/template-react-ts/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/template-react-ts/node_modules/@types/node/test.d.ts +1874 -0
- package/template-react-ts/node_modules/@types/node/timers/promises.d.ts +97 -0
- package/template-react-ts/node_modules/@types/node/timers.d.ts +240 -0
- package/template-react-ts/node_modules/@types/node/tls.d.ts +1217 -0
- package/template-react-ts/node_modules/@types/node/trace_events.d.ts +197 -0
- package/template-react-ts/node_modules/@types/node/tty.d.ts +208 -0
- package/template-react-ts/node_modules/@types/node/url.d.ts +952 -0
- package/template-react-ts/node_modules/@types/node/util.d.ts +2298 -0
- package/template-react-ts/node_modules/@types/node/v8.d.ts +808 -0
- package/template-react-ts/node_modules/@types/node/vm.d.ts +924 -0
- package/template-react-ts/node_modules/@types/node/wasi.d.ts +181 -0
- package/template-react-ts/node_modules/@types/node/worker_threads.d.ts +694 -0
- package/template-react-ts/node_modules/@types/node/zlib.d.ts +539 -0
- package/template-react-ts/node_modules/diff/CONTRIBUTING.md +39 -0
- package/template-react-ts/node_modules/diff/LICENSE +31 -0
- package/template-react-ts/node_modules/diff/README.md +207 -0
- package/template-react-ts/node_modules/diff/dist/diff.js +1585 -0
- package/template-react-ts/node_modules/diff/dist/diff.min.js +38 -0
- package/template-react-ts/node_modules/diff/lib/convert/dmp.js +32 -0
- package/template-react-ts/node_modules/diff/lib/convert/xml.js +42 -0
- package/template-react-ts/node_modules/diff/lib/diff/array.js +45 -0
- package/template-react-ts/node_modules/diff/lib/diff/base.js +304 -0
- package/template-react-ts/node_modules/diff/lib/diff/character.js +37 -0
- package/template-react-ts/node_modules/diff/lib/diff/css.js +41 -0
- package/template-react-ts/node_modules/diff/lib/diff/json.js +163 -0
- package/template-react-ts/node_modules/diff/lib/diff/line.js +89 -0
- package/template-react-ts/node_modules/diff/lib/diff/sentence.js +41 -0
- package/template-react-ts/node_modules/diff/lib/diff/word.js +107 -0
- package/template-react-ts/node_modules/diff/lib/index.es6.js +1519 -0
- package/template-react-ts/node_modules/diff/lib/index.js +216 -0
- package/template-react-ts/node_modules/diff/lib/patch/apply.js +243 -0
- package/template-react-ts/node_modules/diff/lib/patch/create.js +247 -0
- package/template-react-ts/node_modules/diff/lib/patch/merge.js +609 -0
- package/template-react-ts/node_modules/diff/lib/patch/parse.js +156 -0
- package/template-react-ts/node_modules/diff/lib/util/array.js +32 -0
- package/template-react-ts/node_modules/diff/lib/util/distance-iterator.js +57 -0
- package/template-react-ts/node_modules/diff/lib/util/params.js +24 -0
- package/template-react-ts/node_modules/diff/package.json +73 -0
- package/template-react-ts/node_modules/diff/release-notes.md +261 -0
- package/template-react-ts/node_modules/diff/runtime.js +3 -0
- package/template-react-ts/node_modules/ts-node/LICENSE +21 -0
- package/template-react-ts/node_modules/ts-node/README.md +1442 -0
- package/template-react-ts/node_modules/ts-node/child-loader.mjs +8 -0
- package/template-react-ts/node_modules/ts-node/dist/bin-cwd.d.ts +2 -0
- package/template-react-ts/node_modules/ts-node/dist/bin-cwd.js +6 -0
- package/template-react-ts/node_modules/ts-node/dist/bin-cwd.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/bin-esm.d.ts +2 -0
- package/template-react-ts/node_modules/ts-node/dist/bin-esm.js +6 -0
- package/template-react-ts/node_modules/ts-node/dist/bin-esm.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/bin-script-deprecated.d.ts +2 -0
- package/template-react-ts/node_modules/ts-node/dist/bin-script-deprecated.js +7 -0
- package/template-react-ts/node_modules/ts-node/dist/bin-script-deprecated.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/bin-script.d.ts +2 -0
- package/template-react-ts/node_modules/ts-node/dist/bin-script.js +6 -0
- package/template-react-ts/node_modules/ts-node/dist/bin-script.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/bin-transpile.d.ts +2 -0
- package/template-react-ts/node_modules/ts-node/dist/bin-transpile.js +6 -0
- package/template-react-ts/node_modules/ts-node/dist/bin-transpile.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/bin.d.ts +11 -0
- package/template-react-ts/node_modules/ts-node/dist/bin.js +581 -0
- package/template-react-ts/node_modules/ts-node/dist/bin.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/child/argv-payload.d.ts +1 -0
- package/template-react-ts/node_modules/ts-node/dist/child/argv-payload.js +19 -0
- package/template-react-ts/node_modules/ts-node/dist/child/argv-payload.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/child/child-entrypoint.d.ts +1 -0
- package/template-react-ts/node_modules/ts-node/dist/child/child-entrypoint.js +24 -0
- package/template-react-ts/node_modules/ts-node/dist/child/child-entrypoint.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/child/child-loader.d.ts +1 -0
- package/template-react-ts/node_modules/ts-node/dist/child/child-loader.js +32 -0
- package/template-react-ts/node_modules/ts-node/dist/child/child-loader.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/child/child-require.d.ts +7 -0
- package/template-react-ts/node_modules/ts-node/dist/child/child-require.js +22 -0
- package/template-react-ts/node_modules/ts-node/dist/child/child-require.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/child/spawn-child.d.ts +1 -0
- package/template-react-ts/node_modules/ts-node/dist/child/spawn-child.js +49 -0
- package/template-react-ts/node_modules/ts-node/dist/child/spawn-child.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/cjs-resolve-hooks.d.ts +1 -0
- package/template-react-ts/node_modules/ts-node/dist/cjs-resolve-hooks.js +29 -0
- package/template-react-ts/node_modules/ts-node/dist/cjs-resolve-hooks.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/configuration.d.ts +1 -0
- package/template-react-ts/node_modules/ts-node/dist/configuration.js +308 -0
- package/template-react-ts/node_modules/ts-node/dist/configuration.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/esm.d.ts +53 -0
- package/template-react-ts/node_modules/ts-node/dist/esm.js +228 -0
- package/template-react-ts/node_modules/ts-node/dist/esm.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/file-extensions.d.ts +1 -0
- package/template-react-ts/node_modules/ts-node/dist/file-extensions.js +133 -0
- package/template-react-ts/node_modules/ts-node/dist/file-extensions.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/index.d.ts +332 -0
- package/template-react-ts/node_modules/ts-node/dist/index.js +953 -0
- package/template-react-ts/node_modules/ts-node/dist/index.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/module-type-classifier.d.ts +1 -0
- package/template-react-ts/node_modules/ts-node/dist/module-type-classifier.js +64 -0
- package/template-react-ts/node_modules/ts-node/dist/module-type-classifier.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/node-module-type-classifier.d.ts +1 -0
- package/template-react-ts/node_modules/ts-node/dist/node-module-type-classifier.js +39 -0
- package/template-react-ts/node_modules/ts-node/dist/node-module-type-classifier.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/repl.d.ts +78 -0
- package/template-react-ts/node_modules/ts-node/dist/repl.js +561 -0
- package/template-react-ts/node_modules/ts-node/dist/repl.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/resolver-functions.d.ts +1 -0
- package/template-react-ts/node_modules/ts-node/dist/resolver-functions.js +143 -0
- package/template-react-ts/node_modules/ts-node/dist/resolver-functions.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/transpilers/swc.d.ts +11 -0
- package/template-react-ts/node_modules/ts-node/dist/transpilers/swc.js +218 -0
- package/template-react-ts/node_modules/ts-node/dist/transpilers/swc.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/transpilers/types.d.ts +35 -0
- package/template-react-ts/node_modules/ts-node/dist/transpilers/types.js +3 -0
- package/template-react-ts/node_modules/ts-node/dist/transpilers/types.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/ts-compiler-types.d.ts +63 -0
- package/template-react-ts/node_modules/ts-node/dist/ts-compiler-types.js +3 -0
- package/template-react-ts/node_modules/ts-node/dist/ts-compiler-types.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/ts-internals.d.ts +6 -0
- package/template-react-ts/node_modules/ts-node/dist/ts-internals.js +321 -0
- package/template-react-ts/node_modules/ts-node/dist/ts-internals.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/ts-transpile-module.d.ts +1 -0
- package/template-react-ts/node_modules/ts-node/dist/ts-transpile-module.js +100 -0
- package/template-react-ts/node_modules/ts-node/dist/ts-transpile-module.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/tsconfig-schema.d.ts +13 -0
- package/template-react-ts/node_modules/ts-node/dist/tsconfig-schema.js +3 -0
- package/template-react-ts/node_modules/ts-node/dist/tsconfig-schema.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/tsconfigs.d.ts +1 -0
- package/template-react-ts/node_modules/ts-node/dist/tsconfigs.js +36 -0
- package/template-react-ts/node_modules/ts-node/dist/tsconfigs.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist/util.d.ts +4 -0
- package/template-react-ts/node_modules/ts-node/dist/util.js +175 -0
- package/template-react-ts/node_modules/ts-node/dist/util.js.map +1 -0
- package/template-react-ts/node_modules/ts-node/dist-raw/NODE-LICENSE.md +24 -0
- package/template-react-ts/node_modules/ts-node/dist-raw/README.md +36 -0
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-constants.js +4 -0
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-errors.js +82 -0
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-modules-cjs-helpers.js +89 -0
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-modules-cjs-loader.js +593 -0
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-modules-esm-get_format.js +106 -0
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js +962 -0
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-modules-package_json_reader.js +44 -0
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-repl-await.js +254 -0
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internalBinding-fs.js +58 -0
- package/template-react-ts/node_modules/ts-node/dist-raw/node-nativemodule.js +9 -0
- package/template-react-ts/node_modules/ts-node/dist-raw/node-options.js +103 -0
- package/template-react-ts/node_modules/ts-node/dist-raw/node-primordials.js +37 -0
- package/template-react-ts/node_modules/ts-node/dist-raw/runmain-hack.js +9 -0
- package/template-react-ts/node_modules/ts-node/esm/transpile-only.mjs +8 -0
- package/template-react-ts/node_modules/ts-node/esm.mjs +8 -0
- package/template-react-ts/node_modules/ts-node/node10/tsconfig.json +3 -0
- package/template-react-ts/node_modules/ts-node/node12/tsconfig.json +3 -0
- package/template-react-ts/node_modules/ts-node/node14/tsconfig.json +3 -0
- package/template-react-ts/node_modules/ts-node/node16/tsconfig.json +3 -0
- package/template-react-ts/node_modules/ts-node/package.json +182 -0
- package/template-react-ts/node_modules/ts-node/register/files.js +3 -0
- package/template-react-ts/node_modules/ts-node/register/index.js +1 -0
- package/template-react-ts/node_modules/ts-node/register/transpile-only.js +3 -0
- package/template-react-ts/node_modules/ts-node/register/type-check.js +3 -0
- package/template-react-ts/node_modules/ts-node/transpilers/swc-experimental.js +1 -0
- package/template-react-ts/node_modules/ts-node/transpilers/swc.js +1 -0
- package/template-react-ts/node_modules/ts-node/tsconfig.schema.json +183 -0
- package/template-react-ts/node_modules/ts-node/tsconfig.schemastore-schema.json +1326 -0
- package/template-react-ts/package.json +49 -0
- package/template-react-ts/public/favicon.ico +0 -0
- package/template-react-ts/src/App.css +42 -0
- package/template-react-ts/src/App.tsx +103 -0
- package/template-react-ts/src/assets/aleo.svg +5 -0
- package/template-react-ts/src/assets/react.svg +1 -0
- package/template-react-ts/src/custom.d.ts +16 -0
- package/template-react-ts/src/index.css +69 -0
- package/template-react-ts/src/main.tsx +10 -0
- package/template-react-ts/src/workers/AleoWorker.ts +21 -0
- package/template-react-ts/src/workers/worker.ts +73 -0
- package/template-react-ts/tsconfig.json +16 -0
- package/template-react-ts/vite.config.ts +16 -0
- package/template-react-ts/webpack.config.ts +112 -0
- package/template-vanilla/_gitignore +24 -0
- package/template-vanilla/_headers +3 -0
- package/template-vanilla/index.html +13 -0
- package/template-vanilla/javascript.svg +1 -0
- package/template-vanilla/main.js +48 -0
- package/template-vanilla/package.json +16 -0
- package/template-vanilla/public/aleo.svg +76 -0
- package/template-vanilla/public/vite.svg +1 -0
- package/template-vanilla/style.css +97 -0
- package/template-vanilla/vite.config.js +12 -0
- package/template-vanilla/worker.js +95 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# script exists immediately if command fails
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
# check for dependencies
|
|
7
|
+
command -v git >/dev/null 2>&1 || { echo >&2 "git is required but it's not installed. Aborting."; exit 1; }
|
|
8
|
+
command -v cargo >/dev/null 2>&1 || { echo >&2 "cargo is required but it's not installed. Aborting."; exit 1; }
|
|
9
|
+
|
|
10
|
+
INSTALL_DIR="${INSTALL_DIR:-$HOME/.leo}"
|
|
11
|
+
|
|
12
|
+
# ask for confirmation
|
|
13
|
+
read -p "This script will install Leo into $INSTALL_DIR. Do you want to continue? (y/N) " choice
|
|
14
|
+
case "$choice" in
|
|
15
|
+
y|Y ) echo "Continuing installation...";;
|
|
16
|
+
* ) echo "Aborting."; exit;;
|
|
17
|
+
esac
|
|
18
|
+
|
|
19
|
+
# clone or update the repo
|
|
20
|
+
if [ -d "$INSTALL_DIR" ]; then
|
|
21
|
+
echo "Directory $INSTALL_DIR exists. Updating repository..."
|
|
22
|
+
git -C "$INSTALL_DIR" pull
|
|
23
|
+
else
|
|
24
|
+
echo "Cloning repository into $INSTALL_DIR..."
|
|
25
|
+
git clone https://github.com/ProvableHQ/leo "$INSTALL_DIR"
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
# build and install
|
|
29
|
+
echo "Building and installing from source..."
|
|
30
|
+
cargo install --path "$INSTALL_DIR"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "aleo-react-leo-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
|
+
"install-leo": "./install.sh"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@provablehq/sdk": "^0.7.0",
|
|
16
|
+
"comlink": "^4.4.1",
|
|
17
|
+
"react": "^18.2.0",
|
|
18
|
+
"react-dom": "^18.2.0"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@babel/core": "^7.17.2",
|
|
22
|
+
"@babel/preset-env": "^7.16.11",
|
|
23
|
+
"@babel/preset-react": "^7.16.7",
|
|
24
|
+
"@types/react": "^18.2.15",
|
|
25
|
+
"@types/react-dom": "^18.2.7",
|
|
26
|
+
"@vitejs/plugin-react": "^4.0.4",
|
|
27
|
+
"babel-loader": "^8.2.3",
|
|
28
|
+
"copy-webpack-plugin": "^11.0.0",
|
|
29
|
+
"css-loader": "^6.6.0",
|
|
30
|
+
"eslint": "^8.45.0",
|
|
31
|
+
"eslint-plugin-react": "^7.32.2",
|
|
32
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
33
|
+
"eslint-plugin-react-refresh": "^0.4.3",
|
|
34
|
+
"file-loader": "^6.2.0",
|
|
35
|
+
"html-webpack-plugin": "^5.5.0",
|
|
36
|
+
"raw-loader": "^4.0.2",
|
|
37
|
+
"style-loader": "^3.3.1",
|
|
38
|
+
"svg-url-loader": "^8.0.0",
|
|
39
|
+
"vite": "^4.4.12",
|
|
40
|
+
"webpack": "^5.76.0",
|
|
41
|
+
"webpack-cli": "^5.1.4",
|
|
42
|
+
"webpack-dev-server": "^4.15.1"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import reactLogo from "./assets/react.svg";
|
|
3
|
+
import aleoLogo from "./assets/aleo.svg";
|
|
4
|
+
import "./App.css";
|
|
5
|
+
import helloworld_program from "../helloworld/build/main.aleo?raw";
|
|
6
|
+
import { AleoWorker } from "./workers/AleoWorker.js";
|
|
7
|
+
|
|
8
|
+
const aleoWorker = AleoWorker();
|
|
9
|
+
function App() {
|
|
10
|
+
const [count, setCount] = useState(0);
|
|
11
|
+
const [account, setAccount] = useState(null);
|
|
12
|
+
const [executing, setExecuting] = useState(false);
|
|
13
|
+
const [deploying, setDeploying] = useState(false);
|
|
14
|
+
|
|
15
|
+
const generateAccount = async () => {
|
|
16
|
+
const key = await aleoWorker.getPrivateKey();
|
|
17
|
+
setAccount(await key.to_string());
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
async function execute() {
|
|
21
|
+
setExecuting(true);
|
|
22
|
+
const result = await aleoWorker.localProgramExecution(
|
|
23
|
+
helloworld_program,
|
|
24
|
+
"main",
|
|
25
|
+
["5u32", "5u32"],
|
|
26
|
+
);
|
|
27
|
+
setExecuting(false);
|
|
28
|
+
|
|
29
|
+
alert(JSON.stringify(result));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async function deploy() {
|
|
33
|
+
setDeploying(true);
|
|
34
|
+
try {
|
|
35
|
+
const result = await aleoWorker.deployProgram(helloworld_program);
|
|
36
|
+
console.log("Transaction:")
|
|
37
|
+
console.log("https://explorer.hamp.app/transaction?id=" + result)
|
|
38
|
+
alert("Transaction ID: " + result);
|
|
39
|
+
} catch (e) {
|
|
40
|
+
console.log(e)
|
|
41
|
+
alert("Error with deployment, please check console for details");
|
|
42
|
+
}
|
|
43
|
+
setDeploying(false);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<>
|
|
48
|
+
<div>
|
|
49
|
+
<a href="https://provable.com" target="_blank">
|
|
50
|
+
<img src={aleoLogo} className="logo" alt="Aleo logo" />
|
|
51
|
+
</a>
|
|
52
|
+
<a href="https://react.dev" target="_blank">
|
|
53
|
+
<img src={reactLogo} className="logo react" alt="React logo" />
|
|
54
|
+
</a>
|
|
55
|
+
</div>
|
|
56
|
+
<h1>Aleo + React</h1>
|
|
57
|
+
<div className="card">
|
|
58
|
+
<button onClick={() => setCount((count) => count + 1)}>
|
|
59
|
+
count is {count}
|
|
60
|
+
</button>
|
|
61
|
+
<p>
|
|
62
|
+
<button onClick={generateAccount}>
|
|
63
|
+
{account
|
|
64
|
+
? `Account private key is ${JSON.stringify(account)}`
|
|
65
|
+
: `Click to generate account`}
|
|
66
|
+
</button>
|
|
67
|
+
</p>
|
|
68
|
+
<p>
|
|
69
|
+
<button disabled={executing} onClick={execute}>
|
|
70
|
+
{executing
|
|
71
|
+
? `Executing...check console for details...`
|
|
72
|
+
: `Execute helloworld.aleo`}
|
|
73
|
+
</button>
|
|
74
|
+
</p>
|
|
75
|
+
<p>
|
|
76
|
+
Edit <code>src/App.jsx</code> and save to test HMR
|
|
77
|
+
</p>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
{/* Advanced Section */}
|
|
81
|
+
<div className="card">
|
|
82
|
+
<h2>Advanced Actions</h2>
|
|
83
|
+
<p>
|
|
84
|
+
Deployment on Aleo requires certain prerequisites like seeding your
|
|
85
|
+
wallet with credits and retrieving a fee record. Check README for more
|
|
86
|
+
details.
|
|
87
|
+
</p>
|
|
88
|
+
<p>
|
|
89
|
+
<button disabled={deploying} onClick={deploy}>
|
|
90
|
+
{deploying
|
|
91
|
+
? `Deploying...check console for details...`
|
|
92
|
+
: `Deploy helloworld.aleo`}
|
|
93
|
+
</button>
|
|
94
|
+
</p>
|
|
95
|
+
</div>
|
|
96
|
+
<p className="read-the-docs">
|
|
97
|
+
Click on the Aleo and React logos to learn more
|
|
98
|
+
</p>
|
|
99
|
+
</>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export default App;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="76" height="80" viewBox="0 0 76 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M47.886 0H29.4601L13.4679 46.7704H23.2068L36.1609 8.61481H40.8513L53.8036 46.7704H23.2068L20.193 55.3852H56.7073L65.0811 80H75.1314L47.886 0Z" fill="#F5F5F5"/>
|
|
3
|
+
<path d="M2.10278 80H11.8174L20.193 55.3852L10.5213 55.3852L2.10278 80Z" fill="#F5F5F5"/>
|
|
4
|
+
<path d="M3.81482 46.7704L0.868164 55.3852H10.5213L13.4679 46.7704H3.81482Z" fill="#F5F5F5"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
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>
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { wrap } from "comlink";
|
|
2
|
+
|
|
3
|
+
let singletonWorker = null;
|
|
4
|
+
|
|
5
|
+
const AleoWorker = () => {
|
|
6
|
+
if (!singletonWorker) {
|
|
7
|
+
const worker = new Worker(new URL("worker.js", import.meta.url), {
|
|
8
|
+
type: "module",
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
worker.onerror = function(event) {
|
|
12
|
+
console.error("Error in worker: " + event?.message);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
singletonWorker = wrap(worker);
|
|
16
|
+
}
|
|
17
|
+
return singletonWorker;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { AleoWorker };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Account,
|
|
3
|
+
ProgramManager,
|
|
4
|
+
PrivateKey,
|
|
5
|
+
initThreadPool,
|
|
6
|
+
AleoKeyProvider,
|
|
7
|
+
AleoNetworkClient,
|
|
8
|
+
NetworkRecordProvider,
|
|
9
|
+
} from "@provablehq/sdk";
|
|
10
|
+
import { expose, proxy } from "comlink";
|
|
11
|
+
|
|
12
|
+
await initThreadPool();
|
|
13
|
+
|
|
14
|
+
async function localProgramExecution(program, aleoFunction, inputs) {
|
|
15
|
+
const programManager = new ProgramManager();
|
|
16
|
+
|
|
17
|
+
// Create a temporary account for the execution of the program
|
|
18
|
+
const account = new Account();
|
|
19
|
+
programManager.setAccount(account);
|
|
20
|
+
|
|
21
|
+
const executionResponse = await programManager.run(
|
|
22
|
+
program,
|
|
23
|
+
aleoFunction,
|
|
24
|
+
inputs,
|
|
25
|
+
false,
|
|
26
|
+
);
|
|
27
|
+
return executionResponse.getOutputs();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function getPrivateKey() {
|
|
31
|
+
const key = new PrivateKey();
|
|
32
|
+
return proxy(key);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async function deployProgram(program) {
|
|
36
|
+
const keyProvider = new AleoKeyProvider();
|
|
37
|
+
keyProvider.useCache(true);
|
|
38
|
+
|
|
39
|
+
// Create a record provider that will be used to find records and transaction data for Aleo programs
|
|
40
|
+
const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
|
|
41
|
+
|
|
42
|
+
// Use existing account with funds
|
|
43
|
+
const account = new Account({
|
|
44
|
+
privateKey: "user1PrivateKey",
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
48
|
+
|
|
49
|
+
// Initialize a program manager to talk to the Aleo network with the configured key and record providers
|
|
50
|
+
const programManager = new ProgramManager(
|
|
51
|
+
"https://api.explorer.provable.com/v1",
|
|
52
|
+
keyProvider,
|
|
53
|
+
recordProvider,
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
programManager.setAccount(account);
|
|
57
|
+
|
|
58
|
+
// Define a fee to pay to deploy the program
|
|
59
|
+
const fee = 1.9; // 1.9 Aleo credits
|
|
60
|
+
|
|
61
|
+
// Deploy the program to the Aleo network
|
|
62
|
+
const tx_id = await programManager.deploy(program, fee);
|
|
63
|
+
|
|
64
|
+
// Optional: Pass in fee record manually to avoid long scan times
|
|
65
|
+
// const feeRecord = "{ owner: aleo1xxx...xxx.private, microcredits: 2000000u64.private, _nonce: 123...789group.public}";
|
|
66
|
+
// const tx_id = await programManager.deploy(program, fee, undefined, feeRecord);
|
|
67
|
+
|
|
68
|
+
return tx_id;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const workerMethods = { localProgramExecution, getPrivateKey, deployProgram };
|
|
72
|
+
expose(workerMethods);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import react from "@vitejs/plugin-react";
|
|
3
|
+
|
|
4
|
+
// https://vitejs.dev/config/
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [react()],
|
|
7
|
+
optimizeDeps: {
|
|
8
|
+
exclude: ["@provablehq/wasm", "@provablehq/sdk"],
|
|
9
|
+
},
|
|
10
|
+
server: {
|
|
11
|
+
headers: {
|
|
12
|
+
"Cross-Origin-Opener-Policy": "same-origin",
|
|
13
|
+
"Cross-Origin-Embedder-Policy": "require-corp",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import CopyPlugin from "copy-webpack-plugin";
|
|
2
|
+
import TerserPlugin from "terser-webpack-plugin";
|
|
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
|
+
test: /\.aleo$/i,
|
|
67
|
+
use: 'raw-loader',
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
plugins: [
|
|
72
|
+
new CopyPlugin({
|
|
73
|
+
patterns: [{ from: "public", to: "public" }, { from: "_headers", to: "." }],
|
|
74
|
+
}),
|
|
75
|
+
new HtmlWebpackPlugin({
|
|
76
|
+
template: "./index.html",
|
|
77
|
+
}),
|
|
78
|
+
],
|
|
79
|
+
performance: {
|
|
80
|
+
hints: false,
|
|
81
|
+
maxAssetSize: 13 * 1024 * 1024, // 12 MiB
|
|
82
|
+
maxEntrypointSize: 13 * 1024 * 1024, // 12 MiB
|
|
83
|
+
},
|
|
84
|
+
optimization: {
|
|
85
|
+
minimize: true,
|
|
86
|
+
minimizer: [new TerserPlugin({
|
|
87
|
+
terserOptions: {
|
|
88
|
+
module: true,
|
|
89
|
+
}
|
|
90
|
+
})],
|
|
91
|
+
},
|
|
92
|
+
stats: {
|
|
93
|
+
warnings: false,
|
|
94
|
+
},
|
|
95
|
+
experiments: {
|
|
96
|
+
asyncWebAssembly: true,
|
|
97
|
+
topLevelAwait: true,
|
|
98
|
+
},
|
|
99
|
+
devtool: "source-map",
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export default [appConfig];
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
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 Vite with HMR and some ESLint rules.
|
|
7
|
+
|
|
8
|
+
Note: Webpack is currently used for production builds due to a [bug](https://github.com/vitejs/vite/issues/13367) with Vite related to nested workers.
|
|
@@ -0,0 +1,24 @@
|
|
|
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?
|
|
@@ -0,0 +1,88 @@
|
|
|
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>
|