coin

package
v0.4.1-rc4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DecBld

type DecBld struct {
	D sdk.DecCoin
}

TODO: add unit tests for `util/coin/math.go` DecBld is a Builder pattern for dec coin

func NewDecBld

func NewDecBld(d sdk.DecCoin) *DecBld

NewDecBld is a constructor for DecBld type

func (*DecBld) Scale

func (d *DecBld) Scale(f int64) *DecBld

Scale scales dec coin by given factor

func (*DecBld) ScaleStr

func (d *DecBld) ScaleStr(f string) *DecBld

Scale scales dec coin by given factor provided as string. Panics if f is not a correct decimal number.

func (*DecBld) ToCoin

func (d *DecBld) ToCoin() sdk.Coin

ToCoin converts DecCoin to sdk.Coin rounding up

func (*DecBld) ToCoins

func (d *DecBld) ToCoins() sdk.Coins

ToCoins converts DecCoin to sdk.Coins rounding up

func (*DecBld) ToDecCoins

func (d *DecBld) ToDecCoins() sdk.DecCoins

ToCoin converts DecCoin to sdk.DecCoins

Jump to

Keyboard shortcuts

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