Skip to main content

removeTransactionListener

Remove a transaction listener from a contract, such as one created with addTransactionListener.

Usage

Provide the listener function to unregister it.

This must be the same function that was passed to addTransactionListener.

// For example, if you registered a listener like this:
contract.events.addTransactionListener((event) => {
console.log("Hello World!");
});

// You must unregister it like this, by providing the same function.
contract.events.removeTransactionListener((event) => {
console.log("Hello World!");
});

Configuration

listener

The listener to unregister.

Provide the same function that was passed to addTransactionListener.

// For example, if you registered a listener like this:
contract.events.addTransactionListener((event) => {
console.log("Hello World!");
});

// You must unregister it like this, by providing the same function.
contract.events.removeTransactionListener(
(event) => {
console.log("Hello World!");
},
);