Skip to content

@lelantos-org/sdk / index / decodeViewingKey

Function: decodeViewingKey() ​

ts
function decodeViewingKey(P, key): 
  | ViewingKey
  | FullViewingKey;

Defined in: @lelantos-org/sdk/dist/keys/viewing-key.d.ts:19

Decode either tier, recomputing the derived key material.

Returns a FullViewingKey for an lelantosfvk1… string, a ViewingKey otherwise; narrow with isFullViewingKey. Failures are InvalidArgumentError. The key is kept out of the message: it is secret, and error text reaches application logs verbatim.

Parameters ​

ParameterType
PPoseidon
keystring

Returns ​

| ViewingKey | FullViewingKey