@provablehq/sdk 0.6.13 → 0.7.1

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 (81) hide show
  1. package/README.md +20 -20
  2. package/dist/{account.d.ts → mainnet/account.d.ts} +10 -10
  3. package/dist/mainnet/browser.d.ts +20 -0
  4. package/dist/mainnet/browser.js +934 -0
  5. package/dist/mainnet/browser.js.map +1 -0
  6. package/dist/mainnet/constants.d.ts +34 -0
  7. package/dist/{function-key-provider.d.ts → mainnet/function-key-provider.d.ts} +58 -57
  8. package/dist/{network-client.d.ts → mainnet/network-client.d.ts} +29 -26
  9. package/dist/{node-polyfill.d.ts → mainnet/node-polyfill.d.ts} +1 -0
  10. package/dist/{node-polyfill.js → mainnet/node-polyfill.js} +1 -0
  11. package/dist/mainnet/node-polyfill.js.map +1 -0
  12. package/dist/mainnet/node.d.ts +2 -0
  13. package/dist/mainnet/node.js +13 -0
  14. package/dist/{node.js.map → mainnet/node.js.map} +1 -1
  15. package/dist/{offline-key-provider.d.ts → mainnet/offline-key-provider.d.ts} +23 -22
  16. package/dist/mainnet/polyfill/shared.d.ts +1 -0
  17. package/dist/mainnet/program-manager-6a377210.js +2200 -0
  18. package/dist/mainnet/program-manager-6a377210.js.map +1 -0
  19. package/dist/{program-manager.d.ts → mainnet/program-manager.d.ts} +63 -59
  20. package/dist/{record-provider.d.ts → mainnet/record-provider.d.ts} +22 -22
  21. package/dist/{utils.d.ts → mainnet/utils.d.ts} +2 -0
  22. package/dist/mainnet/wasm.d.ts +1 -0
  23. package/dist/{worker.d.ts → mainnet/worker.d.ts} +2 -1
  24. package/dist/mainnet/worker.js +78 -0
  25. package/dist/mainnet/worker.js.map +1 -0
  26. package/dist/testnet/account.d.ts +137 -0
  27. package/dist/testnet/browser.d.ts +20 -0
  28. package/dist/testnet/browser.js +934 -0
  29. package/dist/testnet/browser.js.map +1 -0
  30. package/dist/testnet/constants.d.ts +34 -0
  31. package/dist/testnet/function-key-provider.d.ts +349 -0
  32. package/dist/testnet/managed-worker.d.ts +3 -0
  33. package/dist/testnet/models/block.d.ts +21 -0
  34. package/dist/testnet/models/confirmed_transaction.d.ts +6 -0
  35. package/dist/testnet/models/execution.d.ts +5 -0
  36. package/dist/testnet/models/input.d.ts +10 -0
  37. package/dist/testnet/models/output.d.ts +6 -0
  38. package/dist/testnet/models/transactionModel.d.ts +6 -0
  39. package/dist/testnet/models/transition.d.ts +13 -0
  40. package/dist/testnet/network-client.d.ts +270 -0
  41. package/dist/testnet/node-polyfill.d.ts +5 -0
  42. package/dist/testnet/node-polyfill.js +303 -0
  43. package/dist/testnet/node-polyfill.js.map +1 -0
  44. package/dist/testnet/node.d.ts +2 -0
  45. package/dist/testnet/node.js +13 -0
  46. package/dist/testnet/node.js.map +1 -0
  47. package/dist/testnet/offline-key-provider.d.ts +348 -0
  48. package/dist/testnet/polyfill/crypto.d.ts +1 -0
  49. package/dist/testnet/polyfill/fetch.d.ts +1 -0
  50. package/dist/testnet/polyfill/shared.d.ts +1 -0
  51. package/dist/testnet/polyfill/worker.d.ts +1 -0
  52. package/dist/testnet/polyfill/xmlhttprequest.d.ts +1 -0
  53. package/dist/{index.js → testnet/program-manager-97ade0e6.js} +362 -1278
  54. package/dist/testnet/program-manager-97ade0e6.js.map +1 -0
  55. package/dist/testnet/program-manager.d.ts +640 -0
  56. package/dist/testnet/record-provider.d.ts +236 -0
  57. package/dist/testnet/utils.d.ts +4 -0
  58. package/dist/testnet/wasm.d.ts +1 -0
  59. package/dist/testnet/worker.d.ts +9 -0
  60. package/dist/testnet/worker.js +78 -0
  61. package/dist/testnet/worker.js.map +1 -0
  62. package/package.json +23 -13
  63. package/dist/index.d.ts +0 -52
  64. package/dist/index.js.map +0 -1
  65. package/dist/node-polyfill.js.map +0 -1
  66. package/dist/node.d.ts +0 -2
  67. package/dist/node.js +0 -11
  68. package/dist/worker.js +0 -74
  69. package/dist/worker.js.map +0 -1
  70. /package/dist/{managed-worker.d.ts → mainnet/managed-worker.d.ts} +0 -0
  71. /package/dist/{models → mainnet/models}/block.d.ts +0 -0
  72. /package/dist/{models → mainnet/models}/confirmed_transaction.d.ts +0 -0
  73. /package/dist/{models → mainnet/models}/execution.d.ts +0 -0
  74. /package/dist/{models → mainnet/models}/input.d.ts +0 -0
  75. /package/dist/{models → mainnet/models}/output.d.ts +0 -0
  76. /package/dist/{models → mainnet/models}/transactionModel.d.ts +0 -0
  77. /package/dist/{models → mainnet/models}/transition.d.ts +0 -0
  78. /package/dist/{polyfill → mainnet/polyfill}/crypto.d.ts +0 -0
  79. /package/dist/{polyfill → mainnet/polyfill}/fetch.d.ts +0 -0
  80. /package/dist/{polyfill → mainnet/polyfill}/worker.d.ts +0 -0
  81. /package/dist/{polyfill → mainnet/polyfill}/xmlhttprequest.d.ts +0 -0
@@ -1,4 +1,8 @@
1
- import { Account, AleoNetworkClient, ExecutionResponse, FunctionKeyProvider, FunctionKeyPair, OfflineQuery, KeySearchParams, RecordPlaintext, RecordProvider, RecordSearchParams, PrivateKey, Program, ProgramImports, ProvingKey, VerifyingKey, Transaction } from "./index";
1
+ import { Account } from "./account";
2
+ import { AleoNetworkClient, ProgramImports } from "./network-client";
3
+ import { RecordProvider, RecordSearchParams } from "./record-provider";
4
+ import { FunctionKeyPair, FunctionKeyProvider, KeySearchParams } from "./function-key-provider";
5
+ import { ExecutionResponse, OfflineQuery, RecordPlaintext, PrivateKey, Program, ProvingKey, VerifyingKey, Transaction } from "./wasm";
2
6
  /**
3
7
  * Represents the options for executing a transaction in the Aleo network.
4
8
  * This interface is used to specify the parameters required for building and submitting an execution transaction.
@@ -84,17 +88,17 @@ declare class ProgramManager {
84
88
  * pay the deployment fee
85
89
  * @param {string | RecordPlaintext | undefined} feeRecord Optional Fee record to use for the transaction
86
90
  * @param {PrivateKey | undefined} privateKey Optional private key to use for the transaction
87
- * @returns {string | Error} The transaction id of the deployed program or a failure message from the network
91
+ * @returns {string} The transaction id of the deployed program or a failure message from the network
88
92
  *
89
93
  * @example
90
94
  * // Create a new NetworkClient, KeyProvider, and RecordProvider
91
- * const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1");
95
+ * const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
92
96
  * const keyProvider = new AleoKeyProvider();
93
97
  * const recordProvider = new NetworkRecordProvider(account, networkClient);
94
98
  *
95
99
  * // Initialize a program manager with the key provider to automatically fetch keys for deployments
96
100
  * 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";
97
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, recordProvider);
101
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
98
102
  *
99
103
  * // Define a fee in credits
100
104
  * const fee = 1.2;
@@ -105,22 +109,22 @@ declare class ProgramManager {
105
109
  * // Verify the transaction was successful
106
110
  * const transaction = await programManager.networkClient.getTransaction(tx_id);
107
111
  */
108
- deploy(program: string, fee: number, privateFee: boolean, recordSearchParams?: RecordSearchParams, feeRecord?: string | RecordPlaintext, privateKey?: PrivateKey): Promise<string | Error>;
112
+ deploy(program: string, fee: number, privateFee: boolean, recordSearchParams?: RecordSearchParams, feeRecord?: string | RecordPlaintext, privateKey?: PrivateKey): Promise<string>;
109
113
  /**
110
114
  * Builds an execution transaction for submission to the Aleo network.
111
115
  *
112
116
  * @param {ExecuteOptions} options - The options for the execution transaction.
113
- * @returns {Promise<Transaction | Error>} - A promise that resolves to the transaction or an error.
117
+ * @returns {Promise<Transaction>} - A promise that resolves to the transaction or an error.
114
118
  *
115
119
  * @example
116
120
  * // Create a new NetworkClient, KeyProvider, and RecordProvider using official Aleo record, key, and network providers
117
- * const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1");
121
+ * const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
118
122
  * const keyProvider = new AleoKeyProvider();
119
123
  * keyProvider.useCache = true;
120
124
  * const recordProvider = new NetworkRecordProvider(account, networkClient);
121
125
  *
122
126
  * // Initialize a program manager with the key provider to automatically fetch keys for executions
123
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, recordProvider);
127
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
124
128
  *
125
129
  * // Build and execute the transaction
126
130
  * const transaction = await programManager.buildExecutionTransaction({
@@ -133,22 +137,22 @@ declare class ProgramManager {
133
137
  * });
134
138
  * const result = await programManager.networkClient.submitTransaction(transaction);
135
139
  */
136
- buildExecutionTransaction(options: ExecuteOptions): Promise<Transaction | Error>;
140
+ buildExecutionTransaction(options: ExecuteOptions): Promise<Transaction>;
137
141
  /**
138
142
  * Builds an execution transaction for submission to the Aleo network.
139
143
  *
140
144
  * @param {ExecuteOptions} options - The options for the execution transaction.
141
- * @returns {Promise<Transaction | Error>} - A promise that resolves to the transaction or an error.
145
+ * @returns {Promise<Transaction>} - A promise that resolves to the transaction or an error.
142
146
  *
143
147
  * @example
144
148
  * // Create a new NetworkClient, KeyProvider, and RecordProvider using official Aleo record, key, and network providers
145
- * const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1");
149
+ * const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
146
150
  * const keyProvider = new AleoKeyProvider();
147
151
  * keyProvider.useCache = true;
148
152
  * const recordProvider = new NetworkRecordProvider(account, networkClient);
149
153
  *
150
154
  * // Initialize a program manager with the key provider to automatically fetch keys for executions
151
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, recordProvider);
155
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
152
156
  *
153
157
  * // Build and execute the transaction
154
158
  * const transaction = await programManager.execute({
@@ -161,7 +165,7 @@ declare class ProgramManager {
161
165
  * });
162
166
  * const result = await programManager.networkClient.submitTransaction(transaction);
163
167
  */
164
- execute(options: ExecuteOptions): Promise<string | Error>;
168
+ execute(options: ExecuteOptions): Promise<string>;
165
169
  /**
166
170
  * Run an Aleo program in offline mode
167
171
  *
@@ -177,7 +181,7 @@ declare class ProgramManager {
177
181
  * @param {VerifyingKey | undefined} verifyingKey Optional verifying key to use for the transaction
178
182
  * @param {PrivateKey | undefined} privateKey Optional private key to use for the transaction
179
183
  * @param {OfflineQuery | undefined} offlineQuery Optional offline query if creating transactions in an offline environment
180
- * @returns {Promise<string | Error>}
184
+ * @returns {Promise<string>}
181
185
  *
182
186
  * @example
183
187
  * import { Account, Program } from '@provablehq/sdk';
@@ -208,9 +212,9 @@ declare class ProgramManager {
208
212
  * @param {RecordPlaintext | string | undefined} feeRecord Fee record to use for the join transaction
209
213
  * @param {PrivateKey | undefined} privateKey Private key to use for the join transaction
210
214
  * @param {OfflineQuery | undefined} offlineQuery Optional offline query if creating transactions in an offline environment
211
- * @returns {Promise<string | Error>}
215
+ * @returns {Promise<string>}
212
216
  */
213
- join(recordOne: RecordPlaintext | string, recordTwo: RecordPlaintext | string, fee: number, privateFee: boolean, recordSearchParams?: RecordSearchParams | undefined, feeRecord?: RecordPlaintext | string | undefined, privateKey?: PrivateKey, offlineQuery?: OfflineQuery): Promise<string | Error>;
217
+ join(recordOne: RecordPlaintext | string, recordTwo: RecordPlaintext | string, fee: number, privateFee: boolean, recordSearchParams?: RecordSearchParams | undefined, feeRecord?: RecordPlaintext | string | undefined, privateKey?: PrivateKey, offlineQuery?: OfflineQuery): Promise<string>;
214
218
  /**
215
219
  * Split credits into two new credits records
216
220
  *
@@ -218,22 +222,22 @@ declare class ProgramManager {
218
222
  * @param {RecordPlaintext | string} amountRecord Amount record to use for the split transaction
219
223
  * @param {PrivateKey | undefined} privateKey Optional private key to use for the split transaction
220
224
  * @param {OfflineQuery | undefined} offlineQuery Optional offline query if creating transactions in an offline environment
221
- * @returns {Promise<string | Error>}
225
+ * @returns {Promise<string>}
222
226
  *
223
227
  * @example
224
228
  * // Create a new NetworkClient, KeyProvider, and RecordProvider
225
- * const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1");
229
+ * const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
226
230
  * const keyProvider = new AleoKeyProvider();
227
231
  * const recordProvider = new NetworkRecordProvider(account, networkClient);
228
232
  *
229
233
  * // Initialize a program manager with the key provider to automatically fetch keys for executions
230
234
  * const programName = "hello_hello.aleo";
231
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, recordProvider);
235
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
232
236
  * const record = "{ owner: aleo184vuwr5u7u0ha5f5k44067dd2uaqewxx6pe5ltha5pv99wvhfqxqv339h4.private, microcredits: 45000000u64.private, _nonce: 4106205762862305308495708971985748592380064201230396559307556388725936304984group.public}"
233
237
  * const tx_id = await programManager.split(25000000, record);
234
238
  * const transaction = await programManager.networkClient.getTransaction(tx_id);
235
239
  */
236
- split(splitAmount: number, amountRecord: RecordPlaintext | string, privateKey?: PrivateKey, offlineQuery?: OfflineQuery): Promise<string | Error>;
240
+ split(splitAmount: number, amountRecord: RecordPlaintext | string, privateKey?: PrivateKey, offlineQuery?: OfflineQuery): Promise<string>;
237
241
  /**
238
242
  * Pre-synthesize proving and verifying keys for a program
239
243
  *
@@ -242,9 +246,9 @@ declare class ProgramManager {
242
246
  * @param inputs {Array<string>} Sample inputs to the function
243
247
  * @param privateKey {PrivateKey | undefined} Optional private key to use for the key synthesis
244
248
  *
245
- * @returns {Promise<FunctionKeyPair | Error>}
249
+ * @returns {Promise<FunctionKeyPair>}
246
250
  */
247
- synthesizeKeys(program: string, function_id: string, inputs: Array<string>, privateKey?: PrivateKey): Promise<FunctionKeyPair | Error>;
251
+ synthesizeKeys(program: string, function_id: string, inputs: Array<string>, privateKey?: PrivateKey): Promise<FunctionKeyPair>;
248
252
  /**
249
253
  * Build a transaction to transfer credits to another account for later submission to the Aleo network
250
254
  *
@@ -259,22 +263,22 @@ declare class ProgramManager {
259
263
  * @param {RecordPlaintext | string} feeRecord Optional fee record to use for the transfer
260
264
  * @param {PrivateKey | undefined} privateKey Optional private key to use for the transfer transaction
261
265
  * @param {OfflineQuery | undefined} offlineQuery Optional offline query if creating transactions in an offline environment
262
- * @returns {Promise<string | Error>} The transaction id of the transfer transaction
266
+ * @returns {Promise<string>} The transaction id of the transfer transaction
263
267
  *
264
268
  * @example
265
269
  * // Create a new NetworkClient, KeyProvider, and RecordProvider
266
- * const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1");
270
+ * const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
267
271
  * const keyProvider = new AleoKeyProvider();
268
272
  * const recordProvider = new NetworkRecordProvider(account, networkClient);
269
273
  *
270
274
  * // Initialize a program manager with the key provider to automatically fetch keys for executions
271
275
  * const programName = "hello_hello.aleo";
272
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, recordProvider);
276
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
273
277
  * await programManager.initialize();
274
278
  * const tx_id = await programManager.transfer(1, "aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px", "private", 0.2)
275
279
  * const transaction = await programManager.networkClient.getTransaction(tx_id);
276
280
  */
277
- buildTransferTransaction(amount: number, recipient: string, transferType: string, fee: number, privateFee: boolean, recordSearchParams?: RecordSearchParams, amountRecord?: RecordPlaintext | string, feeRecord?: RecordPlaintext | string, privateKey?: PrivateKey, offlineQuery?: OfflineQuery): Promise<Transaction | Error>;
281
+ buildTransferTransaction(amount: number, recipient: string, transferType: string, fee: number, privateFee: boolean, recordSearchParams?: RecordSearchParams, amountRecord?: RecordPlaintext | string, feeRecord?: RecordPlaintext | string, privateKey?: PrivateKey, offlineQuery?: OfflineQuery): Promise<Transaction>;
278
282
  /**
279
283
  * Build a transfer_public transaction to transfer credits to another account for later submission to the Aleo network
280
284
  *
@@ -289,9 +293,9 @@ declare class ProgramManager {
289
293
  * @param {RecordPlaintext | string} feeRecord Optional fee record to use for the transfer
290
294
  * @param {PrivateKey | undefined} privateKey Optional private key to use for the transfer transaction
291
295
  * @param {OfflineQuery | undefined} offlineQuery Optional offline query if creating transactions in an offline environment
292
- * @returns {Promise<string | Error>} The transaction id of the transfer transaction
296
+ * @returns {Promise<string>} The transaction id of the transfer transaction
293
297
  */
294
- buildTransferPublicTransaction(amount: number, recipient: string, fee: number, privateKey?: PrivateKey, offlineQuery?: OfflineQuery): Promise<Transaction | Error>;
298
+ buildTransferPublicTransaction(amount: number, recipient: string, fee: number, privateKey?: PrivateKey, offlineQuery?: OfflineQuery): Promise<Transaction>;
295
299
  /**
296
300
  * Build a transfer_public_as_signer transaction to transfer credits to another account for later submission to the Aleo network
297
301
  *
@@ -306,9 +310,9 @@ declare class ProgramManager {
306
310
  * @param {RecordPlaintext | string} feeRecord Optional fee record to use for the transfer
307
311
  * @param {PrivateKey | undefined} privateKey Optional private key to use for the transfer transaction
308
312
  * @param {OfflineQuery | undefined} offlineQuery Optional offline query if creating transactions in an offline environment
309
- * @returns {Promise<string | Error>} The transaction id of the transfer transaction
313
+ * @returns {Promise<string>} The transaction id of the transfer transaction
310
314
  */
311
- buildTransferPublicAsSignerTransaction(amount: number, recipient: string, fee: number, privateKey?: PrivateKey, offlineQuery?: OfflineQuery): Promise<Transaction | Error>;
315
+ buildTransferPublicAsSignerTransaction(amount: number, recipient: string, fee: number, privateKey?: PrivateKey, offlineQuery?: OfflineQuery): Promise<Transaction>;
312
316
  /**
313
317
  * Transfer credits to another account
314
318
  *
@@ -323,21 +327,21 @@ declare class ProgramManager {
323
327
  * @param {RecordPlaintext | string} feeRecord Optional fee record to use for the transfer
324
328
  * @param {PrivateKey | undefined} privateKey Optional private key to use for the transfer transaction
325
329
  * @param {OfflineQuery | undefined} offlineQuery Optional offline query if creating transactions in an offline environment
326
- * @returns {Promise<string | Error>} The transaction id of the transfer transaction
330
+ * @returns {Promise<string>} The transaction id of the transfer transaction
327
331
  *
328
332
  * @example
329
333
  * // Create a new NetworkClient, KeyProvider, and RecordProvider
330
- * const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1");
334
+ * const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
331
335
  * const keyProvider = new AleoKeyProvider();
332
336
  * const recordProvider = new NetworkRecordProvider(account, networkClient);
333
337
  *
334
338
  * // Initialize a program manager with the key provider to automatically fetch keys for executions
335
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, recordProvider);
339
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
336
340
  * await programManager.initialize();
337
341
  * const tx_id = await programManager.transfer(1, "aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px", "private", 0.2)
338
342
  * const transaction = await programManager.networkClient.getTransaction(tx_id);
339
343
  */
340
- transfer(amount: number, recipient: string, transferType: string, fee: number, privateFee: boolean, recordSearchParams?: RecordSearchParams, amountRecord?: RecordPlaintext | string, feeRecord?: RecordPlaintext | string, privateKey?: PrivateKey, offlineQuery?: OfflineQuery): Promise<string | Error>;
344
+ transfer(amount: number, recipient: string, transferType: string, fee: number, privateFee: boolean, recordSearchParams?: RecordSearchParams, amountRecord?: RecordPlaintext | string, feeRecord?: RecordPlaintext | string, privateKey?: PrivateKey, offlineQuery?: OfflineQuery): Promise<string>;
341
345
  /**
342
346
  * Build transaction to bond credits to a validator for later submission to the Aleo Network
343
347
  *
@@ -347,7 +351,7 @@ declare class ProgramManager {
347
351
  * keyProvider.useCache = true;
348
352
  *
349
353
  * // Create a new ProgramManager with the key that will be used to bond credits
350
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, undefined);
354
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, undefined);
351
355
  * programManager.setAccount(new Account("YourPrivateKey"));
352
356
  *
353
357
  * // Create the bonding transaction object for later submission
@@ -368,7 +372,7 @@ declare class ProgramManager {
368
372
  * @param {number} amount The amount of credits to bond
369
373
  * @param {Partial<ExecuteOptions>} options - Override default execution options.
370
374
  */
371
- buildBondPublicTransaction(staker_address: string, validator_address: string, withdrawal_address: string, amount: number, options?: Partial<ExecuteOptions>): Promise<Error | Transaction>;
375
+ buildBondPublicTransaction(staker_address: string, validator_address: string, withdrawal_address: string, amount: number, options?: Partial<ExecuteOptions>): Promise<Transaction>;
372
376
  /**
373
377
  * Bond credits to validator.
374
378
  *
@@ -378,7 +382,7 @@ declare class ProgramManager {
378
382
  * keyProvider.useCache = true;
379
383
  *
380
384
  * // Create a new ProgramManager with the key that will be used to bond credits
381
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, undefined);
385
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, undefined);
382
386
  * programManager.setAccount(new Account("YourPrivateKey"));
383
387
  *
384
388
  * // Create the bonding transaction
@@ -395,7 +399,7 @@ declare class ProgramManager {
395
399
  * @param {number} amount The amount of credits to bond
396
400
  * @param {Options} options Options for the execution
397
401
  */
398
- bondPublic(staker_address: string, validator_address: string, withdrawal_address: string, amount: number, options?: Partial<ExecuteOptions>): Promise<string | Error>;
402
+ bondPublic(staker_address: string, validator_address: string, withdrawal_address: string, amount: number, options?: Partial<ExecuteOptions>): Promise<string>;
399
403
  /**
400
404
  * Build a bond_validator transaction for later submission to the Aleo Network.
401
405
  *
@@ -405,7 +409,7 @@ declare class ProgramManager {
405
409
  * keyProvider.useCache = true;
406
410
  *
407
411
  * // Create a new ProgramManager with the key that will be used to bond credits
408
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, undefined);
412
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, undefined);
409
413
  * programManager.setAccount(new Account("YourPrivateKey"));
410
414
  *
411
415
  * // Create the bond validator transaction object for later use.
@@ -426,7 +430,7 @@ declare class ProgramManager {
426
430
  * @param {number} commission The commission rate for the validator (must be between 0 and 100 - an error will be thrown if it is not)
427
431
  * @param {Partial<ExecuteOptions>} options - Override default execution options.
428
432
  */
429
- buildBondValidatorTransaction(validator_address: string, withdrawal_address: string, amount: number, commission: number, options?: Partial<ExecuteOptions>): Promise<Error | Transaction>;
433
+ buildBondValidatorTransaction(validator_address: string, withdrawal_address: string, amount: number, commission: number, options?: Partial<ExecuteOptions>): Promise<Transaction>;
430
434
  /**
431
435
  * Build transaction to bond a validator.
432
436
  *
@@ -436,7 +440,7 @@ declare class ProgramManager {
436
440
  * keyProvider.useCache = true;
437
441
  *
438
442
  * // Create a new ProgramManager with the key that will be used to bond credits
439
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, undefined);
443
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, undefined);
440
444
  * programManager.setAccount(new Account("YourPrivateKey"));
441
445
  *
442
446
  * // Create the bonding transaction
@@ -453,14 +457,14 @@ declare class ProgramManager {
453
457
  * @param {number} commission The commission rate for the validator (must be between 0 and 100 - an error will be thrown if it is not)
454
458
  * @param {Partial<ExecuteOptions>} options - Override default execution options.
455
459
  */
456
- bondValidator(validator_address: string, withdrawal_address: string, amount: number, commission: number, options?: Partial<ExecuteOptions>): Promise<string | Error>;
460
+ bondValidator(validator_address: string, withdrawal_address: string, amount: number, commission: number, options?: Partial<ExecuteOptions>): Promise<string>;
457
461
  /**
458
462
  * Build a transaction to unbond public credits from a validator in the Aleo network.
459
463
  *
460
464
  * @param {string} staker_address - The address of the staker who is unbonding the credits.
461
465
  * @param {number} amount - The amount of credits to unbond (scaled by 1,000,000).
462
466
  * @param {Partial<ExecuteOptions>} options - Override default execution options.
463
- * @returns {Promise<Transaction | Error>} - A promise that resolves to the transaction or an error message.
467
+ * @returns {Promise<Transaction>} - A promise that resolves to the transaction or an error message.
464
468
  *
465
469
  * @example
466
470
  * // Create a keyProvider to handle key management.
@@ -468,14 +472,14 @@ declare class ProgramManager {
468
472
  * keyProvider.useCache = true;
469
473
  *
470
474
  * // Create a new ProgramManager with the key that will be used to unbond credits.
471
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, undefined);
475
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, undefined);
472
476
  * const tx = await programManager.buildUnbondPublicTransaction("aleo1jx8s4dvjepculny4wfrzwyhs3tlyv65r58ns3g6q2gm2esh7ps8sqy9s5j", 2000000);
473
477
  * console.log(tx);
474
478
  *
475
479
  * // The transaction can be submitted later to the network using the network client.
476
480
  * programManager.networkClient.submitTransaction(tx);
477
481
  */
478
- buildUnbondPublicTransaction(staker_address: string, amount: number, options?: Partial<ExecuteOptions>): Promise<Transaction | Error>;
482
+ buildUnbondPublicTransaction(staker_address: string, amount: number, options?: Partial<ExecuteOptions>): Promise<Transaction>;
479
483
  /**
480
484
  * Unbond a specified amount of staked credits.
481
485
  *
@@ -485,7 +489,7 @@ declare class ProgramManager {
485
489
  * keyProvider.useCache = true;
486
490
  *
487
491
  * // Create a new ProgramManager with the key that will be used to bond credits
488
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, undefined);
492
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, undefined);
489
493
  * programManager.setAccount(new Account("YourPrivateKey"));
490
494
  *
491
495
  * // Create the bonding transaction and send it to the network
@@ -501,13 +505,13 @@ declare class ProgramManager {
501
505
  * after the unbond operation, the delegator will be removed from the validator's staking pool.
502
506
  * @param {ExecuteOptions} options Options for the execution
503
507
  */
504
- unbondPublic(staker_address: string, amount: number, options?: Partial<ExecuteOptions>): Promise<string | Error>;
508
+ unbondPublic(staker_address: string, amount: number, options?: Partial<ExecuteOptions>): Promise<string>;
505
509
  /**
506
510
  * Build a transaction to claim unbonded public credits in the Aleo network.
507
511
  *
508
512
  * @param {string} staker_address - The address of the staker who is claiming the credits.
509
513
  * @param {Partial<ExecuteOptions>} options - Override default execution options.
510
- * @returns {Promise<Transaction | Error>} - A promise that resolves to the transaction or an error message.
514
+ * @returns {Promise<Transaction>} - A promise that resolves to the transaction or an error message.
511
515
  *
512
516
  * @example
513
517
  * // Create a keyProvider to handle key management
@@ -515,7 +519,7 @@ declare class ProgramManager {
515
519
  * keyProvider.useCache = true;
516
520
  *
517
521
  * // Create a new ProgramManager with the key that will be used to claim unbonded credits.
518
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, undefined);
522
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, undefined);
519
523
  *
520
524
  * // Create the claim unbonded transaction object for later use.
521
525
  * const tx = await programManager.buildClaimUnbondPublicTransaction("aleo1jx8s4dvjepculny4wfrzwyhs3tlyv65r58ns3g6q2gm2esh7ps8sqy9s5j");
@@ -524,7 +528,7 @@ declare class ProgramManager {
524
528
  * // The transaction can be submitted later to the network using the network client.
525
529
  * programManager.networkClient.submitTransaction(tx);
526
530
  */
527
- buildClaimUnbondPublicTransaction(staker_address: string, options?: Partial<ExecuteOptions>): Promise<Transaction | Error>;
531
+ buildClaimUnbondPublicTransaction(staker_address: string, options?: Partial<ExecuteOptions>): Promise<Transaction>;
528
532
  /**
529
533
  * Claim unbonded credits. If credits have been unbonded by the account executing this function, this method will
530
534
  * claim them and add them to the public balance of the account.
@@ -535,7 +539,7 @@ declare class ProgramManager {
535
539
  * keyProvider.useCache = true;
536
540
  *
537
541
  * // Create a new ProgramManager with the key that will be used to bond credits
538
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, undefined);
542
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, undefined);
539
543
  * programManager.setAccount(new Account("YourPrivateKey"));
540
544
  *
541
545
  * // Create the bonding transaction
@@ -545,7 +549,7 @@ declare class ProgramManager {
545
549
  * @param {ExecuteOptions} options
546
550
  * @returns string
547
551
  */
548
- claimUnbondPublic(staker_address: string, options?: Partial<ExecuteOptions>): Promise<string | Error>;
552
+ claimUnbondPublic(staker_address: string, options?: Partial<ExecuteOptions>): Promise<string>;
549
553
  /**
550
554
  * Build a set_validator_state transaction for later usage.
551
555
  *
@@ -563,7 +567,7 @@ declare class ProgramManager {
563
567
  * keyProvider.useCache = true;
564
568
  *
565
569
  * // Create a new ProgramManager with the key that will be used to bond credits
566
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, undefined);
570
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, undefined);
567
571
  * programManager.setAccount(new Account("ValidatorPrivateKey"));
568
572
  *
569
573
  * // Create the bonding transaction
@@ -576,7 +580,7 @@ declare class ProgramManager {
576
580
  * @param {boolean} validator_state
577
581
  * @param {Partial<ExecuteOptions>} options - Override default execution options
578
582
  */
579
- buildSetValidatorStateTransaction(validator_state: boolean, options?: Partial<ExecuteOptions>): Promise<string | Error>;
583
+ buildSetValidatorStateTransaction(validator_state: boolean, options?: Partial<ExecuteOptions>): Promise<string>;
580
584
  /**
581
585
  * Submit a set_validator_state transaction to the Aleo Network.
582
586
  *
@@ -594,7 +598,7 @@ declare class ProgramManager {
594
598
  * keyProvider.useCache = true;
595
599
  *
596
600
  * // Create a new ProgramManager with the key that will be used to bond credits
597
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, undefined);
601
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, undefined);
598
602
  * programManager.setAccount(new Account("ValidatorPrivateKey"));
599
603
  *
600
604
  * // Create the bonding transaction
@@ -604,7 +608,7 @@ declare class ProgramManager {
604
608
  * @param {boolean} validator_state
605
609
  * @param {Partial<ExecuteOptions>} options - Override default execution options
606
610
  */
607
- setValidatorState(validator_state: boolean, options?: Partial<ExecuteOptions>): Promise<string | Error>;
611
+ setValidatorState(validator_state: boolean, options?: Partial<ExecuteOptions>): Promise<string>;
608
612
  /**
609
613
  * Verify a proof of execution from an offline execution
610
614
  *
@@ -616,9 +620,9 @@ declare class ProgramManager {
616
620
  * Create a program object from a program's source code
617
621
  *
618
622
  * @param {string} program Program source code
619
- * @returns {Program | Error} The program object
623
+ * @returns {Program} The program object
620
624
  */
621
- createProgramFromSource(program: string): Program | Error;
625
+ createProgramFromSource(program: string): Program;
622
626
  /**
623
627
  * Get the credits program object
624
628
  *
@@ -631,6 +635,6 @@ declare class ProgramManager {
631
635
  * @param {string} program The program source code
632
636
  */
633
637
  verifyProgram(program: string): boolean;
634
- getCreditsRecord(amount: number, nonces: string[], record?: RecordPlaintext | string, params?: RecordSearchParams): Promise<RecordPlaintext | Error>;
638
+ getCreditsRecord(amount: number, nonces: string[], record?: RecordPlaintext | string, params?: RecordSearchParams): Promise<RecordPlaintext>;
635
639
  }
636
640
  export { ProgramManager };
@@ -1,4 +1,4 @@
1
- import { RecordPlaintext } from "./index";
1
+ import { RecordPlaintext } from "./wasm";
2
2
  import { Account } from "./account";
3
3
  import { AleoNetworkClient } from "./network-client";
4
4
  /**
@@ -23,7 +23,7 @@ interface RecordProvider {
23
23
  * @param {boolean} unspent Whether or not the record is unspent
24
24
  * @param {string[]} nonces Nonces of records already found so they are not found again
25
25
  * @param {RecordSearchParams} searchParameters Additional parameters to search for
26
- * @returns {Promise<RecordPlaintext | Error>} The record if found, otherwise an error
26
+ * @returns {Promise<RecordPlaintext>} The record if found, otherwise an error
27
27
  *
28
28
  * @example
29
29
  * // A class implementing record provider can be used to find a record with a given number of microcredits
@@ -35,10 +35,10 @@ interface RecordProvider {
35
35
  *
36
36
  * // When the program manager is initialized with the record provider it will be used to find automatically find
37
37
  * // fee records and amount records for value transfers so that they do not need to be specified manually
38
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, recordProvider);
38
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
39
39
  * programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
40
40
  */
41
- findCreditsRecord(microcredits: number, unspent: boolean, nonces?: string[], searchParameters?: RecordSearchParams): Promise<RecordPlaintext | Error>;
41
+ findCreditsRecord(microcredits: number, unspent: boolean, nonces?: string[], searchParameters?: RecordSearchParams): Promise<RecordPlaintext>;
42
42
  /**
43
43
  * Find a list of credit.aleo records with a given number of microcredits from the chosen provider
44
44
  *
@@ -46,7 +46,7 @@ interface RecordProvider {
46
46
  * @param {boolean} unspent Whether or not the record is unspent
47
47
  * @param {string[]} nonces Nonces of records already found so that they are not found again
48
48
  * @param {RecordSearchParams} searchParameters Additional parameters to search for
49
- * @returns {Promise<RecordPlaintext[] | Error>} A list of records with a value greater or equal to the amounts specified if such records exist, otherwise an error
49
+ * @returns {Promise<RecordPlaintext[]>} A list of records with a value greater or equal to the amounts specified if such records exist, otherwise an error
50
50
  *
51
51
  * @example
52
52
  * // A class implementing record provider can be used to find a record with a given number of microcredits
@@ -60,16 +60,16 @@ interface RecordProvider {
60
60
  *
61
61
  * // When the program manager is initialized with the record provider it will be used to find automatically find
62
62
  * // fee records and amount records for value transfers so that they do not need to be specified manually
63
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, recordProvider);
63
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
64
64
  * programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
65
65
  */
66
- findCreditsRecords(microcreditAmounts: number[], unspent: boolean, nonces?: string[], searchParameters?: RecordSearchParams): Promise<RecordPlaintext[] | Error>;
66
+ findCreditsRecords(microcreditAmounts: number[], unspent: boolean, nonces?: string[], searchParameters?: RecordSearchParams): Promise<RecordPlaintext[]>;
67
67
  /**
68
68
  * Find an arbitrary record
69
69
  * @param {boolean} unspent Whether or not the record is unspent
70
70
  * @param {string[]} nonces Nonces of records already found so that they are not found again
71
71
  * @param {RecordSearchParams} searchParameters Additional parameters to search for
72
- * @returns {Promise<RecordPlaintext | Error>} The record if found, otherwise an error
72
+ * @returns {Promise<RecordPlaintext>} The record if found, otherwise an error
73
73
  *
74
74
  * @example
75
75
  * // The RecordSearchParams interface can be used to create parameters for custom record searches which can then
@@ -95,14 +95,14 @@ interface RecordProvider {
95
95
  *
96
96
  * const record = await recordProvider.findRecord(true, [], params);
97
97
  */
98
- findRecord(unspent: boolean, nonces?: string[], searchParameters?: RecordSearchParams): Promise<RecordPlaintext | Error>;
98
+ findRecord(unspent: boolean, nonces?: string[], searchParameters?: RecordSearchParams): Promise<RecordPlaintext>;
99
99
  /**
100
100
  * Find multiple records from arbitrary programs
101
101
  *
102
102
  * @param {boolean} unspent Whether or not the record is unspent
103
103
  * @param {string[]} nonces Nonces of records already found so that they are not found again
104
104
  * @param {RecordSearchParams} searchParameters Additional parameters to search for
105
- * @returns {Promise<RecordPlaintext | Error>} The record if found, otherwise an error
105
+ * @returns {Promise<RecordPlaintext>} The record if found, otherwise an error
106
106
  *
107
107
  * // The RecordSearchParams interface can be used to create parameters for custom record searches which can then
108
108
  * // be passed to the record provider. An example of how this would be done for the credits.aleo program is shown
@@ -128,7 +128,7 @@ interface RecordProvider {
128
128
  * const params = new CustomRecordSearch(0, 100, 5000, 2, "credits.aleo", "credits");
129
129
  * const records = await recordProvider.findRecord(true, [], params);
130
130
  */
131
- findRecords(unspent: boolean, nonces?: string[], searchParameters?: RecordSearchParams): Promise<RecordPlaintext[] | Error>;
131
+ findRecords(unspent: boolean, nonces?: string[], searchParameters?: RecordSearchParams): Promise<RecordPlaintext[]>;
132
132
  }
133
133
  /**
134
134
  * A record provider implementation that uses the official Aleo API to find records for usage in program execution and
@@ -151,11 +151,11 @@ declare class NetworkRecordProvider implements RecordProvider {
151
151
  * @param {boolean} unspent Whether or not the record is unspent
152
152
  * @param {string[]} nonces Nonces of records already found so that they are not found again
153
153
  * @param {RecordSearchParams} searchParameters Additional parameters to search for
154
- * @returns {Promise<RecordPlaintext | Error>} The record if found, otherwise an error
154
+ * @returns {Promise<RecordPlaintext>} The record if found, otherwise an error
155
155
  *
156
156
  * @example
157
157
  * // Create a new NetworkRecordProvider
158
- * const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1");
158
+ * const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
159
159
  * const keyProvider = new AleoKeyProvider();
160
160
  * const recordProvider = new NetworkRecordProvider(account, networkClient);
161
161
  *
@@ -168,11 +168,11 @@ declare class NetworkRecordProvider implements RecordProvider {
168
168
  *
169
169
  * // When the program manager is initialized with the record provider it will be used to find automatically find
170
170
  * // fee records and amount records for value transfers so that they do not need to be specified manually
171
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, recordProvider);
171
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
172
172
  * programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
173
173
  *
174
174
  * */
175
- findCreditsRecords(microcredits: number[], unspent: boolean, nonces?: string[], searchParameters?: RecordSearchParams): Promise<RecordPlaintext[] | Error>;
175
+ findCreditsRecords(microcredits: number[], unspent: boolean, nonces?: string[], searchParameters?: RecordSearchParams): Promise<RecordPlaintext[]>;
176
176
  /**
177
177
  * Find a credit record with a given number of microcredits by via the official Aleo API
178
178
  *
@@ -180,11 +180,11 @@ declare class NetworkRecordProvider implements RecordProvider {
180
180
  * @param {boolean} unspent Whether or not the record is unspent
181
181
  * @param {string[]} nonces Nonces of records already found so that they are not found again
182
182
  * @param {RecordSearchParams} searchParameters Additional parameters to search for
183
- * @returns {Promise<RecordPlaintext | Error>} The record if found, otherwise an error
183
+ * @returns {Promise<RecordPlaintext>} The record if found, otherwise an error
184
184
  *
185
185
  * @example
186
186
  * // Create a new NetworkRecordProvider
187
- * const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1");
187
+ * const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
188
188
  * const keyProvider = new AleoKeyProvider();
189
189
  * const recordProvider = new NetworkRecordProvider(account, networkClient);
190
190
  *
@@ -197,18 +197,18 @@ declare class NetworkRecordProvider implements RecordProvider {
197
197
  *
198
198
  * // When the program manager is initialized with the record provider it will be used to find automatically find
199
199
  * // fee records and amount records for value transfers so that they do not need to be specified manually
200
- * const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, recordProvider);
200
+ * const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
201
201
  * programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
202
202
  */
203
- findCreditsRecord(microcredits: number, unspent: boolean, nonces?: string[], searchParameters?: RecordSearchParams): Promise<RecordPlaintext | Error>;
203
+ findCreditsRecord(microcredits: number, unspent: boolean, nonces?: string[], searchParameters?: RecordSearchParams): Promise<RecordPlaintext>;
204
204
  /**
205
205
  * Find an arbitrary record. WARNING: This function is not implemented yet and will throw an error.
206
206
  */
207
- findRecord(unspent: boolean, nonces?: string[], searchParameters?: RecordSearchParams): Promise<RecordPlaintext | Error>;
207
+ findRecord(unspent: boolean, nonces?: string[], searchParameters?: RecordSearchParams): Promise<RecordPlaintext>;
208
208
  /**
209
209
  * Find multiple arbitrary records. WARNING: This function is not implemented yet and will throw an error.
210
210
  */
211
- findRecords(unspent: boolean, nonces?: string[], searchParameters?: RecordSearchParams): Promise<RecordPlaintext[] | Error>;
211
+ findRecords(unspent: boolean, nonces?: string[], searchParameters?: RecordSearchParams): Promise<RecordPlaintext[]>;
212
212
  }
213
213
  /**
214
214
  * BlockHeightSearch is a RecordSearchParams implementation that allows for searching for records within a given
@@ -219,7 +219,7 @@ declare class NetworkRecordProvider implements RecordProvider {
219
219
  * const params = new BlockHeightSearch(89995, 99995);
220
220
  *
221
221
  * // Create a new NetworkRecordProvider
222
- * const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1");
222
+ * const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
223
223
  * const keyProvider = new AleoKeyProvider();
224
224
  * const recordProvider = new NetworkRecordProvider(account, networkClient);
225
225
  *
@@ -1,2 +1,4 @@
1
+ export declare function logAndThrow(message: string): never;
2
+ export declare function parseJSON(json: string): any;
1
3
  export declare function get(url: URL | string, options?: RequestInit): Promise<Response>;
2
4
  export declare function post(url: URL | string, options: RequestInit): Promise<Response>;
@@ -0,0 +1 @@
1
+ export { Address, Execution, ExecutionResponse, Field, OfflineQuery, Metadata, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager, ProvingKey, RecordCiphertext, RecordPlaintext, Signature, Transaction, VerifyingKey, ViewKey, initThreadPool, verifyFunctionExecution, } from "@provablehq/wasm/mainnet.js";
@@ -1,4 +1,5 @@
1
- import { PrivateKey } from "./index";
1
+ import "./polyfill/shared";
2
+ import { PrivateKey } from "./browser";
2
3
  export interface WorkerAPI {
3
4
  run: (localProgram: string, aleoFunction: string, inputs: string[], privateKey: string) => Promise<{
4
5
  outputs: any;