Back to

Package utils

Latest Go to latest
Published: Jun 11, 2020 | License: Apache-2.0 | Module:


Package Files

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

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

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier