Skip to content

checkNEARStealthAddress()

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / checkNEARStealthAddress

checkNEARStealthAddress(stealthAddress, spendingPrivateKey, viewingPrivateKey): boolean

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:18199

Check if a NEAR stealth address was intended for this recipient

Efficiently checks if a stealth address belongs to the owner of the given spending/viewing keys.

StealthAddress

The stealth address to check

`0x${string}`

Recipient’s spending private key

`0x${string}`

Recipient’s viewing private key

boolean

True if the address belongs to this recipient

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