Skip to content

importNEARViewingKey()

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / 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.

NEARViewingKeyExport

The exported viewing key data

NEARViewingKey

The imported viewing key

If the export format is invalid

const json = await readFile('near-viewing-key.json')
const exported = JSON.parse(json)
const viewingKey = importNEARViewingKey(exported)