xrpl_api/api/
ledger_current.rs

1//! The ledger_current method returns the unique identifiers of the current
2//! in-progress ledger. This command is mostly useful for testing, because the
3//! ledger returned is still in flux.
4//!
5//! <https://xrpl.org/ledger_current.html>
6
7use crate::Request;
8use serde::{Deserialize, Serialize};
9
10#[derive(Default, Debug, Clone, Serialize)]
11pub struct LedgerCurrentRequest {}
12
13impl Request for LedgerCurrentRequest {
14    type Response = LedgerCurrentResponse;
15
16    fn method(&self) -> String {
17        "ledger_current".to_owned()
18    }
19}
20
21impl LedgerCurrentRequest {
22    pub fn new() -> Self {
23        Self::default()
24    }
25}
26
27#[derive(Debug, Serialize, Deserialize)]
28pub struct LedgerCurrentResponse {
29    /// The ledger index of this ledger version..
30    pub ledger_current_index: u32,
31}