watchAnnouncementsForUser
Watches for announcements relevant to the user.
checkStealthAddress is used to determine if the announcement is intended for the specific user.
Usage
import { stealthClient } from "./client";
const unwatch = await stealthClient.watchAnnouncementsForUser({
args,
spendingPublicKey,
viewingPrivateKey,
ERC5564Address,
excludeList,
includeList,
handleLogsForUser,
pollOptions,
});Return Value
-
Type:
functionA function that can be called to stop watching for announcements.
Parameters
args
-
Type:
AnnouncementArgsThe arguments used to filter all announcements.
Includes the scheme ID, stealth address, and caller.
const unwatch = await stealthClient.watchAnnouncementsForUser({
args,
spendingPublicKey,
viewingPrivateKey,
ERC5564Address,
excludeList,
includeList,
handleLogsForUser,
pollOptions,
});spendingPublicKey
-
Type:
HexStringThe spending public key of the user.
const unwatch = await stealthClient.watchAnnouncementsForUser({
args,
spendingPublicKey,
viewingPrivateKey,
ERC5564Address,
excludeList,
includeList,
handleLogsForUser,
pollOptions,
});viewingPrivateKey
-
Type:
HexStringThe viewing private key of the user.
const unwatch = await stealthClient.watchAnnouncementsForUser({
args,
spendingPublicKey,
viewingPrivateKey,
ERC5564Address,
excludeList,
includeList,
handleLogsForUser,
pollOptions,
});ERC5564Address
-
Type:
HexStringThe address of the
ERC5564Announcercontract.
const unwatch = await stealthClient.watchAnnouncementsForUser({
args,
spendingPublicKey,
viewingPrivateKey,
ERC5564Address,
excludeList,
includeList,
handleLogsForUser,
pollOptions,
});excludeList (optional)
-
Type:
EthAddress[]Addresses to exclude from the results.
const unwatch = await stealthClient.watchAnnouncementsForUser({
args,
spendingPublicKey,
viewingPrivateKey,
ERC5564Address,
excludeList,
includeList,
handleLogsForUser,
pollOptions,
});includeList (optional)
-
Type:
EthAddress[]Addresses to include in the results.
const unwatch = await stealthClient.watchAnnouncementsForUser({
args,
spendingPublicKey,
viewingPrivateKey,
ERC5564Address,
excludeList,
includeList,
handleLogsForUser,
pollOptions,
});handleLogsForUser
-
Type:
functionA function to transform relevant announcements.
const unwatch = await stealthClient.watchAnnouncementsForUser({
args,
spendingPublicKey,
viewingPrivateKey,
ERC5564Address,
excludeList,
includeList,
handleLogsForUser,
pollOptions,
});pollOptions (optional)
-
Type:
WatchAnnouncementsForUserPollingOptionsOptions for polling (watching) the contract.
const unwatch = await stealthClient.watchAnnouncementsForUser({
args,
spendingPublicKey,
viewingPrivateKey,
ERC5564Address,
excludeList,
includeList,
handleLogsForUser,
pollOptions,
});