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,126 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--max-width: 1100px;
|
|
3
|
+
--border-radius: 12px;
|
|
4
|
+
--font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono',
|
|
5
|
+
'Roboto Mono', 'Oxygen Mono', 'Ubuntu Monospace', 'Source Code Pro',
|
|
6
|
+
'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace;
|
|
7
|
+
|
|
8
|
+
--foreground-rgb: 0, 0, 0;
|
|
9
|
+
--background-start-rgb: 214, 219, 220;
|
|
10
|
+
--background-end-rgb: 255, 255, 255;
|
|
11
|
+
|
|
12
|
+
--primary-glow: conic-gradient(
|
|
13
|
+
from 180deg at 50% 50%,
|
|
14
|
+
#16abff33 0deg,
|
|
15
|
+
#0885ff33 55deg,
|
|
16
|
+
#54d6ff33 120deg,
|
|
17
|
+
#0071ff33 160deg,
|
|
18
|
+
transparent 360deg
|
|
19
|
+
);
|
|
20
|
+
--secondary-glow: radial-gradient(
|
|
21
|
+
rgba(255, 255, 255, 1),
|
|
22
|
+
rgba(255, 255, 255, 0)
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
--tile-start-rgb: 239, 245, 249;
|
|
26
|
+
--tile-end-rgb: 228, 232, 233;
|
|
27
|
+
--tile-border: conic-gradient(
|
|
28
|
+
#00000080,
|
|
29
|
+
#00000040,
|
|
30
|
+
#00000030,
|
|
31
|
+
#00000020,
|
|
32
|
+
#00000010,
|
|
33
|
+
#00000010,
|
|
34
|
+
#00000080
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
--callout-rgb: 238, 240, 241;
|
|
38
|
+
--callout-border-rgb: 172, 175, 176;
|
|
39
|
+
--card-rgb: 180, 185, 188;
|
|
40
|
+
--card-border-rgb: 131, 134, 135;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
button {
|
|
44
|
+
border-radius: 8px;
|
|
45
|
+
border: 1px solid transparent;
|
|
46
|
+
padding: 0.6em 1.2em;
|
|
47
|
+
font-size: 1em;
|
|
48
|
+
font-weight: 500;
|
|
49
|
+
font-family: inherit;
|
|
50
|
+
background-color: #1a1a1a;
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
transition: border-color 0.25s;
|
|
53
|
+
}
|
|
54
|
+
button:hover {
|
|
55
|
+
border-color: #646cff;
|
|
56
|
+
}
|
|
57
|
+
button:focus,
|
|
58
|
+
button:focus-visible {
|
|
59
|
+
outline: 4px auto -webkit-focus-ring-color;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media (prefers-color-scheme: dark) {
|
|
63
|
+
:root {
|
|
64
|
+
--foreground-rgb: 255, 255, 255;
|
|
65
|
+
--background-start-rgb: 0, 0, 0;
|
|
66
|
+
--background-end-rgb: 0, 0, 0;
|
|
67
|
+
|
|
68
|
+
--primary-glow: radial-gradient(rgba(1, 65, 255, 0.4), rgba(1, 65, 255, 0));
|
|
69
|
+
--secondary-glow: linear-gradient(
|
|
70
|
+
to bottom right,
|
|
71
|
+
rgba(1, 65, 255, 0),
|
|
72
|
+
rgba(1, 65, 255, 0),
|
|
73
|
+
rgba(1, 65, 255, 0.3)
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
--tile-start-rgb: 2, 13, 46;
|
|
77
|
+
--tile-end-rgb: 2, 5, 19;
|
|
78
|
+
--tile-border: conic-gradient(
|
|
79
|
+
#ffffff80,
|
|
80
|
+
#ffffff40,
|
|
81
|
+
#ffffff30,
|
|
82
|
+
#ffffff20,
|
|
83
|
+
#ffffff10,
|
|
84
|
+
#ffffff10,
|
|
85
|
+
#ffffff80
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
--callout-rgb: 20, 20, 20;
|
|
89
|
+
--callout-border-rgb: 108, 108, 108;
|
|
90
|
+
--card-rgb: 100, 100, 100;
|
|
91
|
+
--card-border-rgb: 200, 200, 200;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
* {
|
|
96
|
+
box-sizing: border-box;
|
|
97
|
+
padding: 0;
|
|
98
|
+
margin: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
html,
|
|
102
|
+
body {
|
|
103
|
+
max-width: 100vw;
|
|
104
|
+
overflow-x: hidden;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
body {
|
|
108
|
+
color: rgb(var(--foreground-rgb));
|
|
109
|
+
background: linear-gradient(
|
|
110
|
+
to bottom,
|
|
111
|
+
transparent,
|
|
112
|
+
rgb(var(--background-end-rgb))
|
|
113
|
+
)
|
|
114
|
+
rgb(var(--background-start-rgb));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
a {
|
|
118
|
+
color: inherit;
|
|
119
|
+
text-decoration: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@media (prefers-color-scheme: dark) {
|
|
123
|
+
html {
|
|
124
|
+
color-scheme: dark;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import './globals.css'
|
|
2
|
+
import type { Metadata } from 'next'
|
|
3
|
+
import { Inter } from 'next/font/google'
|
|
4
|
+
|
|
5
|
+
const inter = Inter({ subsets: ['latin'] })
|
|
6
|
+
|
|
7
|
+
export const metadata: Metadata = {
|
|
8
|
+
title: 'Create Next App',
|
|
9
|
+
description: 'Generated by create next app',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default function RootLayout({
|
|
13
|
+
children,
|
|
14
|
+
}: {
|
|
15
|
+
children: React.ReactNode
|
|
16
|
+
}) {
|
|
17
|
+
return (
|
|
18
|
+
<html lang="en">
|
|
19
|
+
<body className={inter.className}>{children}</body>
|
|
20
|
+
</html>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
.main {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
align-items: center;
|
|
6
|
+
padding: 15rem;
|
|
7
|
+
min-height: 100vh;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.description {
|
|
11
|
+
display: inherit;
|
|
12
|
+
justify-content: inherit;
|
|
13
|
+
align-items: inherit;
|
|
14
|
+
font-size: 0.85rem;
|
|
15
|
+
max-width: var(--max-width);
|
|
16
|
+
z-index: 2;
|
|
17
|
+
font-family: var(--font-mono);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.description a {
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: 0.5rem;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.description p {
|
|
28
|
+
position: relative;
|
|
29
|
+
margin: 0;
|
|
30
|
+
padding: 1rem;
|
|
31
|
+
background-color: rgba(var(--callout-rgb), 0.5);
|
|
32
|
+
border: 1px solid rgba(var(--callout-border-rgb), 0.3);
|
|
33
|
+
border-radius: var(--border-radius);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.code {
|
|
37
|
+
font-weight: 700;
|
|
38
|
+
font-family: var(--font-mono);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.center {
|
|
42
|
+
display: flex;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
align-items: center;
|
|
45
|
+
position: relative;
|
|
46
|
+
padding: 4rem 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.center::before {
|
|
50
|
+
background: var(--secondary-glow);
|
|
51
|
+
border-radius: 50%;
|
|
52
|
+
width: 480px;
|
|
53
|
+
height: 360px;
|
|
54
|
+
margin-left: -400px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.center::after {
|
|
58
|
+
background: var(--primary-glow);
|
|
59
|
+
width: 240px;
|
|
60
|
+
height: 180px;
|
|
61
|
+
z-index: -1;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.center::before,
|
|
65
|
+
.center::after {
|
|
66
|
+
content: '';
|
|
67
|
+
left: 50%;
|
|
68
|
+
position: absolute;
|
|
69
|
+
filter: blur(45px);
|
|
70
|
+
transform: translateZ(0);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.logo {
|
|
74
|
+
position: relative;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Mobile */
|
|
78
|
+
@media (max-width: 700px) {
|
|
79
|
+
.content {
|
|
80
|
+
padding: 4rem;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.center {
|
|
84
|
+
padding: 8rem 0 6rem;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.center::before {
|
|
88
|
+
transform: none;
|
|
89
|
+
height: 300px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.description {
|
|
93
|
+
font-size: 0.8rem;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.description a {
|
|
97
|
+
padding: 1rem;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.description p,
|
|
101
|
+
.description div {
|
|
102
|
+
display: flex;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
position: fixed;
|
|
105
|
+
width: 100%;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.description p {
|
|
109
|
+
align-items: center;
|
|
110
|
+
inset: 0 0 auto;
|
|
111
|
+
padding: 2rem 1rem 1.4rem;
|
|
112
|
+
border-radius: 0;
|
|
113
|
+
border: none;
|
|
114
|
+
border-bottom: 1px solid rgba(var(--callout-border-rgb), 0.25);
|
|
115
|
+
background: linear-gradient(
|
|
116
|
+
to bottom,
|
|
117
|
+
rgba(var(--background-start-rgb), 1),
|
|
118
|
+
rgba(var(--callout-rgb), 0.5)
|
|
119
|
+
);
|
|
120
|
+
background-clip: padding-box;
|
|
121
|
+
backdrop-filter: blur(24px);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.description div {
|
|
125
|
+
align-items: flex-end;
|
|
126
|
+
pointer-events: none;
|
|
127
|
+
inset: auto 0 0;
|
|
128
|
+
padding: 2rem;
|
|
129
|
+
height: 200px;
|
|
130
|
+
background: linear-gradient(
|
|
131
|
+
to bottom,
|
|
132
|
+
transparent 0%,
|
|
133
|
+
rgb(var(--background-end-rgb)) 40%
|
|
134
|
+
);
|
|
135
|
+
z-index: 1;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@media (prefers-color-scheme: dark) {
|
|
140
|
+
.logo {
|
|
141
|
+
filter: invert(1) drop-shadow(0 0 0.3rem #ffffff70);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@keyframes rotate {
|
|
146
|
+
from {
|
|
147
|
+
transform: rotate(360deg);
|
|
148
|
+
}
|
|
149
|
+
to {
|
|
150
|
+
transform: rotate(0deg);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.card {
|
|
155
|
+
text-align: center;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.card p {
|
|
159
|
+
padding: 1em;
|
|
160
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import Image from "next/image";
|
|
4
|
+
import styles from "./page.module.css";
|
|
5
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
6
|
+
|
|
7
|
+
export default function Home() {
|
|
8
|
+
const [account, setAccount] = useState(null);
|
|
9
|
+
const [executing, setExecuting] = useState(false);
|
|
10
|
+
|
|
11
|
+
const generateAccount = async () => {
|
|
12
|
+
workerRef.current?.postMessage("key");
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
async function execute() {
|
|
16
|
+
setExecuting(true);
|
|
17
|
+
workerRef.current?.postMessage("execute");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const workerRef = useRef<Worker>();
|
|
21
|
+
|
|
22
|
+
interface AleoWorkerMessageEvent {
|
|
23
|
+
type: string;
|
|
24
|
+
result: any;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
workerRef.current = new Worker(new URL("worker.ts", import.meta.url));
|
|
29
|
+
workerRef.current.onmessage = (
|
|
30
|
+
event: MessageEvent<AleoWorkerMessageEvent>
|
|
31
|
+
) => {
|
|
32
|
+
if (event.data.type === "key") {
|
|
33
|
+
setAccount(event.data.result);
|
|
34
|
+
} else if (event.data.type === "execute") {
|
|
35
|
+
setExecuting(false);
|
|
36
|
+
}
|
|
37
|
+
alert(`WebWorker Response => ${event.data.result}`);
|
|
38
|
+
};
|
|
39
|
+
return () => {
|
|
40
|
+
workerRef.current?.terminate();
|
|
41
|
+
};
|
|
42
|
+
}, []);
|
|
43
|
+
|
|
44
|
+
const handleWork = useCallback(async () => {
|
|
45
|
+
workerRef.current?.postMessage("execute");
|
|
46
|
+
}, []);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<main className={styles.main}>
|
|
50
|
+
<div className={styles.description}>
|
|
51
|
+
<p>
|
|
52
|
+
Get started by editing
|
|
53
|
+
<code className={styles.code}>src/app/page.tsx</code>
|
|
54
|
+
</p>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div className={styles.center}>
|
|
58
|
+
<Image
|
|
59
|
+
className={styles.logo}
|
|
60
|
+
src="/next.svg"
|
|
61
|
+
alt="Next.js Logo"
|
|
62
|
+
width={180}
|
|
63
|
+
height={37}
|
|
64
|
+
priority
|
|
65
|
+
/>
|
|
66
|
+
<Image
|
|
67
|
+
className={styles.logo}
|
|
68
|
+
src="/aleo.svg"
|
|
69
|
+
alt="Next.js Logo"
|
|
70
|
+
width={180}
|
|
71
|
+
height={45}
|
|
72
|
+
priority
|
|
73
|
+
/>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<div className={styles.card}>
|
|
77
|
+
<p>
|
|
78
|
+
<button onClick={generateAccount}>
|
|
79
|
+
{account
|
|
80
|
+
? `Account private key is ${JSON.stringify(account)}`
|
|
81
|
+
: `Click to generate account`}
|
|
82
|
+
</button>
|
|
83
|
+
</p>
|
|
84
|
+
<p>
|
|
85
|
+
<button disabled={executing} onClick={execute}>
|
|
86
|
+
{executing
|
|
87
|
+
? `Executing...check console for details...`
|
|
88
|
+
: `Execute helloworld.aleo`}
|
|
89
|
+
</button>
|
|
90
|
+
</p>
|
|
91
|
+
</div>
|
|
92
|
+
</main>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Account,
|
|
3
|
+
initThreadPool,
|
|
4
|
+
PrivateKey,
|
|
5
|
+
ProgramManager,
|
|
6
|
+
} from "@provablehq/sdk";
|
|
7
|
+
|
|
8
|
+
await initThreadPool();
|
|
9
|
+
|
|
10
|
+
const hello_hello_program =`
|
|
11
|
+
program hello_hello.aleo;
|
|
12
|
+
|
|
13
|
+
function hello:
|
|
14
|
+
input r0 as u32.public;
|
|
15
|
+
input r1 as u32.private;
|
|
16
|
+
add r0 r1 into r2;
|
|
17
|
+
output r2 as u32.private;`
|
|
18
|
+
|
|
19
|
+
async function localProgramExecution(program: string, aleoFunction: string, inputs: string[]) {
|
|
20
|
+
const programManager = new ProgramManager();
|
|
21
|
+
|
|
22
|
+
// Create a temporary account for the execution of the program
|
|
23
|
+
const account = new Account();
|
|
24
|
+
programManager.setAccount(account);
|
|
25
|
+
|
|
26
|
+
const executionResponse = await programManager.run(
|
|
27
|
+
program,
|
|
28
|
+
aleoFunction,
|
|
29
|
+
inputs,
|
|
30
|
+
false,
|
|
31
|
+
);
|
|
32
|
+
return executionResponse.getOutputs();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function getPrivateKey() {
|
|
36
|
+
return new PrivateKey().to_string();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
onmessage = async function (e) {
|
|
40
|
+
if (e.data === "execute") {
|
|
41
|
+
const result = await localProgramExecution(hello_hello_program, "hello", ["5u32", "5u32"]);
|
|
42
|
+
postMessage({type: "execute", result: result});
|
|
43
|
+
} else if (e.data === "key") {
|
|
44
|
+
const result = getPrivateKey();
|
|
45
|
+
postMessage({type: "key", result: result});
|
|
46
|
+
}
|
|
47
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2017",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"module": "esnext",
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"jsx": "preserve",
|
|
15
|
+
"incremental": true,
|
|
16
|
+
"plugins": [
|
|
17
|
+
{
|
|
18
|
+
"name": "next"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"paths": {
|
|
22
|
+
"@/*": ["./src/*"]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
26
|
+
"exclude": ["node_modules"]
|
|
27
|
+
}
|
|
@@ -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,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,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "node-ts-starter",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "rimraf dist/js && rollup --config",
|
|
8
|
+
"start": "npm run build && node dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@provablehq/sdk": "^0.7.0"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"rimraf": "^5.0.1",
|
|
15
|
+
"rollup": "^3.27.2",
|
|
16
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
17
|
+
"typescript": "^5.2.2"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import typescript from "rollup-plugin-typescript2";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
input: {
|
|
5
|
+
index: "./src/index.ts",
|
|
6
|
+
},
|
|
7
|
+
output: {
|
|
8
|
+
dir: `dist`,
|
|
9
|
+
format: "es",
|
|
10
|
+
sourcemap: true,
|
|
11
|
+
},
|
|
12
|
+
external: ['@provablehq/sdk'],
|
|
13
|
+
plugins: [
|
|
14
|
+
typescript({
|
|
15
|
+
tsconfig: "tsconfig.json",
|
|
16
|
+
clean: true,
|
|
17
|
+
}),
|
|
18
|
+
],
|
|
19
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {Account, initThreadPool, ProgramManager, AleoKeyProvider, AleoKeyProviderParams} from "@provablehq/sdk";
|
|
2
|
+
|
|
3
|
+
await initThreadPool();
|
|
4
|
+
|
|
5
|
+
const programName = "hello_hello.aleo"
|
|
6
|
+
|
|
7
|
+
const hello_hello_program =`
|
|
8
|
+
program ${programName};
|
|
9
|
+
|
|
10
|
+
function hello:
|
|
11
|
+
input r0 as u32.public;
|
|
12
|
+
input r1 as u32.private;
|
|
13
|
+
add r0 r1 into r2;
|
|
14
|
+
output r2 as u32.private;`
|
|
15
|
+
|
|
16
|
+
async function localProgramExecution(program, programName, aleoFunction, inputs) {
|
|
17
|
+
const programManager = new ProgramManager();
|
|
18
|
+
|
|
19
|
+
// Create a temporary account for the execution of the program
|
|
20
|
+
const account = new Account();
|
|
21
|
+
programManager.setAccount(account);
|
|
22
|
+
|
|
23
|
+
// Create a key provider in order to re-use the same key for each execution
|
|
24
|
+
const keyProvider = new AleoKeyProvider();
|
|
25
|
+
keyProvider.useCache(true);
|
|
26
|
+
programManager.setKeyProvider(keyProvider);
|
|
27
|
+
|
|
28
|
+
// Pre-synthesize the program keys and then cache them in memory using key provider
|
|
29
|
+
try {
|
|
30
|
+
const keyPair = await programManager.synthesizeKeys(hello_hello_program, aleoFunction, inputs);
|
|
31
|
+
|
|
32
|
+
programManager.keyProvider.cacheKeys(`${programName}:${aleoFunction}`, keyPair);
|
|
33
|
+
|
|
34
|
+
} catch (e) {
|
|
35
|
+
throw new Error(`Failed to synthesize keys: ${e.message}`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Specify parameters for the key provider to use search for program keys. In particular specify the cache key
|
|
39
|
+
// that was used to cache the keys in the previous step.
|
|
40
|
+
const keyProviderParams = new AleoKeyProviderParams({cacheKey: `${programName}:${aleoFunction}`});
|
|
41
|
+
|
|
42
|
+
// Execute once using the key provider params defined above. This will use the cached proving keys and make
|
|
43
|
+
// execution significantly faster.
|
|
44
|
+
let executionResponse = await programManager.run(
|
|
45
|
+
program,
|
|
46
|
+
aleoFunction,
|
|
47
|
+
inputs,
|
|
48
|
+
true,
|
|
49
|
+
undefined,
|
|
50
|
+
keyProviderParams,
|
|
51
|
+
);
|
|
52
|
+
console.log("hello_hello/hello executed - result:", executionResponse.getOutputs());
|
|
53
|
+
|
|
54
|
+
// Verify the execution using the verifying key that was generated earlier.
|
|
55
|
+
if (programManager.verifyExecution(executionResponse)) {
|
|
56
|
+
console.log("hello_hello/hello execution verified!");
|
|
57
|
+
} else {
|
|
58
|
+
throw("Execution failed verification!");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const start = Date.now();
|
|
63
|
+
console.log("Starting execute!");
|
|
64
|
+
await localProgramExecution(hello_hello_program, programName, "hello", ["5u32", "5u32"]);
|
|
65
|
+
console.log("Execute finished!", Date.now() - start);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Basic Options */
|
|
4
|
+
"target": "es2017",
|
|
5
|
+
"module": "esnext",
|
|
6
|
+
|
|
7
|
+
/* Module Resolution Options */
|
|
8
|
+
"moduleResolution": "node",
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
|
|
11
|
+
/* Advanced Options */
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"forceConsistentCasingInFileNames": true
|
|
14
|
+
}
|
|
15
|
+
}
|