checkNEARStealthAddress()
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / checkNEARStealthAddress
Function: checkNEARStealthAddress()
Section titled “Function: 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.
Parameters
Section titled “Parameters”stealthAddress
Section titled “stealthAddress”The stealth address to check
spendingPrivateKey
Section titled “spendingPrivateKey”`0x${string}`
Recipient’s spending private key
viewingPrivateKey
Section titled “viewingPrivateKey”`0x${string}`
Recipient’s viewing private key
Returns
Section titled “Returns”boolean
True if the address belongs to this recipient
Example
Section titled “Example”// Check if a detected address is for usconst isForMe = checkNEARStealthAddress( announcement.stealthAddress, mySpendingPrivateKey, myViewingPrivateKey)
if (isForMe) { // Derive private key and claim funds}