Ledger Methods

Methods for obtaining information about the status of the XRP Ledger.

xrpl.ledger.get_fee(client: SyncClient, *, max_fee: float | None = 2, fee_type: str = 'open') str

Query the ledger for the current transaction fee.

Parameters:
  • client – the network client used to make network calls.

  • max_fee – The maximum fee in XRP that the user wants to pay. If load gets too high, then the fees will not scale past the maximum fee. If None, there is no ceiling for the fee. The default is 2 XRP.

  • fee_type – The type of fee to return. The options are “open” (the load-scaled fee to get into the open ledger), “minimum” (the minimum transaction fee) or “dynamic” (dynamic fee-calculation based on the queue size of the node). The default is “open”. The recommended option is “dynamic”.

Returns:

The transaction fee, in drops. Read more about drops

Raises:
xrpl.ledger.get_latest_open_ledger_sequence(client: SyncClient) int

Returns the sequence number of the latest open ledger.

Parameters:

client – The network client to use to send the request.

Returns:

The sequence number of the latest open ledger.

Raises:

XRPLRequestFailureException – if the rippled API call fails.

xrpl.ledger.get_latest_validated_ledger_sequence(client: SyncClient) int

Returns the sequence number of the latest validated ledger.

Parameters:

client – The network client to use to send the request.

Returns:

The sequence number of the latest validated ledger.

Raises:

XRPLRequestFailureException – if the rippled API call fails.