@acceleratxr/core_sdk / Transaction

Class: Transaction#

Describes a transfer of resources two parties, a sender and a receiver. Transactions may include resources owned by both sender and recipient. In such cases, a trade is performed. In the event that the sender or recipient are specified as null, the transaction will perform a populate or consume action, respectively.

If the user creating the transaction is the sender, their approval is automatically implied and granted. If the recipient makes any changes to the transaction the sender must approve those changes before proceeding. In the event a transaction is created by a trusted role user and both sender/receiver approval is set as true, the transaction is automatically executed without notifying the affected parties.

Cancelled or completed transactions cannot be modified. Cancelled transactions will not be executed. Only transactions that have been approved by both parties (or a trusted role) will be executed.

Cancelled or failed transactions may be periodically removed from the database. Transactions with any other state are permanently stored.

A note on performance. Given the sheer volume of transactions and the speed at which they must be processed, record level ACLs are not used. Instead, class-level ACLs are used with explicit permission verification implemented as code.

author Jean-Philippe Steinmetz info@acceleratxr.com

Hierarchy#

Index#

Constructors#

Properties#

Accessors#

Object literals#

Constructors#

constructor#

+ new Transaction(other?: any): Transaction

Overrides EntityBase.constructor

Defined in src/models/Transaction.ts:86

Parameters:#

Name

Type

other?

any

Returns: Transaction

Properties#

dateCreated#

dateCreated: Date = new Date()

Inherited from EntityBase.dateCreated

Defined in src/EntityBase.ts:18

The date and time that the object was created.


dateModified#

dateModified: Date = new Date()

Inherited from EntityBase.dateModified

Defined in src/EntityBase.ts:23

The date and time that the object was last modified.


from#

from: string = “”

Defined in src/models/Transaction.ts:70

The unique identifier of the persona that is sending resources to a recipient persona. If undefined the user must be a trusted role.


resources#

resources: Array<PersonaResource> = []

Defined in src/models/Transaction.ts:81

The list of resources involved in the transaction. If one or more resource(s) are specified belonging to the recipient then it will be transferred to the sender upon execution.


status#

status: TransactionStatus = TransactionStatus.PENDING

Defined in src/models/Transaction.ts:86

The current status of the transaction


to#

to: string = “”

Defined in src/models/Transaction.ts:75

The unique identifier of the persona is receiving the resources from the sender. If undefined the resources will be destroyed.


uid#

uid: string = uuid.v4()

Inherited from EntityBase.uid

Defined in src/EntityBase.ts:13

The universally unique identifier of the object.


version#

version: number = 0

Inherited from EntityBase.version

Defined in src/EntityBase.ts:28

The optimistic locking version of the object.

Accessors#

ClassName#

Staticget ClassName(): string

Defined in src/models/Transaction.ts:57

Returns: string

Object literals#

approval#

approval: object

Defined in src/models/Transaction.ts:62

The transaction’s current approval status for each party.

Properties:#

Name

Type

Value

from

false

false

to

false

false