convert static method
Converts between units.
Example:
EthUnit.convert(BigInt.from(1), from: Unit.ether, to: Unit.gwei);
// Returns: 1000000000
Implementation
static BigInt convert(BigInt value, {required Unit from, required Unit to}) {
// Convert to wei first
final inWei = value * from.weiMultiplier;
// Then convert to target unit
return inWei ~/ to.weiMultiplier;
}