Skip to main content
Version: Next

InMemoryViewingKey

The InMemoryViewingKey class can be instantiated from a viewing or spending key.

Instantiation from a viewing key:

import { InMemoryViewingKey } from '@taquito/sapling';
const inMemoryViewingKey = new InMemoryViewingKey(
'000000000000000000977d725fc96387e8ec1e603e7ae60c6e63529fb84e36e126770e9db9899d7f2344259fd700dc80120d3c9ca65d698f6064043b048b079caa4f198aed96271740b1d6fd523d71b15cd0b3d75644afbe9abfedb6883e299165665ab692c14ca5c835c61a0e53de553a751c78fbc42d5e7eca807fd441206651c84bf88de803efba837583145a5f338b1a7af8a5f9bec4783054f9d063d365f2352f72cbced95e0a'
);

Instantiation from an unencrypted spending key:

Live Editor
Result

Instantiation from an encrypted spending key:

Live Editor
Result

How to retrieve payment addresses from the viewing key

The InMemoryViewingKey class has a method named getAddress, allowing to derive addresses (zet) from the viewing key. An index can be specified as a parameter, or the default value 0 will be used.

Live Editor
Result

Provide detailed feedback