computeNEARViewingKeyHash()
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / computeNEARViewingKeyHash
Function: computeNEARViewingKeyHash()
Section titled “Function: computeNEARViewingKeyHash()”computeNEARViewingKeyHash(
viewingPublicKey):`0x${string}`
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:18725
Compute the viewing key hash from a public key
The hash is used for announcement matching on-chain. Recipients publish their viewing key hash, and senders include it in transaction announcements.
Parameters
Section titled “Parameters”viewingPublicKey
Section titled “viewingPublicKey”`0x${string}`
The viewing public key (32 bytes, hex)
Returns
Section titled “Returns”`0x${string}`
The hash for announcement matching
Example
Section titled “Example”const hash = computeNEARViewingKeyHash(viewingKey.publicKey)// Use hash in transaction announcements