@provablehq/sdk 0.9.16-rc → 0.9.16

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 (65) hide show
  1. package/dist/mainnet/account.d.ts +18 -3
  2. package/dist/mainnet/browser.d.ts +20 -8
  3. package/dist/mainnet/browser.js +997 -266
  4. package/dist/mainnet/browser.js.map +1 -1
  5. package/dist/{testnet/keys/provider → mainnet}/function-key-provider.d.ts +15 -23
  6. package/dist/mainnet/models/cryptoBoxPubkey.d.ts +4 -0
  7. package/dist/mainnet/models/encryptedProvingRequest.d.ts +4 -0
  8. package/dist/mainnet/models/provingResponse.d.ts +48 -2
  9. package/dist/mainnet/models/record-scanner/encryptedRecordsResult.d.ts +7 -0
  10. package/dist/mainnet/models/record-scanner/encryptedRegistrationRequest.d.ts +8 -0
  11. package/dist/mainnet/models/record-scanner/error.d.ts +47 -0
  12. package/dist/mainnet/models/record-scanner/ownedFilter.d.ts +0 -2
  13. package/dist/mainnet/models/record-scanner/ownedRecordsResult.d.ts +13 -0
  14. package/dist/mainnet/models/record-scanner/registrationResponse.d.ts +0 -2
  15. package/dist/mainnet/models/record-scanner/registrationResult.d.ts +9 -0
  16. package/dist/mainnet/models/record-scanner/serialNumbersResult.d.ts +15 -0
  17. package/dist/mainnet/models/record-scanner/statusResult.d.ts +13 -0
  18. package/dist/mainnet/models/record-scanner/tagsResult.d.ts +12 -0
  19. package/dist/mainnet/network-client.d.ts +81 -35
  20. package/dist/mainnet/node.d.ts +0 -1
  21. package/dist/mainnet/node.js +2 -129
  22. package/dist/mainnet/node.js.map +1 -1
  23. package/dist/mainnet/{keys/provider/offline-key-provider.d.ts → offline-key-provider.d.ts} +3 -6
  24. package/dist/mainnet/program-manager.d.ts +53 -48
  25. package/dist/mainnet/record-provider.d.ts +7 -7
  26. package/dist/mainnet/record-scanner.d.ts +231 -31
  27. package/dist/mainnet/security.d.ts +38 -0
  28. package/dist/mainnet/utils.d.ts +1 -0
  29. package/dist/testnet/account.d.ts +18 -3
  30. package/dist/testnet/browser.d.ts +20 -8
  31. package/dist/testnet/browser.js +997 -266
  32. package/dist/testnet/browser.js.map +1 -1
  33. package/dist/{mainnet/keys/provider → testnet}/function-key-provider.d.ts +15 -23
  34. package/dist/testnet/models/cryptoBoxPubkey.d.ts +4 -0
  35. package/dist/testnet/models/encryptedProvingRequest.d.ts +4 -0
  36. package/dist/testnet/models/provingResponse.d.ts +48 -2
  37. package/dist/testnet/models/record-scanner/encryptedRecordsResult.d.ts +7 -0
  38. package/dist/testnet/models/record-scanner/encryptedRegistrationRequest.d.ts +8 -0
  39. package/dist/testnet/models/record-scanner/error.d.ts +47 -0
  40. package/dist/testnet/models/record-scanner/ownedFilter.d.ts +0 -2
  41. package/dist/testnet/models/record-scanner/ownedRecordsResult.d.ts +13 -0
  42. package/dist/testnet/models/record-scanner/registrationResponse.d.ts +0 -2
  43. package/dist/testnet/models/record-scanner/registrationResult.d.ts +9 -0
  44. package/dist/testnet/models/record-scanner/serialNumbersResult.d.ts +15 -0
  45. package/dist/testnet/models/record-scanner/statusResult.d.ts +13 -0
  46. package/dist/testnet/models/record-scanner/tagsResult.d.ts +12 -0
  47. package/dist/testnet/network-client.d.ts +81 -35
  48. package/dist/testnet/node.d.ts +0 -1
  49. package/dist/testnet/node.js +2 -129
  50. package/dist/testnet/node.js.map +1 -1
  51. package/dist/testnet/{keys/provider/offline-key-provider.d.ts → offline-key-provider.d.ts} +3 -6
  52. package/dist/testnet/program-manager.d.ts +53 -48
  53. package/dist/testnet/record-provider.d.ts +7 -7
  54. package/dist/testnet/record-scanner.d.ts +231 -31
  55. package/dist/testnet/security.d.ts +38 -0
  56. package/dist/testnet/utils.d.ts +1 -0
  57. package/package.json +3 -2
  58. package/dist/mainnet/keys/keystore/file.d.ts +0 -23
  59. package/dist/mainnet/keys/keystore/keystore.d.ts +0 -81
  60. package/dist/mainnet/keys/keystore/memory.d.ts +0 -8
  61. package/dist/mainnet/models/keyPair.d.ts +0 -4
  62. package/dist/testnet/keys/keystore/file.d.ts +0 -23
  63. package/dist/testnet/keys/keystore/keystore.d.ts +0 -81
  64. package/dist/testnet/keys/keystore/memory.d.ts +0 -8
  65. package/dist/testnet/models/keyPair.d.ts +0 -4
@@ -3,7 +3,7 @@ import { BlockJSON } from "./models/blockJSON.js";
3
3
  import { TransactionJSON } from "./models/transaction/transactionJSON.js";
4
4
  import { Address, Plaintext, Program, ProvingRequest, RecordPlaintext, PrivateKey, Transaction } from "./wasm.js";
5
5
  import { ConfirmedTransactionJSON } from "./models/confirmed_transaction.js";
6
- import { ProvingResponse } from "./models/provingResponse.js";
6
+ import { ProvingResponse, ProvingResult } from "./models/provingResponse.js";
7
7
  type ProgramImports = {
8
8
  [key: string]: string | Program;
9
9
  };
@@ -11,6 +11,8 @@ interface AleoNetworkClientOptions {
11
11
  headers?: {
12
12
  [key: string]: string;
13
13
  };
14
+ proverUri?: string;
15
+ recordScannerUri?: string;
14
16
  }
15
17
  /**
16
18
  * Interface for the JWT data.
@@ -37,6 +39,7 @@ interface DelegatedProvingParams {
37
39
  apiKey?: string;
38
40
  consumerId?: string;
39
41
  jwtData?: JWTData;
42
+ dpsPrivacy?: boolean;
40
43
  }
41
44
  /**
42
45
  * Client library that encapsulates REST calls to publicly exposed endpoints of Aleo nodes. The methods provided in this
@@ -51,7 +54,7 @@ interface DelegatedProvingParams {
51
54
  * const account = Account.fromCiphertext(process.env.ciphertext, process.env.password);
52
55
  * const apiKey = process.env.apiKey;
53
56
  * const consumerId = process.env.consumerId;
54
- * const publicNetworkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined, account);
57
+ * const publicNetworkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined, account);
55
58
  */
56
59
  declare class AleoNetworkClient {
57
60
  host: string;
@@ -67,6 +70,8 @@ declare class AleoNetworkClient {
67
70
  apiKey?: string;
68
71
  consumerId?: string;
69
72
  jwtData?: JWTData;
73
+ proverUri?: string;
74
+ recordScannerUri?: string;
70
75
  constructor(host: string, options?: AleoNetworkClientOptions);
71
76
  /**
72
77
  * Set an account to use in networkClient calls
@@ -75,7 +80,7 @@ declare class AleoNetworkClient {
75
80
  * @example
76
81
  * import { Account, AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
77
82
  *
78
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1");
83
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2");
79
84
  * const account = new Account();
80
85
  * networkClient.setAccount(account);
81
86
  */
@@ -99,9 +104,39 @@ declare class AleoNetworkClient {
99
104
  * const networkClient = new AleoNetworkClient("http://0.0.0.0:3030", undefined);
100
105
  *
101
106
  * // Set the host to a public node.
102
- * networkClient.setHost("http://api.explorer.provable.com/v1");
107
+ * networkClient.setHost("https://api.provable.com/v2");
103
108
  */
104
109
  setHost(host: string): void;
110
+ /**
111
+ * Set a new uri for a remote prover.
112
+ *
113
+ * @param {string} proverUri The uri of the remote prover.
114
+ *
115
+ * @example
116
+ * import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
117
+ *
118
+ * // Create a networkClient that connects to the provable explorer api.
119
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
120
+ *
121
+ * // Set the prover uri.
122
+ * networkClient.setProverUri("https://prover.provable.prove");
123
+ */
124
+ setProverUri(proverUri: string): void;
125
+ /**
126
+ * Set a new uri for a remote record scanner.
127
+ *
128
+ * @param {string} recordScannerUri The uri of the remote record scanner.
129
+ *
130
+ * @example
131
+ * import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
132
+ *
133
+ * // Create a networkClient that connects to the provable explorer api.
134
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
135
+ *
136
+ * // Set the record scanner uri.
137
+ * networkClient.setRecordScannerUri("https://scanner.provable.scan");
138
+ */
139
+ setRecordScannerUri(recordScannerUri: string): void;
105
140
  /**
106
141
  * Set verbose errors to true or false for the `AleoNetworkClient`. When set to true, if `submitTransaction` fails, the failure responses will report descriptive information as to why the transaction failed.
107
142
  *
@@ -176,7 +211,7 @@ declare class AleoNetworkClient {
176
211
  * const account = Account.fromCiphertext(process.env.ciphertext, process.env.password);
177
212
  *
178
213
  * // Create a network client.
179
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
214
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
180
215
  * networkClient.setAccount(account);
181
216
  *
182
217
  * // Find specific amounts
@@ -207,7 +242,7 @@ declare class AleoNetworkClient {
207
242
  * const account = Account.fromCiphertext(process.env.ciphertext, process.env.password);
208
243
  *
209
244
  * // Create a network client and set an account to search for records with.
210
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
245
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
211
246
  * networkClient.setAccount(account);
212
247
  *
213
248
  * // Find specific amounts
@@ -240,7 +275,7 @@ declare class AleoNetworkClient {
240
275
  * @example
241
276
  * import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
242
277
  *
243
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
278
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
244
279
  * const block = networkClient.getBlockByHash("ab19dklwl9vp63zu3hwg57wyhvmqf92fx5g8x0t6dr72py8r87pxupqfne5t9");
245
280
  */
246
281
  getBlockByHash(blockHash: string): Promise<BlockJSON>;
@@ -275,7 +310,7 @@ declare class AleoNetworkClient {
275
310
  * import { AleoNetworkClient } from "@provablehq/sdk/testnet.js";
276
311
  *
277
312
  * // Get the transaction ID of the deployment transaction for a program.
278
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
313
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
279
314
  * const transactionId = networkClient.getDeploymentTransactionIDForProgram("hello_hello.aleo");
280
315
  *
281
316
  * // Get the transaction data for the deployment transaction.
@@ -295,7 +330,7 @@ declare class AleoNetworkClient {
295
330
  * import { AleoNetworkClient, DeploymentJSON } from "@provablehq/sdk/testnet.js";
296
331
  *
297
332
  * // Get the transaction ID of the deployment transaction for a program.
298
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
333
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
299
334
  * const transaction = networkClient.getDeploymentTransactionForProgram("hello_hello.aleo");
300
335
  *
301
336
  * // Get the verifying keys for each function in the deployment.
@@ -313,7 +348,7 @@ declare class AleoNetworkClient {
313
348
  * import { AleoNetworkClient } from "@provablehq/sdk/testnet.js";
314
349
  *
315
350
  * // Get the transaction ID of the deployment transaction for a program.
316
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
351
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
317
352
  * const transactionId = networkClient.getDeploymentTransactionIDForProgram("hello_hello.aleo");
318
353
  *
319
354
  * // Get the transaction data for the deployment transaction.
@@ -332,7 +367,7 @@ declare class AleoNetworkClient {
332
367
  * import { AleoNetworkClient } from "@provablehq/sdk/testnet.js";
333
368
  *
334
369
  * // Create a network client.
335
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
370
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
336
371
  *
337
372
  * const latestHeight = networkClient.getLatestBlock();
338
373
  */
@@ -346,10 +381,10 @@ declare class AleoNetworkClient {
346
381
  * import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
347
382
  *
348
383
  * // Create a network client.
349
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
384
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
350
385
  *
351
386
  * // Create a network client and get the latest committee.
352
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
387
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
353
388
  * const latestCommittee = await networkClient.getLatestCommittee();
354
389
  */
355
390
  getLatestCommittee(): Promise<object>;
@@ -363,10 +398,10 @@ declare class AleoNetworkClient {
363
398
  * import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
364
399
  *
365
400
  * // Create a network client.
366
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
401
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
367
402
  *
368
403
  * // Create a network client and get the committee for a specific block.
369
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
404
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
370
405
  * const committee = await networkClient.getCommitteeByBlockHeight(1234);
371
406
  */
372
407
  getCommitteeByBlockHeight(blockHeight: number): Promise<object>;
@@ -379,7 +414,7 @@ declare class AleoNetworkClient {
379
414
  * import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
380
415
  *
381
416
  * // Create a network client.
382
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
417
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
383
418
  *
384
419
  * const latestHeight = networkClient.getLatestHeight();
385
420
  */
@@ -393,7 +428,7 @@ declare class AleoNetworkClient {
393
428
  * import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
394
429
  *
395
430
  * // Create a network client.
396
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
431
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
397
432
  *
398
433
  * // Get the latest block hash.
399
434
  * const latestHash = networkClient.getLatestBlockHash();
@@ -410,7 +445,7 @@ declare class AleoNetworkClient {
410
445
  * import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
411
446
  *
412
447
  * // Create a network client.
413
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
448
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
414
449
  *
415
450
  * // Get the source code of a program.)
416
451
  * @returns {Promise<string>} Source code of the program
@@ -419,7 +454,7 @@ declare class AleoNetworkClient {
419
454
  * import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
420
455
  *
421
456
  * // Create a network client.
422
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
457
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
423
458
  *
424
459
  * const program = networkClient.getProgram("hello_hello.aleo");
425
460
  * const expectedSource = "program hello_hello.aleo;\n\nfunction hello:\n input r0 as u32.public;\n input r1 as u32.private;\n add r0 r1 into r2;\n output r2 as u32.private;\n"
@@ -436,7 +471,7 @@ declare class AleoNetworkClient {
436
471
  * import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
437
472
  *
438
473
  * // Create a network client.
439
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
474
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
440
475
  *
441
476
  * const programVersion = networkClient.getLatestProgramEdition("hello_hello.aleo");
442
477
  * assert.equal(programVersion, 1);
@@ -453,7 +488,7 @@ declare class AleoNetworkClient {
453
488
  * import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
454
489
  *
455
490
  * // Create a network client.
456
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
491
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
457
492
  *
458
493
  * const programID = "hello_hello.aleo";
459
494
  * const programSource = "program hello_hello.aleo;\n\nfunction hello:\n input r0 as u32.public;\n input r1 as u32.private;\n add r0 r1 into r2;\n output r2 as u32.private;\n"
@@ -482,7 +517,7 @@ declare class AleoNetworkClient {
482
517
  * }
483
518
  *
484
519
  * // Create a network client.
485
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
520
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
486
521
  *
487
522
  * // Imports can be fetched using the program ID, source code, or program object
488
523
  * let programImports = await networkClient.getProgramImports("double_test.aleo");
@@ -507,7 +542,7 @@ declare class AleoNetworkClient {
507
542
  * import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
508
543
  *
509
544
  * // Create a network client.
510
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
545
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
511
546
  *
512
547
  * const programImportsNames = networkClient.getProgramImports("wrapped_credits.aleo");
513
548
  * const expectedImportsNames = ["credits.aleo"];
@@ -524,7 +559,7 @@ declare class AleoNetworkClient {
524
559
  * import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
525
560
  *
526
561
  * // Create a network client.
527
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
562
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
528
563
  *
529
564
  * const mappings = networkClient.getProgramMappingNames("credits.aleo");
530
565
  * const expectedMappings = [
@@ -551,7 +586,7 @@ declare class AleoNetworkClient {
551
586
  * import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
552
587
  *
553
588
  * // Create a network client.
554
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
589
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
555
590
  *
556
591
  * // Get public balance of an account
557
592
  * const mappingValue = networkClient.getMappingValue("credits.aleo", "account", "aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px");
@@ -571,7 +606,7 @@ declare class AleoNetworkClient {
571
606
  * import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
572
607
  *
573
608
  * // Create a network client.
574
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
609
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
575
610
  *
576
611
  * // Get the bond state as an account.
577
612
  * const unbondedState = networkClient.getMappingPlaintext("credits.aleo", "bonded", "aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px");
@@ -604,7 +639,7 @@ declare class AleoNetworkClient {
604
639
  * import { AleoNetworkClient, Account } from "@provablehq/sdk/mainnet.js";
605
640
  *
606
641
  * // Create a network client.
607
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
642
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
608
643
  *
609
644
  * // Get the balance of an account from either an address object or address string.
610
645
  * const account = Account.fromCiphertext(process.env.ciphertext, process.env.password);
@@ -622,7 +657,7 @@ declare class AleoNetworkClient {
622
657
  * import { AleoNetworkClient, Account } from "@provablehq/sdk/mainnet.js";
623
658
  *
624
659
  * // Create a network client.
625
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
660
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
626
661
  *
627
662
  * // Get the latest state root.
628
663
  * const stateRoot = networkClient.getStateRoot();
@@ -638,7 +673,7 @@ declare class AleoNetworkClient {
638
673
  * import { AleoNetworkClient, Account } from "@provablehq/sdk/mainnet.js";
639
674
  *
640
675
  * // Create a network client.
641
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
676
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
642
677
  *
643
678
  * const transaction = networkClient.getTransaction("at1handz9xjrqeynjrr0xay4pcsgtnczdksz3e584vfsgaz0dh0lyxq43a4wj");
644
679
  */
@@ -653,7 +688,7 @@ declare class AleoNetworkClient {
653
688
  * import { AleoNetworkClient, Account } from "@provablehq/sdk/mainnet.js";
654
689
  *
655
690
  * // Create a network client.
656
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
691
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
657
692
  *
658
693
  * const transaction = networkClient.getConfirmedTransaction("at1handz9xjrqeynjrr0xay4pcsgtnczdksz3e584vfsgaz0dh0lyxq43a4wj");
659
694
  * assert.equal(transaction.status, "confirmed");
@@ -695,7 +730,7 @@ declare class AleoNetworkClient {
695
730
  * import { AleoNetworkClient, Account } from "@provablehq/sdk/mainnet.js";
696
731
  *
697
732
  * // Create a network client.
698
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
733
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
699
734
  *
700
735
  * const transactions = networkClient.getTransactions(654);
701
736
  */
@@ -710,7 +745,7 @@ declare class AleoNetworkClient {
710
745
  * import { AleoNetworkClient, Account } from "@provablehq/sdk/mainnet.js";
711
746
  *
712
747
  * // Create a network client.
713
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
748
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
714
749
  *
715
750
  * const transactions = networkClient.getTransactionsByBlockHash("ab19dklwl9vp63zu3hwg57wyhvmqf92fx5g8x0t6dr72py8r87pxupqfne5t9");
716
751
  */
@@ -724,7 +759,7 @@ declare class AleoNetworkClient {
724
759
  * import { AleoNetworkClient, Account } from "@provablehq/sdk/mainnet.js";
725
760
  *
726
761
  * // Create a network client.
727
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
762
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
728
763
  *
729
764
  * // Get the current transactions in the mempool.
730
765
  * const transactions = networkClient.getTransactionsInMempool();
@@ -762,12 +797,23 @@ declare class AleoNetworkClient {
762
797
  */
763
798
  private refreshJwt;
764
799
  /**
765
- * Submit a `ProvingRequest` to a remote proving service for delegated proving. If the broadcast flag of the `ProvingRequest` is set to `true` the remote service will attempt to broadcast the result `Transaction` on behalf of the requestor.
800
+ * Parses a /prove or /prove/encrypted response. Returns a result object (never throws for 200/400/500/503).
801
+ */
802
+ private handleProvingResponse;
803
+ /**
804
+ * Submit a `ProvingRequest` to a remote proving service for delegated proving. If the broadcast flag of the `ProvingRequest` is set to `true` the remote service will attempt to broadcast the result `Transaction` on behalf of the requestor. Throws on HTTP 400, 500, 503 (and retries on 500/503). Callers should {@link submitProvingRequestSafe} to handle proving request failures without throwing.
766
805
  *
767
806
  * @param {DelegatedProvingParams} options - The optional parameters required to submit a proving request.
768
807
  * @returns {Promise<ProvingResponse>} The ProvingResponse containing the transaction result and the result of the broadcast if the `broadcast` flag was set to `true`.
769
808
  */
770
809
  submitProvingRequest(options: DelegatedProvingParams): Promise<ProvingResponse>;
810
+ /**
811
+ * Submit a proving request and return a result object instead of throwing. This method is usable when callers want to handle HTTP status (400, 500, 503) yourself. Retries on 500/503 and returns on 200 or 400.
812
+ *
813
+ * @param {DelegatedProvingParams} options - The optional parameters required to submit a proving request.
814
+ * @returns {Promise<ProvingResult>} `{ ok: true, data }` on success (200), or `{ ok: false, status, error }` on 400/500/503. Check `result.ok` and then either `result.data` or `result.status` / `result.error.message`.
815
+ */
816
+ submitProvingRequestSafe(options: DelegatedProvingParams): Promise<ProvingResult>;
771
817
  /**
772
818
  * Await a submitted transaction to be confirmed or rejected on the Aleo network.
773
819
  *
@@ -780,7 +826,7 @@ declare class AleoNetworkClient {
780
826
  * import { AleoNetworkClient, Account, ProgramManager } from "@provablehq/sdk/mainnet.js";
781
827
  *
782
828
  * // Create a network client and program manager.
783
- * const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
829
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2", undefined);
784
830
  * const programManager = new ProgramManager(networkClient);
785
831
  *
786
832
  * // Set the account for the program manager.
@@ -1,3 +1,2 @@
1
1
  import "./node-polyfill.js";
2
- export { LocalFileKeyStore } from "./keys/keystore/file.js";
3
2
  export * from "./browser.js";
@@ -1,9 +1,6 @@
1
1
  import './node-polyfill.js';
2
- import * as fs from 'node:fs/promises';
3
- import * as path from 'path';
4
- import { ProvingKey, VerifyingKey } from '@provablehq/wasm/mainnet.js';
2
+ export { Account, AleoKeyProvider, AleoKeyProviderParams, AleoNetworkClient, BlockHeightSearch, CREDITS_PROGRAM_KEYS, DecryptionNotEnabledError, KEY_STORE, NetworkRecordProvider, OfflineKeyProvider, OfflineSearchParams, PRIVATE_TO_PUBLIC_TRANSFER, PRIVATE_TRANSFER, PRIVATE_TRANSFER_TYPES, PUBLIC_TO_PRIVATE_TRANSFER, PUBLIC_TRANSFER, PUBLIC_TRANSFER_AS_SIGNER, ProgramManager, RECORD_DOMAIN, RecordNotFoundError, RecordScanner, RecordScannerRequestError, SealanceMerkleTree, UUIDError, VALID_TRANSFER_TYPES, ViewKeyNotStoredError, encryptAuthorization, encryptProvingRequest, encryptRegistrationRequest, encryptViewKey, initializeWasm, isProveApiErrorBody, isProvingResponse, logAndThrow } from './browser.js';
5
3
  export { Address, Authorization, BHP1024, BHP256, BHP512, BHP768, Boolean, Ciphertext, ComputeKey, EncryptionToolkit, ExecutionRequest, ExecutionResponse, Field, Execution as FunctionExecution, GraphKey, Group, I128, I16, I32, I64, I8, OfflineQuery, Pedersen128, Pedersen64, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager as ProgramManagerBase, ProvingKey, ProvingRequest, RecordCiphertext, RecordPlaintext, Scalar, Signature, Transaction, Transition, U128, U16, U32, U64, U8, VerifyingKey, ViewKey, getOrInitConsensusVersionTestHeights, initThreadPool, verifyFunctionExecution } from '@provablehq/wasm/mainnet.js';
6
- export { Account, AleoKeyProvider, AleoKeyProviderParams, AleoNetworkClient, BlockHeightSearch, CREDITS_PROGRAM_KEYS, KEY_STORE, NetworkRecordProvider, OfflineKeyProvider, OfflineSearchParams, PRIVATE_TO_PUBLIC_TRANSFER, PRIVATE_TRANSFER, PRIVATE_TRANSFER_TYPES, PUBLIC_TO_PRIVATE_TRANSFER, PUBLIC_TRANSFER, PUBLIC_TRANSFER_AS_SIGNER, ProgramManager, RECORD_DOMAIN, RecordScanner, SealanceMerkleTree, VALID_TRANSFER_TYPES, initializeWasm, logAndThrow, promoteMapToKeyStore } from './browser.js';
7
4
  import 'core-js/proposals/json-parse-with-source.js';
8
5
  import 'node:crypto';
9
6
  import 'node:fs';
@@ -11,130 +8,6 @@ import 'mime/lite';
11
8
  import 'xmlhttprequest-ssl';
12
9
  import 'node:worker_threads';
13
10
  import 'node:os';
11
+ import 'libsodium-wrappers';
14
12
  import '@scure/base';
15
-
16
- class LocalFileKeyStore {
17
- directory;
18
- constructor(directory) {
19
- this.directory = directory ?? path.join(process.cwd(), "keystore");
20
- // Ensure directory exists
21
- fs.mkdir(this.directory, { recursive: true }).catch((err) => {
22
- console.error("Failed to create keystore directory:", err);
23
- });
24
- }
25
- proverPath(locator) {
26
- return path.join(this.directory, `${locator}.prover`);
27
- }
28
- verifierPath(locator) {
29
- return path.join(this.directory, `${locator}.verifier`);
30
- }
31
- async readFileOptional(filepath) {
32
- try {
33
- const data = await fs.readFile(filepath);
34
- return new Uint8Array(data);
35
- }
36
- catch (err) {
37
- if (err.code === "ENOENT")
38
- return null;
39
- throw err;
40
- }
41
- }
42
- async writeFileAtomic(filepath, data) {
43
- // Ensure parent directories for nested locators exist
44
- await fs.mkdir(path.dirname(filepath), { recursive: true });
45
- await fs.writeFile(filepath, data);
46
- }
47
- async clearRecursive(dir) {
48
- let entries;
49
- try {
50
- entries = await fs.readdir(dir);
51
- }
52
- catch (err) {
53
- if (err.code === "ENOENT") {
54
- return;
55
- }
56
- throw err;
57
- }
58
- await Promise.all(entries.map(async (name) => {
59
- const full = path.join(dir, name);
60
- let isDirectory = false;
61
- try {
62
- const stat = await fs.stat(full);
63
- isDirectory = stat.isDirectory();
64
- }
65
- catch {
66
- return;
67
- }
68
- if (isDirectory) {
69
- await this.clearRecursive(full);
70
- }
71
- else if (name.endsWith(".prover") || name.endsWith(".verifier")) {
72
- await fs.unlink(full).catch(() => { });
73
- }
74
- }));
75
- }
76
- // -------------------------------------------------------
77
- // KEYSTORE INTERFACE
78
- // -------------------------------------------------------
79
- async getKeys(locator) {
80
- const prover = await this.getProvingKey(locator);
81
- const verifier = await this.getVerifyingKey(locator);
82
- if (!prover || !verifier)
83
- return null;
84
- return [prover, verifier];
85
- }
86
- async getKeyBytes(locator) {
87
- const prover = await this.getProvingKeyBytes(locator);
88
- const verifier = await this.getVerifyingKeyBytes(locator);
89
- if (!prover || !verifier)
90
- return null;
91
- return [prover, verifier];
92
- }
93
- async getProvingKey(locator) {
94
- const bytes = await this.getProvingKeyBytes(locator);
95
- return bytes ? ProvingKey.fromBytes(bytes) : null;
96
- }
97
- async getProvingKeyBytes(locator) {
98
- return this.readFileOptional(this.proverPath(locator));
99
- }
100
- async getVerifyingKey(locator) {
101
- const bytes = await this.getVerifyingKeyBytes(locator);
102
- return bytes ? VerifyingKey.fromBytes(bytes) : null;
103
- }
104
- async getVerifyingKeyBytes(locator) {
105
- return this.readFileOptional(this.verifierPath(locator));
106
- }
107
- async setKeys(locator, keys) {
108
- const [p, v] = keys;
109
- await this.writeFileAtomic(this.proverPath(locator), p.toBytes());
110
- await this.writeFileAtomic(this.verifierPath(locator), v.toBytes());
111
- }
112
- async setKeyBytes(locator, keys) {
113
- const [proverBytes, verifierBytes] = keys;
114
- await this.writeFileAtomic(this.proverPath(locator), proverBytes);
115
- await this.writeFileAtomic(this.verifierPath(locator), verifierBytes);
116
- }
117
- async has(locator) {
118
- const proverExists = await fs
119
- .access(this.proverPath(locator))
120
- .then(() => true)
121
- .catch(() => false);
122
- const verifierExists = await fs
123
- .access(this.verifierPath(locator))
124
- .then(() => true)
125
- .catch(() => false);
126
- return proverExists && verifierExists;
127
- }
128
- async delete(locator) {
129
- const p = this.proverPath(locator);
130
- const v = this.verifierPath(locator);
131
- await fs.unlink(p).catch(() => { });
132
- await fs.unlink(v).catch(() => { });
133
- }
134
- async clear() {
135
- await this.clearRecursive(this.directory);
136
- }
137
- }
138
-
139
- export { LocalFileKeyStore };
140
13
  //# sourceMappingURL=node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sources":["../../src/keys/keystore/file.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport * as path from \"path\";\n\nimport { CachedKeyPair, FunctionKeyPair } from \"../../models/keyPair.js\";\nimport { KeyStore } from \"./keystore.js\";\nimport { ProvingKey, VerifyingKey } from \"../../wasm.js\";\n\nexport class LocalFileKeyStore implements KeyStore {\n\n private directory: string;\n\n constructor(directory?: string) {\n this.directory = directory ?? path.join(process.cwd(), \"keystore\");\n\n // Ensure directory exists\n fs.mkdir(this.directory, { recursive: true }).catch((err) => {\n console.error(\"Failed to create keystore directory:\", err);\n });\n }\n\n private proverPath(locator: string): string {\n return path.join(this.directory, `${locator}.prover`);\n }\n\n private verifierPath(locator: string): string {\n return path.join(this.directory, `${locator}.verifier`);\n }\n\n private async readFileOptional(filepath: string): Promise<Uint8Array | null> {\n try {\n const data = await fs.readFile(filepath);\n return new Uint8Array(data);\n } catch (err: any) {\n if (err.code === \"ENOENT\") return null;\n throw err;\n }\n }\n\n private async writeFileAtomic(filepath: string, data: Uint8Array): Promise<void> {\n // Ensure parent directories for nested locators exist\n await fs.mkdir(path.dirname(filepath), { recursive: true });\n await fs.writeFile(filepath, data);\n }\n\n private async clearRecursive(dir: string): Promise<void> {\n let entries: string[];\n try {\n entries = await fs.readdir(dir);\n } catch (err: any) {\n if (err.code === \"ENOENT\") {\n return;\n }\n throw err;\n }\n\n await Promise.all(entries.map(async (name) => {\n const full = path.join(dir, name);\n let isDirectory = false;\n try {\n const stat = await fs.stat(full);\n isDirectory = stat.isDirectory();\n } catch {\n return;\n }\n\n if (isDirectory) {\n await this.clearRecursive(full);\n } else if (name.endsWith(\".prover\") || name.endsWith(\".verifier\")) {\n await fs.unlink(full).catch(() => {});\n }\n }));\n }\n\n // -------------------------------------------------------\n // KEYSTORE INTERFACE\n // -------------------------------------------------------\n\n async getKeys(locator: string): Promise<FunctionKeyPair | null> {\n const prover = await this.getProvingKey(locator);\n const verifier = await this.getVerifyingKey(locator);\n if (!prover || !verifier) return null;\n return [prover, verifier];\n }\n\n async getKeyBytes(locator: string): Promise<CachedKeyPair | null> {\n const prover = await this.getProvingKeyBytes(locator);\n const verifier = await this.getVerifyingKeyBytes(locator);\n if (!prover || !verifier) return null;\n return [prover, verifier];\n }\n\n async getProvingKey(locator: string): Promise<ProvingKey | null> {\n const bytes = await this.getProvingKeyBytes(locator);\n return bytes ? ProvingKey.fromBytes(bytes) : null;\n }\n\n async getProvingKeyBytes(locator: string): Promise<Uint8Array | null> {\n return this.readFileOptional(this.proverPath(locator));\n }\n\n async getVerifyingKey(locator: string): Promise<VerifyingKey | null> {\n const bytes = await this.getVerifyingKeyBytes(locator);\n return bytes ? VerifyingKey.fromBytes(bytes) : null;\n }\n\n async getVerifyingKeyBytes(locator: string): Promise<Uint8Array | null> {\n return this.readFileOptional(this.verifierPath(locator));\n }\n\n async setKeys(locator: string, keys: FunctionKeyPair): Promise<void> {\n const [p, v] = keys;\n await this.writeFileAtomic(this.proverPath(locator), p.toBytes());\n await this.writeFileAtomic(this.verifierPath(locator), v.toBytes());\n }\n\n async setKeyBytes(locator: string, keys: CachedKeyPair): Promise<void> {\n const [proverBytes, verifierBytes] = keys;\n await this.writeFileAtomic(this.proverPath(locator), proverBytes);\n await this.writeFileAtomic(this.verifierPath(locator), verifierBytes);\n }\n\n async has(locator: string): Promise<boolean> {\n const proverExists = await fs\n .access(this.proverPath(locator))\n .then(() => true)\n .catch(() => false);\n\n const verifierExists = await fs\n .access(this.verifierPath(locator))\n .then(() => true)\n .catch(() => false);\n\n return proverExists && verifierExists;\n }\n\n async delete(locator: string): Promise<void> {\n const p = this.proverPath(locator);\n const v = this.verifierPath(locator);\n\n await fs.unlink(p).catch(() => {});\n await fs.unlink(v).catch(() => {});\n }\n\n async clear(): Promise<void> {\n await this.clearRecursive(this.directory);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAOa,iBAAiB,CAAA;AAElB,IAAA,SAAS;AAEjB,IAAA,WAAA,CAAY,SAAkB,EAAA;AAC1B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS,IAAI,I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[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -1,7 +1,5 @@
1
- import { FunctionKeyProvider, KeySearchParams } from "./function-key-provider.js";
2
- import { CachedKeyPair, FunctionKeyPair } from "../../models/keyPair.js";
3
- import { ProvingKey, VerifyingKey } from "../../wasm.js";
4
- import { KeyStore } from "../keystore/keystore.js";
1
+ import { CachedKeyPair, FunctionKeyPair, FunctionKeyProvider, KeySearchParams } from "./function-key-provider.js";
2
+ import { ProvingKey, VerifyingKey } from "./wasm.js";
5
3
  /**
6
4
  * Search parameters for the offline key provider. This class implements the KeySearchParams interface and includes
7
5
  * a convenience method for creating a new instance of this class for each function of the credits.aleo program.
@@ -134,13 +132,12 @@ declare class OfflineSearchParams implements KeySearchParams {
134
132
  * const offlineExecuteTx = <Transaction>await this.buildExecutionTransaction("hello_hello.aleo", "hello", 1, false, ["5u32", "5u32"], undefined, offlineSearchParams, undefined, undefined, undefined, undefined, offlineQuery, program);
135
133
  *
136
134
  * // Broadcast the transaction later on a machine with internet access
137
- * const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
135
+ * const networkClient = new AleoNetworkClient("https://api.provable.com/v2");
138
136
  * const txId = await networkClient.broadcastTransaction(offlineExecuteTx);
139
137
  */
140
138
  declare class OfflineKeyProvider implements FunctionKeyProvider {
141
139
  cache: Map<string, CachedKeyPair>;
142
140
  constructor();
143
- keyStore(): Promise<KeyStore | undefined>;
144
141
  /**
145
142
  * Get bond_public function keys from the credits.aleo program. The keys must be cached prior to calling this
146
143
  * method for it to work.