Skip to main content

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
ParamType
returnstring

fromString

Builds a request object from a string representation of a request

fromString(request)ExecutionRequest
ParamTypeDescription
requeststringString representation of the request
returnExecutionRequestExecutionRequest object

toBytesLe

Returns the bytes representation of the request

toBytesLe()Uint8Array
ParamType
returnUint8Array

fromBytesLe

Creates a request object from a bytes representation of a request

fromBytesLe(bytes)ExecutionRequest
ParamTypeDescription
bytesUint8ArrayByte representation of the request
returnExecutionRequestExecutionRequest object

signer

Returns the request signer

signer()Address
ParamType
returnAddress

network_id

Returns the network ID

network_id() ► number
ParamType
returnnumber

program_id

Returns the program ID

program_id() ► string
ParamType
returnstring

function_name

Returns the function name

function_name() ► string
ParamType
returnstring

input_ids

Returns the input IDs for the transition

input_ids()Array
ParamType
returnArray

inputs

Returns the function inputs as an array of strings

inputs()Array
ParamType
returnArray

signature

Returns the signature for the transition

signature()Signature
ParamType
returnSignature

sk_tag

Returns the tag secret key sk_tag

sk_tag()Field
ParamType
returnField

tvk

Returns the transition view key tvk

tvk()Field
ParamType
returnField

to_tpk

Returns the transition public key tpk

to_tpk()Group
ParamType
returnGroup

tcm

Returns the transition commitment tcm

tcm()Field
ParamType
returnField

scm

Returns the signer commitment scm

scm()Field
ParamType
returnField

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
ParamTypeDescription
private_keyPrivateKeyThe private key of the signer
program_idstringThe id of the program to create the signature for
function_namestringThe function name to create the signature for
inputsArrayThe inputs to the function
input_typesArrayThe input types of the function
root_tvkFieldThe tvk of the function at the top of the call graph (undefined if this is the top-level call)
program_checksumFieldOptional program checksum
is_rootbooleanFlag to indicate if this is the top level function in the call graph
returnExecutionRequestThe signed execution request

verify

Verify the input types within a request

verify(input_types, is_root, program_checksum) ► boolean
ParamTypeDescription
input_typesArrayThe input_types within the request
is_rootbooleanFlag to indicate whether this request is the first function in the call graph
program_checksumFieldOptional program checksum
returnbooleanTrue if the request is valid