common

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChainPrefix = "astra"
	Denom       = "astra"
	BaseDenom   = "aastra"
	Decimals    = 18
)

Variables

View Source
var AsaDecimalsBigInt = big.NewInt(Decimals)

Functions

func BigIntToFloat64 added in v0.0.3

func BigIntToFloat64(rawValue *big.Int) float64

BigIntToFloat64 returns the normalized amount without decimals.

func Float64ToBigInt added in v0.0.3

func Float64ToBigInt(amt float64) *big.Int

Float64ToBigInt returns the raw big int value including the decimals.

func FormatAmount

func FormatAmount(amt float64) string

FormatAmount returns string-formatted of the given float64 number.

func Init

func Init()

func ParseAmount added in v0.0.5

func ParseAmount(coins interface{}) sdk.Int

ParseAmount gets the amounts of the given coins w.r.t to the BaseDenom.

func ParseAmountToDec added in v0.0.5

func ParseAmountToDec(coins interface{}) sdk.Dec

ParseAmountToDec gets the amounts of the given coins w.r.t to the Denom.

func ParseAmountWithDenom added in v0.0.5

func ParseAmountWithDenom(coins interface{}, denom string) sdk.Dec

ParseAmountWithDenom gets the amounts of the given coins w.r.t given denom.

func ParseCoinsAmount added in v0.0.5

func ParseCoinsAmount(coins sdk.Coins, denom string) sdk.Dec

ParseCoinsAmount returns the amount of coins w.r.t the given denom.

func ParseDecCoinsAmount added in v0.0.5

func ParseDecCoinsAmount(coins sdk.DecCoins, denom string) sdk.Dec

ParseDecCoinsAmount returns the amount of dec-coins w.r.t the given denom.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL