utils

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuyCoinCalculateAmounts

func BuyCoinCalculateAmounts(ctx sdk.Context, coinToBuy types.Coin, coinToSell types.Coin, wantsBuy sdk.Int, wantsSell sdk.Int) (amountBuy sdk.Int, amountSell sdk.Int, err *sdkerrors.Error)

Calculate amountToSell and amountToBuy for BuyCoin TX In CLI part amountToSell is maxAmountToSell

func ExistsCoin

func ExistsCoin(cliCtx clientctx.CLIContext, symbol string) (bool, error)

Check if coin exists

func GetAccount

func GetAccount(cliCtx ctx.CLIContext, addr sdk.AccAddress) (exported.Account, error)

Returns account for given address if exists

func GetCoin

func GetCoin(cliCtx clientctx.CLIContext, symbol string) (types.Coin, error)

Return coin instance from State

func SellCoinCalculateAmounts

func SellCoinCalculateAmounts(ctx sdk.Context, coinToBuy types.Coin, coinToSell types.Coin, wantsBuy sdk.Int, wantsSell sdk.Int) (amountBuy sdk.Int, amountSell sdk.Int, err *sdkerrors.Error)

Calculate amountToSell and amountToBuy for SellCoin TX In CLI part amountToBuy is minAmountToBuy

Types

This section is empty.

Jump to

Keyboard shortcuts

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