ExecutionRequest
Overview
Represents an execution request for an Aleo program function. The ExecutionRequest class provides methods for creating signed requests that authorize the execution of a specific function with given inputs.
Methods
toString
Returns the request as a string
toString() ► string
| Param | Type |
|---|---|
| return | string |
fromString
Builds a request object from a string representation of a request
fromString(request) ► ExecutionRequest
| Param | Type | Description |
|---|---|---|
| request | string | String representation of the request |
| return | ExecutionRequest | ExecutionRequest object |
toBytesLe
Returns the bytes representation of the request
toBytesLe() ► Uint8Array
| Param | Type |
|---|---|
| return | Uint8Array |
fromBytesLe
Creates a request object from a bytes representation of a request
fromBytesLe(bytes) ► ExecutionRequest
| Param | Type | Description |
|---|---|---|
| bytes | Uint8Array | Byte representation of the request |
| return | ExecutionRequest | ExecutionRequest object |
signer
Returns the request signer
signer() ► Address
| Param | Type |
|---|---|
| return | Address |
network_id
Returns the network ID
network_id() ► number
| Param | Type |
|---|---|
| return | number |
program_id
Returns the program ID
program_id() ► string
| Param | Type |
|---|---|
| return | string |
function_name
Returns the function name
function_name() ► string
| Param | Type |
|---|---|
| return | string |
input_ids
Returns the input IDs for the transition
input_ids() ► Array
| Param | Type |
|---|---|
| return | Array |
inputs
Returns the function inputs as an array of strings
inputs() ► Array
| Param | Type |
|---|---|
| return | Array |
signature
Returns the signature for the transition
signature() ► Signature
| Param | Type |
|---|---|
| return | Signature |
sk_tag
Returns the tag secret key sk_tag
sk_tag() ► Field
| Param | Type |
|---|---|
| return | Field |
tvk
Returns the transition view key tvk
tvk() ► Field
| Param | Type |
|---|---|
| return | Field |
to_tpk
Returns the transition public key tpk
to_tpk() ► Group
| Param | Type |
|---|---|
| return | Group |
tcm
Returns the transition commitment tcm
tcm() ► Field
| Param | Type |
|---|---|
| return | Field |
scm
Returns the signer commitment scm
scm() ► Field
| Param | Type |
|---|---|
| return | Field |
sign
Create a new request by signing over a program ID and set of inputs
sign(private_key, program_id, function_name, inputs, input_types, root_tvk, program_checksum, is_root) ► ExecutionRequest
| Param | Type | Description |
|---|---|---|
| private_key | PrivateKey | The private key of the signer |
| program_id | string | The id of the program to create the signature for |
| function_name | string | The function name to create the signature for |
| inputs | Array | The inputs to the function |
| input_types | Array | The input types of the function |
| root_tvk | Field | The tvk of the function at the top of the call graph (undefined if this is the top-level call) |
| program_checksum | Field | Optional program checksum |
| is_root | boolean | Flag to indicate if this is the top level function in the call graph |
| return | ExecutionRequest | The signed execution request |
verify
Verify the input types within a request
verify(input_types, is_root, program_checksum) ► boolean
| Param | Type | Description |
|---|---|---|
| input_types | Array | The input_types within the request |
| is_root | boolean | Flag to indicate whether this request is the first function in the call graph |
| program_checksum | Field | Optional program checksum |
| return | boolean | True if the request is valid |