create-leo-app 0.9.18 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template-build-and-execute-authorization-ts/package.json +1 -1
- package/template-extension/package.json +2 -1
- package/template-nextjs-ts/node_modules/@types/node/README.md +1 -1
- package/template-nextjs-ts/node_modules/@types/node/package.json +2 -2
- package/template-nextjs-ts/node_modules/@types/node/process.d.ts +0 -19
- package/template-nextjs-ts/node_modules/@types/node/tls.d.ts +0 -4
- package/template-nextjs-ts/package.json +2 -2
- package/template-node/package.json +1 -1
- package/template-node-credits-aleo-functions-ts/package.json +1 -1
- package/template-node-ts/dist/index.js +96 -92
- package/template-node-ts/dist/index.js.map +1 -1
- package/template-node-ts/package.json +1 -1
- package/template-node-ts/src/index.ts +44 -0
- package/template-offline-public-transaction-ts/package.json +1 -1
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/LICENSE +21 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/README.md +15 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/assert/strict.d.ts +111 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/assert.d.ts +1078 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/async_hooks.d.ts +603 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/buffer.buffer.d.ts +472 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/buffer.d.ts +1934 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/child_process.d.ts +1476 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/cluster.d.ts +578 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/console.d.ts +452 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/constants.d.ts +21 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/crypto.d.ts +4545 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/dgram.d.ts +600 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/dns/promises.d.ts +503 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/dns.d.ts +923 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/domain.d.ts +170 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/events.d.ts +976 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/fs/promises.d.ts +1295 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/fs.d.ts +4461 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/globals.d.ts +172 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/globals.typedarray.d.ts +38 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/http.d.ts +2089 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/http2.d.ts +2644 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/https.d.ts +579 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/index.d.ts +97 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/inspector.d.ts +253 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/inspector.generated.d.ts +4052 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/module.d.ts +891 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/net.d.ts +1057 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/os.d.ts +506 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/package.json +145 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/path.d.ts +200 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/perf_hooks.d.ts +968 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/process.d.ts +2070 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/punycode.d.ts +117 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/querystring.d.ts +152 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/readline/promises.d.ts +161 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/readline.d.ts +594 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/repl.d.ts +428 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/sea.d.ts +153 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/sqlite.d.ts +721 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/stream/consumers.d.ts +38 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/stream/promises.d.ts +90 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/stream/web.d.ts +622 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/stream.d.ts +1664 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/test.d.ts +2162 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/timers/promises.d.ts +108 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/timers.d.ts +287 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/tls.d.ts +1315 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/trace_events.d.ts +197 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/ts5.6/index.d.ts +97 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/tty.d.ts +208 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/url.d.ts +984 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/util.d.ts +2606 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/v8.d.ts +920 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/vm.d.ts +1000 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/wasi.d.ts +181 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/web-globals/fetch.d.ts +46 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/web-globals/navigator.d.ts +22 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/worker_threads.d.ts +784 -0
- package/template-react-credits-aleo-functions-ts/node_modules/@types/node/zlib.d.ts +683 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/LICENSE +21 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/README.md +6 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/agent.d.ts +31 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/api.d.ts +43 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/balanced-pool.d.ts +29 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/cache.d.ts +36 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/client.d.ts +108 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/connector.d.ts +34 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/content-type.d.ts +21 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/cookies.d.ts +28 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/dispatcher.d.ts +256 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/errors.d.ts +149 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/eventsource.d.ts +61 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/fetch.d.ts +209 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/file.d.ts +39 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/filereader.d.ts +54 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/formdata.d.ts +108 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/global-origin.d.ts +7 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/handlers.d.ts +15 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/header.d.ts +4 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/index.d.ts +71 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/interceptors.d.ts +17 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/mock-client.d.ts +25 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/package.json +55 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/patch.d.ts +33 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/pool.d.ts +39 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/proxy-agent.d.ts +28 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/readable.d.ts +65 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/retry-handler.d.ts +116 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/util.d.ts +18 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/webidl.d.ts +228 -0
- package/template-react-credits-aleo-functions-ts/node_modules/undici-types/websocket.d.ts +150 -0
- package/template-react-credits-aleo-functions-ts/package.json +2 -2
- package/template-react-leo/package.json +2 -2
- package/template-react-managed-worker/package.json +2 -2
- package/template-react-ts/node_modules/@types/node/README.md +1 -1
- package/template-react-ts/node_modules/@types/node/package.json +2 -2
- package/template-react-ts/node_modules/@types/node/process.d.ts +0 -19
- package/template-react-ts/node_modules/@types/node/tls.d.ts +0 -4
- package/template-react-ts/package.json +2 -2
- package/template-react-ts/src/App.tsx +72 -0
- package/template-react-ts/src/workers/worker.ts +12 -1
- package/template-vanilla/package.json +1 -1
- package/template-react-ts/node_modules/.vite/deps/@scure_base.js +0 -534
- package/template-react-ts/node_modules/.vite/deps/@scure_base.js.map +0 -7
- package/template-react-ts/node_modules/.vite/deps/_metadata.json +0 -67
- package/template-react-ts/node_modules/.vite/deps/chunk-BUSYA2B4.js +0 -8
- package/template-react-ts/node_modules/.vite/deps/chunk-BUSYA2B4.js.map +0 -7
- package/template-react-ts/node_modules/.vite/deps/chunk-CEAIHRR2.js +0 -280
- package/template-react-ts/node_modules/.vite/deps/chunk-CEAIHRR2.js.map +0 -7
- package/template-react-ts/node_modules/.vite/deps/chunk-IWTZO5RK.js +0 -1004
- package/template-react-ts/node_modules/.vite/deps/chunk-IWTZO5RK.js.map +0 -7
- package/template-react-ts/node_modules/.vite/deps/comlink.js +0 -352
- package/template-react-ts/node_modules/.vite/deps/comlink.js.map +0 -7
- package/template-react-ts/node_modules/.vite/deps/core-js_proposals_json-parse-with-source__js.js +0 -1662
- package/template-react-ts/node_modules/.vite/deps/core-js_proposals_json-parse-with-source__js.js.map +0 -7
- package/template-react-ts/node_modules/.vite/deps/package.json +0 -3
- package/template-react-ts/node_modules/.vite/deps/react-dom.js +0 -6
- package/template-react-ts/node_modules/.vite/deps/react-dom.js.map +0 -7
- package/template-react-ts/node_modules/.vite/deps/react-dom_client.js +0 -20217
- package/template-react-ts/node_modules/.vite/deps/react-dom_client.js.map +0 -7
- package/template-react-ts/node_modules/.vite/deps/react.js +0 -5
- package/template-react-ts/node_modules/.vite/deps/react.js.map +0 -7
- package/template-react-ts/node_modules/.vite/deps/react_jsx-dev-runtime.js +0 -278
- package/template-react-ts/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +0 -7
- package/template-react-ts/node_modules/.vite/deps/react_jsx-runtime.js +0 -289
- package/template-react-ts/node_modules/.vite/deps/react_jsx-runtime.js.map +0 -7
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export namespace util {
|
|
2
|
+
/**
|
|
3
|
+
* Retrieves a header name and returns its lowercase value.
|
|
4
|
+
* @param value Header name
|
|
5
|
+
*/
|
|
6
|
+
export function headerNameToString(value: string | Buffer): string;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Receives a header object and returns the parsed value.
|
|
10
|
+
* @param headers Header object
|
|
11
|
+
* @param obj Object to specify a proxy object. Used to assign parsed values.
|
|
12
|
+
* @returns If `obj` is specified, it is equivalent to `obj`.
|
|
13
|
+
*/
|
|
14
|
+
export function parseHeaders(
|
|
15
|
+
headers: (Buffer | string | (Buffer | string)[])[],
|
|
16
|
+
obj?: Record<string, string | string[]>
|
|
17
|
+
): Record<string, string | string[]>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
// These types are not exported, and are only used internally
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Take in an unknown value and return one that is of type T
|
|
5
|
+
*/
|
|
6
|
+
type Converter<T> = (object: unknown) => T
|
|
7
|
+
|
|
8
|
+
type SequenceConverter<T> = (object: unknown, iterable?: IterableIterator<T>) => T[]
|
|
9
|
+
|
|
10
|
+
type RecordConverter<K extends string, V> = (object: unknown) => Record<K, V>
|
|
11
|
+
|
|
12
|
+
interface ConvertToIntOpts {
|
|
13
|
+
clamp?: boolean
|
|
14
|
+
enforceRange?: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface WebidlErrors {
|
|
18
|
+
exception (opts: { header: string, message: string }): TypeError
|
|
19
|
+
/**
|
|
20
|
+
* @description Throw an error when conversion from one type to another has failed
|
|
21
|
+
*/
|
|
22
|
+
conversionFailed (opts: {
|
|
23
|
+
prefix: string
|
|
24
|
+
argument: string
|
|
25
|
+
types: string[]
|
|
26
|
+
}): TypeError
|
|
27
|
+
/**
|
|
28
|
+
* @description Throw an error when an invalid argument is provided
|
|
29
|
+
*/
|
|
30
|
+
invalidArgument (opts: {
|
|
31
|
+
prefix: string
|
|
32
|
+
value: string
|
|
33
|
+
type: string
|
|
34
|
+
}): TypeError
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface WebidlUtil {
|
|
38
|
+
/**
|
|
39
|
+
* @see https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
|
|
40
|
+
*/
|
|
41
|
+
Type (object: unknown):
|
|
42
|
+
| 'Undefined'
|
|
43
|
+
| 'Boolean'
|
|
44
|
+
| 'String'
|
|
45
|
+
| 'Symbol'
|
|
46
|
+
| 'Number'
|
|
47
|
+
| 'BigInt'
|
|
48
|
+
| 'Null'
|
|
49
|
+
| 'Object'
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
|
|
53
|
+
*/
|
|
54
|
+
ConvertToInt (
|
|
55
|
+
V: unknown,
|
|
56
|
+
bitLength: number,
|
|
57
|
+
signedness: 'signed' | 'unsigned',
|
|
58
|
+
opts?: ConvertToIntOpts
|
|
59
|
+
): number
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
|
|
63
|
+
*/
|
|
64
|
+
IntegerPart (N: number): number
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Stringifies {@param V}
|
|
68
|
+
*/
|
|
69
|
+
Stringify (V: any): string
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Mark a value as uncloneable for Node.js.
|
|
73
|
+
* This is only effective in some newer Node.js versions.
|
|
74
|
+
*/
|
|
75
|
+
markAsUncloneable (V: any): void
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
interface WebidlConverters {
|
|
79
|
+
/**
|
|
80
|
+
* @see https://webidl.spec.whatwg.org/#es-DOMString
|
|
81
|
+
*/
|
|
82
|
+
DOMString (V: unknown, prefix: string, argument: string, opts?: {
|
|
83
|
+
legacyNullToEmptyString: boolean
|
|
84
|
+
}): string
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @see https://webidl.spec.whatwg.org/#es-ByteString
|
|
88
|
+
*/
|
|
89
|
+
ByteString (V: unknown, prefix: string, argument: string): string
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @see https://webidl.spec.whatwg.org/#es-USVString
|
|
93
|
+
*/
|
|
94
|
+
USVString (V: unknown): string
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @see https://webidl.spec.whatwg.org/#es-boolean
|
|
98
|
+
*/
|
|
99
|
+
boolean (V: unknown): boolean
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @see https://webidl.spec.whatwg.org/#es-any
|
|
103
|
+
*/
|
|
104
|
+
any <Value>(V: Value): Value
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @see https://webidl.spec.whatwg.org/#es-long-long
|
|
108
|
+
*/
|
|
109
|
+
['long long'] (V: unknown): number
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @see https://webidl.spec.whatwg.org/#es-unsigned-long-long
|
|
113
|
+
*/
|
|
114
|
+
['unsigned long long'] (V: unknown): number
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @see https://webidl.spec.whatwg.org/#es-unsigned-long
|
|
118
|
+
*/
|
|
119
|
+
['unsigned long'] (V: unknown): number
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @see https://webidl.spec.whatwg.org/#es-unsigned-short
|
|
123
|
+
*/
|
|
124
|
+
['unsigned short'] (V: unknown, opts?: ConvertToIntOpts): number
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @see https://webidl.spec.whatwg.org/#idl-ArrayBuffer
|
|
128
|
+
*/
|
|
129
|
+
ArrayBuffer (V: unknown): ArrayBufferLike
|
|
130
|
+
ArrayBuffer (V: unknown, opts: { allowShared: false }): ArrayBuffer
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @see https://webidl.spec.whatwg.org/#es-buffer-source-types
|
|
134
|
+
*/
|
|
135
|
+
TypedArray (
|
|
136
|
+
V: unknown,
|
|
137
|
+
TypedArray: NodeJS.TypedArray | ArrayBufferLike
|
|
138
|
+
): NodeJS.TypedArray | ArrayBufferLike
|
|
139
|
+
TypedArray (
|
|
140
|
+
V: unknown,
|
|
141
|
+
TypedArray: NodeJS.TypedArray | ArrayBufferLike,
|
|
142
|
+
opts?: { allowShared: false }
|
|
143
|
+
): NodeJS.TypedArray | ArrayBuffer
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* @see https://webidl.spec.whatwg.org/#es-buffer-source-types
|
|
147
|
+
*/
|
|
148
|
+
DataView (V: unknown, opts?: { allowShared: boolean }): DataView
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @see https://webidl.spec.whatwg.org/#BufferSource
|
|
152
|
+
*/
|
|
153
|
+
BufferSource (
|
|
154
|
+
V: unknown,
|
|
155
|
+
opts?: { allowShared: boolean }
|
|
156
|
+
): NodeJS.TypedArray | ArrayBufferLike | DataView
|
|
157
|
+
|
|
158
|
+
['sequence<ByteString>']: SequenceConverter<string>
|
|
159
|
+
|
|
160
|
+
['sequence<sequence<ByteString>>']: SequenceConverter<string[]>
|
|
161
|
+
|
|
162
|
+
['record<ByteString, ByteString>']: RecordConverter<string, string>
|
|
163
|
+
|
|
164
|
+
[Key: string]: (...args: any[]) => unknown
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface Webidl {
|
|
168
|
+
errors: WebidlErrors
|
|
169
|
+
util: WebidlUtil
|
|
170
|
+
converters: WebidlConverters
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @description Performs a brand-check on {@param V} to ensure it is a
|
|
174
|
+
* {@param cls} object.
|
|
175
|
+
*/
|
|
176
|
+
brandCheck <Interface>(V: unknown, cls: Interface, opts?: { strict?: boolean }): asserts V is Interface
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @see https://webidl.spec.whatwg.org/#es-sequence
|
|
180
|
+
* @description Convert a value, V, to a WebIDL sequence type.
|
|
181
|
+
*/
|
|
182
|
+
sequenceConverter <Type>(C: Converter<Type>): SequenceConverter<Type>
|
|
183
|
+
|
|
184
|
+
illegalConstructor (): never
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* @see https://webidl.spec.whatwg.org/#es-to-record
|
|
188
|
+
* @description Convert a value, V, to a WebIDL record type.
|
|
189
|
+
*/
|
|
190
|
+
recordConverter <K extends string, V>(
|
|
191
|
+
keyConverter: Converter<K>,
|
|
192
|
+
valueConverter: Converter<V>
|
|
193
|
+
): RecordConverter<K, V>
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Similar to {@link Webidl.brandCheck} but allows skipping the check if third party
|
|
197
|
+
* interfaces are allowed.
|
|
198
|
+
*/
|
|
199
|
+
interfaceConverter <Interface>(cls: Interface): (
|
|
200
|
+
V: unknown,
|
|
201
|
+
opts?: { strict: boolean }
|
|
202
|
+
) => asserts V is typeof cls
|
|
203
|
+
|
|
204
|
+
// TODO(@KhafraDev): a type could likely be implemented that can infer the return type
|
|
205
|
+
// from the converters given?
|
|
206
|
+
/**
|
|
207
|
+
* Converts a value, V, to a WebIDL dictionary types. Allows limiting which keys are
|
|
208
|
+
* allowed, values allowed, optional and required keys. Auto converts the value to
|
|
209
|
+
* a type given a converter.
|
|
210
|
+
*/
|
|
211
|
+
dictionaryConverter (converters: {
|
|
212
|
+
key: string,
|
|
213
|
+
defaultValue?: () => unknown,
|
|
214
|
+
required?: boolean,
|
|
215
|
+
converter: (...args: unknown[]) => unknown,
|
|
216
|
+
allowedValues?: unknown[]
|
|
217
|
+
}[]): (V: unknown) => Record<string, unknown>
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* @see https://webidl.spec.whatwg.org/#idl-nullable-type
|
|
221
|
+
* @description allows a type, V, to be null
|
|
222
|
+
*/
|
|
223
|
+
nullableConverter <T>(
|
|
224
|
+
converter: Converter<T>
|
|
225
|
+
): (V: unknown) => ReturnType<typeof converter> | null
|
|
226
|
+
|
|
227
|
+
argumentLengthCheck (args: { length: number }, min: number, context: string): void
|
|
228
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
|
|
3
|
+
import type { Blob } from 'buffer'
|
|
4
|
+
import type { MessagePort } from 'worker_threads'
|
|
5
|
+
import {
|
|
6
|
+
EventInit,
|
|
7
|
+
EventListenerOptions,
|
|
8
|
+
AddEventListenerOptions,
|
|
9
|
+
EventListenerOrEventListenerObject
|
|
10
|
+
} from './patch'
|
|
11
|
+
import Dispatcher from './dispatcher'
|
|
12
|
+
import { HeadersInit } from './fetch'
|
|
13
|
+
|
|
14
|
+
export type BinaryType = 'blob' | 'arraybuffer'
|
|
15
|
+
|
|
16
|
+
interface WebSocketEventMap {
|
|
17
|
+
close: CloseEvent
|
|
18
|
+
error: ErrorEvent
|
|
19
|
+
message: MessageEvent
|
|
20
|
+
open: Event
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface WebSocket extends EventTarget {
|
|
24
|
+
binaryType: BinaryType
|
|
25
|
+
|
|
26
|
+
readonly bufferedAmount: number
|
|
27
|
+
readonly extensions: string
|
|
28
|
+
|
|
29
|
+
onclose: ((this: WebSocket, ev: WebSocketEventMap['close']) => any) | null
|
|
30
|
+
onerror: ((this: WebSocket, ev: WebSocketEventMap['error']) => any) | null
|
|
31
|
+
onmessage: ((this: WebSocket, ev: WebSocketEventMap['message']) => any) | null
|
|
32
|
+
onopen: ((this: WebSocket, ev: WebSocketEventMap['open']) => any) | null
|
|
33
|
+
|
|
34
|
+
readonly protocol: string
|
|
35
|
+
readonly readyState: number
|
|
36
|
+
readonly url: string
|
|
37
|
+
|
|
38
|
+
close(code?: number, reason?: string): void
|
|
39
|
+
send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void
|
|
40
|
+
|
|
41
|
+
readonly CLOSED: number
|
|
42
|
+
readonly CLOSING: number
|
|
43
|
+
readonly CONNECTING: number
|
|
44
|
+
readonly OPEN: number
|
|
45
|
+
|
|
46
|
+
addEventListener<K extends keyof WebSocketEventMap>(
|
|
47
|
+
type: K,
|
|
48
|
+
listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any,
|
|
49
|
+
options?: boolean | AddEventListenerOptions
|
|
50
|
+
): void
|
|
51
|
+
addEventListener(
|
|
52
|
+
type: string,
|
|
53
|
+
listener: EventListenerOrEventListenerObject,
|
|
54
|
+
options?: boolean | AddEventListenerOptions
|
|
55
|
+
): void
|
|
56
|
+
removeEventListener<K extends keyof WebSocketEventMap>(
|
|
57
|
+
type: K,
|
|
58
|
+
listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any,
|
|
59
|
+
options?: boolean | EventListenerOptions
|
|
60
|
+
): void
|
|
61
|
+
removeEventListener(
|
|
62
|
+
type: string,
|
|
63
|
+
listener: EventListenerOrEventListenerObject,
|
|
64
|
+
options?: boolean | EventListenerOptions
|
|
65
|
+
): void
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export declare const WebSocket: {
|
|
69
|
+
prototype: WebSocket
|
|
70
|
+
new (url: string | URL, protocols?: string | string[] | WebSocketInit): WebSocket
|
|
71
|
+
readonly CLOSED: number
|
|
72
|
+
readonly CLOSING: number
|
|
73
|
+
readonly CONNECTING: number
|
|
74
|
+
readonly OPEN: number
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface CloseEventInit extends EventInit {
|
|
78
|
+
code?: number
|
|
79
|
+
reason?: string
|
|
80
|
+
wasClean?: boolean
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
interface CloseEvent extends Event {
|
|
84
|
+
readonly code: number
|
|
85
|
+
readonly reason: string
|
|
86
|
+
readonly wasClean: boolean
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export declare const CloseEvent: {
|
|
90
|
+
prototype: CloseEvent
|
|
91
|
+
new (type: string, eventInitDict?: CloseEventInit): CloseEvent
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface MessageEventInit<T = any> extends EventInit {
|
|
95
|
+
data?: T
|
|
96
|
+
lastEventId?: string
|
|
97
|
+
origin?: string
|
|
98
|
+
ports?: (typeof MessagePort)[]
|
|
99
|
+
source?: typeof MessagePort | null
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
interface MessageEvent<T = any> extends Event {
|
|
103
|
+
readonly data: T
|
|
104
|
+
readonly lastEventId: string
|
|
105
|
+
readonly origin: string
|
|
106
|
+
readonly ports: ReadonlyArray<typeof MessagePort>
|
|
107
|
+
readonly source: typeof MessagePort | null
|
|
108
|
+
initMessageEvent(
|
|
109
|
+
type: string,
|
|
110
|
+
bubbles?: boolean,
|
|
111
|
+
cancelable?: boolean,
|
|
112
|
+
data?: any,
|
|
113
|
+
origin?: string,
|
|
114
|
+
lastEventId?: string,
|
|
115
|
+
source?: typeof MessagePort | null,
|
|
116
|
+
ports?: (typeof MessagePort)[]
|
|
117
|
+
): void;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export declare const MessageEvent: {
|
|
121
|
+
prototype: MessageEvent
|
|
122
|
+
new<T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent<T>
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
interface ErrorEventInit extends EventInit {
|
|
126
|
+
message?: string
|
|
127
|
+
filename?: string
|
|
128
|
+
lineno?: number
|
|
129
|
+
colno?: number
|
|
130
|
+
error?: any
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
interface ErrorEvent extends Event {
|
|
134
|
+
readonly message: string
|
|
135
|
+
readonly filename: string
|
|
136
|
+
readonly lineno: number
|
|
137
|
+
readonly colno: number
|
|
138
|
+
readonly error: any
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export declare const ErrorEvent: {
|
|
142
|
+
prototype: ErrorEvent
|
|
143
|
+
new (type: string, eventInitDict?: ErrorEventInit): ErrorEvent
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
interface WebSocketInit {
|
|
147
|
+
protocols?: string | string[],
|
|
148
|
+
dispatcher?: Dispatcher,
|
|
149
|
+
headers?: HeadersInit
|
|
150
|
+
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"preview": "vite preview"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@provablehq/sdk": "^0.
|
|
14
|
+
"@provablehq/sdk": "^0.10.0",
|
|
15
15
|
"comlink": "^4.4.2",
|
|
16
16
|
"react": "^19.0.0",
|
|
17
17
|
"react-dom": "^19.0.0"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"ts-node": "^10.9.2",
|
|
42
42
|
"typescript": "^5.7.3",
|
|
43
43
|
"vite": "^6.3.6",
|
|
44
|
-
"webpack": "^5.
|
|
44
|
+
"webpack": "^5.104.1",
|
|
45
45
|
"webpack-cli": "^6.0.1",
|
|
46
46
|
"webpack-dev-server": "^5.2.0"
|
|
47
47
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"install-leo": "./install.sh"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@provablehq/sdk": "^0.
|
|
15
|
+
"@provablehq/sdk": "^0.10.0",
|
|
16
16
|
"comlink": "^4.4.2",
|
|
17
17
|
"react": "^19.0.0",
|
|
18
18
|
"react-dom": "^19.0.0"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"style-loader": "^4.0.0",
|
|
38
38
|
"svg-url-loader": "^8.0.0",
|
|
39
39
|
"vite": "^6.3.6",
|
|
40
|
-
"webpack": "^5.
|
|
40
|
+
"webpack": "^5.104.1",
|
|
41
41
|
"webpack-cli": "^6.0.1",
|
|
42
42
|
"webpack-dev-server": "^5.2.0"
|
|
43
43
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"preview": "vite preview"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@provablehq/sdk": "^0.
|
|
14
|
+
"@provablehq/sdk": "^0.10.0",
|
|
15
15
|
"react": "^19.0.0",
|
|
16
16
|
"react-dom": "^19.0.0"
|
|
17
17
|
},
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"style-loader": "^4.0.0",
|
|
35
35
|
"svg-url-loader": "^8.0.0",
|
|
36
36
|
"vite": "^6.3.6",
|
|
37
|
-
"webpack": "^5.
|
|
37
|
+
"webpack": "^5.104.1",
|
|
38
38
|
"webpack-cli": "^6.0.1",
|
|
39
39
|
"webpack-dev-server": "^5.2.0"
|
|
40
40
|
}
|
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v22.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Mon, 08 Dec 2025 22:36:14 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "22.19.
|
|
3
|
+
"version": "22.19.2",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -140,6 +140,6 @@
|
|
|
140
140
|
"undici-types": "~6.21.0"
|
|
141
141
|
},
|
|
142
142
|
"peerDependencies": {},
|
|
143
|
-
"typesPublisherContentHash": "
|
|
143
|
+
"typesPublisherContentHash": "cb67dd83f6f69ba1e456c156512686df21fb7978863408330225329e663f5c7e",
|
|
144
144
|
"typeScriptVersion": "5.2"
|
|
145
145
|
}
|
|
@@ -474,11 +474,6 @@ declare module "process" {
|
|
|
474
474
|
* @default false
|
|
475
475
|
*/
|
|
476
476
|
reportOnUncaughtException: boolean;
|
|
477
|
-
/**
|
|
478
|
-
* If true, a diagnostic report is generated without the environment variables.
|
|
479
|
-
* @default false
|
|
480
|
-
*/
|
|
481
|
-
excludeEnv: boolean;
|
|
482
477
|
/**
|
|
483
478
|
* The signal used to trigger the creation of a diagnostic report.
|
|
484
479
|
* @default 'SIGUSR2'
|
|
@@ -1710,11 +1705,6 @@ declare module "process" {
|
|
|
1710
1705
|
* @param args Additional arguments to pass when invoking the `callback`
|
|
1711
1706
|
*/
|
|
1712
1707
|
nextTick(callback: Function, ...args: any[]): void;
|
|
1713
|
-
/**
|
|
1714
|
-
* The process.noDeprecation property indicates whether the --no-deprecation flag is set on the current Node.js process.
|
|
1715
|
-
* See the documentation for the ['warning' event](https://nodejs.org/docs/latest/api/process.html#event-warning) and the [emitWarning()](https://nodejs.org/docs/latest/api/process.html#processemitwarningwarning-type-code-ctor) method for more information about this flag's behavior.
|
|
1716
|
-
*/
|
|
1717
|
-
noDeprecation?: boolean;
|
|
1718
1708
|
/**
|
|
1719
1709
|
* This API is available through the [--permission](https://nodejs.org/api/cli.html#--permission) flag.
|
|
1720
1710
|
*
|
|
@@ -1791,15 +1781,6 @@ declare module "process" {
|
|
|
1791
1781
|
options?: MessageOptions,
|
|
1792
1782
|
callback?: (error: Error | null) => void,
|
|
1793
1783
|
): boolean;
|
|
1794
|
-
send?(
|
|
1795
|
-
message: any,
|
|
1796
|
-
sendHandle: SendHandle,
|
|
1797
|
-
callback?: (error: Error | null) => void,
|
|
1798
|
-
): boolean;
|
|
1799
|
-
send?(
|
|
1800
|
-
message: any,
|
|
1801
|
-
callback: (error: Error | null) => void,
|
|
1802
|
-
): boolean;
|
|
1803
1784
|
/**
|
|
1804
1785
|
* If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the
|
|
1805
1786
|
* IPC channel to the parent process, allowing the child process to exit gracefully
|
|
@@ -245,10 +245,6 @@ declare module "tls" {
|
|
|
245
245
|
* When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false.
|
|
246
246
|
*/
|
|
247
247
|
alpnProtocol: string | false | null;
|
|
248
|
-
/**
|
|
249
|
-
* String containing the server name requested via SNI (Server Name Indication) TLS extension.
|
|
250
|
-
*/
|
|
251
|
-
servername: string | false | null;
|
|
252
248
|
/**
|
|
253
249
|
* Returns an object representing the local certificate. The returned object has
|
|
254
250
|
* some properties corresponding to the fields of the certificate.
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"install-leo": "./install.sh"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@provablehq/sdk": "^0.
|
|
15
|
+
"@provablehq/sdk": "^0.10.0",
|
|
16
16
|
"comlink": "^4.4.2",
|
|
17
17
|
"react": "^19.0.0",
|
|
18
18
|
"react-dom": "^19.0.0"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"ts-node": "^10.9.2",
|
|
43
43
|
"typescript": "^5.7.3",
|
|
44
44
|
"vite": "^6.3.6",
|
|
45
|
-
"webpack": "^5.
|
|
45
|
+
"webpack": "^5.104.1",
|
|
46
46
|
"webpack-cli": "^6.0.1",
|
|
47
47
|
"webpack-dev-server": "^5.2.0"
|
|
48
48
|
}
|
|
@@ -5,12 +5,21 @@ import "./App.css";
|
|
|
5
5
|
import helloworld_program from "../helloworld/build/main.aleo?raw";
|
|
6
6
|
import { AleoWorker } from "./workers/AleoWorker";
|
|
7
7
|
|
|
8
|
+
// Sample SNARK proof fixtures from a simple test circuit with 2 public inputs, both equal to 1field.
|
|
9
|
+
const SAMPLE_VERIFYING_KEY = "verifier1qypqqqqqqqqqqqyxqqqqqqqqqqqyzqqqqqqqqqqqgyqqqqqqqqqqqsgqqqqqqqqqqpqsqqqqqqqqqqqvqqqqqqqqqqqgh4c0dzjasutflzxx36ckaea0zr5xqu0ydpaascrhacjlftlvnt99yg003w45g0mj4qepazsl5w5qfl5dm9y3sfq87376ynfyync09xyaz05ggfh79lkpx6yzunrz06zdwsu4klsj9z3933wpeggqj2msqs5xeul99lvzyd98mfmqm34nud4z7qjkxk708d9mvgqqw9hwkes726yl5nla6mr7s56p2a2c36csqpl0qe39wd8rswunurla70pqes7fay5kzh7jv5l5plpc82yu5p8thnxavejw3kwxz038sdmf34n9uqt77pnz2u6w8qae8c8lmu7zpnpun6ffv90ayeflgr7rsw5fegzwh0xd6enyarvuvylz0qmknrtxtcqhaurxy4e5uwpmj0s0lheuyrxre85jjc2l6fjn7s8u8qagnjsyaw7vm4nxf6xeccf7y7phdxxkvhspj4chhza3rsj4v66lfc00u27y9g2mlg7ttgdx8m9d09lns7lcjqmcs9lraqk9wac52hwc0th9g3qsrrsk2xszjn0qyuwcas5g76c4l8u8zycc5n4uslf6kajp0c4aq6ea7d8u3rvxkql5l8njthv82ygpsqmd034693yathl585th5rh29c0yf29l7yk4nry7daf3ndm7lhv8nvy546sa0uysqcvdy5tlxzqq3q8swlatmy33h6zn7ychqcnjjvfc8a4q0szr70k9l2qa8my76c0ud5e5t5yksd78ytlhey426p2xdxq2vfrtuhduyjjh5wgwn35fxz2rvhgaysyhgph4at920ykfrjqph8gjp47vl77zlzqhnwljkxnz6guqmh8xy62966f0sw505l07m64r2qvxd9ggzng7naawtsran2yj77fts7e7mccf25svwdhzt998ee7cruwc6gx9krqpj4ll7x5jw0l3sw8kwjfgck0an2dwcp4dz9yfq272svqqqqqqqqqqqhzxq3v";
|
|
10
|
+
const SAMPLE_PROOF = "proof1qyqsqqqqqqqqqqqpqqqqqqqqqqqg4v4ffaewfrdfyl442hd2jryku27u9cajphqaqa5keztfzy75mxctwth0w9599r2ra0awu9jfmj5qq9n6ufwrq0r68g2wcse7avhuy2t37mp35s39wtl0z9f53qhatkl4gqpyzheggtkj2gxzl45jwjtx8qtsx5wh09f286p866gzc6x292u773zhtgzvxucw5jv397ngkh5wcwtjzwy8qsxhtywz5egx5hzg6wqyayt8ernlmgdy7d6ytmxyx3azdvy6qsjfcqjdmvr3ycaqmzaz20umm3zu4jzunjkwfsm3ry9nu7vqfypg567n33m3226l797v7pqltuw8yl8xwh5jrkgpgjvl8uqp2fttyvs7k0ye5eeeswnl0506aw0qrnxpc687002ukjxdd222ffw6lk8gleuf0tvq4lxkskmhrlqaj95zvp2w9aeza4sdt7hdecy29er3s84skdxq5uf0m767ecpa60tm0krx4vdp2umvdy6aaddy7xxpvtwmwfan8z23yud27z8pan8msgr3zq2s2qnfnqhg8cltzl7v9fewna69kavvy570l62k55x2wayjvvhha2uk6vje5zsgvqw67cskce4dxcqtrdpvkkl3n7yt2v4pwexhw8ftgnv0kkvumgha2cfyn84yp7v2ztysawmt65y2z28auutxlh05nvcqlhaj2a3wd3gqw6tc02z0s67v4x5kh3st28v30nf9cv9k6g5jnc89z4hmu32nnnm9j625q75nfcr99hjpqu50rhqpu57lqnjdwhfu2pvstze2c0qj0a2d4zkcg88ep79eyqe7e399hx86e6p4qswjk32dpg45r7jtzhse8szcaxu7md99u7luj2afl07jzp5zqut05a85qg5qkd8syclvv5sqf4xtfqca4c9r6ffptmv2l587qx8knn7qpukt4hqqpkw27z7tf0xk9z7esermt8hmr2auefw3c0drel890ep6rujt3uff504q744z5s9v2krxkvh3vqjjr48dnuzx5vzpymcz0sdvvt7v7p5pymj82a5p33fd4xup79muz3zvn8tq09mlfujr2nyv99ad80u4qvutsca8g63aw7dsq0hvql3c07l0lxl39lwr8gqwqpvfx85tjpyq3wgn3c7az3xvnj22h2c4qq356zgxjwl69wn4jx4srjsczanm9sqdqvqqqqqqqqqqq2ku9a56rnzvm4zchvwea5dt9qnwjl789zar0dvjmze3aft5d567q2ntdw85p6ep925xx3hymjgwqyqtnxjhxr50cp8tqvpwlexzyajld9z2gu3zzy6cvllnh2kmzr4ctdz78wyprdvxyf2aqs8apz866aspq9qdtd535z8uqaacz6d9v7jahs87gav0388kg0ctdup7h93pphqs27m5jud96f2pnwclyhvk3lv9pgl57l7mqzgljm9qc2kdy39j8eyhq8guca5ytphd7cnjl9u8nurcqqqqw7lyxe";
|
|
11
|
+
const SAMPLE_INPUTS = "1field, 1field";
|
|
12
|
+
|
|
8
13
|
const aleoWorker = AleoWorker();
|
|
9
14
|
function App() {
|
|
10
15
|
const [count, setCount] = useState(0);
|
|
11
16
|
const [account, setAccount] = useState(null);
|
|
12
17
|
const [executing, setExecuting] = useState(false);
|
|
13
18
|
const [deploying, setDeploying] = useState(false);
|
|
19
|
+
const [verifying, setVerifying] = useState(false);
|
|
20
|
+
const [verifyingKeyInput, setVerifyingKeyInput] = useState(SAMPLE_VERIFYING_KEY);
|
|
21
|
+
const [proofInput, setProofInput] = useState(SAMPLE_PROOF);
|
|
22
|
+
const [inputsInput, setInputsInput] = useState(SAMPLE_INPUTS);
|
|
14
23
|
|
|
15
24
|
const generateAccount = async () => {
|
|
16
25
|
const key = await aleoWorker.getPrivateKey();
|
|
@@ -29,6 +38,33 @@ function App() {
|
|
|
29
38
|
alert(JSON.stringify(result));
|
|
30
39
|
}
|
|
31
40
|
|
|
41
|
+
async function verifyProof() {
|
|
42
|
+
setVerifying(true);
|
|
43
|
+
try {
|
|
44
|
+
// Split on commas, but respect brace-delimited structs (e.g. "{ x: 1u8, y: 2u8 }")
|
|
45
|
+
const inputs: string[] = [];
|
|
46
|
+
let depth = 0;
|
|
47
|
+
let current = "";
|
|
48
|
+
for (const ch of inputsInput) {
|
|
49
|
+
if (ch === "{") depth++;
|
|
50
|
+
else if (ch === "}") depth--;
|
|
51
|
+
if (ch === "," && depth === 0) {
|
|
52
|
+
if (current.trim()) inputs.push(current.trim());
|
|
53
|
+
current = "";
|
|
54
|
+
} else {
|
|
55
|
+
current += ch;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (current.trim()) inputs.push(current.trim());
|
|
59
|
+
const result = await aleoWorker.verifyProof(verifyingKeyInput, proofInput, inputs);
|
|
60
|
+
alert(`Proof verification result: ${result}`);
|
|
61
|
+
} catch (e) {
|
|
62
|
+
console.log(e);
|
|
63
|
+
alert("Error with proof verification, please check console for details");
|
|
64
|
+
}
|
|
65
|
+
setVerifying(false);
|
|
66
|
+
}
|
|
67
|
+
|
|
32
68
|
async function deploy() {
|
|
33
69
|
setDeploying(true);
|
|
34
70
|
try {
|
|
@@ -72,6 +108,42 @@ function App() {
|
|
|
72
108
|
: `Execute helloworld.aleo`}
|
|
73
109
|
</button>
|
|
74
110
|
</p>
|
|
111
|
+
<p>
|
|
112
|
+
<label>Verifying Key</label>
|
|
113
|
+
<textarea
|
|
114
|
+
placeholder="Verifying Key (verifier1...)"
|
|
115
|
+
value={verifyingKeyInput}
|
|
116
|
+
onChange={(e) => setVerifyingKeyInput(e.target.value)}
|
|
117
|
+
rows={3}
|
|
118
|
+
style={{ width: "100%", fontFamily: "monospace", fontSize: "0.8em" }}
|
|
119
|
+
/>
|
|
120
|
+
</p>
|
|
121
|
+
<p>
|
|
122
|
+
<label>Proof</label>
|
|
123
|
+
<textarea
|
|
124
|
+
placeholder="Proof (proof1...)"
|
|
125
|
+
value={proofInput}
|
|
126
|
+
onChange={(e) => setProofInput(e.target.value)}
|
|
127
|
+
rows={3}
|
|
128
|
+
style={{ width: "100%", fontFamily: "monospace", fontSize: "0.8em" }}
|
|
129
|
+
/>
|
|
130
|
+
</p>
|
|
131
|
+
<p>
|
|
132
|
+
<label>Public Inputs (comma-separated)</label>
|
|
133
|
+
<input
|
|
134
|
+
placeholder="e.g. 1field, 2field"
|
|
135
|
+
value={inputsInput}
|
|
136
|
+
onChange={(e) => setInputsInput(e.target.value)}
|
|
137
|
+
style={{ width: "100%", fontFamily: "monospace", fontSize: "0.8em" }}
|
|
138
|
+
/>
|
|
139
|
+
</p>
|
|
140
|
+
<p>
|
|
141
|
+
<button disabled={verifying} onClick={verifyProof}>
|
|
142
|
+
{verifying
|
|
143
|
+
? `Verifying proof...`
|
|
144
|
+
: `Verify SNARK proof`}
|
|
145
|
+
</button>
|
|
146
|
+
</p>
|
|
75
147
|
<p>
|
|
76
148
|
Edit <code>src/App.tsx</code> and save to test HMR
|
|
77
149
|
</p>
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
AleoKeyProvider,
|
|
8
8
|
AleoNetworkClient,
|
|
9
9
|
NetworkRecordProvider,
|
|
10
|
+
verifyProof,
|
|
10
11
|
} from "@provablehq/sdk";
|
|
11
12
|
import { expose, proxy } from "comlink";
|
|
12
13
|
|
|
@@ -69,5 +70,15 @@ async function deployProgram(program) {
|
|
|
69
70
|
return tx_id;
|
|
70
71
|
}
|
|
71
72
|
|
|
72
|
-
|
|
73
|
+
// Verify a standalone SNARK proof. This verifies a proof from a circuit that is not necessarily
|
|
74
|
+
// an Aleo program execution — useful for verifying proofs received from external sources.
|
|
75
|
+
async function verifySnarkProof(verifyingKeyStr, proofStr, inputs) {
|
|
76
|
+
return verifyProof({
|
|
77
|
+
verifyingKey: verifyingKeyStr,
|
|
78
|
+
inputs,
|
|
79
|
+
proof: proofStr,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const workerMethods = { localProgramExecution, getPrivateKey, deployProgram, verifyProof: verifySnarkProof };
|
|
73
84
|
expose(workerMethods);
|