Skip to content

buildExecutionTransaction

buildExecutionTransaction builds an Aleo execution transaction that is not broadcasted to the network. To broadcast your transaction, please look into Aleo documentation.

Usage

const options = {
privateKey,
endpoint: "https://api.explorer.provable.com/v1",
functionName: "hello",
inputs: ["5u32", "5u32"],
programId: "hello_hello.aleo",
priorityFee: BigInt(0),
baseFee: BigInt(11323),
enableLog: true,
};
const execution = await buildExecutionTransaction(options);

Options

buildExecutionTransaction accepts 1 parameter (BuildExecutionOptions), the options for building the execution transaction.

ParameterTypeDescription
baseFeebigintBase fee to execute transaction in microcredits
endpointstringAleo network API
functionNamestringName of function to be executed
inputsstring[]Array of input values in string
priorityFeebigintPriority fee for the transaction in microcredits
privateKeystringPrivate key
programIdstringAleo program ID. It should end in .aleo
enableLogbooleanEnable logging for debugging purposes

Return

An execution result object will be returned. The interface for ExecutionResult is as follows.

interface ExecutionResult {
executionTime: string;
id: string;
transaction: string;
}
PropertyTypeDescription
executionTimestringExecution time for building the transaction in seconds
idstringTransaction ID
transactionstringStringified transaction payload to be used to broadcast to network