Skip to content

Commit

Permalink
Prepare for 0.4.1 release, add some crypto currencies. (#53)
Browse files Browse the repository at this point in the history
* Crypto: Added COMP, DAI, MKR, UNI, USDC, USDT, XTZ, ZEC

* Bump version to 0.4.1, update changelog

* Fix date typo

* Fix: syntax error
  • Loading branch information
varunsrin authored Jan 16, 2021
1 parent e5a9e87 commit 4c1e568
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 2 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## [0.4.1] - 2021-01-16

* ISO: Fixed symbols for BHD, ISK, NPR, UYU and alpha code for UYW.
* ISO: Added ALL, STN, UYW currencies [@ObsceneGiraffe](https://github.com/ObsceneGiraffe).
* Crypto: Added COMP, DAI, MKR, UNI, USDC, USDT, XTZ, ZEC
* Fix: `Exchange::get_rate` returns a lifetime `Option<ExchangeRate<'a, T>>` to prevent lifetime conflicts [@RestitutorOrbis](https://github.com/RestitutorOrbis).

## [0.4.0] - 2021-01-01

rusty_money now supports defining your own currencies and has a cryptocurrency module. It no longer depends on lazy_static!,
Expand Down Expand Up @@ -72,6 +79,5 @@ Breaking Changes:
## [Planned]

* Serialization and Deserialization of Money.
* Adding popular currencies to the crypto module.
* Benchmarking performance.
* no-std by default.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rusty-money"
version = "0.4.0"
version = "0.4.1"
authors = ["Varun Srinivasan <[email protected]>"]
edition = "2018"
license = "MIT"
Expand Down
72 changes: 72 additions & 0 deletions src/currency/crypto_currencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@ define_currency_set!(
symbol: "₿",
symbol_first: true,
},
COMP: {
code: "COMP",
exponent: 18,
locale: EnUs,
minor_units: 1_000_000_000_000_000_000,
name: "Compound",
symbol: "COMP",
symbol_first: false,
},
DAI: {
code: "DAI",
exponent: 18,
locale: EnUs,
minor_units: 1_000_000_000_000_000_000,
name: "Dai Stablecoin",
symbol: "DAI",
symbol_first: false,
},
ETH: {
code: "ETH",
exponent: 18,
Expand All @@ -20,6 +38,60 @@ define_currency_set!(
name: "Ethereum",
symbol: "ETH",
symbol_first: false,
},
MKR: {
code: "MKR",
exponent: 18,
locale: EnUs,
minor_units: 1_000_000_000_000_000_000,
name: "Maker",
symbol: "MKR",
symbol_first: false,
},
UNI: {
code: "UNI",
exponent: 18,
locale: EnUs,
minor_units: 1_000_000_000_000_000_000,
name: "Uniswap",
symbol: "UNI",
symbol_first: false,
},
USDC: {
code: "USDC",
exponent: 6,
locale: EnUs,
minor_units: 1_000_000,
name: "USD Coin",
symbol: "USDC",
symbol_first: false,
},
USDT: {
code: "USDT",
exponent: 6,
locale: EnUs,
minor_units: 1_000_000,
name: "Tether",
symbol: "USDT",
symbol_first: false,
},
XTZ: {
code: "XTZ",
exponent: 6,
locale: EnUs,
minor_units: 1_000_000,
name: "Tezos",
symbol: "XTZ",
symbol_first: false,
},
ZEC: {
code: "ZEC",
exponent: 8,
locale: EnUs,
minor_units: 100_000_000,
name: "ZCash",
symbol: "ZEC",
symbol_first: false,
}
}
);
Expand Down

0 comments on commit 4c1e568

Please sign in to comment.