TransactionQueue

Class to manage procedural transaction queues

Type parameters

Args: any

ReturnType: any

Hierarchy

  • Entity‹void›

    TransactionQueue

Index

Constructors

Properties

Methods

Constructors

constructor

+ new TransactionQueue(transactions: TransactionSpec[], fees: Fees, returnValue: MaybeResolver‹ReturnType›, args: Args, procedureType: ProcedureType): TransactionQueue

Defined in src/entities/TransactionQueue.ts:95

Create a transaction queue

Parameters:

Name

Type

Default

Description

transactions

-

list of transactions to be run in this queue

fees

-

-

returnValue

MaybeResolver‹ReturnType›

-

value that will be returned by the queue after it is run. It can be a Post Transaction Resolver

args

Args

-

arguments with which the Procedure that generated this queue was instanced

procedureType

ProcedureType.UnnamedProcedure

-

Returns: TransactionQueue

Properties

args

args: Args

Defined in src/entities/TransactionQueue.ts:65

arguments provided to the transaction queue

entityType

entityType: string = "transactionQueue"

Defined in src/entities/TransactionQueue.ts:40

type of entity

Optional error

error? : Error

Defined in src/entities/TransactionQueue.ts:70

optional error information

fees

fees: Fees

Defined in src/entities/TransactionQueue.ts:75

total cost of running the transactions in the queue. This does not include gas

procedureType

procedureType: ProcedureType

Defined in src/entities/TransactionQueue.ts:45

type of procedure being run

status

status: TransactionQueueStatus = TransactionQueueStatus.Idle

Defined in src/entities/TransactionQueue.ts:60

status of the transaction queue

transactions

transactions: PolyTransaction[]

Defined in src/entities/TransactionQueue.ts:55

array of poly transactions

uid

uid: string

Overrides Entity.uid

Defined in src/entities/TransactionQueue.ts:50

generated transaction queue unique identifier

Methods

_refresh

_refresh(): void

Overrides Entity._refresh

Defined in src/entities/TransactionQueue.ts:269

Hydrate the entity

Returns: void

onStatusChange

onStatusChange(listener: function): (Anonymous function)

Defined in src/entities/TransactionQueue.ts:188

Subscribe to status changes on the Transaction Queue

Parameters:

listener: function

callback function that will be called whenever the Transaction Queue's status changes

▸ (transactionQueue: this): void

Parameters:

Name

Type

transactionQueue

this

Returns: (Anonymous function)

unsubscribe function

onTransactionStatusChange

onTransactionStatusChange(listener: function): (Anonymous function)

Defined in src/entities/TransactionQueue.ts:203

Subscribe to status changes on individual transactions

Parameters:

listener: function

callback function that will be called whenever the individual transaction's status changes

▸ (transaction: PolyTransaction, transactionQueue: this): void

Parameters:

Name

Type

transaction

transactionQueue

this

Returns: (Anonymous function)

unsubscribe function

run

run(): Promise‹ReturnType›

Defined in src/entities/TransactionQueue.ts:155

Run the transactions in the queue

Returns: Promise‹ReturnType›

toPojo

toPojo(): object

Overrides Entity.toPojo

Defined in src/entities/TransactionQueue.ts:139

Convert entity to a POJO (Plain Old Javascript Object)

Returns: object

  • args: Args

  • fees: Fees

  • procedureType: ProcedureType

  • status: TransactionQueueStatus

  • transactions: object[] = transactions.map(transaction => transaction.toPojo())

  • uid: string

Static generateId

generateId(): string

Defined in src/entities/TransactionQueue.ts:31

Generate UUID for this Transaction Queue

Returns: string

Last updated