TransactionQueue
Class to manage procedural transaction queues
Type parameters
▪ Args: any
▪ ReturnType: any
Hierarchy
Entity‹void›
↳ TransactionQueue
Index
Constructors
constructor
Properties
args
entityType
error
fees
procedureType
status
transactions
uid
Methods
_refresh
onStatusChange
onTransactionStatusChange
run
toPojo
generateId
Constructors
constructor
Create a transaction queue
Parameters:
Name
Type
Default
Description
transactions
-
list of transactions to be run in this queue
fees
-
-
returnValue
-
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
arguments provided to the transaction queue
entityType
• entityType: string = "transactionQueue"
type of entity
Optional
error
Optional
error• error? : Error
optional error information
fees
• fees: Fees
total cost of running the transactions in the queue. This does not include gas
procedureType
• procedureType: ProcedureType
type of procedure being run
status
• status: TransactionQueueStatus = TransactionQueueStatus.Idle
status of the transaction queue
transactions
• transactions: PolyTransaction[]
array of poly transactions
uid
• uid: string
Overrides Entity.uid
generated transaction queue unique identifier
Methods
_refresh
▸ _refresh(): void
Overrides Entity._refresh
Hydrate the entity
Returns: void
onStatusChange
▸ onStatusChange(listener
: function): (Anonymous function)
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)
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›
Run the transactions in the queue
Returns: Promise‹ReturnType›
toPojo
▸ toPojo(): object
Overrides Entity.toPojo
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
Static
generateId▸ generateId(): string
Generate UUID for this Transaction Queue
Returns: string
Last updated
Was this helpful?