1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//! The ledger_current method returns the unique identifiers of the current
//! in-progress ledger. This command is mostly useful for testing, because the
//! ledger returned is still in flux.
//!
//! <https://xrpl.org/ledger_current.html>

use crate::Request;
use serde::{Deserialize, Serialize};

#[derive(Default, Debug, Clone, Serialize)]
pub struct LedgerCurrentRequest {}

impl Request for LedgerCurrentRequest {
    type Response = LedgerCurrentResponse;

    fn method(&self) -> String {
        "ledger_current".to_owned()
    }
}

impl LedgerCurrentRequest {
    pub fn new() -> Self {
        Self::default()
    }
}

#[derive(Debug, Serialize, Deserialize)]
pub struct LedgerCurrentResponse {
    /// The ledger index of this ledger version..
    pub ledger_current_index: u32,
}