currency

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2018 License: ISC Imports: 8 Imported by: 0

Documentation

Overview

types and functions for converting currencies to/from enumeration values

Index

Constants

View Source
const (
	Nothing  Currency = iota // this must be the first value
	Bitcoin  Currency = iota
	Litecoin Currency = iota

	First Currency = Nothing + 1
	Last  Currency = maximumValue - 1
	Count int      = int(Last) // count of currencies
)

possible currency values

Variables

This section is empty.

Functions

func UnpackMap added in v0.7.0

func UnpackMap(buffer []byte, testnet bool) (Map, Set, error)

unpack and validate a currency address mapping

Types

type Currency

type Currency uint64

currency enumeration

func FromUint64

func FromUint64(n uint64) (Currency, error)

convert a number to a currency

func (Currency) GetFee added in v0.3.5

func (currency Currency) GetFee() (uint64, error)

convert a string to a currency

func (Currency) GoString

func (currency Currency) GoString() string

convert abot enum value and symbol, for debugging

func (Currency) Index added in v0.5.0

func (currency Currency) Index() int

convert a valid currency to a zero based array index

func (Currency) IsValid added in v0.5.0

func (currency Currency) IsValid() bool

valid currency if in range of First to Last None is not considered as valid

func (Currency) MarshalText

func (currency Currency) MarshalText() ([]byte, error)

convert a currency into JSON

func (*Currency) Scan

func (currency *Currency) Scan(state fmt.ScanState, verb rune) error

convert a currency string

func (Currency) String

func (currency Currency) String() string

convert a currency to its string symbol

func (Currency)