client

package
v0.0.0-...-0cc983d Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: Apache-2.0 Imports: 19 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 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) CreateAndSignTx

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

CreateAndSignTx build and sign tx

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

Jump to

Keyboard shortcuts

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