Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExchangeRate ¶
type ExchangeRate struct { FromDenom string `json:"fromDenom"` ToDenom string `json:"toDenom"` Rate types.Dec `json:"rate"` // FromDenom = ToDenom * Rate }
ExchangeRate - struct to hold exchange rate
func NewExchangeRate ¶
func NewExchangeRate( from string, to string, rate types.Dec, ) ExchangeRate
NewExchangeRate - new ExchangeRate
func (ExchangeRate) Convert ¶
func (e ExchangeRate) Convert(sellingCoin types.Coin) (buyingCoin types.Coin)
Convert - convert from one coin to another using this exchange rate
func (ExchangeRate) Obtain ¶
func (e ExchangeRate) Obtain(buyingCoin types.Coin) (sellingCoin types.Coin)
func (ExchangeRate) String ¶ added in v0.2.2
func (e ExchangeRate) String() string
func (ExchangeRate) UpdateRate ¶
func (e ExchangeRate) UpdateRate(newRate types.Dec) ExchangeRate
UpdateRate - update rate of this exchange rate
type Reserve ¶
type Reserve struct {
Address sdk.AccAddress
}
func GetAllReserve ¶
func GetAllReserve() []Reserve
---------------------------------------------------------------
func NewReserve ¶
func NewReserve(addr sdk.AccAddress) Reserve
Click to show internal directories.
Click to hide internal directories.