Documentation
¶
Index ¶
- Constants
- Variables
- func EthToWei(eth float64) *big.Int
- func EthToWeiWithDecimals(amountRaw float64, decimals uint8) *big.Int
- func GetPowerOfTwoCeil(x uint64) uint64
- func GweiToEth(gwei uint64) float64
- func GweiToWei(gwei float64) *big.Int
- func MilliEthToWei(milliEth float64) *big.Int
- func RoundDown(val float64, places int) float64
- func RoundUp(val float64, places int) float64
- func WeiToEth(wei *big.Int) float64
- func WeiToEthWithDecimals(amount *big.Int, decimals uint8) float64
- func WeiToGwei(wei *big.Int) float64
Constants ¶
View Source
const ( WeiPerEth float64 = 1e18 WeiPerGwei float64 = 1e9 WeiPerMilliEth float64 = 1e15 GweiPerEth float64 = 1e9 )
Conversion factors
Variables ¶
View Source
var Abs = math.Abs
View Source
var Ceil = math.Ceil
View Source
var Floor = math.Floor
View Source
var Pow = math.Pow
Functions ¶
func EthToWeiWithDecimals ¶
Converts float amount to big.Int considering a token's decimals
func GetPowerOfTwoCeil ¶
func WeiToEthWithDecimals ¶
Converts big.Int to float64 considering a token's decimals
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.