Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- account.getEventManager().registerListener(new AccountListener(account));
- private class AccountListener implements EventListener {
- private IotaAccount account;
- public AccountListener(IotaAccount account) {
- this.account = account;
- }
- @AccountEvent
- public void confimed(EventTransferConfirmed e) {
- System.out.println("account: " + account.getId());
- System.out.println("confimed: " + e.getBundle().getBundleHash());
- }
- @AccountEvent
- public void promoted(EventPromotion e) {
- System.out.println("account: " + account.getId());
- System.out.println("promoted: " + e.getPromotedBundle());
- }
- @AccountEvent
- public void reattach(EventReattachment e) {
- System.out.println("account: " + account.getId());
- System.out.println("reattach: " + e.getNewBundle());
- }
- @AccountEvent
- public void sent(EventSentTransfer e) {
- System.out.println("account: " + account.getId());
- System.out.println("sent transfer: " + e.getBundle().getBundleHash());
- }
- @AccountEvent
- public void received(EventReceivedMessage e) {
- System.out.println("account: " + account.getId());
- System.out.println("message: " + e.getMessage());
- }
- @AccountEvent
- public void input(EventNewInput e) {
- System.out.println("account: " + account.getId());
- System.out.println("newInput: " + e.getAddress());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement