assets

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Id       int
	Name     string
	UnitName string
	Decimals int
}

func NewAsset

func NewAsset(id int, name string, unitName string, decimals int) *Asset

func (*Asset) Call

func (s *Asset) Call(amount string) (assetAmount *AssetAmount)

func (*Asset) Fetch

func (s *Asset) Fetch(indexer *indexer.Client) (err error)

not compatible with go-mobile

func (*Asset) Hash

func (s *Asset) Hash() int

func (*Asset) String

func (s *Asset) String() string

type AssetAmount

type AssetAmount struct {
	Asset  *Asset
	Amount string
}

func NewAssetAmount

func NewAssetAmount(asset *Asset, amount string) *AssetAmount

func (*AssetAmount) Add

func (s *AssetAmount) Add(other *AssetAmount) (assetAmount *AssetAmount, err error)

func (*AssetAmount) Eq

func (s *AssetAmount) Eq(other *AssetAmount) (bool, error)

func (*AssetAmount) Gt

func (s *AssetAmount) Gt(other *AssetAmount) (bool, error)

func (*AssetAmount) Lt

func (s *AssetAmount) Lt(other *AssetAmount) (bool, error)

func (*AssetAmount) Mul

func (s *AssetAmount) Mul(other float64) (assetAmount *AssetAmount)

func (*AssetAmount) String

func (s *AssetAmount) String() string

func (*AssetAmount) Sub

func (s *AssetAmount) Sub(other *AssetAmount) (assetAmount *AssetAmount, err error)

Jump to

Keyboard shortcuts

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