Struct xrpl_rs::XRPL [−][src]
pub struct XRPL<T: Transport> { /* fields omitted */ }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".try_into().unwrap()));Implementations
pub async fn account_channels(
&self,
params: AccountChannelsRequest
) -> Result<AccountChannelsResponse, Error>
pub async fn account_channels(
&self,
params: AccountChannelsRequest
) -> Result<AccountChannelsResponse, Error>
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.
pub async fn account_currencies(
&self,
params: AccountCurrenciesRequest
) -> Result<AccountCurrenciesResponse, Error>
pub async fn account_currencies(
&self,
params: AccountCurrenciesRequest
) -> Result<AccountCurrenciesResponse, Error>
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.)
pub async fn account_info(
&self,
params: AccountInfoRequest
) -> Result<AccountInfoResponse, Error>
pub async fn account_info(
&self,
params: AccountInfoRequest
) -> Result<AccountInfoResponse, Error>
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.
pub async fn account_lines(
&self,
params: AccountLinesRequest
) -> Result<AccountLinesResponse, Error>
pub async fn account_lines(
&self,
params: AccountLinesRequest
) -> Result<AccountLinesResponse, Error>
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.
pub async fn account_offers(
&self,
params: AccountOfferRequest
) -> Result<AccountOfferResponse, Error>
pub async fn account_offers(
&self,
params: AccountOfferRequest
) -> Result<AccountOfferResponse, Error>
The account_offers method retrieves a list of offers made by a given account that are outstanding as of a particular ledger version.
pub async fn transaction_entry(
&self,
params: TransactionEntryRequest
) -> Result<TransactionEntryResponse, Error>
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.
pub async fn sign_and_submit(
&self,
params: SignAndSubmitRequest
) -> Result<SubmitResponse, Error>
pub async fn sign_and_submit(
&self,
params: SignAndSubmitRequest
) -> Result<SubmitResponse, Error>
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.
Auto Trait Implementations
impl<T> RefUnwindSafe for XRPL<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for XRPL<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
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
