importNEARViewingKey()
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / importNEARViewingKey
Function: importNEARViewingKey()
Section titled “Function: importNEARViewingKey()”importNEARViewingKey(
exported):NEARViewingKey
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:18769
Import a viewing key from standard JSON format
Validates the export format and reconstructs the viewing key object.
Parameters
Section titled “Parameters”exported
Section titled “exported”The exported viewing key data
Returns
Section titled “Returns”The imported viewing key
Throws
Section titled “Throws”If the export format is invalid
Example
Section titled “Example”const json = await readFile('near-viewing-key.json')const exported = JSON.parse(json)const viewingKey = importNEARViewingKey(exported)