Stealth Client
The stealth client provides a suite of actions that enable developers to handle various stealth address-related functionalities seamlessly.
Some example actions include:
Announcement handling:
getAnnouncements: retrieves stealth address announcements emitted from theERC5564AnnouncercontractwatchAnnouncementsForUser: monitors stealth transaction announcements for a specified user
Contract interaction preparation:
prepareAnnounce: prepares the payload to call theannouncefunction on theERC5564AnnouncercontractprepareRegisterKeys: prepares the payload to call theregisterKeysfunction call on theERC6538Registrycontract
Import
import { createStealthClient } from "@scopelift/stealth-address-sdk";Usage
Initialize a Stealth Client with your desired Chain ID (e.g. 1 for Ethereum) and RPC URL.
import { createStealthClient } from "@scopelift/stealth-address-sdk";
const stealthClient = createStealthClient({
chainId,
rpcUrl,
});Then you can consume StealthActions from the stealthClient instance.
const announcements = await stealthClient.getAnnouncements(...args);Parameters
chainId
-
Type:
VALID_CHAIN_IDSThe ephemeral public key from the announcement.
const stealthClient = createStealthClient({
chainId,
rpcUrl,
});rpcUrl
-
Type:
stringThe RPC URL of the network that corresponds to the provided
chainId.
const stealthClient = createStealthClient({
chainId,
rpcUrl,
});