Transaction
A sent transaction, which can be watched for events.
Constructor Summary
Public Constructor | ||
public |
constructor(sent: Promise<String, Error>, marketplace: FincontractMarketplace, web3: Web3) Constructs Transaction object with a promise of sent transaction as first argument and the usual context necessary for interacting with blockchain |
Method Summary
Public Methods | ||
public |
Constructs a listener and starts watching for the event to happen. |
Public Constructors
public constructor(sent: Promise<String, Error>, marketplace: FincontractMarketplace, web3: Web3) source
Constructs Transaction object with a promise of sent transaction as first argument and the usual context necessary for interacting with blockchain
Params:
Name | Type | Attribute | Description |
sent | Promise<String, Error> | promise of sent transaction, should be the return value of Sender#send |
|
marketplace | FincontractMarketplace | a Fincontracts smart contract instance |
|
web3 | Web3 | a web3 instance connected to Ethereum node |
Public Methods
public async watch(filter: TransactionFilter, callback: Function): Promise<String, Error> source
Constructs a listener and starts watching for the event to happen. Once the event happens the callback will be executed and the returned promise gets resolved with the callback's return value. If any error happens during the execution, the promise rejects with that error.
Params:
Name | Type | Attribute | Description |
filter | TransactionFilter | a filter object to listen for events |
|
callback | Function | a callback to be executed once event was triggered |