Crates.io | xrpl_sdk_jsonrpc |
lib.rs | xrpl_sdk_jsonrpc |
version | 0.12.0 |
source | src |
created_at | 2022-03-05 08:26:25.483246 |
updated_at | 2023-08-14 09:04:40.597036 |
description | A strongly-typed client for the XRP Ledger JSONRPC API |
homepage | |
repository | https://github.com/gmosx/xrpl_sdk_rust/tree/main/xrpl_sdk_jsonrpc |
max_upload_size | |
id | 543920 |
size | 30,137 |
A strongly-typed client for the XRP Ledger HTTP JSONRPC API.
This crate is an unofficial, community-driven effort.
More information about this crate can be found in the crate documentation.
[dependencies]
xrpl_sdk_jsonrpc = "0.12"
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);
This work is under active development and the API is expected to change.
Pull requests, issues and comments are welcome! Make sure to add tests for new features and bug fixes.
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.