diff --git a/batcher/aligned-sdk/src/sdk.rs b/batcher/aligned-sdk/src/sdk.rs index 8c2056058..3c4ae67b3 100644 --- a/batcher/aligned-sdk/src/sdk.rs +++ b/batcher/aligned-sdk/src/sdk.rs @@ -38,6 +38,7 @@ use futures_util::{ /// * `eth_rpc_url` - The URL of the Ethereum RPC node. /// * `chain` - The chain on which the verification will be done. /// * `verification_data` - An array of verification data of each proof. +/// * `max_fees` - An array of the maximum fee that the submitter is willing to pay for each proof verification. /// * `wallet` - The wallet used to sign the proof. /// * `nonce` - The nonce of the submitter address. See `get_next_nonce`. /// # Returns @@ -54,6 +55,7 @@ use futures_util::{ /// * `BatchVerificationTimeout` if there is a timeout waiting for the batch verification. /// * `InvalidSignature` if the signature is invalid. /// * `InvalidNonce` if the nonce is invalid. +/// * `InvalidMaxFee` if the max fee is invalid. /// * `InvalidProof` if the proof is invalid. /// * `ProofTooLarge` if the proof is too large. /// * `InsufficientBalance` if the sender balance is insufficient or unlocked @@ -83,6 +85,7 @@ pub async fn submit_multiple_and_wait_verification( /// # Arguments /// * `batcher_url` - The url of the batcher to which the proof will be submitted. /// * `verification_data` - An array of verification data of each proof. +/// * `max_fees` - An array of the maximum fee that the submitter is willing to pay for each proof verification. /// * `wallet` - The wallet used to sign the proof. /// * `nonce` - The nonce of the submitter address. See `get_next_nonce`. /// # Returns @@ -96,6 +99,7 @@ pub async fn submit_multiple_and_wait_verification( /// * `WebSocketClosedUnexpectedlyError` if the connection with the batcher is closed unexpectedly. /// * `InvalidSignature` if the signature is invalid. /// * `InvalidNonce` if the nonce is invalid. +/// * `InvalidMaxFee` if the max fee is invalid. /// * `InvalidProof` if the proof is invalid. /// * `ProofTooLarge` if the proof is too large. /// * `InsufficientBalance` if the sender balance is insufficient or unlocked. @@ -192,6 +196,7 @@ async fn _submit_multiple( /// * `eth_rpc_url` - The URL of the Ethereum RPC node. /// * `chain` - The chain on which the verification will be done. /// * `verification_data` - The verification data of the proof. +/// * `max_fee` - The maximum fee that the submitter is willing to pay for the verification. /// * `wallet` - The wallet used to sign the proof. /// * `nonce` - The nonce of the submitter address. See `get_next_nonce`. /// # Returns @@ -208,6 +213,7 @@ async fn _submit_multiple( /// * `BatchVerificationTimeout` if there is a timeout waiting for the batch verification. /// * `InvalidSignature` if the signature is invalid. /// * `InvalidNonce` if the nonce is invalid. +/// * `InvalidMaxFee` if the max fee is invalid. /// * `InvalidProof` if the proof is invalid. /// * `ProofTooLarge` if the proof is too large. /// * `InsufficientBalance` if the sender balance is insufficient or unlocked @@ -244,6 +250,7 @@ pub async fn submit_and_wait_verification( /// # Arguments /// * `batcher_url` - The url of the batcher to which the proof will be submitted. /// * `verification_data` - The verification data of the proof. +/// * `max_fee` - The maximum fee that the submitter is willing to pay for the verification. /// * `wallet` - The wallet used to sign the proof. /// * `nonce` - The nonce of the submitter address. See `get_next_nonce`. /// # Returns @@ -257,6 +264,7 @@ pub async fn submit_and_wait_verification( /// * `WebSocketClosedUnexpectedlyError` if the connection with the batcher is closed unexpectedly. /// * `InvalidSignature` if the signature is invalid. /// * `InvalidNonce` if the nonce is invalid. +/// * `InvalidMaxFee` if the max fee is invalid. /// * `InvalidProof` if the proof is invalid. /// * `ProofTooLarge` if the proof is too large. /// * `InsufficientBalance` if the sender balance is insufficient or unlocked diff --git a/docs/3_guides/1.2_SDK_api_reference.md b/docs/3_guides/1.2_SDK_api_reference.md index 21b06456d..e3a39b9f1 100644 --- a/docs/3_guides/1.2_SDK_api_reference.md +++ b/docs/3_guides/1.2_SDK_api_reference.md @@ -10,6 +10,7 @@ Submits a proof to the batcher to be verified and returns an aligned verificatio pub async fn submit( batcher_url: &str, verification_data: &VerificationData, + max_fee; U256, wallet: Wallet, nonce: U256, ) -> Result @@ -19,6 +20,7 @@ pub async fn submit( - `batcher_url` - The url of the batcher to which the proof will be submitted. - `verification_data` - The verification data for the proof. +- `max_fee` - The maximum fee that the submitter is willing to pay for the proof verification. - `wallet` - The wallet used to sign the proof. Should be using correct chain id. See `get_chain_id`. - `nonce` - The nonce of the submitter address. See `get_next_nonce`. @@ -36,6 +38,7 @@ pub async fn submit( - `WebSocketClosedUnexpectedlyError` if the connection with the batcher is closed unexpectedly. - `InvalidSignature` if the signature is invalid. - `InvalidNonce` if the nonce is invalid. +- `InvalidMaxFee` if the max fee is invalid. - `InvalidProof` if the proof is invalid. - `ProofTooLarge` if the proof is too large. - `InsufficientBalance` if the sender balance is not enough or unlocked @@ -50,6 +53,7 @@ Submits multiple proofs to the batcher to be verified and returns an aligned ver pub async fn submit_multiple( batcher_url: &str, verification_data: &[VerificationData], + max_fees: &[U256], wallet: Wallet, nonce: U256, ) -> Result, errors::SubmitError> @@ -59,6 +63,7 @@ pub async fn submit_multiple( - `batcher_url` - The url of the batcher to which the proof will be submitted. - `verification_data` - A verification data array. +- `max_fees` - A max fee array. - `wallet` - The wallet used to sign the proof. Should be using correct chain id. See `get_chain_id`. - `nonce` - The nonce of the submitter address. See `get_next_nonce`. @@ -76,6 +81,7 @@ pub async fn submit_multiple( - `WebSocketClosedUnexpectedlyError` if the connection with the batcher is closed unexpectedly. - `InvalidSignature` if the signature is invalid. - `InvalidNonce` if the nonce is invalid. +- `InvalidMaxFee` if the max fee is invalid. - `InvalidProof` if the proof is invalid. - `ProofTooLarge` if the proof is too large. - `InsufficientBalance` if the sender balance is not enough or unlocked @@ -93,6 +99,7 @@ pub async fn submit_and_wait_verification( eth_rpc_url: &str, chain: Chain, verification_data: &VerificationData, + max_fee: U256, wallet: Wallet, nonce: U256, ) -> Result @@ -104,6 +111,7 @@ pub async fn submit_and_wait_verification( - `eth_rpc_url` - The URL of the Ethereum RPC node. - `chain` - The chain on which the verification will be done. - `verification_data` - The verification data for the proof. +- `max_fee` - The maximum fee that the submitter is willing to pay for the proof verification. - `wallet` - The wallet used to sign the proof. Should be using correct chain id. See `get_chain_id`. - `nonce` - The nonce of the submitter address. See `get_next_nonce`. @@ -124,6 +132,7 @@ pub async fn submit_and_wait_verification( - `BatchVerificationTimeout` if there is a timeout waiting for the batch verification. - `InvalidSignature` if the signature is invalid. - `InvalidNonce` if the nonce is invalid. +- `InvalidMaxFee` if the max fee is invalid. - `InvalidProof` if the proof is invalid. - `ProofTooLarge` if the proof is too large. - `InsufficientBalance` if the sender balance is not enough or unlocked @@ -152,6 +161,7 @@ pub async fn submit_multiple_and_wait_verification( - `eth_rpc_url` - The URL of the Ethereum RPC node. - `chain` - The chain on which the verification will be done. - `verification_data` - A verification data array. +- `max_fees` - A max fee array. - `wallet` - The wallet used to sign the proof. Should be using correct chain id. See `get_chain_id`. - `nonce` - The nonce of the submitter address. See `get_next_nonce`. @@ -172,6 +182,7 @@ pub async fn submit_multiple_and_wait_verification( - `BatchVerificationTimeout` if there is a timeout waiting for the batch verification. - `InvalidSignature` if the signature is invalid. - `InvalidNonce` if the nonce is invalid. +- `InvalidMaxFee` if the max fee is invalid. - `InvalidProof` if the proof is invalid. - `ProofTooLarge` if the proof is too large. - `InsufficientBalance` if the sender balance is not enough or unlocked