File tree Expand file tree Collapse file tree
.agents/skills/aleo-sdk-builder/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ function verifyExecution(filePath: string): { valid: boolean; errors: string[];
3030 }
3131
3232 // Check for DPS without unnecessary initThreadPool
33- if ( content . includes ( "buildAuthorization" ) && content . includes ( "initThreadPool" ) ) {
34- warnings . push ( "initThreadPool() found alongside DPS (buildAuthorization). Thread pool is not needed for delegated proving." ) ;
33+ if ( ( content . includes ( "buildAuthorization" ) || content . includes ( "provingRequest" ) ) && content . includes ( "initThreadPool" ) ) {
34+ warnings . push ( "initThreadPool() found alongside DPS (buildAuthorization/provingRequest ). Thread pool is not needed for delegated proving." ) ;
3535 }
3636
3737 // Check for key provider setup when doing local proving
Original file line number Diff line number Diff line change @@ -96,8 +96,8 @@ Multi-threading is not required for all contexts:
9696
9797### Fee Management
9898
99- - NEVER hardcode fee amounts — always use ` estimateExecutionFee() ` or ` estimateDeploymentFee ()`
100- or ` estimateFeeForAuthorization() ` to get the base fee
99+ - NEVER hardcode fee amounts — use ` estimateExecutionFee() ` or ` estimateFeeForAuthorization ()`
100+ to get the base fee. Deployment fees are estimated automatically by ` buildDeploymentTransaction ` .
101101- Always include a ` priorityFee ` parameter (even if 0)
102102- Handle insufficient balance errors before attempting transactions:
103103 ``` ts
@@ -129,8 +129,8 @@ Multi-threading is not required for all contexts:
129129 for (let i = 0 ; i < 60 ; i ++ ) {
130130 try {
131131 const result = await client .getTransaction (txId );
132- if ( result ) { confirmed = true ; break ; }
133- } catch { /* not confirmed yet */ }
132+ confirmed = true ; break ; // if getTransaction succeeds, the tx is confirmed
133+ } catch { /* throws when not found — not confirmed yet */ }
134134 await new Promise (r => setTimeout (r , 2000 ));
135135 }
136136 ```
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ const tx = await pm.buildTransactionFromAuthorization({
105105 feeAuthorization ,
106106});
107107
108- const txId = await pm .networkClient .submitTransaction (tx . toString () );
108+ const txId = await pm .networkClient .submitTransaction (tx );
109109```
110110
111111> ** Note:** ` buildTransactionFromAuthorization ` performs ** local proving** via
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ const txId = await pm.networkClient.submitTransaction(tx);
3131
3232``` bash
3333cargo install leo-lang
34+ # Standard devnet-only key — not used on mainnet
3435leo devnode start --private-key APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
3536```
3637
@@ -52,7 +53,7 @@ const execTx = await pm.buildDevnodeExecutionTransaction({
5253 priorityFee: 0 ,
5354 privateFee: false ,
5455});
55- await pm .networkClient .submitTransaction (execTx . toString () );
56+ await pm .networkClient .submitTransaction (execTx );
5657```
5758
5859Note: ` buildDevnodeExecutionTransaction ` takes an ` ExecuteOptions ` object (same shape
Original file line number Diff line number Diff line change @@ -43,16 +43,18 @@ pm.setKeyStore(keyStore);
4343Never store plaintext private keys. Use ` PrivateKeyCiphertext ` :
4444
4545``` ts
46- import { PrivateKeyCiphertext } from " @provablehq/sdk/testnet.js" ;
46+ import { PrivateKey , PrivateKeyCiphertext } from " @provablehq/sdk/testnet.js" ;
4747
4848// Encrypt for storage
49- const encrypted = PrivateKeyCiphertext . encryptPrivateKey ( privateKey , password );
49+ const encrypted = privateKey . toCiphertext ( password );
5050const encryptedString = encrypted .toString ();
5151// Store encryptedString safely (file, database, env var)
5252
5353// Decrypt when needed
54- const restored = PrivateKeyCiphertext .fromString (encryptedString )
55- .decryptToPrivateKey (password );
54+ const restored = PrivateKey .fromPrivateKeyCiphertext (
55+ PrivateKeyCiphertext .fromString (encryptedString ),
56+ password ,
57+ );
5658```
5759
5860## Custom Cryptography (libsodium)
You can’t perform that action at this time.
0 commit comments