I find it easier to work with currencies and currency amounts if they were unique structs. So you would have the following structs:
Currencies:
IssuedCurrency
XRP
Amounts:
IssuedCurrencyAmount
XRPAmount
Currently I am having issues accessing the Currencyamount but maybe you know a way how to write a get_amount_value function. The way I am suggesting is how other libraries do it (except for the XRPAmount). You can then wrap the currencies in a Currency enum and the amounts in a Amount enum.
I find it easier to work with currencies and currency amounts if they were unique structs. So you would have the following structs: Currencies:
IssuedCurrency
XRP
Amounts:
IssuedCurrencyAmount
XRPAmount
Currently I am having issues accessing the
Currency
amount
but maybe you know a way how to write aget_amount_value
function. The way I am suggesting is how other libraries do it (except for theXRPAmount
). You can then wrap the currencies in aCurrency
enum and the amounts in aAmount
enum.