@provablehq/sdk 0.11.9 → 0.11.10
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.cts +3 -3
- package/dist/mainnet/account.d.ts +3 -3
- package/dist/mainnet/api-auth.d.cts +14 -9
- package/dist/mainnet/api-auth.d.ts +14 -9
- package/dist/mainnet/browser.cjs +545 -191
- package/dist/mainnet/browser.cjs.map +1 -1
- package/dist/mainnet/browser.d.cts +1 -1
- package/dist/mainnet/browser.d.ts +1 -1
- package/dist/mainnet/browser.js +545 -192
- package/dist/mainnet/browser.js.map +1 -1
- package/dist/mainnet/keys/provider/interface.d.cts +4 -4
- package/dist/mainnet/keys/provider/interface.d.ts +4 -4
- package/dist/mainnet/keys/provider/memory.d.cts +6 -6
- package/dist/mainnet/keys/provider/memory.d.ts +6 -6
- package/dist/mainnet/keys/provider/offline.d.cts +1 -1
- package/dist/mainnet/keys/provider/offline.d.ts +1 -1
- package/dist/mainnet/network-client.d.cts +40 -38
- package/dist/mainnet/network-client.d.ts +40 -38
- package/dist/mainnet/node.cjs +1 -0
- package/dist/mainnet/node.cjs.map +1 -1
- package/dist/mainnet/node.js +1 -1
- package/dist/mainnet/program-manager.d.cts +132 -35
- package/dist/mainnet/program-manager.d.ts +132 -35
- package/dist/mainnet/record-provider.d.cts +7 -7
- package/dist/mainnet/record-provider.d.ts +7 -7
- package/dist/mainnet/record-scanner.d.cts +3 -3
- package/dist/mainnet/record-scanner.d.ts +3 -3
- package/dist/testnet/account.d.cts +3 -3
- package/dist/testnet/account.d.ts +3 -3
- package/dist/testnet/api-auth.d.cts +14 -9
- package/dist/testnet/api-auth.d.ts +14 -9
- package/dist/testnet/browser.cjs +545 -191
- package/dist/testnet/browser.cjs.map +1 -1
- package/dist/testnet/browser.d.cts +1 -1
- package/dist/testnet/browser.d.ts +1 -1
- package/dist/testnet/browser.js +545 -192
- package/dist/testnet/browser.js.map +1 -1
- package/dist/testnet/keys/provider/interface.d.cts +4 -4
- package/dist/testnet/keys/provider/interface.d.ts +4 -4
- package/dist/testnet/keys/provider/memory.d.cts +6 -6
- package/dist/testnet/keys/provider/memory.d.ts +6 -6
- package/dist/testnet/keys/provider/offline.d.cts +1 -1
- package/dist/testnet/keys/provider/offline.d.ts +1 -1
- package/dist/testnet/network-client.d.cts +40 -38
- package/dist/testnet/network-client.d.ts +40 -38
- package/dist/testnet/node.cjs +1 -0
- package/dist/testnet/node.cjs.map +1 -1
- package/dist/testnet/node.js +1 -1
- package/dist/testnet/program-manager.d.cts +132 -35
- package/dist/testnet/program-manager.d.ts +132 -35
- package/dist/testnet/record-provider.d.cts +7 -7
- package/dist/testnet/record-provider.d.ts +7 -7
- package/dist/testnet/record-scanner.d.cts +3 -3
- package/dist/testnet/record-scanner.d.ts +3 -3
- package/package.json +2 -2
|
@@ -91,11 +91,11 @@ interface FunctionKeyProvider {
|
|
|
91
91
|
*
|
|
92
92
|
*
|
|
93
93
|
* const keyProvider = new AleoKeyProvider();
|
|
94
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
94
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
|
|
95
95
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
96
96
|
*
|
|
97
97
|
* // Initialize a program manager with the key provider to automatically fetch keys for value transfers
|
|
98
|
-
* const programManager = new ProgramManager("https://
|
|
98
|
+
* const programManager = new ProgramManager("https://edge.provable.com/api/v2", keyProvider, recordProvider);
|
|
99
99
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
100
100
|
*
|
|
101
101
|
* // Keys can also be fetched manually
|
|
@@ -148,12 +148,12 @@ interface FunctionKeyProvider {
|
|
|
148
148
|
*
|
|
149
149
|
* @example
|
|
150
150
|
* // Create a new object which implements the KeyProvider interface
|
|
151
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
151
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
|
|
152
152
|
* const keyProvider = new AleoKeyProvider();
|
|
153
153
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
154
154
|
*
|
|
155
155
|
* // Initialize a program manager with the key provider to automatically fetch keys for value transfers
|
|
156
|
-
* const programManager = new ProgramManager("https://
|
|
156
|
+
* const programManager = new ProgramManager("https://edge.provable.com/api/v2", keyProvider, recordProvider);
|
|
157
157
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
158
158
|
*
|
|
159
159
|
* // Keys can also be fetched manually
|
|
@@ -91,11 +91,11 @@ interface FunctionKeyProvider {
|
|
|
91
91
|
*
|
|
92
92
|
*
|
|
93
93
|
* const keyProvider = new AleoKeyProvider();
|
|
94
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
94
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
|
|
95
95
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
96
96
|
*
|
|
97
97
|
* // Initialize a program manager with the key provider to automatically fetch keys for value transfers
|
|
98
|
-
* const programManager = new ProgramManager("https://
|
|
98
|
+
* const programManager = new ProgramManager("https://edge.provable.com/api/v2", keyProvider, recordProvider);
|
|
99
99
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
100
100
|
*
|
|
101
101
|
* // Keys can also be fetched manually
|
|
@@ -148,12 +148,12 @@ interface FunctionKeyProvider {
|
|
|
148
148
|
*
|
|
149
149
|
* @example
|
|
150
150
|
* // Create a new object which implements the KeyProvider interface
|
|
151
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
151
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
|
|
152
152
|
* const keyProvider = new AleoKeyProvider();
|
|
153
153
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
154
154
|
*
|
|
155
155
|
* // Initialize a program manager with the key provider to automatically fetch keys for value transfers
|
|
156
|
-
* const programManager = new ProgramManager("https://
|
|
156
|
+
* const programManager = new ProgramManager("https://edge.provable.com/api/v2", keyProvider, recordProvider);
|
|
157
157
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
158
158
|
*
|
|
159
159
|
* // Keys can also be fetched manually
|
|
@@ -95,12 +95,12 @@ declare class AleoKeyProvider implements FunctionKeyProvider {
|
|
|
95
95
|
*
|
|
96
96
|
* @example
|
|
97
97
|
* // Create a new object which implements the KeyProvider interface
|
|
98
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
98
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
|
|
99
99
|
* const keyProvider = new AleoKeyProvider();
|
|
100
100
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
101
101
|
*
|
|
102
102
|
* // Initialize a program manager with the key provider to automatically fetch keys for value transfers
|
|
103
|
-
* const programManager = new ProgramManager("https://
|
|
103
|
+
* const programManager = new ProgramManager("https://edge.provable.com/api/v2", keyProvider, recordProvider);
|
|
104
104
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
105
105
|
*
|
|
106
106
|
* // Keys can also be fetched manually using the key provider
|
|
@@ -119,12 +119,12 @@ declare class AleoKeyProvider implements FunctionKeyProvider {
|
|
|
119
119
|
*
|
|
120
120
|
* @example
|
|
121
121
|
* // Create a new AleoKeyProvider object
|
|
122
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
122
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
|
|
123
123
|
* const keyProvider = new AleoKeyProvider();
|
|
124
124
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
125
125
|
*
|
|
126
126
|
* // Initialize a program manager with the key provider to automatically fetch keys for value transfers
|
|
127
|
-
* const programManager = new ProgramManager("https://
|
|
127
|
+
* const programManager = new ProgramManager("https://edge.provable.com/api/v2", keyProvider, recordProvider);
|
|
128
128
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
129
129
|
*
|
|
130
130
|
* // Keys can also be fetched manually
|
|
@@ -154,12 +154,12 @@ declare class AleoKeyProvider implements FunctionKeyProvider {
|
|
|
154
154
|
*
|
|
155
155
|
* @example
|
|
156
156
|
* // Create a new AleoKeyProvider
|
|
157
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
157
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
|
|
158
158
|
* const keyProvider = new AleoKeyProvider();
|
|
159
159
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
160
160
|
*
|
|
161
161
|
* // Initialize a program manager with the key provider to automatically fetch keys for value transfers
|
|
162
|
-
* const programManager = new ProgramManager("https://
|
|
162
|
+
* const programManager = new ProgramManager("https://edge.provable.com/api/v2", keyProvider, recordProvider);
|
|
163
163
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
164
164
|
*
|
|
165
165
|
* // Keys can also be fetched manually
|
|
@@ -95,12 +95,12 @@ declare class AleoKeyProvider implements FunctionKeyProvider {
|
|
|
95
95
|
*
|
|
96
96
|
* @example
|
|
97
97
|
* // Create a new object which implements the KeyProvider interface
|
|
98
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
98
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
|
|
99
99
|
* const keyProvider = new AleoKeyProvider();
|
|
100
100
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
101
101
|
*
|
|
102
102
|
* // Initialize a program manager with the key provider to automatically fetch keys for value transfers
|
|
103
|
-
* const programManager = new ProgramManager("https://
|
|
103
|
+
* const programManager = new ProgramManager("https://edge.provable.com/api/v2", keyProvider, recordProvider);
|
|
104
104
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
105
105
|
*
|
|
106
106
|
* // Keys can also be fetched manually using the key provider
|
|
@@ -119,12 +119,12 @@ declare class AleoKeyProvider implements FunctionKeyProvider {
|
|
|
119
119
|
*
|
|
120
120
|
* @example
|
|
121
121
|
* // Create a new AleoKeyProvider object
|
|
122
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
122
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
|
|
123
123
|
* const keyProvider = new AleoKeyProvider();
|
|
124
124
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
125
125
|
*
|
|
126
126
|
* // Initialize a program manager with the key provider to automatically fetch keys for value transfers
|
|
127
|
-
* const programManager = new ProgramManager("https://
|
|
127
|
+
* const programManager = new ProgramManager("https://edge.provable.com/api/v2", keyProvider, recordProvider);
|
|
128
128
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
129
129
|
*
|
|
130
130
|
* // Keys can also be fetched manually
|
|
@@ -154,12 +154,12 @@ declare class AleoKeyProvider implements FunctionKeyProvider {
|
|
|
154
154
|
*
|
|
155
155
|
* @example
|
|
156
156
|
* // Create a new AleoKeyProvider
|
|
157
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
157
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
|
|
158
158
|
* const keyProvider = new AleoKeyProvider();
|
|
159
159
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
160
160
|
*
|
|
161
161
|
* // Initialize a program manager with the key provider to automatically fetch keys for value transfers
|
|
162
|
-
* const programManager = new ProgramManager("https://
|
|
162
|
+
* const programManager = new ProgramManager("https://edge.provable.com/api/v2", keyProvider, recordProvider);
|
|
163
163
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
164
164
|
*
|
|
165
165
|
* // Keys can also be fetched manually
|
|
@@ -134,7 +134,7 @@ declare class OfflineSearchParams implements KeySearchParams {
|
|
|
134
134
|
* const offlineExecuteTx = <Transaction>await this.buildExecutionTransaction("hello_hello.aleo", "hello", 1, false, ["5u32", "5u32"], undefined, offlineSearchParams, undefined, undefined, undefined, undefined, offlineQuery, program);
|
|
135
135
|
*
|
|
136
136
|
* // Broadcast the transaction later on a machine with internet access
|
|
137
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
137
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
|
|
138
138
|
* const txId = await networkClient.broadcastTransaction(offlineExecuteTx);
|
|
139
139
|
*/
|
|
140
140
|
declare class OfflineKeyProvider implements FunctionKeyProvider {
|
|
@@ -134,7 +134,7 @@ declare class OfflineSearchParams implements KeySearchParams {
|
|
|
134
134
|
* const offlineExecuteTx = <Transaction>await this.buildExecutionTransaction("hello_hello.aleo", "hello", 1, false, ["5u32", "5u32"], undefined, offlineSearchParams, undefined, undefined, undefined, undefined, offlineQuery, program);
|
|
135
135
|
*
|
|
136
136
|
* // Broadcast the transaction later on a machine with internet access
|
|
137
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
137
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
|
|
138
138
|
* const txId = await networkClient.broadcastTransaction(offlineExecuteTx);
|
|
139
139
|
*/
|
|
140
140
|
declare class OfflineKeyProvider implements FunctionKeyProvider {
|
|
@@ -17,8 +17,9 @@ interface AleoNetworkClientOptions {
|
|
|
17
17
|
recordScannerUri?: string;
|
|
18
18
|
transport?: TransportFunction;
|
|
19
19
|
/**
|
|
20
|
-
* Explicit auth mode
|
|
21
|
-
*
|
|
20
|
+
* Explicit auth mode. edge.provable.com/api is unauthenticated and never uses JWTs:
|
|
21
|
+
* use `none` (default) or `api-key` with an optional provisioned key. `jwt` is for the
|
|
22
|
+
* legacy api.provable.com gateway. Wins over the legacy apiKey/consumerId/jwtData fields.
|
|
22
23
|
*/
|
|
23
24
|
auth?: ApiAuthConfig;
|
|
24
25
|
}
|
|
@@ -68,7 +69,7 @@ interface DelegatedProvingParams {
|
|
|
68
69
|
* const account = Account.fromCiphertext(process.env.ciphertext, process.env.password);
|
|
69
70
|
* const apiKey = process.env.apiKey;
|
|
70
71
|
* const consumerId = process.env.consumerId;
|
|
71
|
-
* const publicNetworkClient = new AleoNetworkClient("https://
|
|
72
|
+
* const publicNetworkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined, account);
|
|
72
73
|
*/
|
|
73
74
|
declare class AleoNetworkClient {
|
|
74
75
|
host: string;
|
|
@@ -89,6 +90,7 @@ declare class AleoNetworkClient {
|
|
|
89
90
|
consumerId?: string;
|
|
90
91
|
jwtData?: JWTData;
|
|
91
92
|
private jwtConsumerId?;
|
|
93
|
+
private jwtMintOrigin?;
|
|
92
94
|
proverUri?: string;
|
|
93
95
|
recordScannerUri?: string;
|
|
94
96
|
constructor(host: string, options?: AleoNetworkClientOptions);
|
|
@@ -99,7 +101,7 @@ declare class AleoNetworkClient {
|
|
|
99
101
|
* @example
|
|
100
102
|
* import { Account, AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
101
103
|
*
|
|
102
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
104
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
|
|
103
105
|
* const account = new Account();
|
|
104
106
|
* networkClient.setAccount(account);
|
|
105
107
|
*/
|
|
@@ -123,7 +125,7 @@ declare class AleoNetworkClient {
|
|
|
123
125
|
* const networkClient = new AleoNetworkClient("http://0.0.0.0:3030", undefined);
|
|
124
126
|
*
|
|
125
127
|
* // Set the host to a public node.
|
|
126
|
-
* networkClient.setHost("https://
|
|
128
|
+
* networkClient.setHost("https://edge.provable.com/api/v2");
|
|
127
129
|
*/
|
|
128
130
|
setHost(host: string): void;
|
|
129
131
|
/**
|
|
@@ -135,7 +137,7 @@ declare class AleoNetworkClient {
|
|
|
135
137
|
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
136
138
|
*
|
|
137
139
|
* // Create a networkClient that connects to the provable explorer api.
|
|
138
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
140
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
139
141
|
*
|
|
140
142
|
* // Set the prover uri.
|
|
141
143
|
* networkClient.setProverUri("https://prover.provable.prove");
|
|
@@ -150,7 +152,7 @@ declare class AleoNetworkClient {
|
|
|
150
152
|
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
151
153
|
*
|
|
152
154
|
* // Create a networkClient that connects to the provable explorer api.
|
|
153
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
155
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
154
156
|
*
|
|
155
157
|
* // Set the record scanner uri.
|
|
156
158
|
* networkClient.setRecordScannerUri("https://scanner.provable.scan");
|
|
@@ -232,7 +234,7 @@ declare class AleoNetworkClient {
|
|
|
232
234
|
* const account = Account.fromCiphertext(process.env.ciphertext, process.env.password);
|
|
233
235
|
*
|
|
234
236
|
* // Create a network client.
|
|
235
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
237
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
236
238
|
* networkClient.setAccount(account);
|
|
237
239
|
*
|
|
238
240
|
* // Find specific amounts
|
|
@@ -263,7 +265,7 @@ declare class AleoNetworkClient {
|
|
|
263
265
|
* const account = Account.fromCiphertext(process.env.ciphertext, process.env.password);
|
|
264
266
|
*
|
|
265
267
|
* // Create a network client and set an account to search for records with.
|
|
266
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
268
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
267
269
|
* networkClient.setAccount(account);
|
|
268
270
|
*
|
|
269
271
|
* // Find specific amounts
|
|
@@ -296,7 +298,7 @@ declare class AleoNetworkClient {
|
|
|
296
298
|
* @example
|
|
297
299
|
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
298
300
|
*
|
|
299
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
301
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
300
302
|
* const block = networkClient.getBlockByHash("ab19dklwl9vp63zu3hwg57wyhvmqf92fx5g8x0t6dr72py8r87pxupqfne5t9");
|
|
301
303
|
*/
|
|
302
304
|
getBlockByHash(blockHash: string): Promise<BlockJSON>;
|
|
@@ -331,7 +333,7 @@ declare class AleoNetworkClient {
|
|
|
331
333
|
* import { AleoNetworkClient } from "@provablehq/sdk/testnet.js";
|
|
332
334
|
*
|
|
333
335
|
* // Get the transaction ID of the deployment transaction for a program.
|
|
334
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
336
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
335
337
|
* const transactionId = networkClient.getDeploymentTransactionIDForProgram("hello_hello.aleo");
|
|
336
338
|
*
|
|
337
339
|
* // Get the transaction data for the deployment transaction.
|
|
@@ -351,7 +353,7 @@ declare class AleoNetworkClient {
|
|
|
351
353
|
* import { AleoNetworkClient, DeploymentJSON } from "@provablehq/sdk/testnet.js";
|
|
352
354
|
*
|
|
353
355
|
* // Get the transaction ID of the deployment transaction for a program.
|
|
354
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
356
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
355
357
|
* const transaction = networkClient.getDeploymentTransactionForProgram("hello_hello.aleo");
|
|
356
358
|
*
|
|
357
359
|
* // Get the verifying keys for each function in the deployment.
|
|
@@ -369,7 +371,7 @@ declare class AleoNetworkClient {
|
|
|
369
371
|
* import { AleoNetworkClient } from "@provablehq/sdk/testnet.js";
|
|
370
372
|
*
|
|
371
373
|
* // Get the transaction ID of the deployment transaction for a program.
|
|
372
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
374
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
373
375
|
* const transactionId = networkClient.getDeploymentTransactionIDForProgram("hello_hello.aleo");
|
|
374
376
|
*
|
|
375
377
|
* // Get the transaction data for the deployment transaction.
|
|
@@ -388,7 +390,7 @@ declare class AleoNetworkClient {
|
|
|
388
390
|
* import { AleoNetworkClient } from "@provablehq/sdk/testnet.js";
|
|
389
391
|
*
|
|
390
392
|
* // Create a network client.
|
|
391
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
393
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
392
394
|
*
|
|
393
395
|
* const latestHeight = networkClient.getLatestBlock();
|
|
394
396
|
*/
|
|
@@ -402,10 +404,10 @@ declare class AleoNetworkClient {
|
|
|
402
404
|
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
403
405
|
*
|
|
404
406
|
* // Create a network client.
|
|
405
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
407
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
406
408
|
*
|
|
407
409
|
* // Create a network client and get the latest committee.
|
|
408
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
410
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
409
411
|
* const latestCommittee = await networkClient.getLatestCommittee();
|
|
410
412
|
*/
|
|
411
413
|
getLatestCommittee(): Promise<object>;
|
|
@@ -419,10 +421,10 @@ declare class AleoNetworkClient {
|
|
|
419
421
|
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
420
422
|
*
|
|
421
423
|
* // Create a network client.
|
|
422
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
424
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
423
425
|
*
|
|
424
426
|
* // Create a network client and get the committee for a specific block.
|
|
425
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
427
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
426
428
|
* const committee = await networkClient.getCommitteeByBlockHeight(1234);
|
|
427
429
|
*/
|
|
428
430
|
getCommitteeByBlockHeight(blockHeight: number): Promise<object>;
|
|
@@ -435,7 +437,7 @@ declare class AleoNetworkClient {
|
|
|
435
437
|
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
436
438
|
*
|
|
437
439
|
* // Create a network client.
|
|
438
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
440
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
439
441
|
*
|
|
440
442
|
* const latestHeight = networkClient.getLatestHeight();
|
|
441
443
|
*/
|
|
@@ -456,7 +458,7 @@ declare class AleoNetworkClient {
|
|
|
456
458
|
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
457
459
|
*
|
|
458
460
|
* // Create a network client.
|
|
459
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
461
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
460
462
|
*
|
|
461
463
|
* // Get the latest block hash.
|
|
462
464
|
* const latestHash = networkClient.getLatestBlockHash();
|
|
@@ -473,7 +475,7 @@ declare class AleoNetworkClient {
|
|
|
473
475
|
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
474
476
|
*
|
|
475
477
|
* // Create a network client.
|
|
476
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
478
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
477
479
|
*
|
|
478
480
|
* // Get the source code of a program.)
|
|
479
481
|
* @returns {Promise<string>} Source code of the program
|
|
@@ -482,7 +484,7 @@ declare class AleoNetworkClient {
|
|
|
482
484
|
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
483
485
|
*
|
|
484
486
|
* // Create a network client.
|
|
485
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
487
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
486
488
|
*
|
|
487
489
|
* const program = networkClient.getProgram("hello_hello.aleo");
|
|
488
490
|
* 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"
|
|
@@ -499,7 +501,7 @@ declare class AleoNetworkClient {
|
|
|
499
501
|
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
500
502
|
*
|
|
501
503
|
* // Create a network client.
|
|
502
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
504
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
503
505
|
*
|
|
504
506
|
* const programVersion = networkClient.getLatestProgramEdition("hello_hello.aleo");
|
|
505
507
|
* assert.equal(programVersion, 1);
|
|
@@ -512,7 +514,7 @@ declare class AleoNetworkClient {
|
|
|
512
514
|
* @returns {{ program_id: string, edition: number, amendment_count: number }}
|
|
513
515
|
*
|
|
514
516
|
* @example
|
|
515
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
517
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
|
|
516
518
|
* const info = await networkClient.getProgramAmendmentCount("hello_hello.aleo");
|
|
517
519
|
* console.log(info.edition, info.amendment_count);
|
|
518
520
|
*/
|
|
@@ -532,7 +534,7 @@ declare class AleoNetworkClient {
|
|
|
532
534
|
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
533
535
|
*
|
|
534
536
|
* // Create a network client.
|
|
535
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
537
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
536
538
|
*
|
|
537
539
|
* const programID = "hello_hello.aleo";
|
|
538
540
|
* 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"
|
|
@@ -561,7 +563,7 @@ declare class AleoNetworkClient {
|
|
|
561
563
|
* }
|
|
562
564
|
*
|
|
563
565
|
* // Create a network client.
|
|
564
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
566
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
565
567
|
*
|
|
566
568
|
* // Imports can be fetched using the program ID, source code, or program object
|
|
567
569
|
* let programImports = await networkClient.getProgramImports("double_test.aleo");
|
|
@@ -586,7 +588,7 @@ declare class AleoNetworkClient {
|
|
|
586
588
|
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
587
589
|
*
|
|
588
590
|
* // Create a network client.
|
|
589
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
591
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
590
592
|
*
|
|
591
593
|
* const programImportsNames = networkClient.getProgramImports("wrapped_credits.aleo");
|
|
592
594
|
* const expectedImportsNames = ["credits.aleo"];
|
|
@@ -603,7 +605,7 @@ declare class AleoNetworkClient {
|
|
|
603
605
|
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
604
606
|
*
|
|
605
607
|
* // Create a network client.
|
|
606
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
608
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
607
609
|
*
|
|
608
610
|
* const mappings = networkClient.getProgramMappingNames("credits.aleo");
|
|
609
611
|
* const expectedMappings = [
|
|
@@ -630,7 +632,7 @@ declare class AleoNetworkClient {
|
|
|
630
632
|
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
631
633
|
*
|
|
632
634
|
* // Create a network client.
|
|
633
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
635
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
634
636
|
*
|
|
635
637
|
* // Get public balance of an account
|
|
636
638
|
* const mappingValue = networkClient.getMappingValue("credits.aleo", "account", "aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px");
|
|
@@ -650,7 +652,7 @@ declare class AleoNetworkClient {
|
|
|
650
652
|
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
651
653
|
*
|
|
652
654
|
* // Create a network client.
|
|
653
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
655
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
654
656
|
*
|
|
655
657
|
* // Get the bond state as an account.
|
|
656
658
|
* const unbondedState = networkClient.getMappingPlaintext("credits.aleo", "bonded", "aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px");
|
|
@@ -683,7 +685,7 @@ declare class AleoNetworkClient {
|
|
|
683
685
|
* import { AleoNetworkClient, Account } from "@provablehq/sdk/mainnet.js";
|
|
684
686
|
*
|
|
685
687
|
* // Create a network client.
|
|
686
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
688
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
687
689
|
*
|
|
688
690
|
* // Get the balance of an account from either an address object or address string.
|
|
689
691
|
* const account = Account.fromCiphertext(process.env.ciphertext, process.env.password);
|
|
@@ -701,7 +703,7 @@ declare class AleoNetworkClient {
|
|
|
701
703
|
* import { AleoNetworkClient, Account } from "@provablehq/sdk/mainnet.js";
|
|
702
704
|
*
|
|
703
705
|
* // Create a network client.
|
|
704
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
706
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
705
707
|
*
|
|
706
708
|
* // Get the latest state root.
|
|
707
709
|
* const stateRoot = networkClient.getStateRoot();
|
|
@@ -717,7 +719,7 @@ declare class AleoNetworkClient {
|
|
|
717
719
|
* import { AleoNetworkClient, Account } from "@provablehq/sdk/mainnet.js";
|
|
718
720
|
*
|
|
719
721
|
* // Create a network client.
|
|
720
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
722
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
721
723
|
*
|
|
722
724
|
* const transaction = networkClient.getTransaction("at1handz9xjrqeynjrr0xay4pcsgtnczdksz3e584vfsgaz0dh0lyxq43a4wj");
|
|
723
725
|
*/
|
|
@@ -732,7 +734,7 @@ declare class AleoNetworkClient {
|
|
|
732
734
|
* import { AleoNetworkClient, Account } from "@provablehq/sdk/mainnet.js";
|
|
733
735
|
*
|
|
734
736
|
* // Create a network client.
|
|
735
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
737
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
736
738
|
*
|
|
737
739
|
* const transaction = networkClient.getConfirmedTransaction("at1handz9xjrqeynjrr0xay4pcsgtnczdksz3e584vfsgaz0dh0lyxq43a4wj");
|
|
738
740
|
* assert.equal(transaction.status, "confirmed");
|
|
@@ -774,7 +776,7 @@ declare class AleoNetworkClient {
|
|
|
774
776
|
* import { AleoNetworkClient, Account } from "@provablehq/sdk/mainnet.js";
|
|
775
777
|
*
|
|
776
778
|
* // Create a network client.
|
|
777
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
779
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
778
780
|
*
|
|
779
781
|
* const transactions = networkClient.getTransactions(654);
|
|
780
782
|
*/
|
|
@@ -789,7 +791,7 @@ declare class AleoNetworkClient {
|
|
|
789
791
|
* import { AleoNetworkClient, Account } from "@provablehq/sdk/mainnet.js";
|
|
790
792
|
*
|
|
791
793
|
* // Create a network client.
|
|
792
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
794
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
793
795
|
*
|
|
794
796
|
* const transactions = networkClient.getTransactionsByBlockHash("ab19dklwl9vp63zu3hwg57wyhvmqf92fx5g8x0t6dr72py8r87pxupqfne5t9");
|
|
795
797
|
*/
|
|
@@ -803,7 +805,7 @@ declare class AleoNetworkClient {
|
|
|
803
805
|
* import { AleoNetworkClient, Account } from "@provablehq/sdk/mainnet.js";
|
|
804
806
|
*
|
|
805
807
|
* // Create a network client.
|
|
806
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
808
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
807
809
|
*
|
|
808
810
|
* // Get the current transactions in the mempool.
|
|
809
811
|
* const transactions = networkClient.getTransactionsInMempool();
|
|
@@ -862,7 +864,7 @@ declare class AleoNetworkClient {
|
|
|
862
864
|
* import { AleoNetworkClient, Account, ProgramManager } from "@provablehq/sdk/mainnet.js";
|
|
863
865
|
*
|
|
864
866
|
* // Create a network client and program manager.
|
|
865
|
-
* const networkClient = new AleoNetworkClient("https://
|
|
867
|
+
* const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2", undefined);
|
|
866
868
|
* const programManager = new ProgramManager(networkClient);
|
|
867
869
|
*
|
|
868
870
|
* // Set the account for the program manager.
|