@@ -8,7 +8,6 @@ Submits a proof to the batcher to be verified and returns an aligned verificatio
88
99``` rust
1010pub async fn submit (
11- batcher_url : & str ,
1211 network : Network ,
1312 verification_data : & VerificationData ,
1413 max_fee ; U256 ,
@@ -19,10 +18,6 @@ pub async fn submit(
1918
2019#### Arguments
2120
22- - ` batcher_url ` - The url of the batcher to which the proof will be submitted:
23- - mainnet: ` wss://mainnet.batcher.alignedlayer.com `
24- - holesky: ` wss://batcher.alignedlayer.com `
25- - devnet: ` ws://localhost:8080 `
2621- ` network ` - The network on which the proof will be submitted (` devnet | holesky | mainnet ` )
2722- ` verification_data ` - The verification data for the proof.
2823- ` max_fee ` - The maximum fee that the submitter is willing to pay for the proof verification.
@@ -57,7 +52,6 @@ Submits multiple proofs to the batcher to be verified and returns an aligned ver
5752
5853``` rust
5954pub async fn submit_multiple (
60- batcher_url : & str ,
6155 network : Network ,
6256 verification_data : & [VerificationData ],
6357 max_fees : & [U256 ],
@@ -68,10 +62,6 @@ pub async fn submit_multiple(
6862
6963#### Arguments
7064
71- - `batcher_url ` - The url of the batcher to which the proof will be submitted :
72- - mainnet : `wss : // mainnet.batcher.alignedlayer.com`
73- - holesky : `wss : // batcher.alignedlayer.com`
74- - devnet : `ws : // localhost:8080`
7565- `network ` - The network on which the proof will be submitted (`devnet | holesky | mainnet `)
7666- `verification_data ` - A verification data array .
7767- `max_fees ` - A max fee array .
@@ -108,7 +98,6 @@ verification data struct.
10898
10999```rust
110100pub async fn submit_and_wait_verification (
111- batcher_url : & str ,
112101 eth_rpc_url : & str ,
113102 network : Network ,
114103 verification_data : & VerificationData ,
@@ -120,18 +109,12 @@ pub async fn submit_and_wait_verification(
120109
121110#### Arguments
122111
123- - `batcher_url ` - The url of the batcher to which the proof will be submitted
124- - mainnet : `wss : // mainnet.batcher.alignedlayer.com`
125- - holesky : `wss : // batcher.alignedlayer.com`
126- - devnet : `ws : // localhost:8080`
127112- `eth_rpc_url ` - The URL of the Ethereum RPC node .
128113- `network ` - The network on which the verification will be done (`devnet | holesky | mainnet `)
129114- `verification_data ` - The verification data for the proof .
130115- `max_fee ` - The maximum fee that the submitter is willing to pay for the proof verification .
131116- `wallet ` - The wallet used to sign the proof . Should be using correct chain id . See `get_chain_id `.
132117- `nonce ` - The nonce of the submitter address . See `get_nonce_from_ethereum `.
133- - `payment_service_addr ` - The address of the batcher payment service contract .
134- - `NotAContract (address )` if you are trying to send to an address that is not a contract . This generally occurs if you have misconfigured the `environment ` parameter .
135118
136119#### Returns
137120
@@ -164,30 +147,23 @@ Submits multiple proofs to the batcher for verification, waits for verification
164147
165148```rust
166149pub async fn submit_multiple_and_wait_verification (
167- batcher_url : & str ,
168150 eth_rpc_url : & str ,
169151 network : Network ,
170152 verification_data : & [VerificationData ],
153+ max_fee : U256 ,
171154 wallet : Wallet <SigningKey >,
172- nonce : U256 ,
173- payment_service_addr : & str ,
155+ nonce : U256
174156) -> Vec <Result <AlignedVerificationData , errors :: SubmitError >>
175157```
176158
177159#### Arguments
178160
179- - `batcher_url ` - The url of the batcher to which the proof will be submitted :
180- - mainnet : `wss : // mainnet.batcher.alignedlayer.com`
181- - holesky : `wss : // batcher.alignedlayer.com`
182- - devnet : `ws : // localhost:8080`
183161- `eth_rpc_url ` - The URL of the Ethereum RPC node .
184162- `network ` - The network on which the verification will be done (`devnet | holesky | mainnet `)
185163- `verification_data ` - A verification data array .
186- - `max_fees ` - A max fee array .
164+ - `max_fee ` - The maximum fee that the submitter is willing to pay for the proof verification .
187165- `wallet ` - The wallet used to sign the proof . Should be using correct chain id . See `get_chain_id `.
188166- `nonce ` - The nonce of the submitter address . See `get_nonce_from_ethereum `.
189- - `payment_service_addr ` - The address of the batcher payment service contract .
190- - `NotAContract (address )` if you are trying to send to an address that is not a contract . This generally occurs if you have misconfigured the `environment ` parameter .
191167
192168#### Returns
193169
@@ -222,8 +198,7 @@ Checks if the proof has been verified with Aligned and is included in the batch
222198pub async fn is_proof_verified (
223199 aligned_verification_data : AlignedVerificationData ,
224200 network : Network ,
225- eth_rpc_url : & str ,
226- payment_service_addr : & str ,
201+ eth_rpc_url : & str
227202) -> Result <bool , errors :: VerificationError >
228203```
229204
@@ -232,7 +207,6 @@ pub async fn is_proof_verified(
232207- `aligned_verification_data ` - The aligned verification data obtained when submitting the proofs .
233208- `network ` - The network on which the verification will be done (`devnet | holesky | mainnet `)
234209- `eth_rpc_url ` - The URL of the Ethereum RPC node .
235- - `payment_service_addr ` - The address of the batcher payment service contract .
236210
237211#### Returns
238212
@@ -245,24 +219,6 @@ pub async fn is_proof_verified(
245219- `EthereumCallError ` if there is an error in the Ethereum call .
246220- `HexDecodingError ` if there is an error decoding the Aligned service manager contract address .
247221
248- ### `get_commitment `
249-
250- Generates a keccak256 hash commitment of the verification key .
251-
252- ```rust
253- pub fn get_commitment (
254- content : & [u8 ]
255- ) -> [u8 ; 32 ]
256- ```
257-
258- #### Arguments
259-
260- - ` content ` - A byte slice of the verification key.
261-
262- #### Returns
263-
264- - ` [u8; 32] ` - A 32-byte array representing the keccak256 hash of the verification key.
265-
266222### `get_nonce_from_ethereum `
267223
268224Returns the nonce for a given address in Ethereum from aligned payment service contract .
@@ -301,17 +257,14 @@ as the batcher proofs might not yet be on ethereum, producing an out-of-sync non
301257
302258```rust
303259pub async fn get_nonce_from_batcher (
304- batcher_ws_url : & str ,
260+ network : Network ,
305261 address : Address ,
306262) -> Result <U256 , GetNonceError > {
307263```
308264#### Arguments
309265
310266
311- - ` batcher_url ` - The batcher websocket url:
312- - mainnet: ` wss://mainnet.batcher.alignedlayer.com `
313- - holesky: ` wss://batcher.alignedlayer.com `
314- - devnet: ` ws://localhost:8080 `
267+ - ` network ` - The network from which the nonce will be retrieved.
315268- ` address ` - The user address for which the nonce will be retrieved.
316269
317270#### Returns
@@ -353,15 +306,14 @@ priority the user wants to have in the batch, the `estimate` parameter can be se
353306``` rust
354307pub async fn estimate_fee (
355308 eth_rpc_url : & str ,
356- estimate : PriceEstimate ,
309+ fee_estimation_type : FeeEstimationType ,
357310) -> Result <U256 , errors :: MaxFeeEstimateError >
358311```
359312
360313#### Arguments
361314
362315- `eth_rpc_url ` - The URL of the Ethereum RPC node .
363- - `estimate ` - The parameter to set the priority for the proof to be included in the batch . It can be one
364- of `Min `, `Default ` or `Max `.
316+ - `estimate_type ` - Enum specifying the type of price estimate : Default , Instant . Custom (usize )
365317
366318#### Returns
367319
@@ -372,33 +324,6 @@ pub async fn estimate_fee(
372324- `EthereumProviderError ` if there is an error in the connection with the RPC provider .
373325- `EthereumCallError ` if there is an error in the Ethereum call .
374326
375- ### `compute_max_fee `
376-
377- Computes `max_fee ` for a proof based on the number of proofs in a batch (`num_proofs_per_batch `) and number of proofs (`num_proofs `) in that batch the user would pay for i . e (`num_proofs ` / `num_proofs_per_batch `).
378-
379- ```rust
380- pub async fn compute_max_fee (
381- eth_rpc_url : & str ,
382- num_proofs : usize ,
383- num_proofs_per_batch : usize ,
384- ) -> Result <U256 , errors :: MaxFeeEstimateError >
385- ```
386-
387- #### Arguments
388-
389- - `eth_rpc_url ` - The URL of the Ethereum RPC node .
390- - `num_proofs ` - The number of proofs in a batch the user would pay for .
391- - `num_proofs_per_batch ` - The number of proofs within a batch .
392-
393- #### Returns
394-
395- - `Result <U256 , MaxFeeEstimateError >` - The calculated `max_fee ` as a `U256 `.
396-
397- #### Errors
398-
399- - `EthereumProviderError ` if there is an error in the connection with the RPC provider .
400- - `EthereumCallError ` if there is an error in the Ethereum call .
401-
402327### `fee_per_proof `
403328
404329Returns the `fee_per_proof ` based on the current gas price for a batch compromised of `num_proofs_per_batch ` i . e. (1 / `num_proofs_per_batch `).
0 commit comments