Skip to content

Commit a354655

Browse files
JuArceglpecileentropidelic
authored
docs: add functions signature to SDK (#589)
Co-authored-by: Gian <58370608+glpecile@users.noreply.github.com> Co-authored-by: Mariano A. Nicolini <mariano.nicolini.91@gmail.com>
1 parent 42be6ed commit a354655

1 file changed

Lines changed: 30 additions & 4 deletions

File tree

docs/guides/1_SDK.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ Some of its functionalities include submitting and verify proofs through the Ali
55

66
You can check the list of supported verifiers [here](../architecture/0_supported_verifiers.md).
77

8-
## Table of Contents
9-
- [Installation](#installation)
10-
- [API Reference](#api-reference)
11-
128
## Installation
139

1410
To use this SDK in your Rust project, add the following to your `Cargo.toml`:
@@ -24,6 +20,14 @@ aligned-sdk = { git = "https://github.com/yetanotherco/aligned_layer" }
2420

2521
Submits a proof to the batcher to be verified and returns an aligned verification data struct.
2622

23+
```rust
24+
pub async fn submit(
25+
batcher_addr: &str,
26+
verification_data: &VerificationData,
27+
wallet: Wallet<SigningKey>,
28+
) -> Result<Option<AlignedVerificationData>, errors::SubmitError>
29+
```
30+
2731
#### Arguments
2832

2933
- `batcher_addr` - The address of the batcher to which the proof will be submitted.
@@ -44,6 +48,14 @@ Submits a proof to the batcher to be verified and returns an aligned verificatio
4448

4549
Submits mulitple proofs to the batcher to be verified and returns an aligned verification data array.
4650

51+
```rust
52+
pub async fn submit_multiple(
53+
batcher_addr: &str,
54+
verification_data: &[VerificationData],
55+
wallet: Wallet<SigningKey>,
56+
) -> Result<Option<Vec<AlignedVerificationData>>, errors::SubmitError>
57+
```
58+
4759
#### Arguments
4860

4961
- `batcher_addr` - The address of the batcher to which the proof will be submitted.
@@ -64,6 +76,14 @@ Submits mulitple proofs to the batcher to be verified and returns an aligned ver
6476

6577
Checks if the proof has been verified with Aligned and is included in the batch on-chain.
6678

79+
```rust
80+
pub async fn verify_proof_onchain(
81+
aligned_verification_data: AlignedVerificationData,
82+
chain: Chain,
83+
eth_rpc_url: &str,
84+
) -> Result<bool, errors::VerificationError>
85+
```
86+
6787
#### Arguments
6888

6989
- `aligned_verification_data` - The aligned verification data obtained when submitting the proofs.
@@ -84,6 +104,12 @@ Checks if the proof has been verified with Aligned and is included in the batch
84104

85105
Generates a keccak256 hash commitment of the verification key.
86106

107+
```rust
108+
pub fn get_verification_key_commitment(
109+
content: &[u8]
110+
) -> [u8; 32]
111+
```
112+
87113
#### Arguments
88114

89115
- `content` - A byte slice of the verification key.

0 commit comments

Comments
 (0)