@provablehq/sdk 0.9.16-rc → 0.9.17
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/dist/mainnet/account.d.ts +18 -3
- package/dist/mainnet/browser.d.ts +26 -7
- package/dist/mainnet/browser.js +1198 -248
- package/dist/mainnet/browser.js.map +1 -1
- package/dist/mainnet/keys/keystore/error.d.ts +23 -0
- package/dist/mainnet/keys/keystore/file.d.ts +207 -13
- package/dist/mainnet/keys/keystore/interface.d.ts +85 -0
- package/dist/mainnet/keys/provider/interface.d.ts +170 -0
- package/dist/{testnet/keys/provider/function-key-provider.d.ts → mainnet/keys/provider/memory.d.ts} +14 -180
- package/dist/{testnet/keys/provider/offline-key-provider.d.ts → mainnet/keys/provider/offline.d.ts} +4 -4
- package/dist/mainnet/keys/verifier/interface.d.ts +70 -0
- package/dist/mainnet/keys/verifier/memory.d.ts +37 -0
- package/dist/mainnet/models/cryptoBoxPubkey.d.ts +4 -0
- package/dist/mainnet/models/encryptedProvingRequest.d.ts +4 -0
- package/dist/mainnet/models/provingResponse.d.ts +48 -2
- package/dist/mainnet/models/record-scanner/encryptedRecordsResult.d.ts +7 -0
- package/dist/mainnet/models/record-scanner/encryptedRegistrationRequest.d.ts +8 -0
- package/dist/mainnet/models/record-scanner/error.d.ts +47 -0
- package/dist/mainnet/models/record-scanner/ownedFilter.d.ts +0 -2
- package/dist/mainnet/models/record-scanner/ownedRecordsResult.d.ts +13 -0
- package/dist/mainnet/models/record-scanner/registrationResponse.d.ts +0 -2
- package/dist/mainnet/models/record-scanner/registrationResult.d.ts +9 -0
- package/dist/mainnet/models/record-scanner/revokeResult.d.ts +17 -0
- package/dist/mainnet/models/record-scanner/serialNumbersResult.d.ts +15 -0
- package/dist/mainnet/models/record-scanner/statusResult.d.ts +13 -0
- package/dist/mainnet/models/record-scanner/tagsResult.d.ts +12 -0
- package/dist/mainnet/network-client.d.ts +81 -35
- package/dist/mainnet/node.js +345 -75
- package/dist/mainnet/node.js.map +1 -1
- package/dist/mainnet/program-manager.d.ts +54 -48
- package/dist/mainnet/record-provider.d.ts +7 -7
- package/dist/mainnet/record-scanner.d.ts +247 -31
- package/dist/mainnet/security.d.ts +38 -0
- package/dist/mainnet/utils.d.ts +1 -0
- package/dist/testnet/account.d.ts +18 -3
- package/dist/testnet/browser.d.ts +26 -7
- package/dist/testnet/browser.js +1198 -248
- package/dist/testnet/browser.js.map +1 -1
- package/dist/testnet/keys/keystore/error.d.ts +23 -0
- package/dist/testnet/keys/keystore/file.d.ts +207 -13
- package/dist/testnet/keys/keystore/interface.d.ts +85 -0
- package/dist/testnet/keys/provider/interface.d.ts +170 -0
- package/dist/{mainnet/keys/provider/function-key-provider.d.ts → testnet/keys/provider/memory.d.ts} +14 -180
- package/dist/{mainnet/keys/provider/offline-key-provider.d.ts → testnet/keys/provider/offline.d.ts} +4 -4
- package/dist/testnet/keys/verifier/interface.d.ts +70 -0
- package/dist/testnet/keys/verifier/memory.d.ts +37 -0
- package/dist/testnet/models/cryptoBoxPubkey.d.ts +4 -0
- package/dist/testnet/models/encryptedProvingRequest.d.ts +4 -0
- package/dist/testnet/models/provingResponse.d.ts +48 -2
- package/dist/testnet/models/record-scanner/encryptedRecordsResult.d.ts +7 -0
- package/dist/testnet/models/record-scanner/encryptedRegistrationRequest.d.ts +8 -0
- package/dist/testnet/models/record-scanner/error.d.ts +47 -0
- package/dist/testnet/models/record-scanner/ownedFilter.d.ts +0 -2
- package/dist/testnet/models/record-scanner/ownedRecordsResult.d.ts +13 -0
- package/dist/testnet/models/record-scanner/registrationResponse.d.ts +0 -2
- package/dist/testnet/models/record-scanner/registrationResult.d.ts +9 -0
- package/dist/testnet/models/record-scanner/revokeResult.d.ts +17 -0
- package/dist/testnet/models/record-scanner/serialNumbersResult.d.ts +15 -0
- package/dist/testnet/models/record-scanner/statusResult.d.ts +13 -0
- package/dist/testnet/models/record-scanner/tagsResult.d.ts +12 -0
- package/dist/testnet/network-client.d.ts +81 -35
- package/dist/testnet/node.js +345 -75
- package/dist/testnet/node.js.map +1 -1
- package/dist/testnet/program-manager.d.ts +54 -48
- package/dist/testnet/record-provider.d.ts +7 -7
- package/dist/testnet/record-scanner.d.ts +247 -31
- package/dist/testnet/security.d.ts +38 -0
- package/dist/testnet/utils.d.ts +1 -0
- package/package.json +4 -3
- package/dist/mainnet/keys/keystore/keystore.d.ts +0 -81
- package/dist/mainnet/keys/keystore/memory.d.ts +0 -8
- package/dist/testnet/keys/keystore/keystore.d.ts +0 -81
- package/dist/testnet/keys/keystore/memory.d.ts +0 -8
|
@@ -3,19 +3,19 @@ import { AleoNetworkClient, AleoNetworkClientOptions, ProgramImports } from "./n
|
|
|
3
3
|
import { ImportedPrograms, ImportedVerifyingKeys } from "./models/imports.js";
|
|
4
4
|
import { RecordProvider } from "./record-provider.js";
|
|
5
5
|
import { RecordSearchParams } from "./models/record-provider/recordSearchParams.js";
|
|
6
|
-
import { FunctionKeyProvider, KeySearchParams } from "./keys/provider/
|
|
7
|
-
import { FunctionKeyPair } from "./models/keyPair";
|
|
6
|
+
import { FunctionKeyProvider, KeySearchParams } from "./keys/provider/interface.js";
|
|
7
|
+
import { FunctionKeyPair } from "./models/keyPair.js";
|
|
8
8
|
import { Authorization, ExecutionResponse, OfflineQuery, RecordPlaintext, PrivateKey, Program, ProvingKey, ProvingRequest, VerifyingKey, Transaction } from "./wasm.js";
|
|
9
9
|
/**
|
|
10
10
|
* Represents the options for deploying and upgrading a transaction in the Aleo network.
|
|
11
11
|
* This interface is used to specify the parameters required for building and submitting an deployment transaction.
|
|
12
12
|
*
|
|
13
13
|
* @property {string} program - The program source code to be deployed.
|
|
14
|
-
* @property {number} priorityFee - The
|
|
14
|
+
* @property {number} priorityFee - The priority fee to be paid for the transaction.
|
|
15
15
|
* @property {boolean} privateFee - If true, uses a private record to pay the fee; otherwise, uses the account's public credit balance.
|
|
16
|
-
* @property {RecordSearchParams
|
|
17
|
-
* @property {string | RecordPlaintext
|
|
18
|
-
* @property {PrivateKey} [privateKey] -
|
|
16
|
+
* @property {RecordSearchParams} [recordSearchParams] - Parameters for searching for a record to pay the execution transaction fee.
|
|
17
|
+
* @property {string | RecordPlaintext} [feeRecord] - Fee record to use for the transaction.
|
|
18
|
+
* @property {PrivateKey} [privateKey] - Private key to use for the transaction.
|
|
19
19
|
*/
|
|
20
20
|
interface DeployOptions {
|
|
21
21
|
program: string;
|
|
@@ -31,18 +31,19 @@ interface DeployOptions {
|
|
|
31
31
|
*
|
|
32
32
|
* @property {string} programName - The name of the program containing the function to be executed.
|
|
33
33
|
* @property {string} functionName - The name of the function to execute within the program.
|
|
34
|
-
* @property {number} priorityFee - The
|
|
34
|
+
* @property {number} priorityFee - The priority fee to be paid for the transaction.
|
|
35
35
|
* @property {boolean} privateFee - If true, uses a private record to pay the fee; otherwise, uses the account's public credit balance.
|
|
36
36
|
* @property {string[]} inputs - The inputs to the function being executed.
|
|
37
|
-
* @property {RecordSearchParams} [recordSearchParams] -
|
|
38
|
-
* @property {KeySearchParams} [keySearchParams] -
|
|
39
|
-
* @property {string | RecordPlaintext} [feeRecord] -
|
|
40
|
-
* @property {ProvingKey} [provingKey] -
|
|
41
|
-
* @property {VerifyingKey} [verifyingKey] -
|
|
42
|
-
* @property {PrivateKey} [privateKey] -
|
|
43
|
-
* @property {OfflineQuery} [offlineQuery] -
|
|
44
|
-
* @property {string | Program} [program] -
|
|
45
|
-
* @property {ProgramImports} [imports] -
|
|
37
|
+
* @property {RecordSearchParams} [recordSearchParams] - Parameters for searching for a record to pay the execution transaction fee.
|
|
38
|
+
* @property {KeySearchParams} [keySearchParams] - Parameters for finding the matching proving & verifying keys for the function.
|
|
39
|
+
* @property {string | RecordPlaintext} [feeRecord] - Fee record to use for the transaction.
|
|
40
|
+
* @property {ProvingKey} [provingKey] - Proving key to use for the transaction.
|
|
41
|
+
* @property {VerifyingKey} [verifyingKey] - Verifying key to use for the transaction.
|
|
42
|
+
* @property {PrivateKey} [privateKey] - Private key to use for the transaction.
|
|
43
|
+
* @property {OfflineQuery} [offlineQuery] - Offline query if creating transactions in an offline environment.
|
|
44
|
+
* @property {string | Program} [program] - Program source code to use for the transaction.
|
|
45
|
+
* @property {ProgramImports} [imports] - Programs that the program being executed imports.
|
|
46
|
+
* @property {number} [edition] - Edition of the program to execute the function in.
|
|
46
47
|
*/
|
|
47
48
|
interface ExecuteOptions {
|
|
48
49
|
programName: string;
|
|
@@ -125,7 +126,8 @@ interface ExecuteAuthorizationOptions {
|
|
|
125
126
|
*
|
|
126
127
|
* @property {string} programName - The name of the program containing the function to be executed.
|
|
127
128
|
* @property {string} functionName - The name of the function to execute within the program.
|
|
128
|
-
* @property {number} baseFee - The base fee to be paid for the transaction.
|
|
129
|
+
* @property {number} [baseFee] - The base fee to be paid for the transaction.
|
|
130
|
+
* @deprecated Base fee is now estimated automatically; this option is ignored and will be removed in a future version.
|
|
129
131
|
* @property {number} priorityFee - The optional priority fee to be paid for the transaction.
|
|
130
132
|
* @property {boolean} privateFee - If true, uses a private record to pay the fee; otherwise, uses the account's public credit balance.
|
|
131
133
|
* @property {string[]} inputs - The inputs to the function being executed.
|
|
@@ -136,6 +138,9 @@ interface ExecuteAuthorizationOptions {
|
|
|
136
138
|
* @property {string} uri - The URI send the ProvingRequest to.
|
|
137
139
|
* @property {ProgramImports} [imports] - Optional programs that the program being executed imports.
|
|
138
140
|
* @property {boolean} broadcast - Whether to broadcast the Transaction generated by the remove prover to the Aleo network.
|
|
141
|
+
* @property {boolean} unchecked - Whether to execute the transaction without checking the validity of the authorization (faster but may fail).
|
|
142
|
+
* @property {number} [edition] - Edition of the program to execute the function in.
|
|
143
|
+
* @property {boolean} [useFeeMaster] - Whether to use the FeeMaster account to execute the transaction.
|
|
139
144
|
*/
|
|
140
145
|
interface ProvingRequestOptions {
|
|
141
146
|
programName: string;
|
|
@@ -152,6 +157,7 @@ interface ProvingRequestOptions {
|
|
|
152
157
|
broadcast?: boolean;
|
|
153
158
|
unchecked?: boolean;
|
|
154
159
|
edition?: number;
|
|
160
|
+
useFeeMaster?: boolean;
|
|
155
161
|
}
|
|
156
162
|
/**
|
|
157
163
|
* Fee estimate options.
|
|
@@ -226,7 +232,7 @@ declare class ProgramManager {
|
|
|
226
232
|
* import { ProgramManager } from "@provablehq/sdk/mainnet.js";
|
|
227
233
|
*
|
|
228
234
|
* // Create a ProgramManager
|
|
229
|
-
* const programManager = new ProgramManager("https://api.
|
|
235
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2");
|
|
230
236
|
*
|
|
231
237
|
* // Set the value of the `Accept-Language` header to `en-US`
|
|
232
238
|
* programManager.setHeader('Accept-Language', 'en-US');
|
|
@@ -245,7 +251,7 @@ declare class ProgramManager {
|
|
|
245
251
|
* keyProvider.useCache(true);
|
|
246
252
|
*
|
|
247
253
|
* // Create a ProgramManager
|
|
248
|
-
* const programManager = new ProgramManager("https://api.
|
|
254
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider);
|
|
249
255
|
*
|
|
250
256
|
* // Set the inclusion keys.
|
|
251
257
|
* programManager.setInclusionProver();
|
|
@@ -260,7 +266,7 @@ declare class ProgramManager {
|
|
|
260
266
|
* import { ProgramManager } from "@provablehq/sdk/mainnet.js";
|
|
261
267
|
*
|
|
262
268
|
* // Create a ProgramManager
|
|
263
|
-
* const programManager = new ProgramManager("https://api.
|
|
269
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2");
|
|
264
270
|
*
|
|
265
271
|
* // Remove the default `X-Aleo-SDK-Version` header
|
|
266
272
|
* programManager.removeHeader('X-Aleo-SDK-Version');
|
|
@@ -288,7 +294,7 @@ declare class ProgramManager {
|
|
|
288
294
|
*
|
|
289
295
|
* // Initialize a program manager with the key provider to automatically fetch keys for deployments
|
|
290
296
|
* const program = "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";
|
|
291
|
-
* const programManager = new ProgramManager("https://api.
|
|
297
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
292
298
|
* programManager.setAccount(Account);
|
|
293
299
|
*
|
|
294
300
|
* // Define a fee in credits
|
|
@@ -321,7 +327,7 @@ declare class ProgramManager {
|
|
|
321
327
|
*
|
|
322
328
|
* // Initialize a program manager with the key provider to automatically fetch keys for deployments
|
|
323
329
|
* const program = "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";
|
|
324
|
-
* const programManager = new ProgramManager("https://api.
|
|
330
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
325
331
|
* programManager.setAccount(Account);
|
|
326
332
|
*
|
|
327
333
|
* // Define a fee in credits
|
|
@@ -360,7 +366,7 @@ declare class ProgramManager {
|
|
|
360
366
|
*
|
|
361
367
|
* // Initialize a program manager with the key provider to automatically fetch keys for deployments
|
|
362
368
|
* const program = "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";
|
|
363
|
-
* const programManager = new ProgramManager("https://api.
|
|
369
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
364
370
|
*
|
|
365
371
|
* // Define a fee in credits
|
|
366
372
|
* const priorityFee = 0.0;
|
|
@@ -391,7 +397,7 @@ declare class ProgramManager {
|
|
|
391
397
|
* keyProvider.useCache(true);
|
|
392
398
|
*
|
|
393
399
|
* // Initialize a program manager with the key provider to automatically fetch keys for executions
|
|
394
|
-
* const programManager = new ProgramManager("https://api.
|
|
400
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
395
401
|
*
|
|
396
402
|
* // Build and execute the transaction
|
|
397
403
|
* const tx = await programManager.buildExecutionTransaction({
|
|
@@ -431,7 +437,7 @@ declare class ProgramManager {
|
|
|
431
437
|
* keyProvider.useCache(true);
|
|
432
438
|
*
|
|
433
439
|
* // Initialize a program manager with the key provider to automatically fetch keys for executions.
|
|
434
|
-
* const programManager = new ProgramManager("https://api.
|
|
440
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider);
|
|
435
441
|
*
|
|
436
442
|
* // Build the `Authorization`.
|
|
437
443
|
* const privateKey = new PrivateKey(); // Change this to a private key that has an aleo credit balance.
|
|
@@ -500,7 +506,7 @@ declare class ProgramManager {
|
|
|
500
506
|
* keyProvider.useCache(true);
|
|
501
507
|
*
|
|
502
508
|
* // Initialize a ProgramManager with the key and record providers.
|
|
503
|
-
* const programManager = new ProgramManager("https://api.
|
|
509
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
504
510
|
*
|
|
505
511
|
* // Build the `Authorization`.
|
|
506
512
|
* const authorization = await programManager.buildAuthorization({
|
|
@@ -529,7 +535,7 @@ declare class ProgramManager {
|
|
|
529
535
|
* keyProvider.useCache(true);
|
|
530
536
|
*
|
|
531
537
|
* // Initialize a ProgramManager with the key and record providers.
|
|
532
|
-
* const programManager = new ProgramManager("https://api.
|
|
538
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
533
539
|
*
|
|
534
540
|
* // Build the unchecked `Authorization`.
|
|
535
541
|
* const authorization = await programManager.buildAuthorizationUnchecked({
|
|
@@ -558,7 +564,7 @@ declare class ProgramManager {
|
|
|
558
564
|
* keyProvider.useCache(true);
|
|
559
565
|
*
|
|
560
566
|
* // Initialize a ProgramManager with the key and record providers.
|
|
561
|
-
* const programManager = new ProgramManager("https://api.
|
|
567
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
562
568
|
*
|
|
563
569
|
* // Build the proving request.
|
|
564
570
|
* const provingRequest = await programManager.provingRequest({
|
|
@@ -590,7 +596,7 @@ declare class ProgramManager {
|
|
|
590
596
|
* keyProvider.useCache(true);
|
|
591
597
|
*
|
|
592
598
|
* // Initialize a ProgramManager with the key and record providers.
|
|
593
|
-
* const programManager = new ProgramManager("https://api.
|
|
599
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
594
600
|
*
|
|
595
601
|
* // Build a credits.aleo/fee_public `Authorization`.
|
|
596
602
|
* const feePublicAuthorization = await programManager.buildFeeAuthorization({
|
|
@@ -623,7 +629,7 @@ declare class ProgramManager {
|
|
|
623
629
|
* keyProvider.useCache(true);
|
|
624
630
|
*
|
|
625
631
|
* // Initialize a program manager with the key provider to automatically fetch keys for executions
|
|
626
|
-
* const programManager = new ProgramManager("https://api.
|
|
632
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
627
633
|
*
|
|
628
634
|
* // Build and execute the transaction
|
|
629
635
|
* const tx_id = await programManager.execute({
|
|
@@ -698,7 +704,7 @@ declare class ProgramManager {
|
|
|
698
704
|
* keyProvider.useCache(true);
|
|
699
705
|
*
|
|
700
706
|
* // Initialize a program manager with the key provider to automatically fetch keys for executions
|
|
701
|
-
* const programManager = new ProgramManager("https://api.
|
|
707
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
702
708
|
* const record_1 = "{ owner: aleo184vuwr5u7u0ha5f5k44067dd2uaqewxx6pe5ltha5pv99wvhfqxqv339h4.private, microcredits: 45000000u64.private, _nonce: 4106205762862305308495708971985748592380064201230396559307556388725936304984group.public}"
|
|
703
709
|
* const record_2 = "{ owner: aleo184vuwr5u7u0ha5f5k44067dd2uaqewxx6pe5ltha5pv99wvhfqxqv339h4.private, microcredits: 45000000u64.private, _nonce: 1540945439182663264862696551825005342995406165131907382295858612069623286213group.public}"
|
|
704
710
|
* const tx_id = await programManager.join(record_1, record_2, 0.05, false);
|
|
@@ -729,7 +735,7 @@ declare class ProgramManager {
|
|
|
729
735
|
* keyProvider.useCache(true);
|
|
730
736
|
*
|
|
731
737
|
* // Initialize a program manager with the key provider to automatically fetch keys for executions
|
|
732
|
-
* const programManager = new ProgramManager("https://api.
|
|
738
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
733
739
|
* const record = "{ owner: aleo184vuwr5u7u0ha5f5k44067dd2uaqewxx6pe5ltha5pv99wvhfqxqv339h4.private, microcredits: 45000000u64.private, _nonce: 4106205762862305308495708971985748592380064201230396559307556388725936304984group.public}"
|
|
734
740
|
* const tx_id = await programManager.split(25000000, record);
|
|
735
741
|
*
|
|
@@ -776,7 +782,7 @@ declare class ProgramManager {
|
|
|
776
782
|
* keyProvider.useCache(true);
|
|
777
783
|
*
|
|
778
784
|
* // Initialize a program manager with the key provider to automatically fetch keys for executions
|
|
779
|
-
* const programManager = new ProgramManager("https://api.
|
|
785
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
780
786
|
* const tx = await programManager.buildTransferTransaction(1, "aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px", "public", 0.2, false);
|
|
781
787
|
* await programManager.networkClient.submitTransaction(tx.toString());
|
|
782
788
|
*
|
|
@@ -807,7 +813,7 @@ declare class ProgramManager {
|
|
|
807
813
|
* keyProvider.useCache(true);
|
|
808
814
|
*
|
|
809
815
|
* // Initialize a program manager with the key provider to automatically fetch keys for executions
|
|
810
|
-
* const programManager = new ProgramManager("https://api.
|
|
816
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
811
817
|
* const tx = await programManager.buildTransferPublicTransaction(1, "aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px", 0.2);
|
|
812
818
|
* await programManager.networkClient.submitTransaction(tx.toString());
|
|
813
819
|
*
|
|
@@ -838,7 +844,7 @@ declare class ProgramManager {
|
|
|
838
844
|
* keyProvider.useCache(true);
|
|
839
845
|
*
|
|
840
846
|
* // Initialize a program manager with the key provider to automatically fetch keys for executions
|
|
841
|
-
* const programManager = new ProgramManager("https://api.
|
|
847
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
842
848
|
* const tx = await programManager.buildTransferPublicAsSignerTransaction(1, "aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px", 0.2);
|
|
843
849
|
* await programManager.networkClient.submitTransaction(tx.toString());
|
|
844
850
|
*
|
|
@@ -874,7 +880,7 @@ declare class ProgramManager {
|
|
|
874
880
|
* keyProvider.useCache(true);
|
|
875
881
|
*
|
|
876
882
|
* // Initialize a program manager with the key provider to automatically fetch keys for executions
|
|
877
|
-
* const programManager = new ProgramManager("https://api.
|
|
883
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
878
884
|
* const tx_id = await programManager.transfer(1, "aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px", "public", 0.2, false);
|
|
879
885
|
*
|
|
880
886
|
* // Verify the transaction was successful
|
|
@@ -902,7 +908,7 @@ declare class ProgramManager {
|
|
|
902
908
|
* keyProvider.useCache(true);
|
|
903
909
|
*
|
|
904
910
|
* // Create a new ProgramManager with the key that will be used to bond credits
|
|
905
|
-
* const programManager = new ProgramManager("https://api.
|
|
911
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, undefined);
|
|
906
912
|
* programManager.setAccount(new Account("YourPrivateKey"));
|
|
907
913
|
*
|
|
908
914
|
* // Create the bonding transaction object for later submission
|
|
@@ -936,7 +942,7 @@ declare class ProgramManager {
|
|
|
936
942
|
* keyProvider.useCache(true);
|
|
937
943
|
*
|
|
938
944
|
* // Create a new ProgramManager with the key that will be used to bond credits
|
|
939
|
-
* const programManager = new ProgramManager("https://api.
|
|
945
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, undefined);
|
|
940
946
|
*
|
|
941
947
|
* // Create the bonding transaction
|
|
942
948
|
* tx_id = await programManager.bondPublic("aleo1jx8s4dvjepculny4wfrzwyhs3tlyv65r58ns3g6q2gm2esh7ps8sqy9s5j", "aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px", "aleo1feya8sjy9k2zflvl2dx39pdsq5tju28elnp2ektnn588uu9ghv8s84msv9", 2000000);
|
|
@@ -967,7 +973,7 @@ declare class ProgramManager {
|
|
|
967
973
|
* keyProvider.useCache(true);
|
|
968
974
|
*
|
|
969
975
|
* // Create a new ProgramManager with the key that will be used to bond credits
|
|
970
|
-
* const programManager = new ProgramManager("https://api.
|
|
976
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, undefined);
|
|
971
977
|
* programManager.setAccount(new Account("YourPrivateKey"));
|
|
972
978
|
*
|
|
973
979
|
* // Create the bond validator transaction object for later use.
|
|
@@ -1002,7 +1008,7 @@ declare class ProgramManager {
|
|
|
1002
1008
|
* keyProvider.useCache(true);
|
|
1003
1009
|
*
|
|
1004
1010
|
* // Create a new ProgramManager with the key that will be used to bond credits
|
|
1005
|
-
* const programManager = new ProgramManager("https://api.
|
|
1011
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, undefined);
|
|
1006
1012
|
* programManager.setAccount(new Account("YourPrivateKey"));
|
|
1007
1013
|
*
|
|
1008
1014
|
* // Create the bonding transaction
|
|
@@ -1032,7 +1038,7 @@ declare class ProgramManager {
|
|
|
1032
1038
|
* keyProvider.useCache(true);
|
|
1033
1039
|
*
|
|
1034
1040
|
* // Create a new ProgramManager with the key that will be used to unbond credits.
|
|
1035
|
-
* const programManager = new ProgramManager("https://api.
|
|
1041
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, undefined);
|
|
1036
1042
|
* const tx = await programManager.buildUnbondPublicTransaction("aleo1jx8s4dvjepculny4wfrzwyhs3tlyv65r58ns3g6q2gm2esh7ps8sqy9s5j", 2000000);
|
|
1037
1043
|
*
|
|
1038
1044
|
* // The transaction can be submitted later to the network using the network client.
|
|
@@ -1067,7 +1073,7 @@ declare class ProgramManager {
|
|
|
1067
1073
|
* keyProvider.useCache(true);
|
|
1068
1074
|
*
|
|
1069
1075
|
* // Create a new ProgramManager with the key that will be used to bond credits
|
|
1070
|
-
* const programManager = new ProgramManager("https://api.
|
|
1076
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, undefined);
|
|
1071
1077
|
* programManager.setAccount(new Account("YourPrivateKey"));
|
|
1072
1078
|
*
|
|
1073
1079
|
* // Create the unbond_public transaction and send it to the network
|
|
@@ -1096,7 +1102,7 @@ declare class ProgramManager {
|
|
|
1096
1102
|
* keyProvider.useCache(true);
|
|
1097
1103
|
*
|
|
1098
1104
|
* // Create a new ProgramManager with the key that will be used to claim unbonded credits.
|
|
1099
|
-
* const programManager = new ProgramManager("https://api.
|
|
1105
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, undefined);
|
|
1100
1106
|
*
|
|
1101
1107
|
* // Create the claim_unbond_public transaction object for later use.
|
|
1102
1108
|
* const tx = await programManager.buildClaimUnbondPublicTransaction("aleo1jx8s4dvjepculny4wfrzwyhs3tlyv65r58ns3g6q2gm2esh7ps8sqy9s5j");
|
|
@@ -1128,7 +1134,7 @@ declare class ProgramManager {
|
|
|
1128
1134
|
* keyProvider.useCache(true);
|
|
1129
1135
|
*
|
|
1130
1136
|
* // Create a new ProgramManager with the key that will be used to bond credits
|
|
1131
|
-
* const programManager = new ProgramManager("https://api.
|
|
1137
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, undefined);
|
|
1132
1138
|
* programManager.setAccount(new Account("YourPrivateKey"));
|
|
1133
1139
|
*
|
|
1134
1140
|
* // Create the claim_unbond_public transaction
|
|
@@ -1165,7 +1171,7 @@ declare class ProgramManager {
|
|
|
1165
1171
|
* keyProvider.useCache(true);
|
|
1166
1172
|
*
|
|
1167
1173
|
* // Create a new ProgramManager with the key that will be used to bond credits
|
|
1168
|
-
* const programManager = new ProgramManager("https://api.
|
|
1174
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, undefined);
|
|
1169
1175
|
*
|
|
1170
1176
|
* // Create the set_validator_state transaction
|
|
1171
1177
|
* const tx = await programManager.buildSetValidatorStateTransaction(true);
|
|
@@ -1204,7 +1210,7 @@ declare class ProgramManager {
|
|
|
1204
1210
|
* keyProvider.useCache(true);
|
|
1205
1211
|
*
|
|
1206
1212
|
* // Create a new ProgramManager with the key that will be used to bond credits
|
|
1207
|
-
* const programManager = new ProgramManager("https://api.
|
|
1213
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, undefined);
|
|
1208
1214
|
*
|
|
1209
1215
|
* // Create the set_validator_state transaction
|
|
1210
1216
|
* const tx_id = await programManager.setValidatorState(true);
|
|
@@ -1285,7 +1291,7 @@ declare class ProgramManager {
|
|
|
1285
1291
|
* keyProvider.useCache(true);
|
|
1286
1292
|
*
|
|
1287
1293
|
* // Initialize a program manager with the key provider to automatically fetch keys for executions.
|
|
1288
|
-
* const programManager = new ProgramManager("https://api.
|
|
1294
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider);
|
|
1289
1295
|
*
|
|
1290
1296
|
* // Build the `Authorization`.
|
|
1291
1297
|
* const privateKey = new PrivateKey(); // Change this to a private key that has an aleo credit balance.
|
|
@@ -1334,7 +1340,7 @@ declare class ProgramManager {
|
|
|
1334
1340
|
* import { AleoKeyProvider, PrivateKey, initThreadPool, ProgramManager } from "@provablehq/sdk";
|
|
1335
1341
|
*
|
|
1336
1342
|
* // Initialize a program manager with the key provider to automatically fetch keys for executions.
|
|
1337
|
-
* const programManager = new ProgramManager("https://api.
|
|
1343
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider);
|
|
1338
1344
|
*
|
|
1339
1345
|
* // Get the base fee in microcredits.
|
|
1340
1346
|
* const baseFeeMicrocredits = await programManager.estimateExecutionFee({programName: "credits.aleo"});
|
|
@@ -54,7 +54,7 @@ interface RecordProvider {
|
|
|
54
54
|
*
|
|
55
55
|
* // When the program manager is initialized with the record provider it will be used to find automatically find
|
|
56
56
|
* // fee records and amount records for value transfers so that they do not need to be specified manually
|
|
57
|
-
* const programManager = new ProgramManager("https://api.
|
|
57
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
58
58
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
59
59
|
*/
|
|
60
60
|
findCreditsRecord(microcredits: number, searchParameters: RecordSearchParams): Promise<OwnedRecord>;
|
|
@@ -77,7 +77,7 @@ interface RecordProvider {
|
|
|
77
77
|
*
|
|
78
78
|
* // When the program manager is initialized with the record provider it will be used to find automatically find
|
|
79
79
|
* // fee records and amount records for value transfers so that they do not need to be specified manually
|
|
80
|
-
* const programManager = new ProgramManager("https://api.
|
|
80
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
81
81
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
82
82
|
*/
|
|
83
83
|
findCreditsRecords(microcreditAmounts: number[], searchParameters: RecordSearchParams): Promise<OwnedRecord[]>;
|
|
@@ -191,7 +191,7 @@ declare class NetworkRecordProvider implements RecordProvider {
|
|
|
191
191
|
*
|
|
192
192
|
* @example
|
|
193
193
|
* // Create a new NetworkRecordProvider
|
|
194
|
-
* const networkClient = new AleoNetworkClient("https://api.
|
|
194
|
+
* const networkClient = new AleoNetworkClient("https://api.provable.com/v2");
|
|
195
195
|
* const keyProvider = new AleoKeyProvider();
|
|
196
196
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
197
197
|
*
|
|
@@ -204,7 +204,7 @@ declare class NetworkRecordProvider implements RecordProvider {
|
|
|
204
204
|
*
|
|
205
205
|
* // When the program manager is initialized with the record provider it will be used to find automatically find
|
|
206
206
|
* // fee records and amount records for value transfers so that they do not need to be specified manually
|
|
207
|
-
* const programManager = new ProgramManager("https://api.
|
|
207
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
208
208
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
209
209
|
*
|
|
210
210
|
* */
|
|
@@ -218,7 +218,7 @@ declare class NetworkRecordProvider implements RecordProvider {
|
|
|
218
218
|
*
|
|
219
219
|
* @example
|
|
220
220
|
* // Create a new NetworkRecordProvider
|
|
221
|
-
* const networkClient = new AleoNetworkClient("https://api.
|
|
221
|
+
* const networkClient = new AleoNetworkClient("https://api.provable.com/v2");
|
|
222
222
|
* const keyProvider = new AleoKeyProvider();
|
|
223
223
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
224
224
|
*
|
|
@@ -231,7 +231,7 @@ declare class NetworkRecordProvider implements RecordProvider {
|
|
|
231
231
|
*
|
|
232
232
|
* // When the program manager is initialized with the record provider it will be used to find automatically find
|
|
233
233
|
* // fee records and amount records for value transfers so that they do not need to be specified manually
|
|
234
|
-
* const programManager = new ProgramManager("https://api.
|
|
234
|
+
* const programManager = new ProgramManager("https://api.provable.com/v2", keyProvider, recordProvider);
|
|
235
235
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
236
236
|
*/
|
|
237
237
|
findCreditsRecord(microcredits: number, searchParameters: RecordSearchParams): Promise<OwnedRecord>;
|
|
@@ -256,7 +256,7 @@ declare class NetworkRecordProvider implements RecordProvider {
|
|
|
256
256
|
* const params = new BlockHeightSearch(89995, 99995);
|
|
257
257
|
*
|
|
258
258
|
* // Create a new NetworkRecordProvider
|
|
259
|
-
* const networkClient = new AleoNetworkClient("https://api.
|
|
259
|
+
* const networkClient = new AleoNetworkClient("https://api.provable.com/v2");
|
|
260
260
|
* const keyProvider = new AleoKeyProvider();
|
|
261
261
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
262
262
|
*
|