#ledger #json-rpc-client #json-rpc #client #api #http-client #xrpl

no-std xrpl_http_client

A strongly-typed client for the XRP Ledger JSONRPC API

7 unstable releases

0.16.5 Sep 16, 2024
0.16.4 May 25, 2024
0.16.3 Mar 27, 2024
0.15.0 Sep 24, 2023
0.13.0 Aug 17, 2023

#8 in #xrpl

Download history 3/week @ 2024-06-20 4/week @ 2024-06-27 21/week @ 2024-07-04 13/week @ 2024-07-25 3/week @ 2024-08-01 4/week @ 2024-08-22 5/week @ 2024-08-29 194/week @ 2024-09-12 49/week @ 2024-09-19 16/week @ 2024-09-26 6/week @ 2024-10-03

265 downloads per month
Used in xrpl_cli

Apache-2.0

300KB
7K SLoC

XRP Ledger JSONRPC client

A strongly-typed client for the XRP Ledger HTTP JSONRPC API.

This crate is an unofficial, community-driven effort.

Crates.io Documentation

More information about this crate can be found in the crate documentation.

Installation

[dependencies]
xrpl_http_client = "0.12"

Usage

let client = Client::new();

let account = "...";

let req = AccountTxRequest::new(&account).limit(5);
let resp = client.call(req).await;

dbg!(&resp);
let client = Client::new();

let account = "...";
let public_key = "...";
let secret_key = "...";

let offer_sequence = 123; // the sequence of the offer to cancel

let tx = Transaction::offer_cancel(account, offer_sequence);

let tx = client.prepare_transaction(tx).await?;

let public_key = hex::decode(public_key)?;
let secret_key = hex::decode(secret_key)?;

let tx = sign_transaction(tx, &public_key, &secret_key);

let tx_blob = serialize_transaction_to_hex(&tx);

let req = SubmitRequest::new(&tx_blob);
let resp = client.call(req).await?;

dbg!(resp);

Status

This work is under active development and the API is expected to change.

Contributing

Pull requests, issues and comments are welcome! Make sure to add tests for new features and bug fixes.

License

This work is licensed under the Apache-2.0 License. See LICENSE.txt or https://spdx.org/licenses/Apache-2.0.html for details.

Copyright © 2022 Georgios Moschovitis.

Dependencies

~7–22MB
~344K SLoC