decryptWithNEARViewing()
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / decryptWithNEARViewing
Function: decryptWithNEARViewing()
Section titled “Function: decryptWithNEARViewing()”decryptWithNEARViewing(
encrypted,viewingKey):NEARTransactionData
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:18810
Decrypt transaction data with a viewing key
Parameters
Section titled “Parameters”encrypted
Section titled “encrypted”The encrypted payload
viewingKey
Section titled “viewingKey”The viewing key for decryption
Returns
Section titled “Returns”The decrypted transaction data
Throws
Section titled “Throws”If decryption fails (wrong key or tampered data)
Example
Section titled “Example”const data = decryptWithNEARViewing(encrypted, viewingKey)console.log('Amount:', data.amount)console.log('Sender:', data.sender)