Documentation
¶
Index ¶
Constants ¶
const ( // AtomsPerVAR is the number of atoms in one VAR coin. // This maintains compatibility with the original DCR atom system. AtomsPerVAR = 1e8 // MaxVARAtoms is the maximum number of VAR atoms that can exist. // This follows the original DCR supply model. MaxVARAtoms = 21e6 * AtomsPerVAR // MaxVARAmount is the maximum VAR amount as an Amount type. MaxVARAmount = Amount(MaxVARAtoms) )
Coin-specific constants for VAR (Varta)
const ( // AtomsPerSKA is the number of atoms in one SKA coin. // Uses same precision as VAR for consistency. AtomsPerSKA = 1e8 // MaxSKAAtoms is the maximum number of SKA atoms that can exist. // Set to 10 million SKA total supply per coin type. MaxSKAAtoms = 10e6 * AtomsPerSKA // MaxSKAAmount is the maximum SKA amount as an Amount type. MaxSKAAmount = Amount(MaxSKAAtoms) )
Coin-specific constants for SKA (Skarb)
Variables ¶
var ErrCoinTypeMismatch = errors.New("coin type mismatch")
ErrCoinTypeMismatch is returned when coin types don't match in operations.
var ErrInactiveCoinType = errors.New("inactive coin type")
ErrInactiveCoinType is returned when attempting to use an inactive coin type.
var ErrInvalidCoinType = errors.New("invalid coin type")
ErrInvalidCoinType is returned when an invalid coin type is encountered.
Functions ¶
func ValidateCoinType ¶
ValidateCoinType validates that a coin type value is within valid range.
Types ¶
type ChainParams ¶
type ChainParams interface {
GetSKACoinConfig(CoinType) SKACoinConfig
}
ChainParams interface defines the methods needed from chaincfg.Params for coin type activation checking. This avoids import cycles.
type CoinType ¶
type CoinType uint8
CoinType represents the type of native coin in the Monetarium network. The network supports VAR (Varta) and multiple SKA (Skarb) coin types.
const ( // CoinTypeVAR represents Varta coins - the original mined cryptocurrency // that functions as network shares. VAR holders earn transaction fees // and can purchase PoS tickets. VAR is always active. CoinTypeVAR CoinType = 0 // CoinTypeMax defines the maximum valid coin type value. // SKA coin types range from 1-255 and are activated dynamically. CoinTypeMax CoinType = 255 )
func ParseCoinType ¶
ParseCoinType parses a string representation of a coin type. Only supports parsing "VAR" and "SKA" - specific SKA types use numeric parsing.
func (CoinType) AtomsPerCoin ¶
AtomsPerCoin returns the number of atoms per coin for the given coin type.
func (CoinType) IsActive ¶
func (ct CoinType) IsActive(params ChainParams) bool
IsActive returns true if the coin type is active on the given chain. VAR is always active. SKA coins are active based on chain configuration.
func (CoinType) IsSKA ¶
IsSKA returns true if this is a SKA coin type (1-255). SKA coins are asset-backed tokens that are activated dynamically.
func (CoinType) IsVAR ¶
IsVAR returns true if this is the VAR coin type (0). VAR has special properties: it's mined, used for staking, and always active.
type SKACoinConfig ¶
type SKACoinConfig interface {
IsActive() bool
}
SKACoinConfig represents the configuration for a SKA coin type. This mirrors the structure in chaincfg to avoid import cycles.