types

package
v0.0.0-...-535af14 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HTTPProtocols = regexp.MustCompile("https?://")
)

Functions

func CreateGrpcConnection

func CreateGrpcConnection(config *ChainConfig, codec codec.Codec) (grpc.ClientConnInterface, error)

CreateGrpcConnection creates a new gRPC client connection from the given configuration

Types

type AccountConfig

type AccountConfig struct {
	Mnemonic string `toml:"mnemonic" yaml:"mnemonic"`
	HDPath   string `toml:"hd_path" yaml:"hd_path"`
}

type ChainConfig

type ChainConfig struct {
	Bech32Prefix  string  `toml:"bech32_prefix" yaml:"bech32_prefix"`
	RPCAddr       string  `toml:"rpc_addr" yaml:"rpc_addr"`
	GRPCAddr      string  `toml:"grpc_addr" yaml:"grpc_addr"`
	GasPrice      string  `toml:"gas_price" yaml:"gas_price"`
	GasAdjustment float64 `toml:"gas_adjustment" yaml:"gas_adjustment"`
}

type TransactionData

type TransactionData struct {
	Messages   []sdk.Msg
	Memo       string
	GasLimit   uint64
	GasAuto    bool
	FeeAmount  sdk.Coins
	FeeAuto    bool
	FeeGranter sdk.AccAddress
	Sequence   *uint64
}

TransactionData contains all the data about a transaction

func NewTransactionData

func NewTransactionData(msgs ...sdk.Msg) *TransactionData

NewTransactionData builds a new TransactionData instance

func (*TransactionData) WithFeeAmount

func (t *TransactionData) WithFeeAmount(amount sdk.Coins) *TransactionData

WithFeeAmount allows to set the given fee amount

func (*TransactionData) WithFeeAuto

func (t *TransactionData) WithFeeAuto() *TransactionData

WithFeeAuto allows to automatically compute the fee amount to be used when broadcasting the transaction

func (*TransactionData) WithFeeGranter

func (t *TransactionData) WithFeeGranter(granter sdk.AccAddress) *TransactionData

WithFeeGranter allows to set the given fee granter that will pay for fees. To work properly, a fee grant must exist from the granter towards the transaction signer.

func (*TransactionData) WithGasAuto

func (t *TransactionData) WithGasAuto() *TransactionData

WithGasAuto allows to automatically compute the amount of gas to be used when broadcasting the transaction

func (*TransactionData) WithGasLimit

func (t *TransactionData) WithGasLimit(limit uint64) *TransactionData

WithGasLimit allows to set the given gas limit

func (*TransactionData) WithMemo

func (t *TransactionData) WithMemo(memo string) *TransactionData

WithMemo allows to set the given memo

func (*TransactionData) WithSequence

func (t *TransactionData) WithSequence(sequence uint64) *TransactionData

WithSequence allows to set the given sequence

type TransactionResponse

type TransactionResponse struct {
	// Response is the response of the transaction broadcast
	// It can be null if there was some error while broadcasting the transaction
	*sdk.TxResponse

	// Account is the account that signed the transaction
	// It can be null if there was some error while building the transaction
	Account sdk.AccountI

	// Tx is the transaction that was broadcasted
	// It can be null if there was some error while building the transaction
	Tx signing.Tx
}

TransactionResponse contains all the data about a transaction response

func NewTransactionResponse

func NewTransactionResponse() TransactionResponse

func (TransactionResponse) WithAccount

func (r TransactionResponse) WithAccount(account sdk.AccountI) TransactionResponse

func (TransactionResponse) WithResponse

func (r TransactionResponse) WithResponse(response *sdk.TxResponse) TransactionResponse

func (TransactionResponse) WithTx

type TxBroadcastMethod

type TxBroadcastMethod func(tx signing.Tx) (*sdk.TxResponse, error)

TxBroadcastMethod represents a function that allows to broadcast a transaction

Jump to

Keyboard shortcuts

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