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:
function
A function that can be called to stop watching for announcements.
Parameters
args
-
Type:
AnnouncementArgs
The 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:
HexString
The spending public key of the user.
const unwatch = await stealthClient.watchAnnouncementsForUser({
args,
spendingPublicKey,
viewingPrivateKey,
ERC5564Address,
excludeList,
includeList,
handleLogsForUser,
pollOptions,
});
viewingPrivateKey
-
Type:
HexString
The viewing private key of the user.
const unwatch = await stealthClient.watchAnnouncementsForUser({
args,
spendingPublicKey,
viewingPrivateKey,
ERC5564Address,
excludeList,
includeList,
handleLogsForUser,
pollOptions,
});
ERC5564Address
-
Type:
HexString
The address of the
ERC5564Announcer
contract.
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:
function
A function to transform relevant announcements.
const unwatch = await stealthClient.watchAnnouncementsForUser({
args,
spendingPublicKey,
viewingPrivateKey,
ERC5564Address,
excludeList,
includeList,
handleLogsForUser,
pollOptions,
});
pollOptions (optional)
-
Type:
WatchAnnouncementsForUserPollingOptions
Options for polling (watching) the contract.
const unwatch = await stealthClient.watchAnnouncementsForUser({
args,
spendingPublicKey,
viewingPrivateKey,
ERC5564Address,
excludeList,
includeList,
handleLogsForUser,
pollOptions,
});