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.
- package/package.json +1 -1
- package/template-extension/package.json +1 -1
- package/template-nextjs-ts/package.json +2 -2
- package/template-node/index.js +1 -1
- package/template-node/package.json +1 -1
- package/template-node-ts/package.json +1 -1
- package/template-offline-public-transaction-ts/package.json +2 -2
- package/template-offline-public-transaction-ts/src/helpers.ts +2 -2
- package/template-offline-public-transaction-ts/src/index.ts +81 -48
- package/template-react-leo/package.json +2 -2
- package/template-react-managed-worker/package.json +2 -2
- package/template-react-ts/package.json +2 -2
- package/template-vanilla/package.json +2 -2
- package/template-nextjs-ts/node_modules/@types/node/LICENSE +0 -21
- package/template-nextjs-ts/node_modules/@types/node/README.md +0 -15
- package/template-nextjs-ts/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/template-nextjs-ts/node_modules/@types/node/assert.d.ts +0 -1054
- package/template-nextjs-ts/node_modules/@types/node/async_hooks.d.ts +0 -603
- package/template-nextjs-ts/node_modules/@types/node/buffer.buffer.d.ts +0 -463
- package/template-nextjs-ts/node_modules/@types/node/buffer.d.ts +0 -1928
- package/template-nextjs-ts/node_modules/@types/node/child_process.d.ts +0 -1549
- package/template-nextjs-ts/node_modules/@types/node/cluster.d.ts +0 -579
- package/template-nextjs-ts/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
- package/template-nextjs-ts/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/template-nextjs-ts/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
- package/template-nextjs-ts/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
- package/template-nextjs-ts/node_modules/@types/node/console.d.ts +0 -452
- package/template-nextjs-ts/node_modules/@types/node/constants.d.ts +0 -21
- package/template-nextjs-ts/node_modules/@types/node/crypto.d.ts +0 -4509
- package/template-nextjs-ts/node_modules/@types/node/dgram.d.ts +0 -599
- package/template-nextjs-ts/node_modules/@types/node/diagnostics_channel.d.ts +0 -578
- package/template-nextjs-ts/node_modules/@types/node/dns/promises.d.ts +0 -502
- package/template-nextjs-ts/node_modules/@types/node/dns.d.ts +0 -919
- package/template-nextjs-ts/node_modules/@types/node/dom-events.d.ts +0 -99
- package/template-nextjs-ts/node_modules/@types/node/domain.d.ts +0 -170
- package/template-nextjs-ts/node_modules/@types/node/events.d.ts +0 -930
- package/template-nextjs-ts/node_modules/@types/node/fs/promises.d.ts +0 -1273
- package/template-nextjs-ts/node_modules/@types/node/fs.d.ts +0 -4437
- package/template-nextjs-ts/node_modules/@types/node/globals.d.ts +0 -364
- package/template-nextjs-ts/node_modules/@types/node/globals.typedarray.d.ts +0 -21
- package/template-nextjs-ts/node_modules/@types/node/http.d.ts +0 -2061
- package/template-nextjs-ts/node_modules/@types/node/http2.d.ts +0 -2625
- package/template-nextjs-ts/node_modules/@types/node/https.d.ts +0 -545
- package/template-nextjs-ts/node_modules/@types/node/index.d.ts +0 -92
- package/template-nextjs-ts/node_modules/@types/node/inspector.d.ts +0 -4002
- package/template-nextjs-ts/node_modules/@types/node/module.d.ts +0 -867
- package/template-nextjs-ts/node_modules/@types/node/net.d.ts +0 -1035
- package/template-nextjs-ts/node_modules/@types/node/os.d.ts +0 -495
- package/template-nextjs-ts/node_modules/@types/node/package.json +0 -225
- package/template-nextjs-ts/node_modules/@types/node/path.d.ts +0 -200
- package/template-nextjs-ts/node_modules/@types/node/perf_hooks.d.ts +0 -970
- package/template-nextjs-ts/node_modules/@types/node/process.d.ts +0 -2061
- package/template-nextjs-ts/node_modules/@types/node/punycode.d.ts +0 -117
- package/template-nextjs-ts/node_modules/@types/node/querystring.d.ts +0 -152
- package/template-nextjs-ts/node_modules/@types/node/readline/promises.d.ts +0 -162
- package/template-nextjs-ts/node_modules/@types/node/readline.d.ts +0 -594
- package/template-nextjs-ts/node_modules/@types/node/repl.d.ts +0 -428
- package/template-nextjs-ts/node_modules/@types/node/sea.d.ts +0 -153
- package/template-nextjs-ts/node_modules/@types/node/sqlite.d.ts +0 -680
- package/template-nextjs-ts/node_modules/@types/node/stream/consumers.d.ts +0 -38
- package/template-nextjs-ts/node_modules/@types/node/stream/promises.d.ts +0 -90
- package/template-nextjs-ts/node_modules/@types/node/stream/web.d.ts +0 -618
- package/template-nextjs-ts/node_modules/@types/node/stream.d.ts +0 -1668
- package/template-nextjs-ts/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/template-nextjs-ts/node_modules/@types/node/test.d.ts +0 -2175
- package/template-nextjs-ts/node_modules/@types/node/timers/promises.d.ts +0 -108
- package/template-nextjs-ts/node_modules/@types/node/timers.d.ts +0 -287
- package/template-nextjs-ts/node_modules/@types/node/tls.d.ts +0 -1259
- package/template-nextjs-ts/node_modules/@types/node/trace_events.d.ts +0 -197
- package/template-nextjs-ts/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -460
- package/template-nextjs-ts/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
- package/template-nextjs-ts/node_modules/@types/node/ts5.6/index.d.ts +0 -92
- package/template-nextjs-ts/node_modules/@types/node/tty.d.ts +0 -208
- package/template-nextjs-ts/node_modules/@types/node/url.d.ts +0 -972
- package/template-nextjs-ts/node_modules/@types/node/util.d.ts +0 -2596
- package/template-nextjs-ts/node_modules/@types/node/v8.d.ts +0 -922
- package/template-nextjs-ts/node_modules/@types/node/vm.d.ts +0 -1029
- package/template-nextjs-ts/node_modules/@types/node/wasi.d.ts +0 -181
- package/template-nextjs-ts/node_modules/@types/node/worker_threads.d.ts +0 -769
- package/template-nextjs-ts/node_modules/@types/node/zlib.d.ts +0 -670
- package/template-nextjs-ts/node_modules/undici-types/LICENSE +0 -21
- package/template-nextjs-ts/node_modules/undici-types/README.md +0 -6
- package/template-nextjs-ts/node_modules/undici-types/agent.d.ts +0 -31
- package/template-nextjs-ts/node_modules/undici-types/api.d.ts +0 -43
- package/template-nextjs-ts/node_modules/undici-types/balanced-pool.d.ts +0 -29
- package/template-nextjs-ts/node_modules/undici-types/cache.d.ts +0 -36
- package/template-nextjs-ts/node_modules/undici-types/client.d.ts +0 -108
- package/template-nextjs-ts/node_modules/undici-types/connector.d.ts +0 -34
- package/template-nextjs-ts/node_modules/undici-types/content-type.d.ts +0 -21
- package/template-nextjs-ts/node_modules/undici-types/cookies.d.ts +0 -28
- package/template-nextjs-ts/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
- package/template-nextjs-ts/node_modules/undici-types/dispatcher.d.ts +0 -256
- package/template-nextjs-ts/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
- package/template-nextjs-ts/node_modules/undici-types/errors.d.ts +0 -149
- package/template-nextjs-ts/node_modules/undici-types/eventsource.d.ts +0 -61
- package/template-nextjs-ts/node_modules/undici-types/fetch.d.ts +0 -209
- package/template-nextjs-ts/node_modules/undici-types/file.d.ts +0 -39
- package/template-nextjs-ts/node_modules/undici-types/filereader.d.ts +0 -54
- package/template-nextjs-ts/node_modules/undici-types/formdata.d.ts +0 -108
- package/template-nextjs-ts/node_modules/undici-types/global-dispatcher.d.ts +0 -9
- package/template-nextjs-ts/node_modules/undici-types/global-origin.d.ts +0 -7
- package/template-nextjs-ts/node_modules/undici-types/handlers.d.ts +0 -15
- package/template-nextjs-ts/node_modules/undici-types/header.d.ts +0 -4
- package/template-nextjs-ts/node_modules/undici-types/index.d.ts +0 -71
- package/template-nextjs-ts/node_modules/undici-types/interceptors.d.ts +0 -17
- package/template-nextjs-ts/node_modules/undici-types/mock-agent.d.ts +0 -50
- package/template-nextjs-ts/node_modules/undici-types/mock-client.d.ts +0 -25
- package/template-nextjs-ts/node_modules/undici-types/mock-errors.d.ts +0 -12
- package/template-nextjs-ts/node_modules/undici-types/mock-interceptor.d.ts +0 -93
- package/template-nextjs-ts/node_modules/undici-types/mock-pool.d.ts +0 -25
- package/template-nextjs-ts/node_modules/undici-types/package.json +0 -55
- package/template-nextjs-ts/node_modules/undici-types/patch.d.ts +0 -33
- package/template-nextjs-ts/node_modules/undici-types/pool-stats.d.ts +0 -19
- package/template-nextjs-ts/node_modules/undici-types/pool.d.ts +0 -39
- package/template-nextjs-ts/node_modules/undici-types/proxy-agent.d.ts +0 -28
- package/template-nextjs-ts/node_modules/undici-types/readable.d.ts +0 -65
- package/template-nextjs-ts/node_modules/undici-types/retry-agent.d.ts +0 -8
- package/template-nextjs-ts/node_modules/undici-types/retry-handler.d.ts +0 -116
- package/template-nextjs-ts/node_modules/undici-types/util.d.ts +0 -18
- package/template-nextjs-ts/node_modules/undici-types/webidl.d.ts +0 -228
- package/template-nextjs-ts/node_modules/undici-types/websocket.d.ts +0 -150
package/package.json
CHANGED
package/template-node/index.js
CHANGED
|
@@ -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.
|
|
66
|
+
const programManager = new ProgramManager("http://34.169.215.4:3030", keyProvider);
|
|
67
67
|
|
|
68
68
|
const tx = await programManager.buildExecutionTransaction(
|
|
69
69
|
{
|
|
@@ -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.
|
|
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 {
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
} catch (err) {
|
|
36
|
-
|
|
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 =
|
|
57
|
+
const blockHeight = 9233665;
|
|
43
58
|
// TODO this is a placeholder block height for now, which offlineQuery now requires
|
|
44
|
-
try {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
} catch (err) {
|
|
48
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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"
|
|
@@ -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).
|