Open alopatindev opened 11 months ago
Sadly that's probably the only working way to parse cryptocurrency amounts returned by etherscan API right now:
let balance = "40891626854930000000000".parse::<i128>().unwrap(); // doesn't fit into i64, so we can't even call Money::from_minor
let currency = crypto::ETH;
dbg!(Money::from_decimal(
Decimal::from_i128_with_scale(balance, currency.exponent()),
currency,
));