Skip to content

Commit 2e229b4

Browse files
committed
docs: update cli and sdk reference
1 parent dc4f841 commit 2e229b4

File tree

3 files changed

+78
-1
lines changed

3 files changed

+78
-1
lines changed

crates/sdk/src/verification_layer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ pub async fn get_nonce_from_ethereum(
650650
/// Retrieves the `max_fee` of the proof with the highest nonce in the batcher queue for a given address.
651651
///
652652
/// This value represents the maximum fee limit that can be used when submitting the next proof.
653-
/// To increase the fee limit for a new proof, you must first bump the fee of the previous proof,
653+
/// To increase the fee limit for a new proof, you must first bump the fee of the previous proofs,
654654
/// and continue doing so recursively until you reach the proof with the highest nonce (this one).
655655
///
656656
/// Read more here: https://docs.alignedlayer.com/architecture/1_proof_verification_layer/1_batcher#max-fee-priority-queue

docs/3_guides/1.2_SDK_api_reference.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,43 @@ pub async fn get_nonce_from_batcher(
270270

271271
- `EthRpcError` if the batcher has an error in the Ethereum call when retrieving the nonce if not already cached.
272272

273+
### `get_last_max_fee`
274+
275+
Retrieves the `max_fee` of the proof with the highest nonce in the batcher queue for a given address.
276+
277+
This value represents the maximum fee limit that can be used when submitting the next proof. To increase the fee limit for a new proof, you must first bump the fee of the previous proofs queued in the batcher.
278+
279+
Read more here: https://docs.alignedlayer.com/architecture/1_proof_verification_layer/1_batcher#max-fee-priority-queue
280+
281+
```rust
282+
pub async fn get_last_max_fee(
283+
network: Network,
284+
address: Address,
285+
) -> Result<U256, GetLastMaxFeeError>
286+
```
287+
288+
#### Arguments
289+
290+
- `network` - The network from which to retrieve the last `max_fee`.
291+
- `address` - The user address whose last `max_fee` will be retrieved.
292+
293+
#### Returns
294+
295+
- `Result<U256, GetLastMaxFeeError>` - The `max_fee` of the proof with the highest nonce for the given user, or `U256::MAX` if the user has no proofs in the queue.
296+
297+
#### Errors
298+
299+
- `ConnectionFailed` if there is an error connecting to the batcher.
300+
- `ProtocolMismatch` if the protocol version doesn't match.
301+
- `SerializationError` if there is an error serializing/deserializing the message.
302+
- `InvalidRequest` if the request is invalid.
303+
- `UnexpectedResponse` if the batcher responds with an unexpected message.
304+
- `GenericError` if the error doesn't match any of the previous ones.
305+
306+
#### Notes
307+
308+
- Returns `U256::MAX` (2^256 - 1) when no proofs are present in the queue for the user.
309+
273310
### `get_chain_id`
274311

275312
Returns the chain ID for a given rpc url.

docs/3_guides/9_aligned_cli.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,46 @@ aligned get-user-nonce-from-ethereum \
319319
320320
---
321321
322+
### **get-user-last-max-fee**
323+
324+
#### Description:
325+
326+
Retrieves the `max_fee` of the proof with the highest nonce in the batcher queue for a given address.
327+
328+
This value represents the maximum fee limit that can be used when submitting the next proof. To increase the fee limit for a new proof, you must first bump the fee of the previous proofs queued in the batcher.
329+
330+
Read more here: https://docs.alignedlayer.com/architecture/1_proof_verification_layer/1_batcher#max-fee-priority-queue
331+
332+
#### Command:
333+
334+
`get-user-last-max-fee [OPTIONS] <user_ethereum_address>`
335+
336+
#### Options:
337+
338+
- `<user_ethereum_address>`: User's Ethereum address.
339+
- One of the following, to specify which Network to interact with:
340+
- `--network <working_network_name>`: Network name to interact with.
341+
- Default: `devnet`
342+
- Possible values: `devnet`, `holesky`, `mainnet`, `hoodi`
343+
- For a custom Network, you must specify the following parameters:
344+
- `--aligned_service_manager <aligned_service_manager_contract_address>`
345+
- `--batcher_payment_service <batcher_payment_service_contract_address>`
346+
- `--batcher_url <batcher_websocket_url>`
347+
348+
#### Example:
349+
350+
```bash
351+
aligned get-user-last-max-fee \
352+
<USER_ETH_ADDRESS> \
353+
--network holesky
354+
```
355+
356+
#### Notes:
357+
358+
- Returns `U256::MAX` (2^256 - 1) when no proofs are present in the queue for the user.
359+
360+
---
361+
322362
### **get-user-amount-of-queued-proofs**
323363

324364
#### Description:

0 commit comments

Comments
 (0)