money

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 3 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// CurrencyMyst is the myst token currency representation
	CurrencyMyst = Currency("MYST")

	// CurrencyMystt is the test myst token currency representation
	CurrencyMystt = Currency("MYSTT")
)

Variables

View Source
var MystSize = big.NewInt(1_000_000_000_000_000_000)

MystSize represents a size of the Myst token.

Functions

This section is empty.

Types

type Currency

type Currency string

Currency represents a supported currency

func (Currency) String

func (c Currency) String() string

type Money

type Money struct {
	Amount   *big.Int `json:"amount,omitempty"`
	Currency Currency `json:"currency,omitempty"`
}

Money holds the currency type and amount

func New

func New(amount *big.Int, currency ...Currency) Money

New returns a new instance of Money. Expected `amount` value for 1 myst is equal to 1_000_000_000_000_000_000. It also allows for an optional currency value to be passed, if one is not passed, default config value is used.

func (Money) String

func (value Money) String() string

String converts Money struct into a string which is represented by a float64 with 6 number precision.

Jump to

Keyboard shortcuts

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