Skip to content

Commit

Permalink
Merge pull request #82 from sephynox/ledger-helpers
Browse files Browse the repository at this point in the history
* add get_latest_open_ledger_sequence
  • Loading branch information
LimpidCrypto authored Sep 1, 2024
2 parents 3e2b3cb + f00c4ea commit 950d97a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/asynch/ledger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,30 @@ pub async fn get_latest_validated_ledger_sequence(client: &impl AsyncClient) ->
.ledger_index)
}

pub async fn get_latest_open_ledger_sequence(client: &impl AsyncClient) -> Result<u32> {
let ledger_response = client
.request(
Ledger::new(
None,
None,
None,
None,
None,
None,
Some("open".into()),
None,
None,
None,
)
.into(),
)
.await?;

Ok(ledger_response
.try_into_result::<LedgerResult<'_>>()?
.ledger_index)
}

pub enum FeeType {
Open,
Minimum,
Expand Down

0 comments on commit 950d97a

Please sign in to comment.