PolyTransaction
Wrapper class for a Polymath Transaction
Type parameters
▪ Args
▪ Values: any[]
Hierarchy
Entity‹void›
↳ PolyTransaction
Index
Constructors
constructor
Properties
args
error
promise
receipt
status
tag
transactionQueue
txHash
uid
Methods
_refresh
onStatusChange
run
toPojo
generateId
Constructors
constructor
+ new PolyTransaction(transaction
: TransactionSpec‹Args, Values, TransactionReceiptWithDecodedLogs | string›, transactionQueue
: TransactionQueue‹any, any›): PolyTransaction
Creates a poly transaction
Parameters:
Name
Type
transaction
transactionQueue
Returns: PolyTransaction
Properties
args
• args: TransactionSpec["args"]
arguments with which the transaction will be called
Optional
error
Optional
error• error? : PolymathError
stores errors thrown while running the transaction (if any)
promise
• promise: Promise‹any›
internal promise that resolves when the transaction has finished running
Optional
receipt
Optional
receipt• receipt? : TransactionReceiptWithDecodedLogs | string
stores the transaction receipt (if successful)
status
• status: TransactionStatus = TransactionStatus.Idle
current status of the transaction
tag
• tag: PolyTransactionTag
type of transaction represented by this instance for display purposes
transactionQueue
• transactionQueue: TransactionQueue
transaction queue to which this transaction belongs
Optional
txHash
Optional
txHash• txHash? : undefined | string
transaction hash (available after running)
uid
• uid: string
Overrides Entity.uid
unique generated identifier of the poly transaction
Methods
_refresh
▸ _refresh(): void
Overrides Entity._refresh
Hydrate the entity
Returns: void
onStatusChange
▸ onStatusChange(listener
: function): (Anonymous function)
Subscribe to status changes
Parameters:
▪ listener: function
callback function that will be called whenever the status changes
▸ (transaction
: this): void
Parameters:
Name
Type
transaction
this
Returns: (Anonymous function)
unsubscribe function
run
▸ run(): Promise‹void›
Run the poly transaction and update the transaction status
Returns: Promise‹void›
toPojo
▸ toPojo(): object
Overrides Entity.toPojo
Convert entity to a POJO (Plain Old Javascript Object)
Returns: object
args: any = filteredArgs as any
error: undefined | PolymathError
receipt: undefined | string | TransactionReceiptWithDecodedLogs
status: TransactionStatus
tag: PolyTransactionTag
transactionQueueUid: string
txHash: undefined | string
uid: string
Static
generateId
Static
generateId▸ generateId(): string
Generate the Poly Transaction's UUID from its identifying properties
Returns: string
Last updated
Was this helpful?