Skip to content

Commit bc8ac24

Browse files
committed
removed record decryption and transition decryption methods from Account obj
1 parent 859ddbf commit bc8ac24

File tree

1 file changed

+0
-47
lines changed

1 file changed

+0
-47
lines changed

sdk/src/account.ts

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -263,53 +263,6 @@ export class Account {
263263
return ciphertexts.map((ciphertext) => this._viewKey.decrypt(ciphertext));
264264
}
265265

266-
/**
267-
* Decrypts an encrypted record string into a plaintext record object using the record view key.
268-
*
269-
* @param {string | RecordCiphertext} ciphertext A string representing the ciphertext of a record.
270-
* @param {string | Field} recordViewKey The record view key used to decrypt the record.
271-
* @returns {RecordPlaintext} The decrypted record plaintext
272-
*
273-
* @example
274-
* // Decrypt a record using a record view key
275-
* const recordViewKey = Field.fromString("your_record_view_key_here");
276-
* const decryptedRecord = decryptRecordWithRecordViewKey(ciphertext, recordViewKey);
277-
* console.log(decryptedRecord);
278-
*/
279-
decryptRecordWithRecordViewKey(ciphertext: RecordCiphertext | string, recordViewKey: Field | string): RecordPlaintext {
280-
if (typeof ciphertext === 'string' ) {
281-
ciphertext = RecordCiphertext.fromString(ciphertext);
282-
}
283-
if (typeof recordViewKey === 'string') {
284-
recordViewKey = Field.fromString(recordViewKey);
285-
}
286-
287-
return ciphertext.decryptWithRecordViewKey(recordViewKey);
288-
}
289-
290-
/**
291-
* Decrypts a transition using the transition view key.
292-
* This method is used to decrypt the private inputs and outputs of a transition without revealing
293-
* the signer's view key.
294-
* @param {string | Transition } transition The transition with private inputs and outputs to decrypt
295-
* @param {string | Field} transitionViewKey The transition view key used to decrypt the transition
296-
* @returns {Transition} The decrypted transition
297-
*
298-
* @example
299-
* // Import the Account class
300-
* import { Account } from "@provablehq/sdk/testnet.js";
301-
*
302-
*/
303-
decryptTransitionWithViewKey(transition: string | Transition, transitionViewKey: string | Field): Transition {
304-
if (typeof transition === 'string') {
305-
transition = Transition.fromString(transition);
306-
}
307-
if (typeof transitionViewKey === 'string') {
308-
transitionViewKey = Field.fromString(transitionViewKey);
309-
}
310-
return EncryptionToolkit.decryptTransitionWithVk(transitionViewKey);
311-
}
312-
313266
/**
314267
* Generates a record view key from the account owner's view key and the record ciphertext.
315268
* This key can be used to decrypt the record without revealing the account's view key.

0 commit comments

Comments
 (0)