How do you subscribe for events

masizemasize Posts: 1 Brand New

Is there any notification mechanism Observer/Subscriber like to listen for events like wallet deposits or even actions inside a contract?

Answers

  • cmichelcmichel Posts: 6 Brand New
    edited May 1

    You can listen to actions send to other contracts in your contract's apply function. All actions pass through it.

    extern "C" {
       [[noreturn]] void apply( uint64_t receiver, uint64_t code, uint64_t action ) {
          // code can be name of other contract like N(eosio.token)
          // action is name of the action like N(transfer)
          eosio_exit(0);
       }
    }
    
  • ptdir1ptdir1 Posts: 1 Brand New

    within a smart contract is there a notification system where events are broadcast to endpoints

Sign In or Register to comment.