client

package
v0.0.0-...-135ce28 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateTxOptions

type CreateTxOptions struct {
	Msgs []msg.Msg
	Memo string

	// Optional parameters
	AccountNumber uint64
	Sequence      uint64
	GasLimit      uint64
	FeeAmount     msg.Coins

	SignMode      tx.SignMode
	FeeGranter    msg.AccAddress
	TimeoutHeight uint64
}

CreateTxOptions tx creation options

type EstimateFeeResWrapper

type EstimateFeeResWrapper struct {
	Height msg.Int                  `json:"height"`
	Result feeutils.EstimateFeeResp `json:"result"`
}

EstimateFeeResWrapper - wrapper for estimate fee query

type LCDClient

type LCDClient struct {
	URL           string
	ChainID       string
	GasPrice      msg.DecCoin
	GasAdjustment msg.Dec

	PrivKey        key.PrivKey
	EncodingConfig terraappparams.EncodingConfig
	// contains filtered or unexported fields
}

LCDClient outer interface for building & signing & broadcasting tx

func NewLCDClient

func NewLCDClient(URL, chainID string, gasPrice msg.DecCoin, gasAdjustment msg.Dec, tmKey key.PrivKey, httpTimeout time.Duration) *LCDClient

NewLCDClient create new LCDClient

func (LCDClient) Broadcast

func (lcd LCDClient) Broadcast(ctx context.Context, txbuilder *tx.Builder) (*sdk.TxResponse, error)

Broadcast - no-lint

func (LCDClient) ComputeTax

func (lcd LCDClient) ComputeTax(ctx context.Context, txbuilder tx.Builder) (*customauthtx.ComputeTaxResponse, error)

ComputeTax compute tax

func (*LCDClient) CreateAndSignTx

func (lcd *LCDClient) CreateAndSignTx(ctx context.Context, options CreateTxOptions) (*tx.Builder, error)

CreateAndSignTx build and sign tx

func (LCDClient) EstimateFee

func (lcd LCDClient) EstimateFee(ctx context.Context, options CreateTxOptions) (res *feeutils.EstimateFeeResp, err error)

EstimateFee simulates gas and fee for a transaction

func (LCDClient) LoadAccount

func (lcd LCDClient) LoadAccount(ctx context.Context, address msg.AccAddress) (res authtypes.AccountI, err error)

LoadAccount simulates gas and fee for a transaction

func (LCDClient) Simulate

func (lcd LCDClient) Simulate(ctx context.Context, txbuilder tx.Builder, options CreateTxOptions) (*sdktx.SimulateResponse, error)

Simulate tx and get response

type QueryAccountRes

type QueryAccountRes struct {
	Account QueryAccountResData `json:"account"`
}

QueryAccountRes response

type QueryAccountResData

type QueryAccountResData struct {
	Address       msg.AccAddress `json:"address"`
	AccountNumber msg.Int        `json:"account_number"`
	Sequence      msg.Int        `json:"sequence"`
}

QueryAccountResData response

Jump to

Keyboard shortcuts

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