constants

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: Apache-2.0 Imports: 3 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// CurrencyName is the official name of the currency.
	CurrencyName = "ndau"

	// CurrencyQuantum is the official name of the smallest possible
	// unit of the currency.
	CurrencyQuantum = "napu"

	// QuantaPerUnit is the number of quanta in a single unit of
	// ndau.
	QuantaPerUnit = 100000000

	// NapuPerNdau is a more human-friendly synonym of QuantaPerUnit
	NapuPerNdau = QuantaPerUnit

	// RateDenominator is the implied denominator for interest rates.
	//
	// EAI rates are expressed as integers, and integer math is performed
	// for determinism. However, the interest-like calculations of EAI
	// expect non-integer rates. We square this circle by treating them
	// as rationals using an implied denominator, specified here.
	//
	// RateDenominator must be tuned to preserve precision. Because of
	// technical details of EAI calculation, it cannot be greater than
	// half of a uint64: approximately 10**18. At the same time, the effective
	// precision of an EAI factor is the precision of the RateDenominator
	// reduced by the fraction of the year over which the EAI is calculated.
	//
	// One hour, as a fraction of a year, is a little more than 1/10000.
	// Therefore, by making the precision of the RateDenominator 10000 times
	// the QuantaPerUnit, we ensure that we don't lose too much precision
	// in EAI calculations. However, EAI calculations much more frequent than
	// an hour can be expected to lose some EAI to dust truncation.
	RateDenominator = QuantaPerUnit * 10000

	// MaxQuantaPerAddress is the number of quanta that
	// can be tracked in a single address.
	MaxQuantaPerAddress = math.MaxInt64

	// TimestampFormat is the format string used to parse timestamps.
	TimestampFormat = "2006-01-02T15:04:05.000000Z"

	// EpochStart is the text representation of the start time of our Epoch.
	EpochStart = "2000-01-01T00:00:00.000000Z"

	// MaxTimestamp is the maximum value a timestamp can take on
	MaxTimestamp = math.MaxInt64

	// MinTimestamp is the minimum value a timestamp can take on
	MinTimestamp = 0

	// DurationFormat is the format regex used to parse durations
	DurationFormat = `` /* 184-byte string literal not displayed */

	// MaxDuration is the maximum value a duration can contain
	MaxDuration = math.MaxInt64

	// MinDuration is the minimum value a duration can contain
	MinDuration = math.MinInt64
)

Variables

View Source
var (
	// Epoch is the basic moment from which Ndau chain time calculations begin.
	Epoch time.Time

	// DurationRE is the regular expression used to parse Durations
	DurationRE *regexp.Regexp
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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