Skip to content

decryptWithNEARViewing()

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / decryptWithNEARViewing

decryptWithNEARViewing(encrypted, viewingKey): NEARTransactionData

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

Decrypt transaction data with a viewing key

NEAREncryptedPayload

The encrypted payload

NEARViewingKey

The viewing key for decryption

NEARTransactionData

The decrypted transaction data

If decryption fails (wrong key or tampered data)

const data = decryptWithNEARViewing(encrypted, viewingKey)
console.log('Amount:', data.amount)
console.log('Sender:', data.sender)