Brord icon

Event usage

Brord | PRO | 04/09/19 06:14:04 PM UTC | 0 ⭐ | 506 👁️ | Never ⏰ | []
Java |

1.63 KB

|

None

|

0 👍

/

0 👎

    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());
        }
    }

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎