create-leo-app 0.11.0 → 0.11.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-leo-app",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "type": "module",
5
5
  "license": "GPL-3.0",
6
6
  "collaborators": [
@@ -8,7 +8,7 @@
8
8
  "dev": "npm run build && node dist/index.js"
9
9
  },
10
10
  "dependencies": {
11
- "@provablehq/sdk": "^0.11.0"
11
+ "@provablehq/sdk": "^0.11.1"
12
12
  },
13
13
  "devDependencies": {
14
14
  "rimraf": "^6.0.1",
@@ -7,7 +7,7 @@
7
7
  "build": "rimraf static/js && rollup --config"
8
8
  },
9
9
  "devDependencies": {
10
- "@provablehq/sdk": "^0.11.0",
10
+ "@provablehq/sdk": "^0.11.1",
11
11
  "@rollup/plugin-node-resolve": "^16.0.0",
12
12
  "@web/rollup-plugin-import-meta-assets": "^2.2.1",
13
13
  "rimraf": "^6.0.1",
@@ -9,7 +9,7 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "@provablehq/sdk": "^0.11.0",
12
+ "@provablehq/sdk": "^0.11.1",
13
13
  "next": "15.5.18",
14
14
  "react": "^19.0.0",
15
15
  "react-dom": "^19.0.0",
@@ -7,6 +7,6 @@
7
7
  "start": "node index.js"
8
8
  },
9
9
  "dependencies": {
10
- "@provablehq/sdk": "^0.11.0"
10
+ "@provablehq/sdk": "^0.11.1"
11
11
  }
12
12
  }
@@ -8,7 +8,7 @@
8
8
  "start": "npm run build && node dist/index.js"
9
9
  },
10
10
  "dependencies": {
11
- "@provablehq/sdk": "^0.11.0"
11
+ "@provablehq/sdk": "^0.11.1"
12
12
  },
13
13
  "devDependencies": {
14
14
  "rimraf": "^6.0.1",
@@ -10,7 +10,7 @@
10
10
  "test": "npm run build && node dist/index.js && node dist/dynamic-dispatch.js"
11
11
  },
12
12
  "dependencies": {
13
- "@provablehq/sdk": "^0.11.0"
13
+ "@provablehq/sdk": "^0.11.1"
14
14
  },
15
15
  "devDependencies": {
16
16
  "rimraf": "^6.0.1",
@@ -8,7 +8,7 @@
8
8
  "dev": "npm run build && node --trace-uncaught dist/index.js"
9
9
  },
10
10
  "dependencies": {
11
- "@provablehq/sdk": "^0.11.0"
11
+ "@provablehq/sdk": "^0.11.1"
12
12
  },
13
13
  "devDependencies": {
14
14
  "rimraf": "^6.0.1",
@@ -11,7 +11,7 @@
11
11
  "preview": "vite preview"
12
12
  },
13
13
  "dependencies": {
14
- "@provablehq/sdk": "^0.11.0",
14
+ "@provablehq/sdk": "^0.11.1",
15
15
  "comlink": "^4.4.2",
16
16
  "react": "^19.0.0",
17
17
  "react-dom": "^19.0.0"
@@ -12,7 +12,7 @@
12
12
  "install-leo": "./install.sh"
13
13
  },
14
14
  "dependencies": {
15
- "@provablehq/sdk": "^0.11.0",
15
+ "@provablehq/sdk": "^0.11.1",
16
16
  "comlink": "^4.4.2",
17
17
  "react": "^19.0.0",
18
18
  "react-dom": "^19.0.0"
@@ -12,7 +12,7 @@
12
12
  "install-leo": "./install.sh"
13
13
  },
14
14
  "dependencies": {
15
- "@provablehq/sdk": "^0.11.0",
15
+ "@provablehq/sdk": "^0.11.1",
16
16
  "comlink": "^4.4.2",
17
17
  "react": "^19.0.0",
18
18
  "react-dom": "^19.0.0"
@@ -9,7 +9,7 @@
9
9
  "preview": "vite preview"
10
10
  },
11
11
  "devDependencies": {
12
- "@provablehq/sdk": "^0.11.0",
12
+ "@provablehq/sdk": "^0.11.1",
13
13
  "tslib": "^2.8.1",
14
14
  "vite": "^6.4.2"
15
15
  }
@@ -1,117 +0,0 @@
1
- import { initThreadPool, ProgramManager, Account, AleoKeyProvider, VerifyingKey, Proof } from '@provablehq/sdk/testnet.js';
2
-
3
- // Initialize the thread pool in order to prove faster.
4
- await initThreadPool();
5
- // Sample SNARK proof fixtures from a simple test circuit with 2 public inputs, both equal to 1field.
6
- // These are used to demonstrate standalone proof verification with snarkVerify/snarkVerifyBatch.
7
- const SAMPLE_VERIFYING_KEY = "verifier1qypqqqqqqqqqqqyxqqqqqqqqqqqyzqqqqqqqqqqqgyqqqqqqqqqqqsgqqqqqqqqqqpqsqqqqqqqqqqqvqqqqqqqqqqqgh4c0dzjasutflzxx36ckaea0zr5xqu0ydpaascrhacjlftlvnt99yg003w45g0mj4qepazsl5w5qfl5dm9y3sfq87376ynfyync09xyaz05ggfh79lkpx6yzunrz06zdwsu4klsj9z3933wpeggqj2msqs5xeul99lvzyd98mfmqm34nud4z7qjkxk708d9mvgqqw9hwkes726yl5nla6mr7s56p2a2c36csqpl0qe39wd8rswunurla70pqes7fay5kzh7jv5l5plpc82yu5p8thnxavejw3kwxz038sdmf34n9uqt77pnz2u6w8qae8c8lmu7zpnpun6ffv90ayeflgr7rsw5fegzwh0xd6enyarvuvylz0qmknrtxtcqhaurxy4e5uwpmj0s0lheuyrxre85jjc2l6fjn7s8u8qagnjsyaw7vm4nxf6xeccf7y7phdxxkvhspj4chhza3rsj4v66lfc00u27y9g2mlg7ttgdx8m9d09lns7lcjqmcs9lraqk9wac52hwc0th9g3qsrrsk2xszjn0qyuwcas5g76c4l8u8zycc5n4uslf6kajp0c4aq6ea7d8u3rvxkql5l8njthv82ygpsqmd034693yathl585th5rh29c0yf29l7yk4nry7daf3ndm7lhv8nvy546sa0uysqcvdy5tlxzqq3q8swlatmy33h6zn7ychqcnjjvfc8a4q0szr70k9l2qa8my76c0ud5e5t5yksd78ytlhey426p2xdxq2vfrtuhduyjjh5wgwn35fxz2rvhgaysyhgph4at920ykfrjqph8gjp47vl77zlzqhnwljkxnz6guqmh8xy62966f0sw505l07m64r2qvxd9ggzng7naawtsran2yj77fts7e7mccf25svwdhzt998ee7cruwc6gx9krqpj4ll7x5jw0l3sw8kwjfgck0an2dwcp4dz9yfq272svqqqqqqqqqqqhzxq3v";
8
- const SAMPLE_PROOF = "proof1qyqsqqqqqqqqqqqpqqqqqqqqqqqg4v4ffaewfrdfyl442hd2jryku27u9cajphqaqa5keztfzy75mxctwth0w9599r2ra0awu9jfmj5qq9n6ufwrq0r68g2wcse7avhuy2t37mp35s39wtl0z9f53qhatkl4gqpyzheggtkj2gxzl45jwjtx8qtsx5wh09f286p866gzc6x292u773zhtgzvxucw5jv397ngkh5wcwtjzwy8qsxhtywz5egx5hzg6wqyayt8ernlmgdy7d6ytmxyx3azdvy6qsjfcqjdmvr3ycaqmzaz20umm3zu4jzunjkwfsm3ry9nu7vqfypg567n33m3226l797v7pqltuw8yl8xwh5jrkgpgjvl8uqp2fttyvs7k0ye5eeeswnl0506aw0qrnxpc687002ukjxdd222ffw6lk8gleuf0tvq4lxkskmhrlqaj95zvp2w9aeza4sdt7hdecy29er3s84skdxq5uf0m767ecpa60tm0krx4vdp2umvdy6aaddy7xxpvtwmwfan8z23yud27z8pan8msgr3zq2s2qnfnqhg8cltzl7v9fewna69kavvy570l62k55x2wayjvvhha2uk6vje5zsgvqw67cskce4dxcqtrdpvkkl3n7yt2v4pwexhw8ftgnv0kkvumgha2cfyn84yp7v2ztysawmt65y2z28auutxlh05nvcqlhaj2a3wd3gqw6tc02z0s67v4x5kh3st28v30nf9cv9k6g5jnc89z4hmu32nnnm9j625q75nfcr99hjpqu50rhqpu57lqnjdwhfu2pvstze2c0qj0a2d4zkcg88ep79eyqe7e399hx86e6p4qswjk32dpg45r7jtzhse8szcaxu7md99u7luj2afl07jzp5zqut05a85qg5qkd8syclvv5sqf4xtfqca4c9r6ffptmv2l587qx8knn7qpukt4hqqpkw27z7tf0xk9z7esermt8hmr2auefw3c0drel890ep6rujt3uff504q744z5s9v2krxkvh3vqjjr48dnuzx5vzpymcz0sdvvt7v7p5pymj82a5p33fd4xup79muz3zvn8tq09mlfujr2nyv99ad80u4qvutsca8g63aw7dsq0hvql3c07l0lxl39lwr8gqwqpvfx85tjpyq3wgn3c7az3xvnj22h2c4qq356zgxjwl69wn4jx4srjsczanm9sqdqvqqqqqqqqqqq2ku9a56rnzvm4zchvwea5dt9qnwjl789zar0dvjmze3aft5d567q2ntdw85p6ep925xx3hymjgwqyqtnxjhxr50cp8tqvpwlexzyajld9z2gu3zzy6cvllnh2kmzr4ctdz78wyprdvxyf2aqs8apz866aspq9qdtd535z8uqaacz6d9v7jahs87gav0388kg0ctdup7h93pphqs27m5jud96f2pnwclyhvk3lv9pgl57l7mqzgljm9qc2kdy39j8eyhq8guca5ytphd7cnjl9u8nurcqqqqw7lyxe";
9
- const SAMPLE_INPUTS = ["1field", "1field"];
10
- const programManager = new ProgramManager();
11
- // Create a temporary account for the execution of the program
12
- const account = new Account();
13
- programManager.setAccount(account);
14
- // Create a key provider in order to re-use the same key for each execution
15
- const keyProvider = new AleoKeyProvider();
16
- keyProvider.useCache(true);
17
- programManager.setKeyProvider(keyProvider);
18
- // Demonstrate standalone SNARK proof verification. This verifies a proof from a circuit that is
19
- // not necessarily an Aleo program execution. Useful for verifying proofs received from external
20
- // sources (e.g. another party proved a computation and you want to verify it).
21
- function snarkProofVerification() {
22
- // Parse the verifying key and proof from their string representations.
23
- const verifyingKey = VerifyingKey.fromString(SAMPLE_VERIFYING_KEY);
24
- const proof = Proof.fromString(SAMPLE_PROOF);
25
- // Verify the proof with the correct public inputs.
26
- const isValid = verifyingKey.verify(SAMPLE_INPUTS, proof);
27
- console.log(` VerifyingKey.verify with valid inputs: ${isValid}`); // true
28
- // Verify the proof with wrong inputs — this should return false.
29
- const isInvalid = verifyingKey.verify(["1field", "2field"], proof);
30
- console.log(` VerifyingKey.verify with wrong inputs: ${isInvalid}`); // false
31
- // Batch verification: verify the same proof with its verifying key and inputs in a batch context.
32
- // VerifyingKey.verifyBatch takes arrays of verifying key strings and a 3D inputs array:
33
- // [circuit_index][instance_index][field_index]
34
- const batchResult = VerifyingKey.verifyBatch([SAMPLE_VERIFYING_KEY], [[SAMPLE_INPUTS]], proof);
35
- console.log(` VerifyingKey.verifyBatch result: ${batchResult}`); // true
36
- }
37
- // Run a deployment and both online and offline executions.
38
- async function run(online = false) {
39
- // // Generate the hello_hello.aleo program source code and inputs.
40
- // let programName = `hello_hello.aleo`;
41
- // let hello_hello_program = generateHelloHelloSource(programName);
42
- // const functionName = "hello";
43
- // const inputs = ["5u32", "5u32"];
44
- //
45
- // console.log("");
46
- // console.log("// --- STEP 1: Execute the program offline to test it gives the expected results. --- //");
47
- // // Execute the program locally.
48
- // console.log(`Executing ${programName}/hello offline`);
49
- // let start = Date.now();
50
- // const result = await localProgramExecution(hello_hello_program, programName, functionName, inputs);
51
- // console.log(`✅ Local execute finished in ${(Date.now() - start)/1000}s`);
52
- //
53
- // console.log("");
54
- // console.log("// --- STEP 2: Build the deployment transaction. --- //");
55
- let start = Date.now();
56
- // programName = `hello_hello_${Math.floor(Math.random() * 65536)}.aleo`;
57
- // hello_hello_program = generateHelloHelloSource(programName);
58
- // const deploymentTx: Transaction = await programManager.buildDeploymentTransaction(
59
- // hello_hello_program,
60
- // 0,
61
- // false,
62
- // )
63
- // console.log(`✅ Deployment transaction built in ${(Date.now() - start)/1000}s`);
64
- //
65
- // // If the deployment flag is set to true, deploy the program on testnet (requires aleo credits).
66
- // if (online) {
67
- // const txId: string = await programManager.networkClient.submitTransaction(deploymentTx);
68
- // const confirmedTx: ConfirmedTransactionJSON = await programManager.networkClient.waitForTransactionConfirmation(txId);
69
- // if (txId === confirmedTx.transaction.id) {
70
- // console.log(`Program ${programName} deployed to Aleo Testnet successfully!`);
71
- // }
72
- // } else {
73
- // programName = `hello_hello.aleo`;
74
- // hello_hello_program = generateHelloHelloSource(programName);
75
- // }
76
- //
77
- // console.log("");
78
- // console.log("// --- STEP 3: Execute the program ONLINE. --- //");
79
- //
80
- // // If the program was actually deployed, execute it online. Otherwise, execute an equivalent
81
- // // program with the same logic.
82
- // console.log(`Executing ${programName}/hello online on the aleo network`);
83
- // start = Date.now();
84
- // const keySearchParams = new AleoKeyProviderParams({cacheKey: `${programName}:${functionName}`});
85
- // const executionTx: Transaction = await programManager.buildExecutionTransaction(
86
- // {
87
- // programName,
88
- // functionName,
89
- // priorityFee: 0,
90
- // privateFee: false,
91
- // inputs: inputs,
92
- // keySearchParams,
93
- // program: hello_hello_program
94
- // }
95
- // )
96
- // console.log(`✅ Online execution of ${programName} built in ${(Date.now() - start)/1000}s`);
97
- //
98
- // // If the online option is specified, submit the transaction to the network.
99
- // if (online) {
100
- // const txId: string = await programManager.networkClient.submitTransaction(executionTx);
101
- // const confirmedTx: ConfirmedTransactionJSON = await programManager.networkClient.waitForTransactionConfirmation(txId);
102
- // if (txId === confirmedTx.transaction.id) {
103
- // console.log(`Program ${programName}/hello executed successfully!`);
104
- // }
105
- // }
106
- console.log("");
107
- console.log("// --- STEP 4: Verify a standalone SNARK proof. --- //");
108
- // snarkVerify and snarkVerifyBatch let you verify a proof from any Varuna circuit directly,
109
- // without requiring an on-chain program execution. This is useful when you receive a proof
110
- // from an external source and want to verify it independently.
111
- start = Date.now();
112
- snarkProofVerification();
113
- console.log(`✅ SNARK proof verification finished in ${(Date.now() - start) / 1000}s`);
114
- }
115
- // Run the offline execution, deployment, and online execution of hello_hello.aleo.
116
- await run(false);
117
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}