Skip to content

A client implementation in Rust for interacting with the XRPL.

Notifications You must be signed in to change notification settings

Decentralised-Advertising/xrpl-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A client implementation in Rust for interacting with the XRPL.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages