@provablehq/wasm 0.10.5 → 0.10.6-rc.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.
@@ -2,18 +2,6 @@
2
2
  /* eslint-disable */
3
3
  export function runRayonThread(receiver: number): void;
4
4
  export function initThreadPool(url: URL, num_threads: number): Promise<void>;
5
- /**
6
- * Verify a SNARK proof against a verifying key and public inputs.
7
- *
8
- * This function verifies a proof produced by an Aleo program that may not be deployed on chain.
9
- * It directly invokes the Varuna proof verification from snarkVM.
10
- *
11
- * @param {VerifyingKey} verifying_key The verifying key for the circuit
12
- * @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. ["1field", "2field"])
13
- * @param {Proof} proof The proof to verify
14
- * @returns {boolean} True if the proof is valid, false otherwise
15
- */
16
- export function snarkVerify(verifying_key: VerifyingKey, inputs: Array<any>, proof: Proof): boolean;
17
5
  /**
18
6
  * Verify an execution. Executions with multiple transitions must have the program source code and
19
7
  * verifying keys of imported functions supplied from outside to correctly verify. Also, this does
@@ -27,7 +15,7 @@ export function snarkVerify(verifying_key: VerifyingKey, inputs: Array<any>, pro
27
15
  * @param {Object} import_verifying_keys The verifying keys for the imports in the form of { "program_id.aleo": [["function, "verifying_key"], ...], ...}
28
16
  * @returns {boolean} True if the execution is valid, false otherwise
29
17
  */
30
- export function verifyFunctionExecution(execution: Execution, verifying_key: VerifyingKey, program: Program, function_id: string, imports: object | null | undefined, imported_verifying_keys: object | null | undefined, block_height: number): boolean;
18
+ export function verifyFunctionExecution(execution: Execution, verifying_key: VerifyingKey, program: Program, function_id: string, imports: object | null | undefined, imported_verifying_keys: object | null | undefined, block_height: number, program_imports?: ProgramImports | null): boolean;
31
19
  /**
32
20
  * Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
33
21
  *
@@ -40,6 +28,18 @@ export function verifyFunctionExecution(execution: Execution, verifying_key: Ver
40
28
  * @returns {boolean} True if the batch proof is valid, false otherwise
41
29
  */
42
30
  export function snarkVerifyBatch(verifying_keys: Array<any>, inputs: Array<any>, proof: Proof): boolean;
31
+ /**
32
+ * Verify a SNARK proof against a verifying key and public inputs.
33
+ *
34
+ * This function verifies a proof produced by an Aleo program that may not be deployed on chain.
35
+ * It directly invokes the Varuna proof verification from snarkVM.
36
+ *
37
+ * @param {VerifyingKey} verifying_key The verifying key for the circuit
38
+ * @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. ["1field", "2field"])
39
+ * @param {Proof} proof The proof to verify
40
+ * @returns {boolean} True if the proof is valid, false otherwise
41
+ */
42
+ export function snarkVerify(verifying_key: VerifyingKey, inputs: Array<any>, proof: Proof): boolean;
43
43
  export function stringToField(string: string): Field;
44
44
  /**
45
45
  * Set test consensus version heights for testing.
@@ -2887,6 +2887,18 @@ export class Program {
2887
2887
  * console.log(credits_functions === expected_functions); // Output should be "true"
2888
2888
  */
2889
2889
  getFunctions(): Array<any>;
2890
+ /**
2891
+ * Get the external call graph reachable from a specific entry function.
2892
+ *
2893
+ * Starting from `entry_function`, traces all reachable functions and closures
2894
+ * within this program (via local calls) and collects external calls
2895
+ * (`call program.aleo/function`). Returns a JS object mapping program names
2896
+ * to arrays of called function names.
2897
+ *
2898
+ * @param {string} entry_function The name of the entry function to trace from
2899
+ * @returns {object} An object like `{ "program.aleo": ["fn1", "fn2"] }`
2900
+ */
2901
+ getCallGraph(entry_function: string): any;
2890
2902
  /**
2891
2903
  * Get a javascript object representation of a program record and its types
2892
2904
  *
@@ -3037,6 +3049,198 @@ export class Program {
3037
3049
  */
3038
3050
  toString(): string;
3039
3051
  }
3052
+ /**
3053
+ * Backed by `Rc<RefCell<>>` for interior mutability — cloning produces a cheap
3054
+ * reference-counted copy that shares the same underlying data. This allows
3055
+ * execution functions to clone the builder internally while the caller's
3056
+ * original reference automatically sees any mutations (e.g. synthesized keys).
3057
+ */
3058
+ export class ProgramImports {
3059
+ free(): void;
3060
+ [Symbol.dispose](): void;
3061
+ /**
3062
+ * Add a program's source code to the imports.
3063
+ *
3064
+ * The source is parsed, validated, and added to the internal Process.
3065
+ * Static imports of the program are resolved depth-first from programs
3066
+ * already present in this builder.
3067
+ *
3068
+ * @param {string} name The program name (e.g., "my_program.aleo").
3069
+ * @param {string} source The program source code.
3070
+ * @param {number | undefined} edition The program edition (defaults to 1).
3071
+ */
3072
+ addProgram(name: string, source: string, edition?: number | null): void;
3073
+ /**
3074
+ * Create a ProgramImports from a plain JavaScript object.
3075
+ *
3076
+ * Accepts three formats:
3077
+ * ```js
3078
+ * // 1. Plain string — source code only.
3079
+ * { "my_program.aleo": "program source..." }
3080
+ *
3081
+ * // 2. Structured — program source with optional edition.
3082
+ * { "my_program.aleo": { program: "program source..." } }
3083
+ *
3084
+ * // 3. Structured with keys — program source plus proving/verifying keys per function.
3085
+ * {
3086
+ * "my_program.aleo": {
3087
+ * program: "program source...",
3088
+ * keys: {
3089
+ * "my_function": {
3090
+ * provingKey: Uint8Array,
3091
+ * verifyingKey: Uint8Array
3092
+ * }
3093
+ * }
3094
+ * }
3095
+ * }
3096
+ * ```
3097
+ *
3098
+ * Programs created via this method default to edition 1.
3099
+ *
3100
+ * @param {Object} object A plain JavaScript object mapping program names to source code
3101
+ * and optional keys.
3102
+ * @returns {ProgramImports}
3103
+ */
3104
+ static fromObject(object: object): ProgramImports;
3105
+ /**
3106
+ * Return the source code of a program by name, without serializing keys.
3107
+ *
3108
+ * @param {string} name The program name (e.g., "my_program.aleo").
3109
+ * @returns {string | undefined}
3110
+ */
3111
+ getProgram(name: string): string | undefined;
3112
+ /**
3113
+ * Return the names of all programs in this builder as a JS `Array<string>`.
3114
+ *
3115
+ * This is a lightweight alternative to `toObject()` when you only need to
3116
+ * enumerate program names without serializing keys.
3117
+ *
3118
+ * @returns {Array<string>}
3119
+ */
3120
+ programNames(): Array<any>;
3121
+ /**
3122
+ * Add a proving key for a function or record within an imported program.
3123
+ *
3124
+ * The key is transferred directly from the WASM `ProvingKey` type with no
3125
+ * serialization overhead.
3126
+ *
3127
+ * @param {string} program_name The program name (e.g., "my_program.aleo").
3128
+ * @param {string} identifier The function name or record name the key belongs to.
3129
+ * @param {ProvingKey} key The proving key.
3130
+ */
3131
+ addProvingKey(program_name: string, identifier: string, key: ProvingKey): void;
3132
+ /**
3133
+ * Get a proving key for a specific program and identifier (function or record name).
3134
+ * Returns a clone of the key from the internal Process. Non-destructive — the key
3135
+ * remains available for future calls.
3136
+ *
3137
+ * @param {string} program_name The program name (e.g., "my_program.aleo").
3138
+ * @param {string} identifier The function or record name.
3139
+ * @returns {ProvingKey | undefined}
3140
+ */
3141
+ getProvingKey(program_name: string, identifier: string): ProvingKey | undefined;
3142
+ /**
3143
+ * Add a verifying key for a function or record within an imported program.
3144
+ *
3145
+ * The key is transferred directly from the WASM `VerifyingKey` type with no
3146
+ * serialization overhead.
3147
+ *
3148
+ * @param {string} program_name The program name (e.g., "my_program.aleo").
3149
+ * @param {string} identifier The function name or record name the key belongs to.
3150
+ * @param {VerifyingKey} key The verifying key.
3151
+ */
3152
+ addVerifyingKey(program_name: string, identifier: string, key: VerifyingKey): void;
3153
+ /**
3154
+ * Get a verifying key for a specific program and identifier (function or record name).
3155
+ * Returns a clone of the key from the internal Process. Non-destructive — the key
3156
+ * remains available for future calls.
3157
+ *
3158
+ * @param {string} program_name The program name (e.g., "my_program.aleo").
3159
+ * @param {string} identifier The function or record name.
3160
+ * @returns {VerifyingKey | undefined}
3161
+ */
3162
+ getVerifyingKey(program_name: string, identifier: string): VerifyingKey | undefined;
3163
+ /**
3164
+ * Add a proving key from its byte representation.
3165
+ *
3166
+ * Deserializes the bytes into a native proving key and stores it. The program
3167
+ * must already have been added via `addProgram`.
3168
+ *
3169
+ * @param {string} program_name The program name (e.g., "my_program.aleo").
3170
+ * @param {string} identifier The function name or record name the key belongs to.
3171
+ * @param {Uint8Array} bytes The proving key bytes.
3172
+ */
3173
+ addProvingKeyBytes(program_name: string, identifier: string, bytes: Uint8Array): void;
3174
+ /**
3175
+ * Add a verifying key from its byte representation.
3176
+ *
3177
+ * Deserializes the bytes into a native verifying key and stores it. The program
3178
+ * must already have been added via `addProgram`.
3179
+ *
3180
+ * @param {string} program_name The program name (e.g., "my_program.aleo").
3181
+ * @param {string} identifier The function name or record name the key belongs to.
3182
+ * @param {Uint8Array} bytes The verifying key bytes.
3183
+ */
3184
+ addVerifyingKeyBytes(program_name: string, identifier: string, bytes: Uint8Array): void;
3185
+ /**
3186
+ * Return the names of functions that have both a proving key and a verifying key
3187
+ * stored for the given program.
3188
+ *
3189
+ * @param {string} program_name The program name (e.g., "my_program.aleo").
3190
+ * @returns {Array<string>}
3191
+ */
3192
+ functionKeysAvailable(program_name: string): Array<any>;
3193
+ /**
3194
+ * Create a new empty ProgramImports builder.
3195
+ *
3196
+ * Initializes an internal snarkVM Process. This is the same cost as a
3197
+ * single execution call, but is paid once and reused across all operations.
3198
+ */
3199
+ constructor();
3200
+ /**
3201
+ * Create a cheap clone that shares the same underlying data.
3202
+ *
3203
+ * Useful for passing to WASM execution functions which consume ownership:
3204
+ * the caller keeps the original, and both copies see any mutations
3205
+ * (e.g. synthesized keys) through the shared interior state.
3206
+ */
3207
+ clone(): ProgramImports;
3208
+ /**
3209
+ * Check whether a specific program has been added.
3210
+ *
3211
+ * @param {string} name The program name.
3212
+ * @returns {boolean}
3213
+ */
3214
+ contains(name: string): boolean;
3215
+ /**
3216
+ * Check whether any programs have been added to this builder.
3217
+ *
3218
+ * @returns {boolean}
3219
+ */
3220
+ isEmpty(): boolean;
3221
+ /**
3222
+ * Convert this ProgramImports to a plain JavaScript object.
3223
+ *
3224
+ * Entries without keys use the simple `{ "name.aleo": "source" }` format.
3225
+ * Entries with keys use the structured format:
3226
+ * ```js
3227
+ * {
3228
+ * "name.aleo": {
3229
+ * program: "program source...",
3230
+ * keys: {
3231
+ * "function_name": {
3232
+ * provingKey: Uint8Array,
3233
+ * verifyingKey: Uint8Array
3234
+ * }
3235
+ * }
3236
+ * }
3237
+ * }
3238
+ * ```
3239
+ *
3240
+ * @returns {Object}
3241
+ */
3242
+ toObject(): object;
3243
+ }
3040
3244
  export class ProgramManager {
3041
3245
  private constructor();
3042
3246
  free(): void;
@@ -3049,7 +3253,7 @@ export class ProgramManager {
3049
3253
  * @param {Array} inputs The inputs to the function
3050
3254
  * @param {Object | undefined} imports The imports for the program
3051
3255
  */
3052
- static synthesizeKeyPair(private_key: PrivateKey, program: string, function_id: string, inputs: Array<any>, imports?: object | null, edition?: number | null): Promise<KeyPair>;
3256
+ static synthesizeKeyPair(private_key: PrivateKey, program: string, function_id: string, inputs: Array<any>, imports?: object | null, edition?: number | null, program_imports?: ProgramImports | null): Promise<KeyPair>;
3053
3257
  static loadInclusionProver(proving_key: ProvingKey): void;
3054
3258
  /**
3055
3259
  * Create a `ProvingRequest` object. This object creates authorizations for the top level
@@ -3068,7 +3272,7 @@ export class ProgramManager {
3068
3272
  * @param broadcast (optional) Flag to indicate if the transaction should be broadcast
3069
3273
  * @returns {Authorization}
3070
3274
  */
3071
- static buildProvingRequest(private_key: PrivateKey, program: string, function_name: string, inputs: Array<any>, base_fee_credits: number, priority_fee_credits: number, fee_record: RecordPlaintext | null | undefined, imports: object | null | undefined, broadcast: boolean, unchecked: boolean, edition: number | null | undefined, use_fee_master: boolean): Promise<ProvingRequest>;
3275
+ static buildProvingRequest(private_key: PrivateKey, program: string, function_name: string, inputs: Array<any>, base_fee_credits: number, priority_fee_credits: number, fee_record: RecordPlaintext | null | undefined, imports: object | null | undefined, broadcast: boolean, unchecked: boolean, edition: number | null | undefined, use_fee_master: boolean, program_imports?: ProgramImports | null): Promise<ProvingRequest>;
3072
3276
  /**
3073
3277
  * Build a proving request from a `Request` object. By default this method currently uses the feemaster.
3074
3278
  *
@@ -3080,7 +3284,7 @@ export class ProgramManager {
3080
3284
  * @param {object | undefined} imports The imports to the program in the format {"programname.aleo":"aleo instructions source code"}.
3081
3285
  * @param {PrivateKey | undefined} [private_key] Optional private key of the signer. If not provided, functions which call other programs may not succeed.
3082
3286
  */
3083
- static buildProvingRequestFromExecutionRequest(request: ExecutionRequest, program: string, unchecked: boolean, broadcast: boolean, edition?: number | null, imports?: object | null, private_key?: PrivateKey | null): Promise<ProvingRequest>;
3287
+ static buildProvingRequestFromExecutionRequest(request: ExecutionRequest, program: string, unchecked: boolean, broadcast: boolean, edition?: number | null, imports?: object | null, private_key?: PrivateKey | null, program_imports?: ProgramImports | null): Promise<ProvingRequest>;
3084
3288
  /**
3085
3289
  * Join two records together to create a new record with an amount of credits equal to the sum
3086
3290
  * of the credits of the two original records
@@ -3131,7 +3335,7 @@ export class ProgramManager {
3131
3335
  * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
3132
3336
  * @returns {Transaction}
3133
3337
  */
3134
- static buildDevnodeDeploymentTransaction(private_key: PrivateKey, program: string, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null): Promise<Transaction>;
3338
+ static buildDevnodeDeploymentTransaction(private_key: PrivateKey, program: string, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null, program_imports?: ProgramImports | null): Promise<Transaction>;
3135
3339
  /**
3136
3340
  * Upgrade a deployed Aleo program without synthesizing keys and generating certificates.
3137
3341
  * Intended for use with Leo Devnode.
@@ -3152,7 +3356,7 @@ export class ProgramManager {
3152
3356
  * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
3153
3357
  * @returns {Transaction}
3154
3358
  */
3155
- static buildDevnodeUpgradeTransaction(private_key: PrivateKey, program: string, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null): Promise<Transaction>;
3359
+ static buildDevnodeUpgradeTransaction(private_key: PrivateKey, program: string, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null, program_imports?: ProgramImports | null): Promise<Transaction>;
3156
3360
  /**
3157
3361
  * Estimate the component of the deployment cost which comes from the fee for the program name.
3158
3362
  * Note that this cost does not represent the entire cost of deployment. It is additional to
@@ -3175,7 +3379,7 @@ export class ProgramManager {
3175
3379
  * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
3176
3380
  * @returns {u64}
3177
3381
  */
3178
- static estimateDeploymentFee(program: string, imports?: object | null): Promise<bigint>;
3382
+ static estimateDeploymentFee(program: string, imports?: object | null, program_imports?: ProgramImports | null): Promise<bigint>;
3179
3383
  /**
3180
3384
  * Deploy an Aleo program
3181
3385
  *
@@ -3195,7 +3399,7 @@ export class ProgramManager {
3195
3399
  * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
3196
3400
  * @returns {Transaction}
3197
3401
  */
3198
- static buildDeploymentTransaction(private_key: PrivateKey, program: string, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null, fee_proving_key?: ProvingKey | null, fee_verifying_key?: VerifyingKey | null, offline_query?: OfflineQuery | null): Promise<Transaction>;
3402
+ static buildDeploymentTransaction(private_key: PrivateKey, program: string, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null, fee_proving_key?: ProvingKey | null, fee_verifying_key?: VerifyingKey | null, offline_query?: OfflineQuery | null, program_imports?: ProgramImports | null): Promise<Transaction>;
3199
3403
  /**
3200
3404
  * Upgrade an Aleo program
3201
3405
  *
@@ -3213,7 +3417,7 @@ export class ProgramManager {
3213
3417
  * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
3214
3418
  * @returns {Transaction}
3215
3419
  */
3216
- static buildUpgradeTransaction(private_key: PrivateKey, program: string, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null, fee_proving_key?: ProvingKey | null, fee_verifying_key?: VerifyingKey | null, offline_query?: OfflineQuery | null): Promise<Transaction>;
3420
+ static buildUpgradeTransaction(private_key: PrivateKey, program: string, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null, fee_proving_key?: ProvingKey | null, fee_verifying_key?: VerifyingKey | null, offline_query?: OfflineQuery | null, program_imports?: ProgramImports | null): Promise<Transaction>;
3217
3421
  /**
3218
3422
  * Generate an execution transaction without a proof.
3219
3423
  * Intended for use with the Leo devnode tool.
@@ -3225,22 +3429,13 @@ export class ProgramManager {
3225
3429
  * @param priority_fee_credits The optional priority fee to be paid for the transaction
3226
3430
  * @param fee_record The record to spend the fee from
3227
3431
  * @param url The url of the Aleo network node to send the transaction to
3228
- * If this is set to 'true' the keys synthesized (or passed in as optional parameters via the
3229
- * `proving_key` and `verifying_key` arguments) will be stored in the ProgramManager's memory
3230
- * and used for subsequent transactions. If this is set to 'false' the proving and verifying
3231
- * keys will be deallocated from memory after the transaction is executed.
3232
3432
  * @param imports (optional) Provide a list of imports to use for the function execution in the
3233
3433
  * form of a javascript object where the keys are a string of the program name and the values
3234
3434
  * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
3235
- * @param proving_key (optional) Provide a verifying key to use for the function execution
3236
- * @param verifying_key (optional) Provide a verifying key to use for the function execution
3237
- * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
3238
- * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
3239
- * @param offline_query An offline query object to use if building a transaction without an internet connection.
3240
- * @param edition The edition of the program to execute. Defaults to the latest found on the network, or 1 if the program does not exist on the network.
3435
+ * @param edition The edition of the program to execute. Defaults to 1.
3241
3436
  * @returns {Transaction}
3242
3437
  */
3243
- static buildDevnodeExecutionTransaction(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null, edition?: number | null): Promise<Transaction>;
3438
+ static buildDevnodeExecutionTransaction(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null, edition?: number | null, program_imports?: ProgramImports | null): Promise<Transaction>;
3244
3439
  /**
3245
3440
  * Estimate the finalize fee component for executing a function. This fee is additional to the
3246
3441
  * size of the execution of the program in bytes. If the function does not have a finalize
@@ -3262,22 +3457,21 @@ export class ProgramManager {
3262
3457
  * @param imports The imports of the program being executed.
3263
3458
  * @param url The url to get the inclusion proving information from.
3264
3459
  * @param offline_query Optional offline query object if building a Transaction offline.
3460
+ * @param edition The program edition (defaults to 1).
3265
3461
  */
3266
- static executeAuthorization(authorization: Authorization, fee_authorization: Authorization | null | undefined, program: string, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, fee_proving_key?: ProvingKey | null, fee_verifying_key?: VerifyingKey | null, imports?: object | null, url?: string | null, query?: QueryOption | null): Promise<Transaction>;
3462
+ static executeAuthorization(authorization: Authorization, fee_authorization: Authorization | null | undefined, program: string, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, fee_proving_key?: ProvingKey | null, fee_verifying_key?: VerifyingKey | null, imports?: object | null, url?: string | null, query?: QueryOption | null, program_imports?: ProgramImports | null, edition?: number | null): Promise<Transaction>;
3267
3463
  /**
3268
- * Estimate Fee for Aleo function execution. Note if "cache" is set to true, the proving and
3269
- * verifying keys will be stored in the ProgramManager's memory and used for subsequent
3270
- * program executions.
3464
+ * Estimate Fee for Aleo function execution.
3271
3465
  *
3272
3466
  * @param program The source code of the program to estimate the execution fee for.
3273
3467
  * @param function The name of the function to estimate the execution fee for.
3274
3468
  * @param imports (optional) Provide a list of imports to use for the fee estimation in the
3275
3469
  * form of a javascript object where the keys are a string of the program name and the values
3276
3470
  * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
3277
- * @param edition {
3471
+ * @param edition The edition of the program. Defaults to 1.
3278
3472
  * @returns {u64} Fee in microcredits
3279
3473
  */
3280
- static estimateExecutionFee(program: string, _function: string, imports?: object | null, edition?: number | null): bigint;
3474
+ static estimateExecutionFee(program: string, _function: string, imports?: object | null, edition?: number | null, program_imports?: ProgramImports | null): bigint;
3281
3475
  /**
3282
3476
  * Execute an arbitrary function locally
3283
3477
  *
@@ -3295,10 +3489,10 @@ export class ProgramManager {
3295
3489
  * @param {Object | undefined} imports (optional) Provide a list of imports to use for the function execution in the
3296
3490
  * form of a javascript object where the keys are a string of the program name and the values
3297
3491
  * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
3298
- * @param {ProvingKey | undefined} proving_key (optional) Provide a verifying key to use for the function execution
3492
+ * @param {ProvingKey | undefined} proving_key (optional) Provide a proving key to use for the function execution
3299
3493
  * @param {VerifyingKey | undefined} verifying_key (optional) Provide a verifying key to use for the function execution
3300
3494
  */
3301
- static executeFunctionOffline(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, prove_execution: boolean, cache: boolean, imports?: object | null, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, url?: string | null, query?: QueryOption | null, edition?: number | null): Promise<ExecutionResponse>;
3495
+ static executeFunctionOffline(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, prove_execution: boolean, cache: boolean, imports?: object | null, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, url?: string | null, query?: QueryOption | null, edition?: number | null, program_imports?: ProgramImports | null): Promise<ExecutionResponse>;
3302
3496
  /**
3303
3497
  * Compute the query requirements for a function execution without making
3304
3498
  * any network calls. Returns the commitments that need state paths and
@@ -3329,7 +3523,7 @@ export class ProgramManager {
3329
3523
  * @param edition: Optional edition to estimate the fee for.
3330
3524
  * @returns {u64} Fee in microcredits
3331
3525
  */
3332
- static estimateFeeForAuthorization(authorization: Authorization, program: string, imports?: object | null, edition?: number | null): bigint;
3526
+ static estimateFeeForAuthorization(authorization: Authorization, program: string, imports?: object | null, edition?: number | null, program_imports?: ProgramImports | null): bigint;
3333
3527
  /**
3334
3528
  * Execute Aleo function and create an Aleo execution transaction
3335
3529
  *
@@ -3340,22 +3534,18 @@ export class ProgramManager {
3340
3534
  * @param priority_fee_credits The optional priority fee to be paid for the transaction
3341
3535
  * @param fee_record The record to spend the fee from
3342
3536
  * @param url The url of the Aleo network node to send the transaction to
3343
- * If this is set to 'true' the keys synthesized (or passed in as optional parameters via the
3344
- * `proving_key` and `verifying_key` arguments) will be stored in the ProgramManager's memory
3345
- * and used for subsequent transactions. If this is set to 'false' the proving and verifying
3346
- * keys will be deallocated from memory after the transaction is executed.
3347
3537
  * @param imports (optional) Provide a list of imports to use for the function execution in the
3348
3538
  * form of a javascript object where the keys are a string of the program name and the values
3349
3539
  * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
3350
- * @param proving_key (optional) Provide a verifying key to use for the function execution
3540
+ * @param proving_key (optional) Provide a proving key to use for the function execution
3351
3541
  * @param verifying_key (optional) Provide a verifying key to use for the function execution
3352
3542
  * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
3353
3543
  * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
3354
3544
  * @param offline_query An offline query object to use if building a transaction without an internet connection.
3355
- * @param edition The edition of the program to execute. Defaults to the latest found on the network, or 1 if the program does not exist on the network.
3545
+ * @param edition The edition of the program to execute. Defaults to 1.
3356
3546
  * @returns {Transaction}
3357
3547
  */
3358
- static buildExecutionTransaction(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, fee_proving_key?: ProvingKey | null, fee_verifying_key?: VerifyingKey | null, query?: QueryOption | null, edition?: number | null): Promise<Transaction>;
3548
+ static buildExecutionTransaction(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, fee_proving_key?: ProvingKey | null, fee_verifying_key?: VerifyingKey | null, query?: QueryOption | null, edition?: number | null, program_imports?: ProgramImports | null): Promise<Transaction>;
3359
3549
  /**
3360
3550
  * Send credits from one Aleo account to another
3361
3551
  *
@@ -3397,7 +3587,7 @@ export class ProgramManager {
3397
3587
  * @param {object | undefined} imports The imports to the program in the format {"programname.aleo":"aleo instructions source code"}.
3398
3588
  * @param {PrivateKey | undefined} [private_key] Optional private key of the signer. If not provided, functions which call other programs may not succeed.
3399
3589
  */
3400
- static buildAuthorizationFromExecutionRequest(request: ExecutionRequest, program: string, unchecked: boolean, edition?: number | null, imports?: object | null, private_key?: PrivateKey | null): Promise<Authorization>;
3590
+ static buildAuthorizationFromExecutionRequest(request: ExecutionRequest, program: string, unchecked: boolean, edition?: number | null, imports?: object | null, private_key?: PrivateKey | null, program_imports?: ProgramImports | null): Promise<Authorization>;
3401
3591
  /**
3402
3592
  * Create an execution `Authorization` without generating a circuit. Use this function when
3403
3593
  * fast delegated proving is needed.
@@ -3408,7 +3598,7 @@ export class ProgramManager {
3408
3598
  * @param inputs A javascript array of inputs to the function.
3409
3599
  * @param imports The imports to the program in the format {"programname.aleo":"aleo instructions source code"}.
3410
3600
  */
3411
- static buildAuthorizationUnchecked(private_key: PrivateKey, program: string, function_name: string, inputs: Array<any>, imports?: object | null, edition?: number | null): Promise<Authorization>;
3601
+ static buildAuthorizationUnchecked(private_key: PrivateKey, program: string, function_name: string, inputs: Array<any>, imports?: object | null, edition?: number | null, program_imports?: ProgramImports | null): Promise<Authorization>;
3412
3602
  /**
3413
3603
  * Create an execution `Authorization` for a given program:function tuple with specified inputs.
3414
3604
  *
@@ -3418,7 +3608,7 @@ export class ProgramManager {
3418
3608
  * @param inputs A javascript array of inputs to the function.
3419
3609
  * @param imports The imports to the program in the format {"programname.aleo":"aleo instructions source code"}.
3420
3610
  */
3421
- static authorize(private_key: PrivateKey, program: string, function_name: string, inputs: Array<any>, imports?: object | null, edition?: number | null): Promise<Authorization>;
3611
+ static authorize(private_key: PrivateKey, program: string, function_name: string, inputs: Array<any>, imports?: object | null, edition?: number | null, program_imports?: ProgramImports | null): Promise<Authorization>;
3422
3612
  }
3423
3613
  /**
3424
3614
  * SNARK proof for verification of program execution
Binary file