Skip to content

checkNEARStealthAddress()

SIP Protocol API Reference v0.15.1


SIP Protocol API Reference / checkNEARStealthAddress

checkNEARStealthAddress(stealthAddress, viewingPrivateKey, spendingPublicKey): boolean

Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:18535

Check if a NEAR stealth address was intended for this recipient

Canonical EIP-5564 view-only check: requires only the recipient’s viewing private key plus their spending PUBLIC key (no spending private key needed).

StealthAddress

The stealth address to check

`0x${string}`

Recipient’s viewing private key

`0x${string}`

Recipient’s spending public key (meta-address spendingKey)

boolean

True if the address belongs to this recipient

// Check if a detected address is for us
const isForMe = checkNEARStealthAddress(
announcement.stealthAddress,
myViewingPrivateKey,
mySpendingPublicKey
)
if (isForMe) {
// Derive private key and claim funds
}