pub struct XRPL<T: Transport> { /* private fields */ }
Expand description

A client that exposes methods for interacting with the XRP Ledger.

Examples

use std::convert::TryInto;
use xrpl_rs::{XRPL, transports::HTTP, types::account::AccountInfoRequest, types::CurrencyAmount};
use tokio_test::block_on;

// Create a new XRPL client with the HTTP transport.
let xrpl = XRPL::new(
    HTTP::builder()
        .with_endpoint("http://s1.ripple.com:51234/")
        .unwrap()
        .build()
        .unwrap());

// Create a request
let mut req = AccountInfoRequest::default();
req.account = "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn".to_owned();

// Fetch the account info for an address.
let account_info = block_on(async {
    xrpl
        .account_info(req)
        .await
        .unwrap()
});

assert_eq!(account_info.account_data.balance, CurrencyAmount::xrp(9977));

Implementations

The account_channels method returns information about an account’s Payment Channels. This includes only channels where the specified account is the channel’s source, not the destination. (A channel’s “source” and “owner” are the same.) All information retrieved is relative to a particular version of the ledger.

The account_currencies command retrieves a list of currencies that an account can send or receive, based on its trust lines. (This is not a thoroughly confirmed list, but it can be used to populate user interfaces.)

The account_info command retrieves information about an account, its activity, and its XRP balance. All information retrieved is relative to a particular version of the ledger.

The account_lines method returns information about an account’s trust lines, including balances in all non-XRP currencies and assets. All information retrieved is relative to a particular version of the ledger.

The account_offers method retrieves a list of offers made by a given account that are outstanding as of a particular ledger version.

source

pub async fn transaction_entry(
    &self,
    params: TransactionEntryRequest
) -> Result<TransactionEntryResponse, Error>

The transaction_entry method retrieves information on a single transaction from a specific ledger version. (The tx method, by contrast, searches all ledgers for the specified transaction. We recommend using that method instead.)

The submit method applies a transaction and sends it to the network to be confirmed and included in future ledgers.

The sign_and_submit method applies a transaction and sends it to the network to be confirmed and included in future ledgers.

The fee command reports the current state of the open-ledger requirements for the transaction cost. This requires the FeeEscalation amendment to be enabled. New in: rippled 0.31.0.

Retrieve information about the public ledger.

The channel_verify method checks the validity of a signature that can be used to redeem a specific amount of XRP from a payment channel.

The tx method retrieves information on a single transaction, by its identifying hash.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more