xlm

package
v0.1.0-alpha.0...-0b1224c Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Stroop     Amount = 1
	Microlumen        = 10 * Stroop
	Millilumen        = 1000 * Microlumen
	Lumen             = 1000 * Millilumen
)

Common amounts.

To count the number of units in an Amount, divide:

lumen := xlm.Lumen
fmt.Print(int64(lumen/xlm.Stroop)) // prints 10000000

To convert an integer number of units to an Amount, multiply:

lumens := 10
fmt.Print(xlm.Amount(lumens)*xlm.Lumen) // prints 10XLM

Variables

This section is empty.

Functions

This section is empty.

Types

type Amount

type Amount int64

Amount represents a quantity of XLM as an int64 count of stroops.

func Parse

func Parse(horizonString string) (Amount, error)

Parse converts a Horizon balance string to an Amount.

func (Amount) HorizonString

func (n Amount) HorizonString() string

HorizonString returns the Amount in decimal form in terms of Lumens, required for building transactions to be submitted to Horizon.

func (Amount) String

func (n Amount) String() string

Jump to

Keyboard shortcuts

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