Skip to content

Commit

Permalink
Merge pull request #63 from LimpidCrypto/0.2.0-beta-signed
Browse files Browse the repository at this point in the history
0.2.0-beta
  • Loading branch information
LimpidCrypto authored Apr 13, 2023
2 parents 3a4fd33 + a364ee2 commit 4fb9829
Show file tree
Hide file tree
Showing 132 changed files with 15,168 additions and 292 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Cargo.lock

# VSCode
.vscode
.idea

# Additional
src/main.rs
39 changes: 35 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,40 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [[Incomplete]]
- Support for no_std environments
- JSONRPC
- Websockets
- Models
- Integration Tests
- Performance Benchmarks

## [[Unreleased]]
### Modified
- Use the core hex library

## [[v0.2.0-beta]]
### Added
- Initial Implementation
- Request models
- Transaction models
- Ledger models
- Utilize `anyhow` and `thiserror` for models
- Utilities regarding `serde` crate
- Utilities regarding `anyhow` crate
### Changed
- Use `serde_with` to reduce repetitive serialization skip attribute tags
- Use `strum_macros::Display` instead of manual `core::fmt::Display`
- Use `strum_macros::Display` for `CryptoAlgorithm` enum
- Separated `Currency` to `Currency` (`IssuedCurrency`, `XRP`) and `Amount` (`IssuedCurrencyAmount`, `XRPAmount`)
- Make `Wallet` fields public
- Updated crates:
- secp256k1
- crypto-bigint
- serde_with
- criterion
### Fixed
- Broken documentation link
- Flatten hex exceptions missed from previous pass

---

## [v0.1.1] - 2021-10-28
Initial core release.
### Added
- All Core functionality working with unit tests
72 changes: 44 additions & 28 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xrpl-rust"
version = "0.1.1"
version = "0.2.0"
edition = "2018"
authors = ["Tanveer Wahid <tan@wahid.email>"]
description = "A 100% Rust library to interact with the XRPL"
Expand All @@ -18,50 +18,66 @@ tag-name = "{{version}}"
[lib]
name = "xrpl"
crate-type = ["lib"]
proc-macro = true

[dependencies]
lazy_static = "1.4.0"
sha2 = "0.9.8"
sha2 = "0.10.2"
rand_hc = "0.3.1"
ripemd160 = "0.9.1"
ripemd = "0.1.1"
ed25519-dalek = "1.0.1"
secp256k1 = { version = "0.27.0", default-features = false, features = [
"alloc",
] }
bs58 = { version = "0.4.0", default-features = false, features = [
"check",
"alloc",
] }
indexmap = { version = "1.7.0", features = ["serde"] }
strum = { version = "0.22.0", default-features = false }
strum_macros = { version = "0.22.0", default-features = false }
regex = { version = "1.5.4", default-features = false }
num-bigint = { version = "0.4.2", default-features = false }
rust_decimal = { version = "1.17.0", default-features = false, features = ["serde"] }
chrono = { version = "0.4.19", default-features = false, features = ["alloc", "clock"] }
strum = { version = "0.24.1", default-features = false }
strum_macros = { version = "0.24.2", default-features = false }
crypto-bigint = { version = "0.5.1" }
rust_decimal = { version = "1.17.0", default-features = false, features = [
"serde",
] }
chrono = { version = "0.4.19", default-features = false, features = [
"alloc",
"clock",
] }
hex = { version = "0.4.3", default-features = false, features = ["alloc"] }
bs58 = { version = "0.4.0", default-features = false, features = ["check", "alloc"] }
serde = { version = "1.0.130", default-features = false, features = ["derive"] }
serde_json = { version = "1.0.68", default-features = false, features = ["alloc"] }
rand = { version = "0.8.4", default-features = false, features = ["getrandom"] }
secp256k1 = { version = "0.20.3", default-features = false, features = ["alloc"] }
serde = { version = "1.0.130", default-features = false, features = ["derive"] }
serde_json = { version = "1.0.68", default-features = false, features = [
"alloc",
] }
serde_with = "2.3.1"
serde_repr = "0.1"
zeroize = "1.5.7"
hashbrown = { version = "0.13.2", default-features = false, features = ["serde"] }
fnv = { version = "1.0.7", default-features = false }
derive-new = { version = "0.5.9", default-features = false }
thiserror-no-std = "2.0.2"
anyhow = { version ="1.0.69", default-features = false }

[dev-dependencies]
criterion = "0.3.5"
cargo-husky = { version = "1.5.0", default-features = false, features = ["user-hooks"] }
criterion = "0.4.0"
cargo-husky = { version = "1.5.0", default-features = false, features = [
"user-hooks",
] }

[[bench]]
name = "benchmarks"
harness = false

[features]
default = ["std", "core", "models", "utils"]
models = ["core"]
models = ["core", "transactions", "requests", "ledger"]
transactions = ["core", "amounts", "currencies"]
requests = ["core", "amounts", "currencies"]
ledger = ["core", "amounts", "currencies"]
amounts = ["core"]
currencies = ["core"]
core = ["utils"]
utils = []
std = [
"rand/std",
"regex/std",
"chrono/std",
"num-bigint/std",
"rand/std_rng",
"hex/std",
"rust_decimal/std",
"bs58/std",
"serde/std",
"indexmap/std",
"secp256k1/std"
]
std = ["rand/std", "regex/std", "chrono/std", "rand/std_rng", "hex/std", "rust_decimal/std", "bs58/std", "serde/std", "indexmap/std", "secp256k1/std"]
53 changes: 27 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
# xrpl-rust ![Downloads](https://img.shields.io/crates/d/xrpl-rust)

[![latest]][crates.io] [![deps_status]][deps] [![audit_status]][audit] [![unit_status]][unit]

[latest]: https://img.shields.io/crates/v/xrpl-rust.svg
[crates.io]: https://crates.io/crates/xrpl-rust

[docs_status]: https://docs.rs/xrpl-rust/badge.svg
[docs]: https://docs.rs/xrpl-rust

[docs]: https://docs.rs/xrpl-rust/latest/xrpl/
[deps_status]: https://deps.rs/repo/github/589labs/xrpl-rust/status.svg
[deps]: https://deps.rs/repo/github/589labs/xrpl-rust

[audit_status]: https://github.com/589labs/xrpl-rust/actions/workflows/audit_test.yml/badge.svg
[audit]: https://github.com/589labs/xrpl-rust/actions/workflows/audit_test.yml

[rustc]: https://img.shields.io/badge/rust-1.51.0%2B-orange.svg
[rust]: https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html

[unit_status]: https://github.com/589labs/xrpl-rust/actions/workflows/unit_test.yml/badge.svg
[unit]: https://github.com/589labs/xrpl-rust/actions/workflows/unit_test.yml

[contributors]: https://github.com/589labs/xrpl-rust/graphs/contributors
[contributors_status]: https://img.shields.io/github/contributors/589labs/xrpl-rust.svg

[license]: https://opensource.org/licenses/ISC
[license_status]: https://img.shields.io/badge/License-ISC-blue.svg

<picture>
<source media="(prefers-color-scheme: dark)" srcset="/assets/xrpl-rust_white.png">
<img alt="" src="/assets/xrpl-rust_black.png">
</picture>

A Rust library to interact with the XRPL.
Based off of the [xrpl-py](https://github.com/XRPLF/xrpl-py) library.

A pure Rust implementation for interacting with the XRP Ledger. The xrpl-rust
A pure Rust implementation for interacting with the XRP Ledger. The xrpl-rust
crate simplifies the hardest parts of XRP Ledger interaction including
serialization and transaction signing while providing idiomatic Rust
functionality for XRP Ledger transactions and core server API (rippled)
serialization and transaction signing while providing idiomatic Rust
functionality for XRP Ledger transactions and core server API (rippled)
objects.

Interactions with this crate occur using data structures from this crate or
core [alloc](https://doc.rust-lang.org/alloc) types with the exception of
serde for JSON handling and indexmap for dictionaries. The goal is to ensure
core [alloc](https://doc.rust-lang.org/alloc) types with the exception of
serde for JSON handling and indexmap for dictionaries. The goal is to ensure
this library can be used on devices without the ability to use a
[std](hhttps://doc.rust-lang.org/std) environment.

Expand All @@ -53,23 +52,25 @@ version = "0.1.1"

# 🕮 Documentation [![docs_status]][docs]

Documentation is available [here](https://docs.rs/xrpl).
Documentation is available [here](https://docs.rs/xrpl-rust).

## ⛮ Quickstart
TODO - Most core functionality is in place and working.

In Progres:
* Models
* Asynchronous ledger interactions
* JSON RPC
* API
* Websocket
* Benchmarks
* Integration tests
TODO - Most core functionality is in place and working.

In Progress:

- Models
- Asynchronous ledger interactions
- JSON RPC
- API
- Websocket
- Benchmarks
- Integration tests

# ⚐ Flags

By default, the `std` and `core` features are enabled.
By default, the `std` and `core` features are enabled.
To operate in a `#![no_std]` environment simply disable the defaults
and enable features manually:

Expand All @@ -88,7 +89,7 @@ This project exports [serde](https://serde.rs) for handling JSON.

### Indexmap

This project exports [indexmap](https://docs.rs/crate/indexmap) as `HashMap` is
This project exports [indexmap](https://docs.rs/crate/indexmap) as `HashMap` is
not supported in the `alloc` crate. TODO: Support both.

## ⚙ #![no_std]
Expand All @@ -101,5 +102,5 @@ If you want to contribute to this project, see [CONTRIBUTING](CONTRIBUTING.md).

# 🗎 License [![license_status]][license]

The `xrpl-rust` library is licensed under the ISC License.
The `xrpl-rust` library is licensed under the ISC License.
See [LICENSE](LICENSE) for more information.
Binary file added assets/xrpl-rust_black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/xrpl-rust_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/_anyhow/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/// Turns a `thiserror_no_std::Error` into a `anyhow::Error`
#[macro_export]
macro_rules! Err {
($err:expr $(,)?) => {{
let error = $err.to_string().replace("\"", "");
let boxed_error = ::alloc::boxed::Box::new(error);
let leaked_error: &'static str = ::alloc::boxed::Box::leak(boxed_error);
Err(anyhow::anyhow!(leaked_error))
}};
}
Loading

0 comments on commit 4fb9829

Please sign in to comment.