@provablehq/sdk 0.9.4-offline-rc → 0.9.5
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/browser.d.ts +1 -1
- package/dist/mainnet/browser.js +78 -130
- package/dist/mainnet/browser.js.map +1 -1
- package/dist/mainnet/function-key-provider.d.ts +0 -18
- package/dist/mainnet/network-client.d.ts +32 -5
- package/dist/mainnet/node.js +1 -1
- package/dist/mainnet/offline-key-provider.d.ts +0 -14
- package/dist/mainnet/program-manager.d.ts +0 -10
- package/dist/mainnet/wasm.d.ts +1 -1
- package/dist/testnet/browser.d.ts +1 -1
- package/dist/testnet/browser.js +78 -130
- package/dist/testnet/browser.js.map +1 -1
- package/dist/testnet/function-key-provider.d.ts +0 -18
- package/dist/testnet/network-client.d.ts +32 -5
- package/dist/testnet/node.js +1 -1
- package/dist/testnet/offline-key-provider.d.ts +0 -14
- package/dist/testnet/program-manager.d.ts +0 -10
- package/dist/testnet/wasm.d.ts +1 -1
- package/package.json +2 -2
|
@@ -146,12 +146,6 @@ interface FunctionKeyProvider {
|
|
|
146
146
|
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the join function
|
|
147
147
|
*/
|
|
148
148
|
feePublicKeys(): Promise<FunctionKeyPair>;
|
|
149
|
-
/**
|
|
150
|
-
* Get keys for the inclusion proof.
|
|
151
|
-
*
|
|
152
|
-
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the join function
|
|
153
|
-
*/
|
|
154
|
-
inclusionKeys(): Promise<FunctionKeyPair>;
|
|
155
149
|
/**
|
|
156
150
|
* Get join function keys from the credits.aleo program
|
|
157
151
|
*
|
|
@@ -320,18 +314,6 @@ declare class AleoKeyProvider implements FunctionKeyProvider {
|
|
|
320
314
|
* const [transferPublicProvingKey, transferPublicVerifyingKey] = await keyProvider.transferKeys("public");
|
|
321
315
|
*/
|
|
322
316
|
transferKeys(visibility: string): Promise<FunctionKeyPair>;
|
|
323
|
-
/**
|
|
324
|
-
* Returns the proving and verifying keys for the transfer_public function.
|
|
325
|
-
*
|
|
326
|
-
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the transfer_public function
|
|
327
|
-
*/
|
|
328
|
-
transferPublicKeys(): Promise<FunctionKeyPair>;
|
|
329
|
-
/**
|
|
330
|
-
* Returns the proving and verifying keys for the inclusion proof.
|
|
331
|
-
*
|
|
332
|
-
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the inclusion proof.
|
|
333
|
-
*/
|
|
334
|
-
inclusionKeys(): Promise<FunctionKeyPair>;
|
|
335
317
|
/**
|
|
336
318
|
* Returns the proving and verifying keys for the join function in the credits.aleo program
|
|
337
319
|
*
|
|
@@ -356,7 +356,17 @@ declare class AleoNetworkClient {
|
|
|
356
356
|
/**
|
|
357
357
|
* Returns the source code of a program given a program ID.
|
|
358
358
|
*
|
|
359
|
-
* @param {string} programId The program ID of a program deployed to the Aleo Network
|
|
359
|
+
* @param {string} programId The program ID of a program deployed to the Aleo Network.
|
|
360
|
+
* @param {number | undefined} edition The edition of the program to fetch. When this is undefined it will fetch the latest version.
|
|
361
|
+
* @returns {Promise<string>} The source code of the program.
|
|
362
|
+
*
|
|
363
|
+
* @example
|
|
364
|
+
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
365
|
+
*
|
|
366
|
+
* // Create a network client.
|
|
367
|
+
* const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
|
|
368
|
+
*
|
|
369
|
+
* // Get the source code of a program.)
|
|
360
370
|
* @returns {Promise<string>} Source code of the program
|
|
361
371
|
*
|
|
362
372
|
* @example
|
|
@@ -369,12 +379,29 @@ declare class AleoNetworkClient {
|
|
|
369
379
|
* 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"
|
|
370
380
|
* assert.equal(program, expectedSource);
|
|
371
381
|
*/
|
|
372
|
-
getProgram(programId: string): Promise<string>;
|
|
382
|
+
getProgram(programId: string, edition?: number): Promise<string>;
|
|
383
|
+
/**
|
|
384
|
+
* Returns the current program edition deployed on the Aleo network.
|
|
385
|
+
*
|
|
386
|
+
* @param {string} programId The program ID of a program deployed to the Aleo Network.
|
|
387
|
+
* @returns {Promise<number>} The edition of the program.
|
|
388
|
+
*
|
|
389
|
+
* @example
|
|
390
|
+
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
391
|
+
*
|
|
392
|
+
* // Create a network client.
|
|
393
|
+
* const networkClient = new AleoNetworkClient("http://api.explorer.provable.com/v1", undefined);
|
|
394
|
+
*
|
|
395
|
+
* const programVersion = networkClient.getLatestProgramEdition("hello_hello.aleo");
|
|
396
|
+
* assert.equal(programVersion, 1);
|
|
397
|
+
*/
|
|
398
|
+
getLatestProgramEdition(programId: string): Promise<number>;
|
|
373
399
|
/**
|
|
374
400
|
* Returns a program object from a program ID or program source code.
|
|
375
401
|
*
|
|
376
|
-
* @param {string} inputProgram The program ID or program source code of a program deployed to the Aleo Network
|
|
377
|
-
* @
|
|
402
|
+
* @param {string} inputProgram The program ID or program source code of a program deployed to the Aleo Network.
|
|
403
|
+
* @param {number | undefined} edition The edition of the program to fetch. When this is undefined it will fetch the latest version.
|
|
404
|
+
* @returns {Promise<Program>} Source code of the program.
|
|
378
405
|
*
|
|
379
406
|
* @example
|
|
380
407
|
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
|
|
@@ -392,7 +419,7 @@ declare class AleoNetworkClient {
|
|
|
392
419
|
* // Both program objects should be equal
|
|
393
420
|
* assert(programObjectFromID.to_string() === programObjectFromSource.to_string());
|
|
394
421
|
*/
|
|
395
|
-
getProgramObject(inputProgram: string): Promise<Program>;
|
|
422
|
+
getProgramObject(inputProgram: string, edition?: number): Promise<Program>;
|
|
396
423
|
/**
|
|
397
424
|
* Returns an object containing the source code of a program and the source code of all programs it imports
|
|
398
425
|
*
|
package/dist/testnet/node.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './node-polyfill.js';
|
|
2
2
|
export { Account, AleoKeyProvider, AleoKeyProviderParams, AleoNetworkClient, BlockHeightSearch, CREDITS_PROGRAM_KEYS, KEY_STORE, NetworkRecordProvider, OfflineKeyProvider, OfflineSearchParams, PRIVATE_TO_PUBLIC_TRANSFER, PRIVATE_TRANSFER, PRIVATE_TRANSFER_TYPES, PUBLIC_TO_PRIVATE_TRANSFER, PUBLIC_TRANSFER, PUBLIC_TRANSFER_AS_SIGNER, ProgramManager, VALID_TRANSFER_TYPES, initializeWasm, logAndThrow } from './browser.js';
|
|
3
|
-
export { Address, Authorization, BHP1024, BHP256, BHP512, BHP768, Boolean, Ciphertext, ComputeKey, EncryptionToolkit, ExecutionRequest, ExecutionResponse, Field, Execution as FunctionExecution, Group, OfflineQuery, Pedersen128, Pedersen64, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager as ProgramManagerBase, ProvingKey, ProvingRequest, RecordCiphertext, RecordPlaintext, Scalar, Signature, Transaction, Transition, VerifyingKey, ViewKey, initThreadPool, verifyFunctionExecution } from '@provablehq/wasm/testnet.js';
|
|
3
|
+
export { Address, Authorization, BHP1024, BHP256, BHP512, BHP768, Boolean, Ciphertext, ComputeKey, EncryptionToolkit, ExecutionRequest, ExecutionResponse, Field, Execution as FunctionExecution, Group, I128, I16, I32, I64, I8, OfflineQuery, Pedersen128, Pedersen64, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager as ProgramManagerBase, ProvingKey, ProvingRequest, RecordCiphertext, RecordPlaintext, Scalar, Signature, Transaction, Transition, U128, U16, U32, U64, U8, VerifyingKey, ViewKey, initThreadPool, verifyFunctionExecution } from '@provablehq/wasm/testnet.js';
|
|
4
4
|
import 'core-js/proposals/json-parse-with-source.js';
|
|
5
5
|
import 'node:crypto';
|
|
6
6
|
import 'node:fs';
|
|
@@ -212,12 +212,6 @@ declare class OfflineKeyProvider implements FunctionKeyProvider {
|
|
|
212
212
|
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the join function
|
|
213
213
|
*/
|
|
214
214
|
feePublicKeys(): Promise<FunctionKeyPair>;
|
|
215
|
-
/**
|
|
216
|
-
* Get the inclusion prover keys from. The keys must be cached prior to calling this method for it to work.
|
|
217
|
-
*
|
|
218
|
-
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the inclusion prover
|
|
219
|
-
*/
|
|
220
|
-
inclusionKeys(): Promise<FunctionKeyPair>;
|
|
221
215
|
/**
|
|
222
216
|
* Get join function keys from the credits.aleo program. The keys must be cached prior to calling this
|
|
223
217
|
* method for it to work.
|
|
@@ -293,14 +287,6 @@ declare class OfflineKeyProvider implements FunctionKeyProvider {
|
|
|
293
287
|
* @param provingKey
|
|
294
288
|
*/
|
|
295
289
|
insertFeePublicKeys(provingKey: ProvingKey): void;
|
|
296
|
-
/**
|
|
297
|
-
* Insert the proving and verifying keys for the inclusion prover into the cache. Only the proving key needs
|
|
298
|
-
* to be inserted, the verifying key is automatically inserted by the SDK. This function will automatically check
|
|
299
|
-
* that the keys match the expected checksum for the inclusion prover.
|
|
300
|
-
*
|
|
301
|
-
* @param provingKey
|
|
302
|
-
*/
|
|
303
|
-
insertInclusionKeys(provingKey: ProvingKey): void;
|
|
304
290
|
/**
|
|
305
291
|
* Insert the proving and verifying keys for the join function into the cache. Only the proving key needs
|
|
306
292
|
* to be inserted, the verifying key is automatically inserted by the SDK. This function will automatically check
|
|
@@ -115,7 +115,6 @@ declare class ProgramManager {
|
|
|
115
115
|
host: string;
|
|
116
116
|
networkClient: AleoNetworkClient;
|
|
117
117
|
recordProvider: RecordProvider | undefined;
|
|
118
|
-
inclusionKeysLoaded: boolean;
|
|
119
118
|
/** Create a new instance of the ProgramManager
|
|
120
119
|
*
|
|
121
120
|
* @param { string | undefined } host A host uri running the official Aleo API
|
|
@@ -1064,15 +1063,6 @@ declare class ProgramManager {
|
|
|
1064
1063
|
* assert(isValid);
|
|
1065
1064
|
*/
|
|
1066
1065
|
verifyExecution(executionResponse: ExecutionResponse, blockHeight: number, imports?: ImportedPrograms, importedVerifyingKeys?: ImportedVerifyingKeys): boolean;
|
|
1067
|
-
/**
|
|
1068
|
-
* Set the inclusion key bytes.
|
|
1069
|
-
*
|
|
1070
|
-
* @param {executionResponse} executionResponse The response from an offline function execution (via the `programManager.run` method)
|
|
1071
|
-
* @param {ImportedPrograms} imports The imported programs used in the execution. Specified as { "programName": "programSourceCode", ... }
|
|
1072
|
-
* @param {ImportedVerifyingKeys} importedVerifyingKeys The verifying keys in the execution. Specified as { "programName": [["functionName", "verifyingKey"], ...], ... }
|
|
1073
|
-
* @returns {boolean} True if the proof is valid, false otherwise
|
|
1074
|
-
*
|
|
1075
|
-
|
|
1076
1066
|
/**
|
|
1077
1067
|
* Create a program object from a program's source code
|
|
1078
1068
|
*
|
package/dist/testnet/wasm.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Address, Authorization, Boolean, BHP256, BHP512, BHP768, BHP1024, Ciphertext, ComputeKey, EncryptionToolkit, ExecutionRequest, Execution, ExecutionResponse, Field, Group, OfflineQuery, Metadata, Pedersen64, Pedersen128, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager, ProvingKey, ProvingRequest, RecordCiphertext, RecordPlaintext, Scalar, Signature, Transaction, Transition, VerifyingKey, ViewKey, initThreadPool, verifyFunctionExecution, } from "@provablehq/wasm/testnet.js";
|
|
1
|
+
export { Address, Authorization, Boolean, BHP256, BHP512, BHP768, BHP1024, Ciphertext, ComputeKey, EncryptionToolkit, ExecutionRequest, Execution, ExecutionResponse, Field, Group, I8, I16, I32, I64, I128, OfflineQuery, Metadata, Pedersen64, Pedersen128, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager, ProvingKey, ProvingRequest, RecordCiphertext, RecordPlaintext, Scalar, Signature, Transaction, Transition, U8, U16, U32, U64, U128, VerifyingKey, ViewKey, initThreadPool, verifyFunctionExecution, } from "@provablehq/wasm/testnet.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@provablehq/sdk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.5",
|
|
4
4
|
"description": "A Software Development Kit (SDK) for Zero-Knowledge Transactions",
|
|
5
5
|
"collaborators": [
|
|
6
6
|
"The Provable Team"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://github.com/ProvableHQ/sdk#readme",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@provablehq/wasm": "0.9.
|
|
50
|
+
"@provablehq/wasm": "^0.9.5",
|
|
51
51
|
"comlink": "^4.4.2",
|
|
52
52
|
"core-js": "^3.40.0",
|
|
53
53
|
"mime": "^4.0.6",
|