Skip to content

Commit 4812eca

Browse files
authored
Merge pull request #94 from sephynox/dev
v0.4.0
2 parents b5874c9 + 989c12a commit 4812eca

File tree

133 files changed

+7479
-3229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+7479
-3229
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"panicbit.cargo",
2626
"vadimcn.vscode-lldb",
2727
"tamasfe.even-better-toml",
28-
"Swellaby.vscode-rust-test-adapter"
28+
"Swellaby.vscode-rust-test-adapter",
29+
"fill-labs.dependi"
2930
],
3031
"settings": {
3132
"files.autoSave": "onFocusChange",

.github/workflows/unit_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ jobs:
7272
name: Test for no_std
7373
with:
7474
command: test
75-
args: --release --no-default-features --features embassy-rt,core,wallet,models,helpers,websocket,json-rpc
75+
args: --release --no-default-features --features embassy-rt,core,utils,wallet,models,helpers,websocket,json-rpc

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
## [[Unreleased]]
1515

16-
## [[v0.2.0-beta.1]]
16+
## [[v0.4.0]]
17+
18+
- add amm support
19+
- Transaction models
20+
- Transaction signing
21+
- Request models
22+
- add sidechain support
23+
- Transaction models
24+
- Transaction signing
25+
- improve errorhandling utilizing thiserror
26+
- simplifying feature flags
27+
28+
## [[v0.3.0]]
1729

1830
- Examples
1931
- Wallet from seed

Cargo.toml

Lines changed: 15 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[package]
22
name = "xrpl-rust"
3-
version = "0.3.0"
3+
version = "0.4.0"
44
edition = "2021"
55
authors = [
66
"Tanveer Wahid <tan@wahid.email>",
7-
"Steffen Konermann <contact@limpidcrypto.com>",
7+
"LimpidCrypto <contact@limpidcrypto.com>",
88
]
99
description = "A 100% Rust library to interact with the XRPL"
1010
readme = "README.md"
@@ -33,14 +33,14 @@ ed25519-dalek = { version = "2.1.1", default-features = false, features = [
3333
"alloc",
3434
"zeroize",
3535
] }
36-
secp256k1 = { version = "0.29.0", default-features = false, features = [
36+
secp256k1 = { version = "0.30.0", default-features = false, features = [
3737
"alloc",
3838
] }
3939
bs58 = { version = "0.5.0", default-features = false, features = [
4040
"check",
4141
"alloc",
4242
] }
43-
indexmap = { version = "2.0.0", features = ["serde"] }
43+
indexmap = { version = "2.6.0", features = ["serde"] }
4444
regex = { version = "1.5.4", default-features = false }
4545
strum = { version = "0.26.3", default-features = false }
4646
strum_macros = { version = "0.26.4", default-features = false }
@@ -61,11 +61,10 @@ serde_json = { version = "1.0.68", default-features = false, features = [
6161
serde_with = "3.2.0"
6262
serde_repr = "0.1"
6363
zeroize = "1.5.7"
64-
hashbrown = { version = "0.14.5", features = ["serde"] }
64+
hashbrown = { version = "0.15.0", features = ["serde"] }
6565
fnv = { version = "1.0.7", default-features = false }
6666
derive-new = { version = "0.7.0", default-features = false }
6767
thiserror-no-std = "2.0.2"
68-
anyhow = { version = "1.0.69", default-features = false }
6968
embassy-sync = "0.6.0"
7069

7170
# networking
@@ -77,23 +76,25 @@ embassy-time = { version = "0.3.2", optional = true }
7776
embedded-websocket-embedded-io = { version = "0.1.0", optional = true, default-features = false, features = [
7877
"embedded-io-async",
7978
] }
80-
reqwless = { version = "0.12.1", optional = true }
79+
reqwless = { version = "0.13.0", optional = true }
8180
reqwest = { version = "0.12.7", optional = true, features = ["json"] }
82-
tokio-tungstenite = { version = "0.23.1", optional = true, features = [
81+
tokio-tungstenite = { version = "0.24.0", optional = true, features = [
8382
"native-tls",
8483
] }
8584
embassy-futures = { version = "0.1.1" }
86-
embedded-nal-async = { version = "0.7.1", optional = true }
85+
embedded-nal-async = { version = "0.8.0", optional = true }
8786
actix-rt = { version = "2.10.0", optional = true }
8887
async-std = { version = "1.13.0", optional = true }
8988
futures-executor = { version = "0.3.30", optional = true }
9089
futures-timer = { version = "3.0.3", optional = true }
9190
smol = { version = "2.0.2", optional = true }
91+
bigdecimal = { version = "0.4.5", features = ["serde-json"] }
9292

9393
[dev-dependencies]
9494
criterion = "0.5.1"
9595
tokio = { version = "1.0", features = ["full"] }
9696
embedded-io-adapters = { version = "0.6.1", features = ["tokio-1"] }
97+
anyhow = { version = "1.0.91", no-default-features = true }
9798

9899
[[bench]]
99100
name = "benchmarks"
@@ -108,42 +109,15 @@ default = [
108109
"models",
109110
"utils",
110111
"helpers",
111-
"websocket",
112112
"json-rpc",
113+
"websocket",
113114
]
114-
models = [
115-
"transaction-models",
116-
"request-models",
117-
"ledger-models",
118-
"result-models",
119-
]
120-
transaction-models = ["core"]
121-
request-models = []
122-
result-models = ["request-models", "ledger-models"]
123-
ledger-models = []
124-
helpers = [
125-
"account-helpers",
126-
"ledger-helpers",
127-
"transaction-helpers",
128-
"wallet-helpers",
129-
]
130-
account-helpers = ["core", "request-models", "result-models"]
131-
ledger-helpers = ["request-models", "result-models"]
132-
wallet-helpers = ["wallet", "request-models", "result-models"]
133-
transaction-helpers = [
134-
"wallet",
135-
"account-helpers",
136-
"ledger-helpers",
137-
"request-models",
138-
"result-models",
139-
"transaction-models",
140-
"ledger-models",
141-
]
115+
models = ["core"]
116+
helpers = ["core", "models", "wallet"]
142117
wallet = ["core"]
143-
json-rpc = ["request-models", "result-models", "reqwless", "embedded-nal-async"]
118+
json-rpc = ["models", "reqwless", "embedded-io-async", "embedded-nal-async"]
144119
websocket = [
145-
"request-models",
146-
"result-models",
120+
"models",
147121
"futures",
148122
"embedded-io-async",
149123
"embedded-websocket-embedded-io",

README.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
<img alt="" src="/assets/xrpl-rust_black.png">
2525
</picture>
2626

27+
> [!WARNING]
28+
> This repository is under active development. All releases before v1.0.0 can be considered as **beta-releases**
29+
2730
A Rust library to interact with the XRPL.
2831
Based off of the [xrpl-py](https://github.com/XRPLF/xrpl-py) library.
2932

@@ -47,7 +50,7 @@ To install, add the following to your project's `Cargo.toml`:
4750

4851
```toml
4952
[dependencies.xrpl]
50-
version = "0.1.1"
53+
version = "0.4.0"
5154
```
5255

5356
# 🕮 Documentation [![docs_status]][docs]
@@ -60,38 +63,37 @@ TODO - Most core functionality is in place and working.
6063

6164
In Progress:
6265

63-
- Models
64-
- Asynchronous ledger interactions
65-
- JSON RPC
66-
- API
67-
- Websocket
66+
- no_std examples
67+
- Response Models
6868
- Benchmarks
6969
- Integration tests
7070

7171
# ⚐ Flags
7272

73-
By default, the `std` and `core` features are enabled.
73+
By default, the the following features are enabled:
74+
75+
- std
76+
- core
77+
- models
78+
- wallet
79+
- utils
80+
- websocket
81+
- json-rpc
82+
- helpers
83+
- tokio-rt
84+
85+
When `helpers` is enabled you also need to specify a `*-rt` feature flag as it is needed for waiting between requests when using the `submit_and_wait` function.
86+
7487
To operate in a `#![no_std]` environment simply disable the defaults
7588
and enable features manually:
7689

7790
```toml
7891
[dependencies.xrpl]
79-
version = "0.1.1"
92+
version = "0.4.0"
8093
default-features = false
81-
features = ["core", "models"]
94+
features = ["core", "models", "wallet", "utils", "websocket", "json-rpc", "helpers", "embassy-rt"]
8295
```
8396

84-
## ‼ Exported Dependencies
85-
86-
### Serde
87-
88-
This project exports [serde](https://serde.rs) for handling JSON.
89-
90-
### Indexmap
91-
92-
This project exports [indexmap](https://docs.rs/crate/indexmap) as `HashMap` is
93-
not supported in the `alloc` crate. TODO: Support both.
94-
9597
## ⚙ #![no_std]
9698

9799
This library aims to be `#![no_std]` compliant.

benches/benchmarks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use criterion::{black_box, criterion_group, criterion_main, Criterion};
2-
use xrpl::core::definitions::get_field_type_name;
2+
use xrpl::core::binarycodec::definitions::get_field_type_name;
33
use xrpl::utils::xrp_to_drops;
44

55
pub fn bench_xrp_to_drops(c: &mut Criterion) {

src/_anyhow/mod.rs

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/account/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use alloc::borrow::Cow;
2-
use anyhow::Result;
32
use embassy_futures::block_on;
43

54
use crate::{
@@ -12,6 +11,7 @@ use crate::{
1211
get_xrp_balance as async_get_xrp_balance,
1312
},
1413
clients::XRPLClient,
14+
exceptions::XRPLHelperResult,
1515
},
1616
models::{ledger::objects::AccountRoot, results::account_tx::AccountTx, XRPAmount},
1717
};
@@ -20,7 +20,7 @@ pub fn does_account_exist<C>(
2020
address: Cow<'_, str>,
2121
client: &C,
2222
ledger_index: Option<Cow<'_, str>>,
23-
) -> Result<bool>
23+
) -> XRPLHelperResult<bool>
2424
where
2525
C: XRPLClient,
2626
{
@@ -31,7 +31,7 @@ pub fn get_next_valid_seq_number<C>(
3131
address: Cow<'_, str>,
3232
client: &C,
3333
ledger_index: Option<Cow<'_, str>>,
34-
) -> Result<u32>
34+
) -> XRPLHelperResult<u32>
3535
where
3636
C: XRPLClient,
3737
{
@@ -46,7 +46,7 @@ pub fn get_xrp_balance<'a: 'b, 'b, C>(
4646
address: Cow<'a, str>,
4747
client: &C,
4848
ledger_index: Option<Cow<'a, str>>,
49-
) -> Result<XRPAmount<'b>>
49+
) -> XRPLHelperResult<XRPAmount<'b>>
5050
where
5151
C: XRPLClient,
5252
{
@@ -57,7 +57,7 @@ pub fn get_account_root<'a: 'b, 'b, C>(
5757
address: Cow<'a, str>,
5858
client: &C,
5959
ledger_index: Cow<'a, str>,
60-
) -> Result<AccountRoot<'b>>
60+
) -> XRPLHelperResult<AccountRoot<'b>>
6161
where
6262
C: XRPLClient,
6363
{
@@ -67,7 +67,7 @@ where
6767
pub fn get_latest_transaction<'a: 'b, 'b, C>(
6868
address: Cow<'a, str>,
6969
client: &C,
70-
) -> Result<AccountTx<'b>>
70+
) -> XRPLHelperResult<AccountTx<'b>>
7171
where
7272
C: XRPLClient,
7373
{

0 commit comments

Comments
 (0)