package
7.0.1+incompatible
Repository: https://github.com/dydxprotocol/v4-chain.git
Documentation: pkg.go.dev
# Packages
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
No description provided by the author
nolint:lll.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
AddUint32 returns the sum of a and b.
No description provided by the author
No description provided by the author
AvgInt32 returns average of the input int32 array.
BaseToQuoteQuantums converts an amount denoted in base quantums, to an equivalent amount denoted in quote quantums.
BigDivCeil returns the ceiling of `a / b`.
BigFloatMaxUint64 returns a `big.Float` that is set to MaxUint64.
BigI returns a new big.Int from the input signed integer.
BigInt32Clamp takes a `big.Int` as input, and `int32` upper and lower bounds.
See `bigGenericClamp` for specification.
BigIntMulPow10 returns the result of `input * 10^exponent`, rounding in the direction indicated.
BigIntMulPpm takes a `big.Int` and returns the result of `input * ppm / 1_000_000`.
BigIntOneMillion returns a `big.Int` that is set to 1_000_000.
BigIntOneTrillion returns a `big.Int` that is set to 1_000_000_000_000.
BigIntRoundToMultiple takes an input, a multiple, and a direction to round (true for up, false for down).
BigMax takes two `big.Int` as parameters and returns the larger one.
BigMaxInt32 returns a `big.Int` that represents `MaxInt32`.
BigMin takes two `big.Int` as parameters and returns the smaller one.
BigMulPpm returns the result of `val * ppm / 1_000_000`, rounding in the direction indicated.
BigNegMaxUint64 returns a `big.Int` that is set to -math.MaxUint64.
BigPow10 returns the result of `10^abs(exponent)` and whether the exponent is non-negative.
BigRat0 returns a `big.Rat` that is set to 0.
BigRat1 returns a `big.Rat` that is set to 1.
See `bigGenericClamp` for specification.
BigRatMin takes two `big.Rat` as parameters and returns the smaller one.
BigRatMulPpm takes a `big.Rat` and returns the result of `input * ppm / 1_000_000`.
BigRatOneMillion returns a `big.Rat` that is set to 1_000_000.
BigRatRound takes an input and a direction to round (true for up, false for down).
BigU returns a new big.Int from the input unsigned integer.
BigUint64Clamp takes a `big.Int` as input, and `uint64` upper and lower bounds.
BytesToUint32Array converts a byte slice to a slice of uint32.
ChangeRateUint64 returns the rate of change between the original and the new values.
ContainsDuplicates returns true if the slice contains duplicates, false if not.
ConvertBigFloatSliceToUint64Slice attempts to convert all values in a slice from big Float to uint64 and return an error if any conversions fail.
ConvertBigFloatToUint64 attempts to convert a big Float into a uint64 and returns an error if the conversion would fail.
ConvertStringSliceToBigFloatSlice attempts to convert all values in a slice from string to big Float and return an error if any conversions fail.
DedupeSlice deduplicates a slice of comparable values.
FilterSlice takes a function that returns a boolean on whether to include the element in the final result, and returns a slice of elements where the function returned true when called with each element.
GetSortedKeys returns the keys of the map in sorted order.
No description provided by the author
Int64MulPpm multiplies an int64 by a scaling factor represented in parts per million.
IntToString converts any int type to a base-10 string.
No description provided by the author
MapSlice takes a function and executes that function on each element of a slice, returning the result.
MapToSortedSlice returns a slice of values from a map, sorted by key.
No description provided by the author
MaybeGetStructJsonString returns the json representation of a struct, or a formatted string using %+v if the json conversion encounters an error.
Median is a generic median calculator.
MergeAllMapsMustHaveDistinctKeys merges all the maps into a single map.
MergeMaps merges all the maps into a single map.
No description provided by the author
`MustConvertBigIntToInt32` converts a `big.Int` to an `int32` and panics if the input value overflows or underflows `int32`.
No description provided by the author
MustDivideUint32RoundUp returns the result of x/y, rounded up.
MustGetMedian is a wrapper around `Median` that panics if input length is zero.
MustParseCoinsNormalized parses a string of coins and panics on error.
QuoteToBaseQuantums converts an amount denoted in quote quantums, to an equivalent amount denoted in base quantums.
RandomBytesBetween returns a random byte slice that is in the range [start, end] when compared lexicographically.
Check if slice contains a particular value.
TxMode returns a textual representation of the tx mode, one of `CheckTx`, `ReCheckTx`, or `DeliverTx`.
Uint32ArrayToBytes converts a slice of uint32 to a byte slice.
Uint32ToKey converts a uint32 to a 4-byte slice in big-endian format.
Uint64LinearInterpolate interpolates value v0 towards v1 by a small constant value c, typically expected to be between 0 and 1.
Uint64MulPpm multiplies a uint64 value by a scaling factor represented in parts per million.
UintToString converts any uint type to a base-10 string.
UniqueSliceToMap converts a slice to a map using the provided keyFunc to generate the key.
UniqueSliceToSet converts a slice of unique values to a set.
UnwrapSDKContext is a thin wrapper around cosmos sdk's unwrap function that extracts the cosmos context from the standard golang context.
# Constants
No description provided by the author
10^BaseDenomExponent denotes how much full coin is represented by 1 base denom.
No description provided by the author
Custom exec modes.
Custom exec modes.
Custom exec modes.
No description provided by the author
No description provided by the author
No description provided by the author
10^6 quantums == 1 USD.
No description provided by the author
No description provided by the author
# Variables
GovModuleAddress is the module address for the gov module.
PowerReduction defines the default power reduction value for staking.
# Interfaces
No description provided by the author