@provablehq/sdk 0.9.2 → 0.9.4

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 (43) hide show
  1. package/dist/mainnet/account.d.ts +36 -1
  2. package/dist/mainnet/browser.d.ts +5 -4
  3. package/dist/mainnet/browser.js +4298 -557
  4. package/dist/mainnet/browser.js.map +1 -1
  5. package/dist/mainnet/models/authorization.d.ts +6 -0
  6. package/dist/mainnet/models/inputID.d.ts +4 -0
  7. package/dist/mainnet/models/provingRequest.d.ts +6 -0
  8. package/dist/mainnet/models/provingResponse.d.ts +5 -0
  9. package/dist/mainnet/models/request.d.ts +14 -0
  10. package/dist/mainnet/network-client.d.ts +0 -14
  11. package/dist/mainnet/node-polyfill.js.map +1 -1
  12. package/dist/mainnet/node.js +2 -4
  13. package/dist/mainnet/node.js.map +1 -1
  14. package/dist/mainnet/program-manager.d.ts +199 -6
  15. package/dist/mainnet/wasm.d.ts +1 -1
  16. package/dist/testnet/account.d.ts +36 -1
  17. package/dist/testnet/browser.d.ts +5 -4
  18. package/dist/testnet/browser.js +4298 -557
  19. package/dist/testnet/browser.js.map +1 -1
  20. package/dist/testnet/models/authorization.d.ts +6 -0
  21. package/dist/testnet/models/inputID.d.ts +4 -0
  22. package/dist/testnet/models/provingRequest.d.ts +6 -0
  23. package/dist/testnet/models/provingResponse.d.ts +5 -0
  24. package/dist/testnet/models/request.d.ts +14 -0
  25. package/dist/testnet/network-client.d.ts +0 -14
  26. package/dist/testnet/node-polyfill.js.map +1 -1
  27. package/dist/testnet/node.js +2 -4
  28. package/dist/testnet/node.js.map +1 -1
  29. package/dist/testnet/program-manager.d.ts +199 -6
  30. package/dist/testnet/wasm.d.ts +1 -1
  31. package/package.json +2 -2
  32. package/dist/mainnet/managed-worker.d.ts +0 -3
  33. package/dist/mainnet/program-manager-B-18sj9m.js +0 -3458
  34. package/dist/mainnet/program-manager-B-18sj9m.js.map +0 -1
  35. package/dist/mainnet/worker.d.ts +0 -9
  36. package/dist/mainnet/worker.js +0 -78
  37. package/dist/mainnet/worker.js.map +0 -1
  38. package/dist/testnet/managed-worker.d.ts +0 -3
  39. package/dist/testnet/program-manager-BR5taTR7.js +0 -3458
  40. package/dist/testnet/program-manager-BR5taTR7.js.map +0 -1
  41. package/dist/testnet/worker.d.ts +0 -9
  42. package/dist/testnet/worker.js +0 -78
  43. package/dist/testnet/worker.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { Address, ComputeKey, PrivateKey, Signature, ViewKey, PrivateKeyCiphertext, RecordCiphertext, RecordPlaintext } from "./wasm.js";
1
+ import { Address, ComputeKey, Field, Group, PrivateKey, Signature, ViewKey, PrivateKeyCiphertext, RecordCiphertext, RecordPlaintext } from "./wasm.js";
2
2
  interface AccountParam {
3
3
  privateKey?: string;
4
4
  seed?: Uint8Array;
@@ -182,6 +182,41 @@ export declare class Account {
182
182
  * const decryptedRecords = account.decryptRecords(records);
183
183
  */
184
184
  decryptRecords(ciphertexts: string[]): RecordPlaintext[];
185
+ /**
186
+ * Generates a record view key from the account owner's view key and the record ciphertext.
187
+ * This key can be used to decrypt the record without revealing the account's view key.
188
+ * @param {RecordCiphertext | string} recordCiphertext The record ciphertext to generate the view key for
189
+ * @returns {Field} The record view key
190
+ *
191
+ * @example
192
+ * // Import the Account class
193
+ * import { Account } from "@provablehq/sdk/testnet.js";
194
+ *
195
+ * // Create an account object from a previously encrypted ciphertext and password.
196
+ * const account = Account.fromCiphertext(process.env.ciphertext!, process.env.password!);
197
+ *
198
+ * // Generate a record view key from the account's view key and a record ciphertext
199
+ * const recordCiphertext = RecordCiphertext.fromString("your_record_ciphertext_here");
200
+ * const recordViewKey = account.generateRecordViewKey(recordCiphertext);
201
+ */
202
+ generateRecordViewKey(recordCiphertext: RecordCiphertext | string): Field;
203
+ /**
204
+ * Generates a transition view key from the account owner's view key and the transition public key.
205
+ * This key can be used to decrypt the private inputs and outputs of a the transition without
206
+ * revealing the account's view key.
207
+ * @param {string | Group} tpk The transition public key
208
+ * @returns {Field} The transition view key
209
+ *
210
+ * @example
211
+ * // Import the Account class
212
+ * import { Account } from "@provablehq/sdk/testnet.js";
213
+ *
214
+ * // Generate a transition view key from the account's view key and a transition public key
215
+ * const tpk = Group.fromString("your_transition_public_key_here");
216
+ *
217
+ * const transitionViewKey = account.generateTransitionViewKey(tpk);
218
+ */
219
+ generateTransitionViewKey(tpk: string | Group): Field;
185
220
  /**
186
221
  * Determines whether the account owns a ciphertext record.
187
222
  * @param {RecordCiphertext | string} ciphertext The record ciphertext to check ownership of
@@ -19,6 +19,8 @@ import { PlaintextArray } from "./models/plaintext/array.js";
19
19
  import { PlaintextLiteral } from "./models/plaintext/literal.js";
20
20
  import { PlaintextObject } from "./models/plaintext/plaintext.js";
21
21
  import { PlaintextStruct } from "./models/plaintext/struct.js";
22
+ import { ProvingRequestJSON } from "./models/provingRequest.js";
23
+ import { ProvingResponse } from "./models/provingResponse.js";
22
24
  import { RatificationJSON } from "./models/ratification.js";
23
25
  import { SolutionsJSON, SolutionJSON, PartialSolutionJSON } from "./models/solution.js";
24
26
  import { TransactionJSON } from "./models/transaction/transactionJSON.js";
@@ -29,10 +31,9 @@ import { AleoKeyProvider, AleoKeyProviderParams, AleoKeyProviderInitParams, Cach
29
31
  import { OfflineKeyProvider, OfflineSearchParams } from "./offline-key-provider.js";
30
32
  import { BlockHeightSearch, NetworkRecordProvider, RecordProvider, RecordSearchParams } from "./record-provider.js";
31
33
  declare function initializeWasm(): Promise<void>;
32
- export { createAleoWorker } from "./managed-worker.js";
33
- export { ProgramManager } from "./program-manager.js";
34
+ export { ProgramManager, ProvingRequestOptions, ExecuteOptions, FeeAuthorizationOptions, AuthorizationOptions } from "./program-manager.js";
34
35
  export { logAndThrow } from "./utils.js";
35
- export { Address, BHP256, BHP512, BHP768, BHP1024, Ciphertext, ComputeKey, Execution as FunctionExecution, ExecutionResponse, Field, Group, OfflineQuery, Pedersen64, Pedersen128, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager as ProgramManagerBase, ProvingKey, RecordCiphertext, RecordPlaintext, Signature, Scalar, Transaction, Transition, VerifyingKey, ViewKey, initThreadPool, verifyFunctionExecution, } from "./wasm.js";
36
+ export { Address, Authorization, Boolean, BHP256, BHP512, BHP768, BHP1024, Ciphertext, ComputeKey, Execution as FunctionExecution, ExecutionRequest, ExecutionResponse, EncryptionToolkit, Field, Group, OfflineQuery, Pedersen64, Pedersen128, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager as ProgramManagerBase, ProvingKey, ProvingRequest, RecordCiphertext, RecordPlaintext, Signature, Scalar, Transaction, Transition, VerifyingKey, ViewKey, initThreadPool, verifyFunctionExecution, } from "./wasm.js";
36
37
  export { initializeWasm };
37
38
  export { Key, CREDITS_PROGRAM_KEYS, KEY_STORE, PRIVATE_TRANSFER, PRIVATE_TO_PUBLIC_TRANSFER, PRIVATE_TRANSFER_TYPES, PUBLIC_TRANSFER, PUBLIC_TRANSFER_AS_SIGNER, PUBLIC_TO_PRIVATE_TRANSFER, VALID_TRANSFER_TYPES, } from "./constants.js";
38
- export { Account, AleoKeyProvider, AleoKeyProviderParams, AleoKeyProviderInitParams, AleoNetworkClient, BlockJSON, BlockHeightSearch, CachedKeyPair, ConfirmedTransactionJSON, DeploymentJSON, DeploymentObject, ExecutionJSON, ExecutionObject, FeeExecutionJSON, FeeExecutionObject, FinalizeJSON, FunctionObject, FunctionKeyPair, FunctionKeyProvider, Header, ImportedPrograms, ImportedVerifyingKeys, InputJSON, InputObject, KeySearchParams, Metadata, NetworkRecordProvider, OfflineKeyProvider, OfflineSearchParams, OutputJSON, OutputObject, OwnerJSON, PartialSolutionJSON, PlaintextArray, PlaintextLiteral, PlaintextObject, PlaintextStruct, ProgramImports, RatificationJSON, RecordProvider, RecordSearchParams, SolutionJSON, SolutionsJSON, TransactionJSON, TransactionObject, TransitionJSON, TransitionObject, VerifyingKeys, };
39
+ export { Account, AleoKeyProvider, AleoKeyProviderParams, AleoKeyProviderInitParams, AleoNetworkClient, BlockJSON, BlockHeightSearch, CachedKeyPair, ConfirmedTransactionJSON, DeploymentJSON, DeploymentObject, ExecutionJSON, ExecutionObject, FeeExecutionJSON, FeeExecutionObject, FinalizeJSON, FunctionObject, FunctionKeyPair, FunctionKeyProvider, Header, ImportedPrograms, ImportedVerifyingKeys, InputJSON, InputObject, KeySearchParams, Metadata, NetworkRecordProvider, OfflineKeyProvider, OfflineSearchParams, OutputJSON, OutputObject, OwnerJSON, PartialSolutionJSON, PlaintextArray, PlaintextLiteral, PlaintextObject, PlaintextStruct, ProgramImports, ProvingRequestJSON, ProvingResponse, RatificationJSON, RecordProvider, RecordSearchParams, SolutionJSON, SolutionsJSON, TransactionJSON, TransactionObject, TransitionJSON, TransitionObject, VerifyingKeys, };