utils

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeFees

func ComputeFees(
	cliCtx context.CLIContext,
	req ComputeReqParams) (fees sdk.Coins, gas uint64, err error)

ComputeFees returns fee amount with given transfer, gas, gas prices, and fees amount.

func ComputeFeesWithStdTx

func ComputeFeesWithStdTx(
	cliCtx context.CLIContext,
	tx auth.StdTx,
	gasAdjustment float64,
	gasPrices sdk.DecCoins) (fees sdk.Coins, gas uint64, err error)

ComputeFeesWithStdTx returns fee amount with given stdTx.

func ParseFloat64

func ParseFloat64(s string, defaultIfEmpty float64) (n float64, err error)

ParseFloat64 parses string to float64

Types

type ComputeReqParams

type ComputeReqParams struct {
	Memo          string
	ChainID       string
	AccountNumber uint64
	Sequence      uint64
	GasPrices     sdk.DecCoins
	Gas           string
	GasAdjustment string

	Msgs []sdk.Msg
}

ComputeReqParams no-lint

type EstimateFeeReq

type EstimateFeeReq struct {
	Tx            auth.StdTx   `json:"tx"`
	GasAdjustment string       `json:"gas_adjustment"`
	GasPrices     sdk.DecCoins `json:"gas_prices"`
}

EstimateFeeReq defines a tx encoding request.

type EstimateFeeResp

type EstimateFeeResp struct {
	Fees sdk.Coins `json:"fees"`
	Gas  uint64    `json:"gas"`
}

EstimateFeeResp defines a tx encoding response.

func (EstimateFeeResp) String

func (r EstimateFeeResp) String() string

String implements fmt.Stringer interface

Jump to

Keyboard shortcuts

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