@@ -285,6 +285,61 @@ const decryptedRecords = account.decryptRecords(records);
285285
286286---
287287
288+ ### ` generateRecordViewKey(recordCiphertext) ► Field `
289+
290+ ![ modifier: public] ( images/badges/modifier-public.svg )
291+
292+ Generates a record view key from the account owner' ; s view key and the record ciphertext.
293+ This key can be used to decrypt the record without revealing the account' ; s view key.
294+
295+ Parameters | Type | Description
296+ --- | --- | ---
297+ __ recordCiphertext__ | [ RecordCiphertext] ( sdk-src_wasm.md ) | * The record ciphertext to generate the view key for*
298+ __ * return* __ | [ Field] ( sdk-src_wasm.md ) | * The record view key*
299+
300+ #### Examples
301+
302+ ``` javascript
303+ // Import the Account class
304+ import { Account } from " @provablehq/sdk/testnet.js" ;
305+
306+ // Create an account object from a previously encrypted ciphertext and password.
307+ const account = Account .fromCiphertext (process .env .ciphertext ! , process .env .password ! );
308+
309+ // Generate a record view key from the account's view key and a record ciphertext
310+ const recordCiphertext = RecordCiphertext .fromString (" your_record_ciphertext_here" );
311+ const recordViewKey = account .generateRecordViewKey (recordCiphertext);
312+ ```
313+
314+ ---
315+
316+ ### ` generateTransitionViewKey(tpk) ► Field `
317+
318+ ![ modifier: public] ( images/badges/modifier-public.svg )
319+
320+ Generates a transition view key from the account owner' ; s view key and the transition public key.
321+ This key can be used to decrypt the private inputs and outputs of a the transition without
322+ revealing the account' ; s view key.
323+
324+ Parameters | Type | Description
325+ --- | --- | ---
326+ __ tpk__ | ` string ` | * The transition public key*
327+ __ * return* __ | [ Field] ( sdk-src_wasm.md ) | * The transition view key*
328+
329+ #### Examples
330+
331+ ``` javascript
332+ // Import the Account class
333+ import { Account } from " @provablehq/sdk/testnet.js" ;
334+
335+ // Generate a transition view key from the account's view key and a transition public key
336+ const tpk = Group .fromString (" your_transition_public_key_here" );
337+
338+ const transitionViewKey = account .generateTransitionViewKey (tpk);
339+ ```
340+
341+ ---
342+
288343### ` ownsRecordCiphertext(ciphertext) ► boolean `
289344
290345![ modifier: public] ( images/badges/modifier-public.svg )
@@ -449,23 +504,21 @@ const viewKey = account.viewKey();
449504
450505---
451506
452- ### ` computeKey() ► ComputeKey `
507+ ### ` computeKey() ► Field `
453508
454509![ modifier: public] ( images/badges/modifier-public.svg )
455510
456- Returns the ComputeKey associated with the account .
511+ Returns the Transition View Key associated with the transition public key .
457512
458513Parameters | Type | Description
459514--- | --- | ---
460- __ * return* __ | ` ComputeKey ` | * The compute key of the account *
515+ __ * return* __ | [ Field ] ( sdk-src_wasm.md ) | * The transition view key *
461516
462517#### Examples
463518
464519``` javascript
465520import { Account } from " @provablehq/sdk/testnet.js" ;
466-
467- const account = new Account ();
468- const computeKey = account .computeKey ();
521+ const account =
469522```
470523
471524---
@@ -614,6 +667,61 @@ const decryptedRecords = account.decryptRecords(records);
614667
615668---
616669
670+ ### ` generateRecordViewKey(recordCiphertext) ► Field `
671+
672+ ![ modifier: public] ( images/badges/modifier-public.svg )
673+
674+ Generates a record view key from the account owner' ; s view key and the record ciphertext.
675+ This key can be used to decrypt the record without revealing the account' ; s view key.
676+
677+ Parameters | Type | Description
678+ --- | --- | ---
679+ __ recordCiphertext__ | [ RecordCiphertext] ( sdk-src_wasm.md ) | * The record ciphertext to generate the view key for*
680+ __ * return* __ | [ Field] ( sdk-src_wasm.md ) | * The record view key*
681+
682+ #### Examples
683+
684+ ``` javascript
685+ // Import the Account class
686+ import { Account } from " @provablehq/sdk/testnet.js" ;
687+
688+ // Create an account object from a previously encrypted ciphertext and password.
689+ const account = Account .fromCiphertext (process .env .ciphertext ! , process .env .password ! );
690+
691+ // Generate a record view key from the account's view key and a record ciphertext
692+ const recordCiphertext = RecordCiphertext .fromString (" your_record_ciphertext_here" );
693+ const recordViewKey = account .generateRecordViewKey (recordCiphertext);
694+ ```
695+
696+ ---
697+
698+ ### ` generateTransitionViewKey(tpk) ► Field `
699+
700+ ![ modifier: public] ( images/badges/modifier-public.svg )
701+
702+ Generates a transition view key from the account owner' ; s view key and the transition public key.
703+ This key can be used to decrypt the private inputs and outputs of a the transition without
704+ revealing the account' ; s view key.
705+
706+ Parameters | Type | Description
707+ --- | --- | ---
708+ __ tpk__ | ` string ` | * The transition public key*
709+ __ * return* __ | [ Field] ( sdk-src_wasm.md ) | * The transition view key*
710+
711+ #### Examples
712+
713+ ``` javascript
714+ // Import the Account class
715+ import { Account } from " @provablehq/sdk/testnet.js" ;
716+
717+ // Generate a transition view key from the account's view key and a transition public key
718+ const tpk = Group .fromString (" your_transition_public_key_here" );
719+
720+ const transitionViewKey = account .generateTransitionViewKey (tpk);
721+ ```
722+
723+ ---
724+
617725### ` ownsRecordCiphertext(ciphertext) ► boolean `
618726
619727![ modifier: public] ( images/badges/modifier-public.svg )
0 commit comments