@provablehq/sdk 0.9.8 → 0.9.10-testnet-rc

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/browser.d.ts +11 -4
  2. package/dist/mainnet/browser.js +492 -51
  3. package/dist/mainnet/browser.js.map +1 -1
  4. package/dist/mainnet/constants.d.ts +1 -0
  5. package/dist/mainnet/function-key-provider.d.ts +18 -0
  6. package/dist/mainnet/models/record-provider/encryptedRecord.d.ts +58 -0
  7. package/dist/mainnet/models/record-provider/ownedRecord.d.ts +60 -0
  8. package/dist/mainnet/models/record-provider/recordSearchParams.d.ts +19 -0
  9. package/dist/mainnet/models/record-scanner/ownedFilter.d.ts +24 -0
  10. package/dist/mainnet/models/record-scanner/ownedRecordsResponseFilter.d.ts +42 -0
  11. package/dist/mainnet/models/record-scanner/recordsFilter.d.ts +35 -0
  12. package/dist/mainnet/models/record-scanner/recordsResponseFilter.d.ts +42 -0
  13. package/dist/mainnet/models/record-scanner/registrationRequest.d.ts +13 -0
  14. package/dist/mainnet/models/record-scanner/registrationResponse.d.ts +15 -0
  15. package/dist/mainnet/models/record-scanner/statusResponse.d.ts +13 -0
  16. package/dist/mainnet/node.js +2 -2
  17. package/dist/mainnet/offline-key-provider.d.ts +14 -0
  18. package/dist/mainnet/program-manager.d.ts +14 -2
  19. package/dist/mainnet/record-provider.d.ts +106 -68
  20. package/dist/mainnet/record-scanner.d.ts +151 -0
  21. package/dist/mainnet/wasm.d.ts +1 -1
  22. package/dist/testnet/browser.d.ts +11 -4
  23. package/dist/testnet/browser.js +492 -51
  24. package/dist/testnet/browser.js.map +1 -1
  25. package/dist/testnet/constants.d.ts +1 -0
  26. package/dist/testnet/function-key-provider.d.ts +18 -0
  27. package/dist/testnet/models/record-provider/encryptedRecord.d.ts +58 -0
  28. package/dist/testnet/models/record-provider/ownedRecord.d.ts +60 -0
  29. package/dist/testnet/models/record-provider/recordSearchParams.d.ts +19 -0
  30. package/dist/testnet/models/record-scanner/ownedFilter.d.ts +24 -0
  31. package/dist/testnet/models/record-scanner/ownedRecordsResponseFilter.d.ts +42 -0
  32. package/dist/testnet/models/record-scanner/recordsFilter.d.ts +35 -0
  33. package/dist/testnet/models/record-scanner/recordsResponseFilter.d.ts +42 -0
  34. package/dist/testnet/models/record-scanner/registrationRequest.d.ts +13 -0
  35. package/dist/testnet/models/record-scanner/registrationResponse.d.ts +15 -0
  36. package/dist/testnet/models/record-scanner/statusResponse.d.ts +13 -0
  37. package/dist/testnet/node.js +2 -2
  38. package/dist/testnet/offline-key-provider.d.ts +14 -0
  39. package/dist/testnet/program-manager.d.ts +14 -2
  40. package/dist/testnet/record-provider.d.ts +106 -68
  41. package/dist/testnet/record-scanner.d.ts +151 -0
  42. package/dist/testnet/wasm.d.ts +1 -1
  43. package/package.json +3 -3
@@ -32,3 +32,4 @@ export declare const PRIVATE_TO_PUBLIC_TRANSFER: Set<string>;
32
32
  export declare const PUBLIC_TRANSFER: Set<string>;
33
33
  export declare const PUBLIC_TRANSFER_AS_SIGNER: Set<string>;
34
34
  export declare const PUBLIC_TO_PRIVATE_TRANSFER: Set<string>;
35
+ export declare const RECORD_DOMAIN = "RecordScannerV0";
@@ -146,6 +146,12 @@ 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>;
149
155
  /**
150
156
  * Get join function keys from the credits.aleo program
151
157
  *
@@ -314,6 +320,18 @@ declare class AleoKeyProvider implements FunctionKeyProvider {
314
320
  * const [transferPublicProvingKey, transferPublicVerifyingKey] = await keyProvider.transferKeys("public");
315
321
  */
316
322
  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>;
317
335
  /**
318
336
  * Returns the proving and verifying keys for the join function in the credits.aleo program
319
337
  *
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Encrypted Record found on chain. This type provides the record ciphertext and metadata from the ledger such as the record's name, the program/function that produced it, etc.
3
+ *
4
+ * @property {string} commitment - The commitment of the record.
5
+ * @property {string | undefined} checksum - The checksum of the record.
6
+ * @property {number | undefined} block_height - The block height of the record.
7
+ * @property {number | undefined} block_timestamp - The block timestamp of the record.
8
+ * @property {string | undefined} program_name - The name of the program that produced the record.
9
+ * @property {string | undefined} function_name - The name of the function that produced the record.
10
+ * @property {number | undefined} output_index - The output index of the record.
11
+ * @property {string | undefined} owner - The owner of the record.
12
+ * @property {string | undefined} record_ciphertext - The ciphertext of the record.
13
+ * @property {string | undefined} record_name - The name of the record.
14
+ * @property {string | undefined} record_nonce - The nonce of the record.
15
+ * @property {string | undefined} sender_ciphertext - The ciphertext of the sender.
16
+ * @property {string | undefined} transaction_id - The ID of the transaction that produced the record.
17
+ * @property {string | undefined} transition_id - The ID of the transition that produced the record.
18
+ * @property {number | undefined} transaction_index - The index of the transaction that produced the record.
19
+ * @property {number | undefined} transition_index - The index of the transition that produced the record.
20
+ *
21
+ * @example
22
+ * const encryptedRecord: EncryptedRecord = {
23
+ * commitment: "1754131901135854615627743152473414463769543922079966020586765988138574911385field",
24
+ * checksum: "731623304764338277682996290553427512270277231686866672455141481050283829616field",
25
+ * block_height: 123456,
26
+ * block_timestamp: 1725845998,
27
+ * program_name: "credits.aleo",
28
+ * function_name: "transfer_private",
29
+ * output_index: 0,
30
+ * owner: "ciphertext1qgqdetlfzk98jkm4e7sgqml66e3x2gpg5d6udkpw0g67z0tplkpmzrm6q5dyfd7xhgmhedvptxzwfhrtxaqn7n0hs0esge3lwg9s2zukqgzxd0cr",
31
+ * record_ciphertext: "record1qyqsqt43u9kp97svljyyup3v4jmppd0vgght9edvvmtxx6mxycsej8cwqsrxzmt0w4h8ggcqqgqspf8zqut2ycnap7f0uzz5ktu0cxscca96urtkg2aweuzn70787dsrpp6x76m9de0kjezrqqpqyqp3mn3xeh53lukvcy406amjf5g0ksl3saauzjk0j4ljtjqq6kqlqhdz05sw92zye96qym7kp83ra0eesgtwhaw37c85r499456se8ts28m90p6x2unwv9k97ct4w35x7unf0fshg6t0de0hyet3w45hyetyyvqqyqgq4t2wr9tmcrfha5tfz5j585ptvvslqe0f6sf29vytshhdh7ym05rpqct4w35x7unf0fjkghm4de6xjmprqqpqzqru6p7fef29vuz6smyqwcn3z7jhxtdgjdw5xv23ppxhpgnvu72fp8hz6fjt6gsdn8yxhzq7gpsah0rscwqrzxwl5e8aemkj5gt09y7q5506yrf",
32
+ * record_name: "credits",
33
+ * record_nonce: "3077450429259593211617823051143573281856129402760267155982965992208217472983group",
34
+ * sender_ciphertext: "1754131901135854615627743152473414463769543922079966020586765988138574911385field",
35
+ * transaction_id: "at1f8ueqxu3x49sckpc6jlg676tmxumddzer3fwe2l0dxwj4dqxygyqua4u2q",
36
+ * transition_id: "au17mm5v7sfwus6y40xsyc99d5rtsr4vsajdec6twdjzv0m458q85zspqdnka",
37
+ * transaction_index: 0,
38
+ * transition_index: 0,
39
+ * }
40
+ */
41
+ export type EncryptedRecord = {
42
+ commitment: string;
43
+ checksum?: string;
44
+ block_height?: number;
45
+ block_timestamp?: number;
46
+ program_name?: string;
47
+ function_name?: string;
48
+ output_index?: number;
49
+ owner?: string;
50
+ record_ciphertext?: string;
51
+ record_name?: string;
52
+ record_nonce?: string;
53
+ sender_ciphertext?: string;
54
+ transaction_id?: string;
55
+ transition_id?: string;
56
+ transaction_index?: number;
57
+ transition_index?: number;
58
+ };
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Record owned by a registered view key. This type provides the record ciphertext, record plaintext and metadata from the ledger such as the record's name, the program/function that produced it, etc.
3
+ *
4
+ * @property {number | undefined} block_height - Block height where the record was created.
5
+ * @property {number | undefined} block_timestamp - The timestamp of the block that the record was created in.
6
+ * @property {string | undefined} commitment - Commitment of the record.
7
+ * @property {string | undefined} function_name - Name of the function that created the record.
8
+ * @property {number | undefined} output_index - Index of the output in the function call that created the record.
9
+ * @property {string | undefined} owner - Address of the record owner.
10
+ * @property {string | undefined} program_name - Name of the program that created the record.
11
+ * @property {string | undefined} record_ciphertext - Encrypted ciphertext of the record.
12
+ * @property {string | undefined} record_name - Name of the record.
13
+ * @property {string | undefined} sender - Address of the sender.
14
+ * @property {boolean | undefined} spent - Whether the record has been spent.
15
+ * @property {string | undefined} tag - Tag associated with the record.
16
+ * @property {string | undefined} transaction_id - ID of the transaction that created the record.
17
+ * @property {string | undefined} transition_id - ID of the transition that created the record.
18
+ * @property {string | undefined} transaction_index - Index of the transaction in the block.
19
+ * @property {string | undefined} transition_index - Index of the transition in the transaction.
20
+ *
21
+ * @example
22
+ * const ownedRecord: OwnedRecord = {
23
+ * block_height: 123456,
24
+ * block_timestamp: 1725845998,
25
+ * commitment: "1754131901135854615627743152473414463769543922079966020586765988138574911385field",
26
+ * function_name: "transfer_public_to_private",
27
+ * output_index: 0,
28
+ * owner: "ciphertext1qgqdetlfzk98jkm4e7sgqml66e3x2gpg5d6udkpw0g67z0tplkpmzrm6q5dyfd7xhgmhedvptxzwfhrtxaqn7n0hs0esge3lwg9s2zukqgzxd0cr",
29
+ * program_name: "credits.aleo",
30
+ * record_ciphertext: "record1qyqsqt43u9kp97svljyyup3v4jmppd0vgght9edvvmtxx6mxycsej8cwqsrxzmt0w4h8ggcqqgqspf8zqut2ycnap7f0uzz5ktu0cxscca96urtkg2aweuzn70787dsrpp6x76m9de0kjezrqqpqyqp3mn3xeh53lukvcy406amjf5g0ksl3saauzjk0j4ljtjqq6kqlqhdz05sw92zye96qym7kp83ra0eesgtwhaw37c85r499456se8ts28m90p6x2unwv9k97ct4w35x7unf0fshg6t0de0hyet3w45hyetyyvqqyqgq4t2wr9tmcrfha5tfz5j585ptvvslqe0f6sf29vytshhdh7ym05rpqct4w35x7unf0fjkghm4de6xjmprqqpqzqru6p7fef29vuz6smyqwcn3z7jhxtdgjdw5xv23ppxhpgnvu72fp8hz6fjt6gsdn8yxhzq7gpsah0rscwqrzxwl5e8aemkj5gt09y7q5506yrf",
31
+ * record_plaintext: "{ owner: aleo1j7qxyunfldj2lp8hsvy7mw5k8zaqgjfyr72x2gh3x4ewgae8v5gscf5jh3.private, microcredits: 1500000000000000u64.private, _nonce: 3077450429259593211617823051143573281856129402760267155982965992208217472983group.public , _version: 1u8 }",
32
+ * record_name: "credits",
33
+ * spent: true,
34
+ * sender: "aleo1sf5kk4f8mcmgjasw9fannmm0h8z2nwqxu5e200cjneu28jxvtvpqulfxsa",
35
+ * tag: "6511661650536816422260305447175136877451468301541296257226129781611237851030field",
36
+ * transaction_id: "at1f8ueqxu3x49sckpc6jlg676tmxumddzer3fwe2l0dxwj4dqxygyqua4u2q",
37
+ * transition_id: "au17mm5v7sfwus6y40xsyc99d5rtsr4vsajdec6twdjzv0m458q85zspqdnka",
38
+ * transaction_index: 0,
39
+ * transition_index: 0,
40
+ * }
41
+ */
42
+ export type OwnedRecord = {
43
+ block_height?: number;
44
+ block_timestamp?: number;
45
+ commitment?: string;
46
+ function_name?: string;
47
+ output_index?: number;
48
+ owner?: string;
49
+ program_name?: string;
50
+ record_ciphertext?: string;
51
+ record_plaintext?: string;
52
+ record_name?: string;
53
+ sender?: string;
54
+ spent?: boolean;
55
+ tag?: string;
56
+ transaction_id?: string;
57
+ transition_id?: string;
58
+ transaction_index?: number;
59
+ transition_index?: number;
60
+ };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Interface for record search parameters. This allows for arbitrary search parameters to be passed to record provider
3
+ * implementations.
4
+ *
5
+ * @example
6
+ * const recordSearchParams: RecordSearchParams = {
7
+ * // Declared fields
8
+ * unspent: true,
9
+ * nonces: ["3077450429259593211617823051143573281856129402760267155982965992208217472983group"],
10
+ * // Arbitrary fields
11
+ * startHeight: 123456,
12
+ * programName: "credits.aleo"
13
+ * }
14
+ */
15
+ export interface RecordSearchParams {
16
+ unspent?: boolean;
17
+ nonces?: string[];
18
+ [key: string]: any;
19
+ }
@@ -0,0 +1,24 @@
1
+ import { RecordSearchParams } from "../record-provider/recordSearchParams";
2
+ import { RecordsFilter } from "./recordsFilter";
3
+ import { OwnedRecordsResponseFilter } from "./ownedRecordsResponseFilter";
4
+ /**
5
+ * OwnedFilter is an extension of RecordSearchParams that represents a filter for scanning owned records.
6
+ *
7
+ * @example
8
+ * const ownedFilter: OwnedFilter = {
9
+ * unspent: true,
10
+ * nonces: ["3077450429259593211617823051143573281856129402760267155982965992208217472983group"],
11
+ * decrypt: true,
12
+ * filter: {
13
+ * program: "credits.aleo",
14
+ * record: "credits",
15
+ * },
16
+ * }
17
+ */
18
+ export interface OwnedFilter extends RecordSearchParams {
19
+ decrypt?: boolean;
20
+ filter?: RecordsFilter;
21
+ responseFilter?: OwnedRecordsResponseFilter;
22
+ unspent?: boolean;
23
+ uuid?: string;
24
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * OwnedRecordsResponseFilter is a type that represents a filter for the response from a record provider.
3
+ * A `true` value for a field in the filter will include that field in the response.
4
+ *
5
+ * @example
6
+ * const ownedRecordsResponseFilter: OwnedRecordsResponseFilter = {
7
+ * commitment: true,
8
+ * owner: true,
9
+ * tag: true,
10
+ * sender: true,
11
+ * spent: true,
12
+ * record_ciphertext: true,
13
+ * block_height: true,
14
+ * block_timestamp: true,
15
+ * output_index: true,
16
+ * record_name: true,
17
+ * function_name: true,
18
+ * program_name: true,
19
+ * transition_id: true,
20
+ * transaction_id: true,
21
+ * transaction_index: true,
22
+ * transition_index: true,
23
+ * }
24
+ */
25
+ export interface OwnedRecordsResponseFilter {
26
+ commitment?: boolean;
27
+ owner?: boolean;
28
+ tag?: boolean;
29
+ sender?: boolean;
30
+ spent?: boolean;
31
+ record_ciphertext?: boolean;
32
+ block_height?: boolean;
33
+ block_timestamp?: boolean;
34
+ output_index?: boolean;
35
+ record_name?: boolean;
36
+ function_name?: boolean;
37
+ program_name?: boolean;
38
+ transition_id?: boolean;
39
+ transaction_id?: boolean;
40
+ transaction_index?: boolean;
41
+ transition_index?: boolean;
42
+ }
@@ -0,0 +1,35 @@
1
+ import { RecordSearchParams } from "../record-provider/recordSearchParams";
2
+ import { RecordsResponseFilter } from "./recordsResponseFilter";
3
+ /**
4
+ * RecordsFilter is an extension of RecordSearchParams that represents a filter for scanning encrypted or owned records.
5
+ *
6
+ * @example
7
+ * const recordsFilter: RecordsFilter = {
8
+ * start: 0,
9
+ * end: 100,
10
+ * programs: ["credits.aleo"],
11
+ * records: ["credits"],
12
+ * functions: ["transfer_public_to_private"],
13
+ * response: {
14
+ * program: true,
15
+ * record: true,
16
+ * function: true,
17
+ * transition: true,
18
+ * block_height: true,
19
+ * transaction_id: true,
20
+ * }
21
+ * results_per_page: 100,
22
+ * page: 0,
23
+ * }
24
+ */
25
+ export interface RecordsFilter extends RecordSearchParams {
26
+ commitments?: string[];
27
+ response?: RecordsResponseFilter;
28
+ start?: number;
29
+ end?: number;
30
+ programs?: string[];
31
+ records?: string[];
32
+ functions?: string[];
33
+ results_per_page?: number;
34
+ page?: number;
35
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * RecordsResponseFilter is a type that represents a filter for the response from a record provider.
3
+ * A `true` value for a field in the filter will include that field in the response.
4
+ *
5
+ * @example
6
+ * const recordsResponseFilter: RecordsResponseFilter = {
7
+ * block_height: true,
8
+ * block_timestamp: true,
9
+ * checksum: true,
10
+ * commitment: true,
11
+ * record_ciphertext: true,
12
+ * function_name: true,
13
+ * nonce: true,
14
+ * output_index: true,
15
+ * owner: true,
16
+ * program_name: true,
17
+ * record_name: true,
18
+ * sender_ciphertext: true,
19
+ * transaction_id: true,
20
+ * transition_id: true,
21
+ * transaction_index: true,
22
+ * transition_index: true,
23
+ * }
24
+ */
25
+ export type RecordsResponseFilter = {
26
+ block_height?: boolean;
27
+ block_timestamp?: boolean;
28
+ checksum?: boolean;
29
+ commitment?: boolean;
30
+ record_ciphertext?: boolean;
31
+ sender_ciphertext?: boolean;
32
+ function_name?: boolean;
33
+ nonce?: boolean;
34
+ output_index?: boolean;
35
+ owner?: boolean;
36
+ program_name?: boolean;
37
+ record_name?: boolean;
38
+ transaction_id?: boolean;
39
+ transition_id?: boolean;
40
+ transaction_index?: boolean;
41
+ transition_index?: boolean;
42
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * RegistrationRequest is a type that represents a request to register an account's view key with a record scanning service.
3
+ *
4
+ * @example
5
+ * const registrationRequest: RegistrationRequest = {
6
+ * view_key: "AViewKey1ccEt8A2Ryva5rxnKcAbn7wgTaTsb79tzkKHFpeKsm9NX",
7
+ * start: 123456,
8
+ * }
9
+ */
10
+ export type RegistrationRequest = {
11
+ view_key: string;
12
+ start: number;
13
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * RegistrationResponse is a type that represents a response from a record scanning service's registration endpoint.
3
+ *
4
+ * @example
5
+ * const registrationResponse: RegistrationResponse = {
6
+ * uuid: "5291249998620209321712738612705518874926462927543783711572375085855029172391field",
7
+ * job_id: "3019177021147406178755252788128212930359855601860174268911518336835545087409field",
8
+ * status: "pending",
9
+ * }
10
+ */
11
+ export interface RegistrationResponse {
12
+ uuid: string;
13
+ job_id?: string;
14
+ status?: string;
15
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * StatusResponse is a type that represents a response from a record scanning service's status endpoint.
3
+ *
4
+ * @example
5
+ * const statusResponse: StatusResponse = {
6
+ * synced: true,
7
+ * percentage: 100,
8
+ * }
9
+ */
10
+ export interface StatusResponse {
11
+ synced: boolean;
12
+ percentage: number;
13
+ }
@@ -1,6 +1,6 @@
1
1
  import './node-polyfill.js';
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, GraphKey, 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/mainnet.js';
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, RECORD_DOMAIN, RecordScanner, 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, GraphKey, 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, getOrInitConsensusVersionTestHeights, initThreadPool, verifyFunctionExecution } from '@provablehq/wasm/mainnet.js';
4
4
  import 'core-js/proposals/json-parse-with-source.js';
5
5
  import 'node:crypto';
6
6
  import 'node:fs';
@@ -212,6 +212,12 @@ 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>;
215
221
  /**
216
222
  * Get join function keys from the credits.aleo program. The keys must be cached prior to calling this
217
223
  * method for it to work.
@@ -287,6 +293,14 @@ declare class OfflineKeyProvider implements FunctionKeyProvider {
287
293
  * @param provingKey
288
294
  */
289
295
  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;
290
304
  /**
291
305
  * Insert the proving and verifying keys for the join function into the cache. Only the proving key needs
292
306
  * to be inserted, the verifying key is automatically inserted by the SDK. This function will automatically check
@@ -1,9 +1,11 @@
1
1
  import { Account } from "./account.js";
2
2
  import { AleoNetworkClient, AleoNetworkClientOptions, ProgramImports } from "./network-client.js";
3
3
  import { ImportedPrograms, ImportedVerifyingKeys } from "./models/imports.js";
4
- import { RecordProvider, RecordSearchParams } from "./record-provider.js";
4
+ import { RecordProvider } from "./record-provider.js";
5
+ import { RecordSearchParams } from "./models/record-provider/recordSearchParams.js";
5
6
  import { FunctionKeyPair, FunctionKeyProvider, KeySearchParams } from "./function-key-provider.js";
6
7
  import { Authorization, ExecutionResponse, OfflineQuery, RecordPlaintext, PrivateKey, Program, ProvingKey, ProvingRequest, VerifyingKey, Transaction } from "./wasm.js";
8
+ import { OwnedRecord } from "./models/record-provider/ownedRecord.js";
7
9
  /**
8
10
  * Represents the options for executing a transaction in the Aleo network.
9
11
  * This interface is used to specify the parameters required for building and submitting an execution transaction.
@@ -118,6 +120,7 @@ declare class ProgramManager {
118
120
  host: string;
119
121
  networkClient: AleoNetworkClient;
120
122
  recordProvider: RecordProvider | undefined;
123
+ inclusionKeysLoaded: boolean;
121
124
  /** Create a new instance of the ProgramManager
122
125
  *
123
126
  * @param { string | undefined } host A host uri running the official Aleo API
@@ -1066,6 +1069,15 @@ declare class ProgramManager {
1066
1069
  * assert(isValid);
1067
1070
  */
1068
1071
  verifyExecution(executionResponse: ExecutionResponse, blockHeight: number, imports?: ImportedPrograms, importedVerifyingKeys?: ImportedVerifyingKeys): boolean;
1072
+ /**
1073
+ * Set the inclusion key bytes.
1074
+ *
1075
+ * @param {executionResponse} executionResponse The response from an offline function execution (via the `programManager.run` method)
1076
+ * @param {ImportedPrograms} imports The imported programs used in the execution. Specified as { "programName": "programSourceCode", ... }
1077
+ * @param {ImportedVerifyingKeys} importedVerifyingKeys The verifying keys in the execution. Specified as { "programName": [["functionName", "verifyingKey"], ...], ... }
1078
+ * @returns {boolean} True if the proof is valid, false otherwise
1079
+ *
1080
+
1069
1081
  /**
1070
1082
  * Create a program object from a program's source code
1071
1083
  *
@@ -1085,6 +1097,6 @@ declare class ProgramManager {
1085
1097
  * @param {string} program The program source code
1086
1098
  */
1087
1099
  verifyProgram(program: string): boolean;
1088
- getCreditsRecord(amount: number, nonces: string[], record?: RecordPlaintext | string, params?: RecordSearchParams): Promise<RecordPlaintext>;
1100
+ getCreditsRecord(amount: number, nonces: string[], record?: RecordPlaintext | string, params?: RecordSearchParams): Promise<OwnedRecord>;
1089
1101
  }
1090
1102
  export { ProgramManager, AuthorizationOptions, FeeAuthorizationOptions, ExecuteOptions, ProvingRequestOptions };