Skip to content

Commit 477427c

Browse files
committed
Regenerating docs
1 parent 87904e8 commit 477427c

File tree

3 files changed

+287
-53
lines changed

3 files changed

+287
-53
lines changed

docs/api_reference/sdk-src_account.md

Lines changed: 77 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -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

4949
Attempts to create an account from a private key ciphertext
5050

5151
Parameters | 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
6061
import { 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
239243
const 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.
243250
const 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
275282
const 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.
279289
const transaction = await networkClient.getTransactionObject("at1fjy6s9md2v4rgcn3j3q4qndtfaa2zvg58a4uha0rujvrn4cumu9qfazxdd");
@@ -304,7 +314,10 @@ __*return*__ | [Field](sdk-src_wasm.md) | *The record view key*
304314
import { 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
310323
const 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
361374
const 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.
365381
const transaction = await networkClient.getTransactionObject("at1fjy6s9md2v4rgcn3j3q4qndtfaa2zvg58a4uha0rujvrn4cumu9qfazxdd");
@@ -395,29 +411,33 @@ __*return*__ | [Signature](sdk-src_wasm.md) | *Signature over the message in byt
395411
import { 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.
401420
const account = new Account();
402421
const message = Uint8Array.from([104, 101, 108, 108, 111 119, 111, 114, 108, 100])
403422
const 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

415434
Verifies the Signature on a message.
416435

417436
Parameters | 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.*
427447
import { 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.
433456
const message = Uint8Array.from([104, 101, 108, 108, 111 119, 111, 114, 108, 100])
434457
const 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

446469
Attempts to create an account from a private key ciphertext
447470

448471
Parameters | 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
457481
import { 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
623650
const 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.
627657
const 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
659689
const 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.
663696
const transaction = await networkClient.getTransactionObject("at1fjy6s9md2v4rgcn3j3q4qndtfaa2zvg58a4uha0rujvrn4cumu9qfazxdd");
@@ -688,7 +721,10 @@ __*return*__ | [Field](sdk-src_wasm.md) | *The record view key*
688721
import { 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
694730
const 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

704740
Generates 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
706742
revealing the account's view key.
707743

708744
Parameters | 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
745781
const 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.
749788
const transaction = await networkClient.getTransactionObject("at1fjy6s9md2v4rgcn3j3q4qndtfaa2zvg58a4uha0rujvrn4cumu9qfazxdd");
@@ -779,29 +818,33 @@ __*return*__ | [Signature](sdk-src_wasm.md) | *Signature over the message in byt
779818
import { 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.
785827
const account = new Account();
786828
const message = Uint8Array.from([104, 101, 108, 108, 111 119, 111, 114, 108, 100])
787829
const 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

799841
Verifies the Signature on a message.
800842

801843
Parameters | 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.*
811854
import { 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.
817863
const message = Uint8Array.from([104, 101, 108, 108, 111 119, 111, 114, 108, 100])
818864
const 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

Comments
 (0)