8 releases

0.1.7 May 16, 2022
0.1.6 Apr 12, 2022
0.1.5 Mar 30, 2022
0.1.1 Feb 19, 2022
0.1.0 Jan 6, 2022

#4 in #xrp

Download history 8/week @ 2024-02-18 7/week @ 2024-02-25 124/week @ 2024-03-31

124 downloads per month

MIT license

155KB
2.5K SLoC

xrpl-rs

latest docs_badge deps_status Downloads

A client implementation in Rust for interacting with the XRPL.

Example Usage

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 an account info 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));

lib.rs:

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

Example Usage

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));

Dependencies

~18–34MB
~520K SLoC