sephynox / xrpl-rust

A 100% Rust library to interact with the XRPL. XRPL Grant Winner
https://crates.io/crates/xrpl-rust
ISC License
20 stars 8 forks source link

Separate currency amount/currency #59

Closed LimpidCrypto closed 1 year ago

LimpidCrypto commented 1 year ago

This is a follow up #55

High Level Overview of Change

This PR allows us to make our models stronger typed. It adds the following models:

Amounts can be turned into Currencies and vice versa. The value can be easily turned into Decimal using the TryInto trait (error handling still has to be implemented).

Context of Change

https://github.com/sephynox/xrpl-rust/pull/55#issuecomment-1474174141

Type of Change

Test Plan

The currencies and amounts are tested in the tests for the models.

Future Tasks