We need to build a transaction listener, to detect incoming transactions to the bank's customers. We need one for Bank A and one for Bank B.
The transaction listener will carry out the following tasks:
- Monitor the blockchain for the txCreated event. The txCreated event is triggered by the corprem whenever a new transaction is created using the method createTx.
- In the case of an event being triggered, the listener checks the transaction payload to see if the receiving bank (trans.Rbank) is the bank hosting the transaction listener. Thus, the transaction listener for Bank A checks for transactions where the receiving bank is banka. Similarly, the transaction listener for Bank B checks if the receiving bank is bankb.
- If the transaction is intended for the bank, the transaction listener fetches the customer's current balance...