Documentation ¶
Index ¶
- func AddressToBigInt(addr common.Address) big.Int
- func PrettyBlockNumberWithUnderscores(blockNumber uint64) string
- func PrettyShortenAddress(addr string) string
- func PrettyTrimAddress(addr common.Address) (trimmed string)
- func SafeBigIntToFloat(n *big.Int) float64
- func SafeScaleTokenValue(tokenValue *big.Int, decimals int) (resultFloat float64)
- func SafeStringToInt(s string) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrettyBlockNumberWithUnderscores ¶
PrettyBlockNumberWithUnderscores pretty prints a block number e.g. 16345454 as 16_345_454
func PrettyShortenAddress ¶
PrettyShortenAddress takes an address like 0xdA6c517C4ed4134E5Ae1f825d028559f267767df and returns 0xdA6c...df
func PrettyTrimAddress ¶
PrettyTrimAddress removes leading zeros in address
func SafeBigIntToFloat ¶
SafeBigIntToFloat converts a big.Int to a float or zero if any troubles
func SafeScaleTokenValue ¶
SafeScaleTokenValue scales a token value by the given decimals and returns the value with two decimal places afterwards. So 123456789 and 6 decimals will return 123.46 (which is 123.456789 rounded up to 123.46). If anything goes wrong the expected will be 0.00.
func SafeStringToInt ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.