Skip to main content

Authorization

Overview

Authorization object containing the authorization for a transaction. This class provides methods for creating, manipulating, and querying authorization objects that are used in Aleo transactions to authorize program executions.

Methods

new

Create a new authorization from a request object

new(request)Authorization
ParamTypeDescription
requestExecutionRequestThe ExecutionRequest to build the authorization from
returnAuthorization

replicate

Returns a new and independent replica of the Authorization

replicate()Authorization
ParamType
returnAuthorization

toString

Returns the string representation of the Authorization

toString() ► string
ParamType
returnstring

fromString

Reconstructs an Authorization object from its string representation

fromString(authorization)Authorization
ParamTypeDescription
authorizationStringThe string representation of the Authorization
returnAuthorization

toBytesLe

Returns the left-endian byte representation of the Authorization

toBytesLe()Uint8Array
ParamType
returnUint8Array

fromBytesLe

Creates an authorization object from a left-endian byte representation of an Authorization

fromBytesLe(bytes)Authorization
ParamTypeDescription
bytesUint8ArrayLeft-endian bytes representing the Authorization
returnAuthorization

equals

Check if an Authorization object is the same as another

equals(other) ► boolean
ParamTypeDescription
otherAuthorizationThe Authorization object to determine equality with
returnboolean

len

Returns the number of Requests in the Authorization

len() ► number
ParamType
returnnumber

isEmpty

Return true if the Authorization is empty

isEmpty() ► boolean
ParamType
returnboolean

isFeePrivate

Returns true if the Authorization is for credits.aleo/fee_private

isFeePrivate() ► boolean
ParamType
returnboolean

isFeePublic

Returns true if the Authorization is for credits.aleo/fee_public

isFeePublic() ► boolean
ParamType
returnboolean

isSplit

Returns true if the Authorization is for credits.aleo/split

isSplit() ► boolean
ParamType
returnboolean

insertTransition

Insert a transition into the Authorization

insertTransition(transition)void
ParamTypeDescription
transitionTransitionThe transition object to insert into the Authorization
returnvoid

transitions

Get the transitions in an Authorization

transitions()Array.<Transition>
ParamType
returnArray.<Transition>

toExecutionId

Returns the execution ID for the Authorization

toExecutionId()Field
ParamType
returnField