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
| Param | Type | Description |
|---|---|---|
| request | ExecutionRequest | The ExecutionRequest to build the authorization from |
| return | Authorization |
replicate
Returns a new and independent replica of the Authorization
replicate() ► Authorization
| Param | Type |
|---|---|
| return | Authorization |
toString
Returns the string representation of the Authorization
toString() ► string
| Param | Type |
|---|---|
| return | string |
fromString
Reconstructs an Authorization object from its string representation
fromString(authorization) ► Authorization
| Param | Type | Description |
|---|---|---|
| authorization | String | The string representation of the Authorization |
| return | Authorization |
toBytesLe
Returns the left-endian byte representation of the Authorization
toBytesLe() ► Uint8Array
| Param | Type |
|---|---|
| return | Uint8Array |
fromBytesLe
Creates an authorization object from a left-endian byte representation of an Authorization
fromBytesLe(bytes) ► Authorization
| Param | Type | Description |
|---|---|---|
| bytes | Uint8Array | Left-endian bytes representing the Authorization |
| return | Authorization |
equals
Check if an Authorization object is the same as another
equals(other) ► boolean
| Param | Type | Description |
|---|---|---|
| other | Authorization | The Authorization object to determine equality with |
| return | boolean |
len
Returns the number of Requests in the Authorization
len() ► number
| Param | Type |
|---|---|
| return | number |
isEmpty
Return true if the Authorization is empty
isEmpty() ► boolean
| Param | Type |
|---|---|
| return | boolean |
isFeePrivate
Returns true if the Authorization is for credits.aleo/fee_private
isFeePrivate() ► boolean
| Param | Type |
|---|---|
| return | boolean |
isFeePublic
Returns true if the Authorization is for credits.aleo/fee_public
isFeePublic() ► boolean
| Param | Type |
|---|---|
| return | boolean |
isSplit
Returns true if the Authorization is for credits.aleo/split
isSplit() ► boolean
| Param | Type |
|---|---|
| return | boolean |
insertTransition
Insert a transition into the Authorization
insertTransition(transition) ► void
| Param | Type | Description |
|---|---|---|
| transition | Transition | The transition object to insert into the Authorization |
| return | void |
transitions
Get the transitions in an Authorization
transitions() ► Array.<Transition>
| Param | Type |
|---|---|
| return | Array.<Transition> |
toExecutionId
Returns the execution ID for the Authorization
toExecutionId() ► Field
| Param | Type |
|---|---|
| return | Field |