create-leo-app 0.9.8 → 0.9.10-testnet-rc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/package.json +1 -1
  2. package/template-extension/package.json +1 -1
  3. package/template-nextjs-ts/package.json +2 -2
  4. package/template-node/index.js +1 -1
  5. package/template-node/package.json +1 -1
  6. package/template-node-ts/package.json +1 -1
  7. package/template-offline-public-transaction-ts/package.json +2 -2
  8. package/template-offline-public-transaction-ts/src/helpers.ts +2 -2
  9. package/template-offline-public-transaction-ts/src/index.ts +81 -48
  10. package/template-react-leo/package.json +2 -2
  11. package/template-react-managed-worker/package.json +2 -2
  12. package/template-react-ts/package.json +2 -2
  13. package/template-vanilla/package.json +2 -2
  14. package/template-nextjs-ts/node_modules/@types/node/LICENSE +0 -21
  15. package/template-nextjs-ts/node_modules/@types/node/README.md +0 -15
  16. package/template-nextjs-ts/node_modules/@types/node/assert/strict.d.ts +0 -8
  17. package/template-nextjs-ts/node_modules/@types/node/assert.d.ts +0 -1054
  18. package/template-nextjs-ts/node_modules/@types/node/async_hooks.d.ts +0 -603
  19. package/template-nextjs-ts/node_modules/@types/node/buffer.buffer.d.ts +0 -463
  20. package/template-nextjs-ts/node_modules/@types/node/buffer.d.ts +0 -1928
  21. package/template-nextjs-ts/node_modules/@types/node/child_process.d.ts +0 -1549
  22. package/template-nextjs-ts/node_modules/@types/node/cluster.d.ts +0 -579
  23. package/template-nextjs-ts/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
  24. package/template-nextjs-ts/node_modules/@types/node/compatibility/index.d.ts +0 -9
  25. package/template-nextjs-ts/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
  26. package/template-nextjs-ts/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
  27. package/template-nextjs-ts/node_modules/@types/node/console.d.ts +0 -452
  28. package/template-nextjs-ts/node_modules/@types/node/constants.d.ts +0 -21
  29. package/template-nextjs-ts/node_modules/@types/node/crypto.d.ts +0 -4509
  30. package/template-nextjs-ts/node_modules/@types/node/dgram.d.ts +0 -599
  31. package/template-nextjs-ts/node_modules/@types/node/diagnostics_channel.d.ts +0 -578
  32. package/template-nextjs-ts/node_modules/@types/node/dns/promises.d.ts +0 -502
  33. package/template-nextjs-ts/node_modules/@types/node/dns.d.ts +0 -919
  34. package/template-nextjs-ts/node_modules/@types/node/dom-events.d.ts +0 -99
  35. package/template-nextjs-ts/node_modules/@types/node/domain.d.ts +0 -170
  36. package/template-nextjs-ts/node_modules/@types/node/events.d.ts +0 -930
  37. package/template-nextjs-ts/node_modules/@types/node/fs/promises.d.ts +0 -1273
  38. package/template-nextjs-ts/node_modules/@types/node/fs.d.ts +0 -4437
  39. package/template-nextjs-ts/node_modules/@types/node/globals.d.ts +0 -364
  40. package/template-nextjs-ts/node_modules/@types/node/globals.typedarray.d.ts +0 -21
  41. package/template-nextjs-ts/node_modules/@types/node/http.d.ts +0 -2061
  42. package/template-nextjs-ts/node_modules/@types/node/http2.d.ts +0 -2625
  43. package/template-nextjs-ts/node_modules/@types/node/https.d.ts +0 -545
  44. package/template-nextjs-ts/node_modules/@types/node/index.d.ts +0 -92
  45. package/template-nextjs-ts/node_modules/@types/node/inspector.d.ts +0 -4002
  46. package/template-nextjs-ts/node_modules/@types/node/module.d.ts +0 -867
  47. package/template-nextjs-ts/node_modules/@types/node/net.d.ts +0 -1035
  48. package/template-nextjs-ts/node_modules/@types/node/os.d.ts +0 -495
  49. package/template-nextjs-ts/node_modules/@types/node/package.json +0 -225
  50. package/template-nextjs-ts/node_modules/@types/node/path.d.ts +0 -200
  51. package/template-nextjs-ts/node_modules/@types/node/perf_hooks.d.ts +0 -970
  52. package/template-nextjs-ts/node_modules/@types/node/process.d.ts +0 -2061
  53. package/template-nextjs-ts/node_modules/@types/node/punycode.d.ts +0 -117
  54. package/template-nextjs-ts/node_modules/@types/node/querystring.d.ts +0 -152
  55. package/template-nextjs-ts/node_modules/@types/node/readline/promises.d.ts +0 -162
  56. package/template-nextjs-ts/node_modules/@types/node/readline.d.ts +0 -594
  57. package/template-nextjs-ts/node_modules/@types/node/repl.d.ts +0 -428
  58. package/template-nextjs-ts/node_modules/@types/node/sea.d.ts +0 -153
  59. package/template-nextjs-ts/node_modules/@types/node/sqlite.d.ts +0 -680
  60. package/template-nextjs-ts/node_modules/@types/node/stream/consumers.d.ts +0 -38
  61. package/template-nextjs-ts/node_modules/@types/node/stream/promises.d.ts +0 -90
  62. package/template-nextjs-ts/node_modules/@types/node/stream/web.d.ts +0 -618
  63. package/template-nextjs-ts/node_modules/@types/node/stream.d.ts +0 -1668
  64. package/template-nextjs-ts/node_modules/@types/node/string_decoder.d.ts +0 -67
  65. package/template-nextjs-ts/node_modules/@types/node/test.d.ts +0 -2175
  66. package/template-nextjs-ts/node_modules/@types/node/timers/promises.d.ts +0 -108
  67. package/template-nextjs-ts/node_modules/@types/node/timers.d.ts +0 -287
  68. package/template-nextjs-ts/node_modules/@types/node/tls.d.ts +0 -1259
  69. package/template-nextjs-ts/node_modules/@types/node/trace_events.d.ts +0 -197
  70. package/template-nextjs-ts/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -460
  71. package/template-nextjs-ts/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
  72. package/template-nextjs-ts/node_modules/@types/node/ts5.6/index.d.ts +0 -92
  73. package/template-nextjs-ts/node_modules/@types/node/tty.d.ts +0 -208
  74. package/template-nextjs-ts/node_modules/@types/node/url.d.ts +0 -972
  75. package/template-nextjs-ts/node_modules/@types/node/util.d.ts +0 -2596
  76. package/template-nextjs-ts/node_modules/@types/node/v8.d.ts +0 -922
  77. package/template-nextjs-ts/node_modules/@types/node/vm.d.ts +0 -1029
  78. package/template-nextjs-ts/node_modules/@types/node/wasi.d.ts +0 -181
  79. package/template-nextjs-ts/node_modules/@types/node/worker_threads.d.ts +0 -769
  80. package/template-nextjs-ts/node_modules/@types/node/zlib.d.ts +0 -670
  81. package/template-nextjs-ts/node_modules/undici-types/LICENSE +0 -21
  82. package/template-nextjs-ts/node_modules/undici-types/README.md +0 -6
  83. package/template-nextjs-ts/node_modules/undici-types/agent.d.ts +0 -31
  84. package/template-nextjs-ts/node_modules/undici-types/api.d.ts +0 -43
  85. package/template-nextjs-ts/node_modules/undici-types/balanced-pool.d.ts +0 -29
  86. package/template-nextjs-ts/node_modules/undici-types/cache.d.ts +0 -36
  87. package/template-nextjs-ts/node_modules/undici-types/client.d.ts +0 -108
  88. package/template-nextjs-ts/node_modules/undici-types/connector.d.ts +0 -34
  89. package/template-nextjs-ts/node_modules/undici-types/content-type.d.ts +0 -21
  90. package/template-nextjs-ts/node_modules/undici-types/cookies.d.ts +0 -28
  91. package/template-nextjs-ts/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  92. package/template-nextjs-ts/node_modules/undici-types/dispatcher.d.ts +0 -256
  93. package/template-nextjs-ts/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  94. package/template-nextjs-ts/node_modules/undici-types/errors.d.ts +0 -149
  95. package/template-nextjs-ts/node_modules/undici-types/eventsource.d.ts +0 -61
  96. package/template-nextjs-ts/node_modules/undici-types/fetch.d.ts +0 -209
  97. package/template-nextjs-ts/node_modules/undici-types/file.d.ts +0 -39
  98. package/template-nextjs-ts/node_modules/undici-types/filereader.d.ts +0 -54
  99. package/template-nextjs-ts/node_modules/undici-types/formdata.d.ts +0 -108
  100. package/template-nextjs-ts/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  101. package/template-nextjs-ts/node_modules/undici-types/global-origin.d.ts +0 -7
  102. package/template-nextjs-ts/node_modules/undici-types/handlers.d.ts +0 -15
  103. package/template-nextjs-ts/node_modules/undici-types/header.d.ts +0 -4
  104. package/template-nextjs-ts/node_modules/undici-types/index.d.ts +0 -71
  105. package/template-nextjs-ts/node_modules/undici-types/interceptors.d.ts +0 -17
  106. package/template-nextjs-ts/node_modules/undici-types/mock-agent.d.ts +0 -50
  107. package/template-nextjs-ts/node_modules/undici-types/mock-client.d.ts +0 -25
  108. package/template-nextjs-ts/node_modules/undici-types/mock-errors.d.ts +0 -12
  109. package/template-nextjs-ts/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  110. package/template-nextjs-ts/node_modules/undici-types/mock-pool.d.ts +0 -25
  111. package/template-nextjs-ts/node_modules/undici-types/package.json +0 -55
  112. package/template-nextjs-ts/node_modules/undici-types/patch.d.ts +0 -33
  113. package/template-nextjs-ts/node_modules/undici-types/pool-stats.d.ts +0 -19
  114. package/template-nextjs-ts/node_modules/undici-types/pool.d.ts +0 -39
  115. package/template-nextjs-ts/node_modules/undici-types/proxy-agent.d.ts +0 -28
  116. package/template-nextjs-ts/node_modules/undici-types/readable.d.ts +0 -65
  117. package/template-nextjs-ts/node_modules/undici-types/retry-agent.d.ts +0 -8
  118. package/template-nextjs-ts/node_modules/undici-types/retry-handler.d.ts +0 -116
  119. package/template-nextjs-ts/node_modules/undici-types/util.d.ts +0 -18
  120. package/template-nextjs-ts/node_modules/undici-types/webidl.d.ts +0 -228
  121. package/template-nextjs-ts/node_modules/undici-types/websocket.d.ts +0 -150
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-leo-app",
3
- "version": "0.9.8",
3
+ "version": "0.9.10-testnet-rc",
4
4
  "type": "module",
5
5
  "license": "GPL-3.0",
6
6
  "collaborators": [
@@ -7,7 +7,7 @@
7
7
  "build": "rimraf static/js && rollup --config"
8
8
  },
9
9
  "devDependencies": {
10
- "@provablehq/sdk": "^0.9.8",
10
+ "@provablehq/sdk": "^0.9.10-testnet-rc",
11
11
  "@web/rollup-plugin-import-meta-assets": "^2.2.1",
12
12
  "rimraf": "^6.0.1",
13
13
  "rollup": "^4.32.0"
@@ -9,8 +9,8 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "@provablehq/sdk": "^0.9.8",
13
- "next": "15.2.3",
12
+ "@provablehq/sdk": "^0.9.10-testnet-rc",
13
+ "next": "15.4.7",
14
14
  "react": "^19.0.0",
15
15
  "react-dom": "^19.0.0",
16
16
  "terser-webpack-plugin": "^5.3.11"
@@ -63,7 +63,7 @@ async function remoteProgramExecution(programName, functionName, inputs) {
63
63
  const keyProvider = new AleoKeyProvider();
64
64
  keyProvider.useCache(true);
65
65
 
66
- const programManager = new ProgramManager("http://34.168.156.3:3030", keyProvider);
66
+ const programManager = new ProgramManager("http://34.169.215.4:3030", keyProvider);
67
67
 
68
68
  const tx = await programManager.buildExecutionTransaction(
69
69
  {
@@ -7,6 +7,6 @@
7
7
  "dev": "node index.js"
8
8
  },
9
9
  "dependencies": {
10
- "@provablehq/sdk": "^0.9.8"
10
+ "@provablehq/sdk": "^0.9.10-testnet-rc"
11
11
  }
12
12
  }
@@ -8,7 +8,7 @@
8
8
  "dev": "npm run build && node dist/index.js"
9
9
  },
10
10
  "dependencies": {
11
- "@provablehq/sdk": "^0.9.8"
11
+ "@provablehq/sdk": "^0.9.10-testnet-rc"
12
12
  },
13
13
  "devDependencies": {
14
14
  "rimraf": "^6.0.1",
@@ -5,10 +5,10 @@
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "rimraf dist/js && rollup --config",
8
- "dev": "npm run build && node dist/index.js"
8
+ "dev": "npm run build && node --trace-uncaught dist/index.js"
9
9
  },
10
10
  "dependencies": {
11
- "@provablehq/sdk": "^0.9.8"
11
+ "@provablehq/sdk": "^0.9.10-testnet-rc"
12
12
  },
13
13
  "devDependencies": {
14
14
  "rimraf": "^6.0.1",
@@ -28,7 +28,7 @@ async function preDownloadTransferKeys() {
28
28
  const keysDirPath = path.join(__dirname, "keys");
29
29
  await fsPromises.mkdir(keysDirPath, { recursive: true });
30
30
 
31
- for (const keyData of [CREDITS_PROGRAM_KEYS.transfer_public, CREDITS_PROGRAM_KEYS.fee_public, CREDITS_PROGRAM_KEYS.transfer_public_as_signer]) {
31
+ for (const keyData of [CREDITS_PROGRAM_KEYS.transfer_public, CREDITS_PROGRAM_KEYS.fee_public, CREDITS_PROGRAM_KEYS.transfer_public_as_signer, CREDITS_PROGRAM_KEYS.inclusion]) {
32
32
  try {
33
33
  keyPaths[keyData.locator] = await downloadAndSaveKey(keyData, keysDirPath);
34
34
  } catch (error) {
@@ -45,7 +45,7 @@ async function preDownloadBondingKeys() {
45
45
  const keysDirPath = path.join(__dirname, "keys");
46
46
  await fsPromises.mkdir(keysDirPath, { recursive: true });
47
47
 
48
- for (const keyData of [CREDITS_PROGRAM_KEYS.bond_public, CREDITS_PROGRAM_KEYS.fee_public, CREDITS_PROGRAM_KEYS.unbond_public, CREDITS_PROGRAM_KEYS.claim_unbond_public]) {
48
+ for (const keyData of [CREDITS_PROGRAM_KEYS.bond_public, CREDITS_PROGRAM_KEYS.fee_public, CREDITS_PROGRAM_KEYS.unbond_public, CREDITS_PROGRAM_KEYS.claim_unbond_public, CREDITS_PROGRAM_KEYS.inclusion]) {
49
49
  try {
50
50
  keyPaths[keyData.locator] = await downloadAndSaveKey(keyData, keysDirPath);
51
51
  } catch (error) {
@@ -1,4 +1,16 @@
1
- import {Account, Address, CREDITS_PROGRAM_KEYS, initThreadPool, ProgramManager, OfflineQuery, OfflineKeyProvider, OfflineSearchParams, ProvingKey, Transaction} from "@provablehq/sdk";
1
+ import {
2
+ Account,
3
+ Address,
4
+ CREDITS_PROGRAM_KEYS,
5
+ initThreadPool,
6
+ ProgramManager,
7
+ OfflineQuery,
8
+ OfflineKeyProvider,
9
+ OfflineSearchParams,
10
+ ProvingKey,
11
+ Transaction,
12
+ VerifyingKey
13
+ } from "@provablehq/sdk";
2
14
  import { getLocalKey, preDownloadBondingKeys, preDownloadTransferKeys } from "./helpers";
3
15
 
4
16
  await initThreadPool();
@@ -19,6 +31,9 @@ async function buildTransferPublicTxOffline(recipientAddress: Address, amount: n
19
31
  const transferPublicProvingKey = ProvingKey.fromBytes(
20
32
  await getLocalKey(<string>keyPaths[CREDITS_PROGRAM_KEYS.transfer_public.locator])
21
33
  );
34
+ const inclusionKey = ProvingKey.fromBytes(
35
+ await getLocalKey(<string>keyPaths[CREDITS_PROGRAM_KEYS.inclusion.locator])
36
+ );
22
37
 
23
38
  // Create an offline key provider
24
39
  console.log("Creating offline key provider");
@@ -28,25 +43,25 @@ async function buildTransferPublicTxOffline(recipientAddress: Address, amount: n
28
43
  // keys into the key manager.
29
44
  console.log("Inserting proving keys into key provider");
30
45
  offlineKeyProvider.insertFeePublicKeys(feePublicProvingKey);
46
+ offlineKeyProvider.insertInclusionKeys(inclusionKey)
31
47
 
32
- try {
33
- offlineKeyProvider.insertTransferPublicKeys(transferPublicProvingKey);
34
- console.log("Successfully inserted proving key");
35
- } catch (err) {
36
- console.error("Failed to insert proving key:", err);
37
- }
38
-
48
+ try {
49
+ offlineKeyProvider.insertTransferPublicKeys(transferPublicProvingKey);
50
+ console.log("Successfully inserted proving key");
51
+ } catch (err) {
52
+ console.error("Failed to insert proving key:", err);
53
+ }
39
54
 
40
55
  // Create an offline query to complete the inclusion proof
41
56
  let offlineQuery: OfflineQuery;
42
- const blockHeight = 0;
57
+ const blockHeight = 9233665;
43
58
  // TODO this is a placeholder block height for now, which offlineQuery now requires
44
- try {
45
- const offlineQuery = new OfflineQuery(blockHeight, latestStateRoot);
46
- console.log("Successfully created OfflineQuery", offlineQuery);
47
- } catch (err) {
48
- console.error("Failed to create OfflineQuery:", err);
49
- }
59
+ try {
60
+ offlineQuery = new OfflineQuery(blockHeight, latestStateRoot);
61
+ console.log("Successfully created OfflineQuery", offlineQuery);
62
+ } catch (err) {
63
+ console.error("Failed to create OfflineQuery:", err);
64
+ }
50
65
 
51
66
  // Insert the key provider into the program manager
52
67
  programManager.setKeyProvider(offlineKeyProvider);
@@ -83,10 +98,12 @@ async function buildBondingTxOffline(
83
98
  const bondPublicKeyBytes = await getLocalKey(<string>keyPaths[CREDITS_PROGRAM_KEYS.bond_public.locator]);
84
99
  const unbondPublicKeyBytes = await getLocalKey(<string>keyPaths[CREDITS_PROGRAM_KEYS.unbond_public.locator]);
85
100
  const claimUnbondPublicKeyBytes = await getLocalKey(<string>keyPaths[CREDITS_PROGRAM_KEYS.claim_unbond_public.locator]);
101
+ const inclusionKeys = await getLocalKey(<string>keyPaths[CREDITS_PROGRAM_KEYS.inclusion.locator]);
86
102
  const feePublicProvingKey = ProvingKey.fromBytes(feePublicKeyBytes);
87
103
  const bondPublicProvingKey = ProvingKey.fromBytes(bondPublicKeyBytes);
88
104
  const unBondPublicProvingKey = ProvingKey.fromBytes(unbondPublicKeyBytes);
89
105
  const claimUnbondPublicProvingKey = ProvingKey.fromBytes(claimUnbondPublicKeyBytes);
106
+ const inclusionProvingKey = ProvingKey.fromBytes(inclusionKeys);
90
107
 
91
108
  // Create an offline key provider to fetch keys without connection to the internet
92
109
  console.log("Creating offline key provider");
@@ -98,6 +115,7 @@ async function buildBondingTxOffline(
98
115
  offlineKeyProvider.insertBondPublicKeys(bondPublicProvingKey);
99
116
  offlineKeyProvider.insertUnbondPublicKeys(unBondPublicProvingKey);
100
117
  offlineKeyProvider.insertClaimUnbondPublicKeys(claimUnbondPublicProvingKey);
118
+ offlineKeyProvider.insertInclusionKeys(inclusionProvingKey);
101
119
 
102
120
  // Insert the key provider into the program manager
103
121
  programManager.setKeyProvider(offlineKeyProvider);
@@ -111,10 +129,10 @@ async function buildBondingTxOffline(
111
129
 
112
130
  const bondPublicOptions = {
113
131
  keySearchParams: OfflineSearchParams.bondPublicKeyParams(),
114
- offlineQuery: new OfflineQuery(0, latestStateRoot)
132
+ offlineQuery: new OfflineQuery(9233665, latestStateRoot)
115
133
  };
116
134
 
117
-
135
+ console.log("Build bond public transaction");
118
136
  const bondTx = <Transaction>await programManager.buildBondPublicTransaction(
119
137
  validatorAddress.to_string(),
120
138
  withdrawalAddress.to_string(),
@@ -126,7 +144,7 @@ async function buildBondingTxOffline(
126
144
 
127
145
  const unbondPublicOptions = {
128
146
  keySearchParams: OfflineSearchParams.unbondPublicKeyParams(),
129
- offlineQuery: new OfflineQuery(0, latestStateRoot)
147
+ offlineQuery: new OfflineQuery(9233665, latestStateRoot)
130
148
  };
131
149
 
132
150
  const unBondTx = <Transaction>await programManager.buildUnbondPublicTransaction(
@@ -139,7 +157,7 @@ async function buildBondingTxOffline(
139
157
  console.log("Building a claim_unbond_public transaction offline");
140
158
  const claimUnbondPublicOptions = {
141
159
  keySearchParams: OfflineSearchParams.claimUnbondPublicKeyParams(),
142
- offlineQuery: new OfflineQuery(0, latestStateRoot)
160
+ offlineQuery: new OfflineQuery(9233665, latestStateRoot)
143
161
  };
144
162
 
145
163
  const claimUnbondTx = <Transaction>await programManager.buildClaimUnbondPublicTransaction(
@@ -150,38 +168,53 @@ async function buildBondingTxOffline(
150
168
  return [bondTx, unBondTx, claimUnbondTx];
151
169
  }
152
170
 
153
- // -------------------ONLINE COMPONENT---------------------
154
- // (Do this part on an internet connected machine)
155
-
156
- // Download the needed keys for the functions we want to execute offline
157
- const transferKeyPaths = await preDownloadTransferKeys();
158
- const bondingKeyPaths = await preDownloadBondingKeys();
159
- //---------------------------------------------------------
160
-
161
- // ------------------OFFLINE COMPONENT---------------------
162
- // (Do this part on an offline machine)
163
- // Get the latest state root from an online machine and enter it into an offline machine
164
- const latestStateRoot = "sr1p93gpsezrjzdhcd2wujznx5s07k8qa39t6vfcej35zew8vn2jyrs46te8q";
165
-
166
- // Build a transfer_public transaction
167
171
  const stakerAddress = new Account().address();
168
172
  const validatorAddress = new Account().address();
169
173
  const withdrawalAddress = new Account().address();
170
- const transferTx = await buildTransferPublicTxOffline(stakerAddress, 10000, latestStateRoot, transferKeyPaths);
171
- console.log("Transfer transaction built offline!");
172
- console.log(`\n---------------transfer_public transaction---------------\n${transferTx}`);
173
- console.log(`---------------------------------------------------------`);
174
-
175
- // Build bonding & unbonding transactions
176
- const bondTransactions = await buildBondingTxOffline(validatorAddress, withdrawalAddress, 100, latestStateRoot, bondingKeyPaths);
177
- console.log("Bonding transactions built offline!");
178
- console.log(`\n-----------------bond_public transaction-----------------\n${bondTransactions[0]}`);
179
- console.log(`---------------------------------------------------------`);
180
- console.log(`\n----------------unbond_public transaction:---------------\n${bondTransactions[1]}`);
181
- console.log(`---------------------------------------------------------`);
182
- console.log(`\n-----------------claim_unbond_public transaction:---------------\n${bondTransactions[2]}`);
183
- console.log(`---------------------------------------------------------`);
184
- //---------------------------------------------------------
174
+
175
+ async function main() {
176
+ try {
177
+ // -------------------ONLINE COMPONENT---------------------
178
+ // (Do this part on an internet connected machine)
179
+
180
+ // Download the needed keys for the functions we want to execute offline
181
+ const transferKeyPaths = await preDownloadTransferKeys();
182
+ const bondingKeyPaths = await preDownloadBondingKeys();
183
+ //---------------------------------------------------------
184
+
185
+ // ------------------OFFLINE COMPONENT---------------------
186
+ // (Do this part on an offline machine)
187
+ // Get the latest state root from an online machine and enter it into an offline machine
188
+ const latestStateRoot = "sr18kzmy5fw3rwr8gldzfg2deemvyapgkuahte372shyz7phtwtsypqngg0ml";
189
+
190
+ // // // Build a transfer_public transaction
191
+ const transferTx = await buildTransferPublicTxOffline(stakerAddress, 10000, latestStateRoot, transferKeyPaths);
192
+ console.log("Transfer transaction built offline!");
193
+ console.log(`\n---------------transfer_public transaction---------------\n${transferTx}`);
194
+ console.log(`---------------------------------------------------------`);
195
+
196
+ function sleep(ms) {
197
+ return new Promise(resolve => setTimeout(resolve, ms));
198
+ }
199
+ await sleep(15000);
200
+
201
+ // Build bonding & unbonding transactions
202
+ const bondTransactions = await buildBondingTxOffline(validatorAddress, withdrawalAddress, 100, latestStateRoot, bondingKeyPaths);
203
+ console.log("Bonding transactions built offline!");
204
+ console.log(`\n-----------------bond_public transaction-----------------\n${bondTransactions[0]}`);
205
+ console.log(`---------------------------------------------------------`);
206
+ console.log(`\n----------------unbond_public transaction:---------------\n${bondTransactions[1]}`);
207
+ console.log(`---------------------------------------------------------`);
208
+ console.log(`\n-----------------claim_unbond_public transaction:---------------\n${bondTransactions[2]}`);
209
+ console.log(`---------------------------------------------------------`);
210
+ //---------------------------------------------------------
211
+ } catch (e) {
212
+ console.log(e);
213
+ process.exit(1);
214
+ }
215
+ }
216
+
217
+ await main();
185
218
 
186
219
  // -------------------ONLINE COMPONENT---------------------
187
220
  // (Do this part on an internet connected machine)
@@ -12,7 +12,7 @@
12
12
  "install-leo": "./install.sh"
13
13
  },
14
14
  "dependencies": {
15
- "@provablehq/sdk": "^0.9.8",
15
+ "@provablehq/sdk": "^0.9.10-testnet-rc",
16
16
  "comlink": "^4.4.2",
17
17
  "react": "^19.0.0",
18
18
  "react-dom": "^19.0.0"
@@ -36,7 +36,7 @@
36
36
  "raw-loader": "^4.0.2",
37
37
  "style-loader": "^4.0.0",
38
38
  "svg-url-loader": "^8.0.0",
39
- "vite": "^6.1.2",
39
+ "vite": "^6.3.6",
40
40
  "webpack": "^5.97.1",
41
41
  "webpack-cli": "^6.0.1",
42
42
  "webpack-dev-server": "^5.2.0"
@@ -11,7 +11,7 @@
11
11
  "preview": "vite preview"
12
12
  },
13
13
  "dependencies": {
14
- "@provablehq/sdk": "^0.9.8",
14
+ "@provablehq/sdk": "^0.9.10-testnet-rc",
15
15
  "react": "^19.0.0",
16
16
  "react-dom": "^19.0.0"
17
17
  },
@@ -33,7 +33,7 @@
33
33
  "html-webpack-plugin": "^5.6.3",
34
34
  "style-loader": "^4.0.0",
35
35
  "svg-url-loader": "^8.0.0",
36
- "vite": "^6.1.2",
36
+ "vite": "^6.3.6",
37
37
  "webpack": "^5.97.1",
38
38
  "webpack-cli": "^6.0.1",
39
39
  "webpack-dev-server": "^5.2.0"
@@ -12,7 +12,7 @@
12
12
  "install-leo": "./install.sh"
13
13
  },
14
14
  "dependencies": {
15
- "@provablehq/sdk": "^0.9.8",
15
+ "@provablehq/sdk": "^0.9.10-testnet-rc",
16
16
  "comlink": "^4.4.2",
17
17
  "react": "^19.0.0",
18
18
  "react-dom": "^19.0.0"
@@ -41,7 +41,7 @@
41
41
  "svg-url-loader": "^8.0.0",
42
42
  "ts-node": "^10.9.2",
43
43
  "typescript": "^5.7.3",
44
- "vite": "^6.1.2",
44
+ "vite": "^6.3.6",
45
45
  "webpack": "^5.97.1",
46
46
  "webpack-cli": "^6.0.1",
47
47
  "webpack-dev-server": "^5.2.0"
@@ -9,8 +9,8 @@
9
9
  "preview": "vite preview"
10
10
  },
11
11
  "devDependencies": {
12
- "@provablehq/sdk": "^0.9.8",
12
+ "@provablehq/sdk": "^0.9.10-testnet-rc",
13
13
  "tslib": "^2.8.1",
14
- "vite": "^6.1.2"
14
+ "vite": "^6.3.6"
15
15
  }
16
16
  }
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE
@@ -1,15 +0,0 @@
1
- # Installation
2
- > `npm install --save @types/node`
3
-
4
- # Summary
5
- This package contains type definitions for node (https://nodejs.org/).
6
-
7
- # Details
8
- Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v22.
9
-
10
- ### Additional Details
11
- * Last updated: Tue, 01 Jul 2025 20:02:28 GMT
12
- * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
-
14
- # Credits
15
- These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https://github.com/Semigradsky), and [René](https://github.com/Renegade334).
@@ -1,8 +0,0 @@
1
- declare module "assert/strict" {
2
- import { strict } from "node:assert";
3
- export = strict;
4
- }
5
- declare module "node:assert/strict" {
6
- import { strict } from "node:assert";
7
- export = strict;
8
- }