Documentation ¶
Index ¶
Constants ¶
const ColorLength = 32
ColorLength represents the length of a Color (amount of bytes).
const Length = 8 + ColorLength
Length encodes the length of a marshaled Balance (the length of the color + 8 bytes for the balance).
Variables ¶
var ColorNew = [32]byte{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}
ColorNew represents a placeholder Color that will be replaced with the transaction ID that created the funds. It is used to indicate that tokens should be "colored" in their Output (minting new colored coins).
Functions ¶
This section is empty.
Types ¶
type Balance ¶
type Balance struct { // The numeric value of the balance. Value int64 `json:"value"` // The color of the balance. Color Color `json:"color"` }
Balance represents a balance in the IOTA ledger. It consists out of a numeric value and a color.
func Parse ¶
func Parse(marshalUtil *marshalutil.MarshalUtil) (*Balance, error)
Parse is a wrapper for simplified unmarshaling in a byte stream using the marshalUtil package.
type Color ¶
type Color [ColorLength]byte
Color represents a marker that is associated to a token balance and that gives it a certain "meaning". The zero value represents "vanilla" IOTA tokens but it is also possible to define tokens that represent i.e. real world assets.
ColorIOTA is the zero value of the Color and represents vanilla IOTA tokens.
func ColorFromBytes ¶
ColorFromBytes unmarshals a Color from a sequence of bytes.