Docs

watchTransactions

Watch for transactions to or from a given address.

Example

// this will log out the new transactions every time a new block is finalized
const unsubscribe = watchTransactions({
  network: "ethereum",
  address: "0x1234",
  onTransactions: (transactions) => {
    console.log("new transactions", transactions);
  },
});
// later on you can call unsubscribe to stop listening for new transactions
unsubscribe();

Parameters

Returns

An unsubscribe function that will stop listening for new transactions when called