package
0.0.8
Repository: https://github.com/dfwallet/cosmossdk.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

CompactUnmarshal is a space efficient decoding for CompactBitArray.
ConvertCoin attempts to convert a coin to a given denomination.
ConvertDecCoin attempts to convert a decimal coin to a given denomination.
intended to be used with require/assert: require.True(DecEq(...)).
test if two decimal arrays are equal.
DefaultCoinDenomRegex returns the default regex string.
GetBaseDenom returns the denom of smallest unit registered.
GetDenomUnit returns a unit for a given denomination if it exists.
intended to be used with require/assert: require.True(IntEq(...)).
maximum decimal between two.
MaxInt returns the maximum between two integers.
minimum decimal between two.
return the minimum of the ints.
Decimal from string, panic on error.
NewAnyWithValue constructs a new Any packed with the value provided or returns an error if that value couldn't be packed.
NewCoin returns a new coin with a denomination and amount.
NewCoins constructs a new coin set.
NewCompactBitArray returns a new compact bit array.
create a new Dec from integer assuming whole number.
NewDecCoin creates a new DecCoin instance from an Int.
NewDecCoinFromCoin creates a new DecCoin from a Coin.
NewDecCoinFromDec creates a new DecCoin instance from a Dec.
NewDecCoins constructs a new coin set with with decimal values from DecCoins.
NewDecCoinsFromCoins constructs a new coin set with decimal values from regular Coins.
create a new Dec from big integer assuming whole numbers CONTRACT: prec <= Precision.
create a new Dec from big integer assuming whole numbers CONTRACT: prec <= Precision.
create a new Dec from big integer assuming whole numbers CONTRACT: prec <= Precision.
create a new Dec from big integer with decimal place at prec CONTRACT: prec <= Precision.
create a decimal from an input decimal string.
create a new Dec from integer with decimal place at prec CONTRACT: prec <= Precision.
NewInt constructs Int from int64.
NewInt64DecCoin returns a new DecCoin with a denomination and amount.
NewIntFromBigInt constructs Int from big.Int.
NewIntFromString constructs Int from string.
NewIntFromUint64 constructs an Int from a uint64.
NewIntWithDecimal constructs Int with decimal Result value is n*10^dec.
No description provided by the author
NormalizeCoin try to convert a coin to the smallest unit registered, returns original one if failed.
NormalizeCoins normalize and truncate a list of decimal coins.
NormalizeDecCoin try to convert a decimal coin to the smallest unit registered, returns original one if failed.
No description provided by the author
OneInt returns Int value with one.
ParseCoinNormalized parses and normalize a cli input for one coin type, returning errors if invalid or on an empty string as well.
ParseCoinsNormalized will parse out a list of coins separated by commas, and normalize them by converting to smallest unit.
ParseDecCoin parses a decimal coin from a string, returning an error if invalid.
ParseDecCoins will parse out a list of decimal coins separated by commas.
RegisterDenom registers a denomination with a corresponding unit.
SetCoinDenomRegex allows for coin's custom validation by overriding the regular expression string used for denom validation.
No description provided by the author
SortableDecBytes returns a byte slice representation of a Dec that can be sorted.
UnsafePackAny packs the value x in the Any and instead of returning the error in the case of a packing failure, keeps the cached value.
ValidateDenom is the default validation function for Coin.Denom.
ValidSortableDec ensures that a Dec is within the sortable bounds, a Dec can't have a precision of less than 10^-18.
No description provided by the author
ZeroInt returns Int value with zero.

# Constants

bytes required to represent the above precision Ceiling[Log2[999 999 999 999 999 999]].
number of decimal places.

# Variables

Decimal errors.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Decimal errors.
Decimal errors.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MaxSortableDec is the largest Dec that can be passed into SortableDecBytes() Its negative form is the least Dec that can be passed in.

# Structs

No description provided by the author
Coin defines a token with a denomination and an amount.
CompactBitArray is an implementation of a space efficient bit array.
NOTE: never use new(Dec) or else we will panic unmarshalling into the nil embedded big.Int.
DecCoin defines a token with a denomination and a decimal amount.
DecProto defines a Protobuf wrapper around a Dec object.
Int wraps big.Int with a 257 bit range bound Checks overflow, underflow and division by zero Exists in range from -(2^256 - 1) to 2^256 - 1.
IntProto defines a Protobuf wrapper around an Int object.
MsgSend represents a message to send coins from one account to another.
MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey.

# Interfaces

CustomProtobufType defines the interface custom gogo proto types must implement in order to be used as a "customtype" extension.
PubKey defines a public key and extends proto.Message.

# Type aliases

No description provided by the author
Coins is a set of Coin, one per currency.
DecCoins defines a slice of coins with decimal values.