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 theERC5564Announcer
contractwatchAnnouncementsForUser
: monitors stealth transaction announcements for a specified user
Contract interaction preparation:
prepareAnnounce
: prepares the payload to call theannounce
function on theERC5564Announcer
contractprepareRegisterKeys
: prepares the payload to call theregisterKeys
function call on theERC6538Registry
contract
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_IDS
The ephemeral public key from the announcement.
const stealthClient = createStealthClient({
chainId,
rpcUrl,
});
rpcUrl
-
Type:
string
The RPC URL of the network that corresponds to the provided
chainId
.
const stealthClient = createStealthClient({
chainId,
rpcUrl,
});