getAnnouncementsForUser
Filters a list of given announcements based on if they are relevant for the user.
Usage
import { stealthClient } from "./client";
const userAnnouncements = await stealthClient.getAnnouncementsForUser({
announcements,
spendingPublicKey,
viewingPrivateKey,
excludeList,
includeList
});
/*
Array of announcements relevant to the user.
[
{
caller: "0x...",
ephemeralPubKey: "0x...",
metadata: "0x...",
schemeId: 1n,
stealthAddress: "0x...",
more log data...
}
]
*/
Return Value
-
Type:
GetAnnouncementsForUserReturnType
An array of announcements relevant to the user, filtered by the provided criteria.
Parameters
announcements
-
Type:
AnnouncementLog[]
An array of announcement logs to be processed and filtered.
const userAnnouncements = await stealthClient.getAnnouncementsFroUser({
announcements,
spendingPublicKey,
viewingPrivateKey,
excludeList,
includeList,
});
spendingPublicKey
-
Type:
HexString
The user's spending public key.
const userAnnouncements = await stealthClient.getAnnouncementsFroUser({
announcements,
spendingPublicKey,
viewingPrivateKey,
excludeList,
includeList,
});
viewingPrivateKey
-
Type:
HexString
The user's viewing private key.
const userAnnouncements = await stealthClient.getAnnouncementsFroUser({
announcements,
spendingPublicKey,
viewingPrivateKey,
excludeList,
includeList,
});
excludeList (optional)
-
Type:
EthAddress[]
Addresses to exclude from the results.
const userAnnouncements = await stealthClient.getAnnouncementsFroUser({
announcements,
spendingPublicKey,
viewingPrivateKey,
excludeList,
includeList,
});
includeList (optional)
-
Type:
EthAddress[]
Addresses to specifically include in the results.
const userAnnouncements = await stealthClient.getAnnouncementsFroUser({
announcements,
spendingPublicKey,
viewingPrivateKey,
excludeList,
includeList,
});