tx

package
v0.2.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BroadcastTx

func BroadcastTx(clientCtx client.Context, txf tx.Factory, msgs ...sdk.Msg) (*sdk.TxResponse, error)

BroadcastTx attempts to generate, sign and broadcast a transaction with the given set of messages. It will also simulate gas requirements if necessary. It will return an error upon failure.

Note, BroadcastTx is copied from the SDK except it removes a few unnecessary things like prompting for confirmation and printing the response. Instead, we return the TxResponse.

func CreateAccountFromMnemonic

func CreateAccountFromMnemonic(name, mnemonic string) (*keyring.Record, keyring.Keyring, error)

CreateAccountFromMnemonic creates a new account from a mnemonic

func CreateMnemonic added in v0.1.4

func CreateMnemonic() (string, error)

Types

type Client

type Client struct {
	ChainID       string
	TMRPCEndpoint string

	ClientContext *client.Context
	// contains filtered or unexported fields
}

TxClient is a wrapper around the cosmos sdk client context and transaction factory for signing and broadcasting transactions

func NewClient

func NewClient(
	chainID string,
	tmrpcEndpoint string,
	accountName string,
	accountMnemonic string,
) (c *Client, err error)

Initializes a cosmos sdk client context and transaction factory for signing and broadcasting transactions

func (*Client) Address added in v0.2.0

func (c *Client) Address() (sdk.AccAddress, error)

func (*Client) BroadcastTx

func (c *Client) BroadcastTx(msgs ...sdk.Msg) (*sdk.TxResponse, error)

func (*Client) TxClaimAirdrop added in v0.2.0

func (c *Client) TxClaimAirdrop(
	fromAddress string,
	toAddress string,
) (*sdk.TxResponse, error)

func (*Client) TxDelegate added in v0.2.0

func (c *Client) TxDelegate(
	fromAddress sdk.AccAddress,
	validatorAddress sdk.ValAddress,
	amount sdk.Coin,
) (*sdk.TxResponse, error)

func (*Client) TxDelegateFeedConsent

func (c *Client) TxDelegateFeedConsent(
	feeder sdk.AccAddress,
) (*sdk.TxResponse, error)

TxDelegateFeedConsent delegates the feed consent to the given feeder from the OjoClient's validator

func (*Client) TxSubmitLegacyProposal

func (c *Client) TxSubmitLegacyProposal(
	changes []proposal.ParamChange,
) (*sdk.TxResponse, error)

TxSubmitProposal sends a gov/v1beta1 transaction to submit a proposal

func (*Client) TxSubmitProposal

func (c *Client) TxSubmitProposal(
	msgs []sdk.Msg,
	deposit sdk.Coins,
	title string,
	summary string,
) (*sdk.TxResponse, error)

TxSubmitProposal sends a gov/v1 transaction to submit a proposal

func (*Client) TxVoteYes

func (c *Client) TxVoteYes(proposalID uint64) (*sdk.TxResponse, error)

TxVoteYes sends a transaction to vote yes on a proposal

type OjoAccount added in v0.2.0

type OjoAccount struct {
	Moniker    string
	Mnemonic   string
	KeyInfo    *keyring.Record
	PrivateKey keyring.Keyring
}

func NewOjoAccount added in v0.2.0

func NewOjoAccount(moniker string) (*OjoAccount, error)

Jump to

Keyboard shortcuts

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