You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Returns the estimated `max_fee` depending on the batch inclusion preference of the user, computed based on the current gas price, and the number of proofs in a batch.
112
-
/// NOTE: The `max_fee` is computed from an rpc nodes max priority gas price.
114
+
/// NOTE: The `max_fee` is computed from a rpc node's max priority gas price.
113
115
/// To estimate the `max_fee` of a batch we compute it based on a batch size of 1 (Instant), 10 (Default), or a user supplied `number_proofs_in_batch` (Custom).
114
116
/// The `max_fee` estimates therefore are:
115
-
/// * `Default`: Specifies a `max_fee` equivalent to the cost of paying for one proof within a batch of 10 proofs ie. 1 / 10 proofs.
117
+
/// * `Default`: Specifies a `max_fee` equivalent to the cost of paying for one proof within a batch of 10 proofs i.e. 1 / 10 proofs.
116
118
/// This estimates a default `max_fee` the user should specify for including there proof within the batch.
117
119
/// * `Instant`: Specifies a `max_fee` equivalent to the cost of paying for an entire batch ensuring the user's proof is included instantly assuming the proof is not competing with others for inclusion.
118
120
/// * `Custom (number_proofs_in_batch)`: Specifies a `max_fee` equivalent to the cost of paying 1 proof / `number_proofs_in_batch` allowing the user a user to estimate the `max_fee` precisely based on the `number_proofs_in_batch`.
119
121
///
120
122
/// # Arguments
121
123
/// * `eth_rpc_url` - The URL of the Ethereum RPC node.
122
-
/// * `estimate_type` - Enum specifying the type of price estimate: Default, Instant. Custom(usize)
124
+
/// * `fee_estimation_type` - Enum specifying the type of price estimate: Default, Instant. Custom(usize)
125
+
///
123
126
/// # Returns
124
127
/// The estimated `max_fee` in gas for a proof based on the users `FeeEstimateType` as a `U256`.
128
+
///
125
129
/// # Errors
126
130
/// * `EthereumProviderError` if there is an error in the connection with the RPC provider.
127
131
/// * `EthereumGasPriceError` if there is an error retrieving the Ethereum gas price.
@@ -144,12 +148,16 @@ pub async fn estimate_fee(
144
148
145
149
/// Returns the `fee_per_proof` based on the current gas price for a batch compromised of `num_proofs_per_batch`
146
150
/// i.e. (1 / `num_proofs_per_batch`).
147
-
// NOTE: The `fee_per_proof` is computed from an rpc nodes max priority gas price.
151
+
///
152
+
/// NOTE: The `fee_per_proof` is computed from a rpc node's max priority gas price.
153
+
///
148
154
/// # Arguments
149
155
/// * `eth_rpc_url` - The URL of the users Ethereum RPC node.
150
-
/// * `num_proofs_per_batch` - number of proofs within a batch.
156
+
/// * `num_proofs_in_batch` - number of proofs within a batch.
157
+
///
151
158
/// # Returns
152
159
/// * The fee per proof of a batch as a `U256`.
160
+
///
153
161
/// # Errors
154
162
/// * `EthereumProviderError` if there is an error in the connection with the RPC provider.
155
163
/// * `EthereumGasPriceError` if there is an error retrieving the Ethereum gas price.
@@ -195,14 +203,17 @@ async fn fetch_gas_price(
195
203
}
196
204
197
205
/// Submits multiple proofs to the batcher to be verified in Aligned.
206
+
///
198
207
/// # Arguments
199
208
/// * `network` - The network on which the verification will be done.
200
209
/// * `verification_data` - An array of verification data of each proof.
201
-
/// * `max_fees` - An array of the maximum fee that the submitter is willing to pay for each proof verification.
210
+
/// * `max_fee` - The maximum fee that the submitter is willing to pay for the verification for each proof.
202
211
/// * `wallet` - The wallet used to sign the proof.
203
212
/// * `nonce` - The nonce of the submitter address. See [`get_nonce_from_ethereum`] or [`get_nonce_from_batcher`].
213
+
///
204
214
/// # Returns
205
215
/// * An array of aligned verification data obtained when submitting the proof.
216
+
///
206
217
/// # Errors
207
218
/// * `MissingRequiredParameter` if the verification data vector is empty.
208
219
/// * `ProtocolVersionMismatch` if the version of the SDK is lower than the expected one.
@@ -307,16 +318,18 @@ async fn _submit_multiple(
307
318
}
308
319
309
320
/// Submits a proof to the batcher to be verified in Aligned and waits for the verification on-chain.
321
+
///
310
322
/// # Arguments
311
323
/// * `eth_rpc_url` - The URL of the Ethereum RPC node.
312
-
/// * `chain` - The chain on which the verification will be done.
324
+
/// * `network` - The network on which the verification will be done.
313
325
/// * `verification_data` - The verification data of the proof.
314
326
/// * `max_fee` - The maximum fee that the submitter is willing to pay for the verification.
315
327
/// * `wallet` - The wallet used to sign the proof.
316
328
/// * `nonce` - The nonce of the submitter address. See [`get_nonce_from_ethereum`] or [`get_nonce_from_batcher`].
317
-
/// * `payment_service_addr` - The address of the payment service contract.
329
+
///
318
330
/// # Returns
319
331
/// * The aligned verification data obtained when submitting the proof.
332
+
///
320
333
/// # Errors
321
334
/// * `MissingRequiredParameter` if the verification data vector is empty.
322
335
/// * `ProtocolVersionMismatch` if the version of the SDK is lower than the expected one.
0 commit comments