@@ -42,16 +42,17 @@ assert(myRandomAccount.verify(hello_world, signature));
4242
4343## Methods
4444
45- ### ` fromCiphertext(ciphertext, password ) ► Account `
45+ ### ` fromCiphertext(params ) ► Account `
4646
4747![ modifier: public] ( images/badges/modifier-public.svg ) ![ modifier: static] ( images/badges/modifier-static.svg )
4848
4949Attempts to create an account from a private key ciphertext
5050
5151Parameters | Type | Description
5252--- | --- | ---
53- __ ciphertext__ | [ PrivateKeyCiphertext] ( sdk-src_wasm.md ) | * The encrypted private key ciphertext or its string representation*
54- __ password__ | ` string ` | * The password used to decrypt the private key ciphertext*
53+ __ params__ | ` Object ` | **
54+ __ params.ciphertext__ | [ PrivateKeyCiphertext] ( sdk-src_wasm.md ) | * The encrypted private key ciphertext or its string representation*
55+ __ params.password__ | ` string ` | * The password used to decrypt the private key ciphertext*
5556__ * return* __ | [ Account] ( sdk-src_account.md ) | * A new Account instance created from the decrypted private key*
5657
5758#### Examples
@@ -60,7 +61,10 @@ __*return*__ | [Account](sdk-src_account.md) | *A new Account instance created f
6061import { Account } from " @provablehq/sdk/testnet.js" ;
6162
6263// Create an account object from a previously encrypted ciphertext and password.
63- const account = Account .fromCiphertext (process .env .ciphertext , process .env .password );
64+ const account = Account .fromCiphertext ({
65+ ciphertext: process .env .ciphertext ,
66+ password: process .env .password ,
67+ });
6468```
6569
6670---
@@ -237,7 +241,10 @@ import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
237241
238242// Create a connection to the Aleo network and an account
239243const networkClient = new AleoNetworkClient ({ host: " https://api.explorer.provable.com/v1" });
240- const account = Account .fromCiphertext (process .env .ciphertext ! , process .env .password ! );
244+ const account = Account .fromCiphertext ({
245+ ciphertext: process .env .ciphertext ! ,
246+ password: process .env .password ! ,
247+ });
241248
242249// Get the record ciphertexts from a transaction.
243250const transaction = await networkClient .getTransactionObject (" at1fjy6s9md2v4rgcn3j3q4qndtfaa2zvg58a4uha0rujvrn4cumu9qfazxdd" );
@@ -273,7 +280,10 @@ import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
273280
274281// Create a connection to the Aleo network and an account
275282const networkClient = new AleoNetworkClient ({ host: " https://api.explorer.provable.com/v1" });
276- const account = Account .fromCiphertext (process .env .ciphertext ! , process .env .password ! );
283+ const account = Account .fromCiphertext ({
284+ ciphertext: process .env .ciphertext ! ,
285+ password: process .env .password ! ,
286+ });
277287
278288// Get the record ciphertexts from a transaction.
279289const transaction = await networkClient .getTransactionObject (" at1fjy6s9md2v4rgcn3j3q4qndtfaa2zvg58a4uha0rujvrn4cumu9qfazxdd" );
@@ -304,7 +314,10 @@ __*return*__ | [Field](sdk-src_wasm.md) | *The record view key*
304314import { Account } from " @provablehq/sdk/testnet.js" ;
305315
306316// Create an account object from a previously encrypted ciphertext and password.
307- const account = Account .fromCiphertext (process .env .ciphertext ! , process .env .password ! );
317+ const account = Account .fromCiphertext ({
318+ ciphertext: process .env .ciphertext ! ,
319+ password: process .env .password ! ,
320+ });
308321
309322// Generate a record view key from the account's view key and a record ciphertext
310323const recordCiphertext = RecordCiphertext .fromString (" your_record_ciphertext_here" );
@@ -359,7 +372,10 @@ import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
359372
360373// Create a connection to the Aleo network and an account
361374const networkClient = new AleoNetworkClient ({ host: " https://api.explorer.provable.com/v1" });
362- const account = Account .fromCiphertext (process .env .ciphertext ! , process .env .password ! );
375+ const account = Account .fromCiphertext ({
376+ ciphertext: process .env .ciphertext ! ,
377+ password: process .env .password ! ,
378+ });
363379
364380// Get the record ciphertexts from a transaction and check ownership of them.
365381const transaction = await networkClient .getTransactionObject (" at1fjy6s9md2v4rgcn3j3q4qndtfaa2zvg58a4uha0rujvrn4cumu9qfazxdd" );
@@ -395,29 +411,33 @@ __*return*__ | [Signature](sdk-src_wasm.md) | *Signature over the message in byt
395411import { Account } from " @provablehq/sdk/testnet.js" ;
396412
397413// Create a connection to the Aleo network and an account
398- const account = Account .fromCiphertext (process .env .ciphertext , process .env .password );
414+ const account = Account .fromCiphertext ({
415+ ciphertext: process .env .ciphertext ,
416+ password: process .env .password ,
417+ });
399418
400419// Create an account and a message to sign.
401420const account = new Account ();
402421const message = Uint8Array .from ([104 , 101 , 108 , 108 , 111 119 , 111 , 114 , 108 , 100 ])
403422const signature = account .sign (message);
404423
405424// Verify the signature.
406- assert (account .verify (message, signature));
425+ assert (account .verify ({ message, signature } ));
407426```
408427
409428---
410429
411- ### ` verify(message, signature ) ► boolean `
430+ ### ` verify(params ) ► boolean `
412431
413432![ modifier: public] ( images/badges/modifier-public.svg )
414433
415434Verifies the Signature on a message.
416435
417436Parameters | Type | Description
418437--- | --- | ---
419- __ message__ | ` Uint8Array ` | * Message in bytes to be signed.*
420- __ signature__ | [ Signature] ( sdk-src_wasm.md ) | * Signature to be verified.*
438+ __ params__ | ` Object ` | **
439+ __ params.message__ | ` Uint8Array ` | * Message in bytes to be signed.*
440+ __ params.signature__ | [ Signature] ( sdk-src_wasm.md ) | * Signature to be verified.*
421441__ * return* __ | ` boolean ` | * True if the signature is valid, false otherwise.*
422442
423443#### Examples
@@ -427,28 +447,32 @@ __*return*__ | `boolean` | *True if the signature is valid, false otherwise.*
427447import { Account } from " @provablehq/sdk/testnet.js" ;
428448
429449// Create a connection to the Aleo network and an account
430- const account = Account .fromCiphertext (process .env .ciphertext , process .env .password );
450+ const account = Account .fromCiphertext ({
451+ ciphertext: process .env .ciphertext ,
452+ password: process .env .password ,
453+ });
431454
432455// Sign a message.
433456const message = Uint8Array .from ([104 , 101 , 108 , 108 , 111 119 , 111 , 114 , 108 , 100 ])
434457const signature = account .sign (message);
435458
436459// Verify the signature.
437- assert (account .verify (message, signature));
460+ assert (account .verify ({ message, signature } ));
438461```
439462
440463---
441464
442- ### ` fromCiphertext(ciphertext, password ) ► Account `
465+ ### ` fromCiphertext(params ) ► Account `
443466
444467![ modifier: public] ( images/badges/modifier-public.svg ) ![ modifier: static] ( images/badges/modifier-static.svg )
445468
446469Attempts to create an account from a private key ciphertext
447470
448471Parameters | Type | Description
449472--- | --- | ---
450- __ ciphertext__ | [ PrivateKeyCiphertext] ( sdk-src_wasm.md ) | * The encrypted private key ciphertext or its string representation*
451- __ password__ | ` string ` | * The password used to decrypt the private key ciphertext*
473+ __ params__ | ` Object ` | **
474+ __ params.ciphertext__ | [ PrivateKeyCiphertext] ( sdk-src_wasm.md ) | * The encrypted private key ciphertext or its string representation*
475+ __ params.password__ | ` string ` | * The password used to decrypt the private key ciphertext*
452476__ * return* __ | [ Account] ( sdk-src_account.md ) | * A new Account instance created from the decrypted private key*
453477
454478#### Examples
@@ -457,7 +481,10 @@ __*return*__ | [Account](sdk-src_account.md) | *A new Account instance created f
457481import { Account } from " @provablehq/sdk/testnet.js" ;
458482
459483// Create an account object from a previously encrypted ciphertext and password.
460- const account = Account .fromCiphertext (process .env .ciphertext , process .env .password );
484+ const account = Account .fromCiphertext ({
485+ ciphertext: process .env .ciphertext ,
486+ password: process .env .password ,
487+ });
461488```
462489
463490---
@@ -621,7 +648,10 @@ import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
621648
622649// Create a connection to the Aleo network and an account
623650const networkClient = new AleoNetworkClient ({ host: " https://api.explorer.provable.com/v1" });
624- const account = Account .fromCiphertext (process .env .ciphertext ! , process .env .password ! );
651+ const account = Account .fromCiphertext ({
652+ ciphertext: process .env .ciphertext ! ,
653+ password: process .env .password ! ,
654+ });
625655
626656// Get the record ciphertexts from a transaction.
627657const transaction = await networkClient .getTransactionObject (" at1fjy6s9md2v4rgcn3j3q4qndtfaa2zvg58a4uha0rujvrn4cumu9qfazxdd" );
@@ -657,7 +687,10 @@ import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
657687
658688// Create a connection to the Aleo network and an account
659689const networkClient = new AleoNetworkClient ({ host: " https://api.explorer.provable.com/v1" });
660- const account = Account .fromCiphertext (process .env .ciphertext ! , process .env .password ! );
690+ const account = Account .fromCiphertext ({
691+ ciphertext: process .env .ciphertext ! ,
692+ password: process .env .password ! ,
693+ });
661694
662695// Get the record ciphertexts from a transaction.
663696const transaction = await networkClient .getTransactionObject (" at1fjy6s9md2v4rgcn3j3q4qndtfaa2zvg58a4uha0rujvrn4cumu9qfazxdd" );
@@ -688,7 +721,10 @@ __*return*__ | [Field](sdk-src_wasm.md) | *The record view key*
688721import { Account } from " @provablehq/sdk/testnet.js" ;
689722
690723// Create an account object from a previously encrypted ciphertext and password.
691- const account = Account .fromCiphertext (process .env .ciphertext ! , process .env .password ! );
724+ const account = Account .fromCiphertext ({
725+ ciphertext: process .env .ciphertext ! ,
726+ password: process .env .password ! ,
727+ });
692728
693729// Generate a record view key from the account's view key and a record ciphertext
694730const recordCiphertext = RecordCiphertext .fromString (" your_record_ciphertext_here" );
@@ -702,7 +738,7 @@ const recordViewKey = account.generateRecordViewKey(recordCiphertext);
702738![ modifier: public] ( images/badges/modifier-public.svg )
703739
704740Generates a transition view key from the account owner' ; s view key and the transition public key.
705- This key can be used to decrypt the private inputs and outputs of a the transition without
741+ This key can be used to decrypt the private inputs and outputs of a the transition without
706742revealing the account' ; s view key.
707743
708744Parameters | Type | Description
@@ -743,7 +779,10 @@ import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
743779
744780// Create a connection to the Aleo network and an account
745781const networkClient = new AleoNetworkClient ({ host: " https://api.explorer.provable.com/v1" });
746- const account = Account .fromCiphertext (process .env .ciphertext ! , process .env .password ! );
782+ const account = Account .fromCiphertext ({
783+ ciphertext: process .env .ciphertext ! ,
784+ password: process .env .password ! ,
785+ });
747786
748787// Get the record ciphertexts from a transaction and check ownership of them.
749788const transaction = await networkClient .getTransactionObject (" at1fjy6s9md2v4rgcn3j3q4qndtfaa2zvg58a4uha0rujvrn4cumu9qfazxdd" );
@@ -779,29 +818,33 @@ __*return*__ | [Signature](sdk-src_wasm.md) | *Signature over the message in byt
779818import { Account } from " @provablehq/sdk/testnet.js" ;
780819
781820// Create a connection to the Aleo network and an account
782- const account = Account .fromCiphertext (process .env .ciphertext , process .env .password );
821+ const account = Account .fromCiphertext ({
822+ ciphertext: process .env .ciphertext ,
823+ password: process .env .password ,
824+ });
783825
784826// Create an account and a message to sign.
785827const account = new Account ();
786828const message = Uint8Array .from ([104 , 101 , 108 , 108 , 111 119 , 111 , 114 , 108 , 100 ])
787829const signature = account .sign (message);
788830
789831// Verify the signature.
790- assert (account .verify (message, signature));
832+ assert (account .verify ({ message, signature } ));
791833```
792834
793835---
794836
795- ### ` verify(message, signature ) ► boolean `
837+ ### ` verify(params ) ► boolean `
796838
797839![ modifier: public] ( images/badges/modifier-public.svg )
798840
799841Verifies the Signature on a message.
800842
801843Parameters | Type | Description
802844--- | --- | ---
803- __ message__ | ` Uint8Array ` | * Message in bytes to be signed.*
804- __ signature__ | [ Signature] ( sdk-src_wasm.md ) | * Signature to be verified.*
845+ __ params__ | ` Object ` | **
846+ __ params.message__ | ` Uint8Array ` | * Message in bytes to be signed.*
847+ __ params.signature__ | [ Signature] ( sdk-src_wasm.md ) | * Signature to be verified.*
805848__ * return* __ | ` boolean ` | * True if the signature is valid, false otherwise.*
806849
807850#### Examples
@@ -811,14 +854,17 @@ __*return*__ | `boolean` | *True if the signature is valid, false otherwise.*
811854import { Account } from " @provablehq/sdk/testnet.js" ;
812855
813856// Create a connection to the Aleo network and an account
814- const account = Account .fromCiphertext (process .env .ciphertext , process .env .password );
857+ const account = Account .fromCiphertext ({
858+ ciphertext: process .env .ciphertext ,
859+ password: process .env .password ,
860+ });
815861
816862// Sign a message.
817863const message = Uint8Array .from ([104 , 101 , 108 , 108 , 111 119 , 111 , 114 , 108 , 100 ])
818864const signature = account .sign (message);
819865
820866// Verify the signature.
821- assert (account .verify (message, signature));
867+ assert (account .verify ({ message, signature } ));
822868```
823869
824870---
0 commit comments