wallet

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetTxConfig() sdkclient.TxConfig

	GetAccountPrefix() string
	GetChainID() (string, error)
	GetAccount(address string) (sdk.AccountI, error)
	GetFees(gas int64) sdk.Coins

	SimulateTx(tx signing.Tx) (uint64, error)
	BroadcastTxAsync(tx signing.Tx) (*sdk.TxResponse, error)
	BroadcastTxSync(tx signing.Tx) (*sdk.TxResponse, error)
	BroadcastTxCommit(tx signing.Tx) (*sdk.TxResponse, error)
}

type Wallet

type Wallet struct {
	// contains filtered or unexported fields
}

Wallet represents a Cosmos wallet that should be used to create and send transactions to the chain

func NewWallet

func NewWallet(accountCfg *types.AccountConfig, client Client) (*Wallet, error)

NewWallet allows to build a new Wallet instance

func (*Wallet) AccAddress

func (w *Wallet) AccAddress() string

AccAddress returns the address of the account that is going to be used to sign the transactions

func (*Wallet) BroadcastTxAsync

func (w *Wallet) BroadcastTxAsync(data *types.TransactionData) (types.TransactionResponse, error)

BroadcastTxAsync creates and signs a transaction with the provided messages and fees, then broadcasts it using the async method

func (*Wallet) BroadcastTxCommit

func (w *Wallet) BroadcastTxCommit(data *types.TransactionData) (types.TransactionResponse, error)

BroadcastTxCommit creates and signs a transaction with the provided messages and fees, then broadcasts it using the commit method

func (*Wallet) BroadcastTxSync

func (w *Wallet) BroadcastTxSync(data *types.TransactionData) (types.TransactionResponse, error)

BroadcastTxSync creates and signs a transaction with the provided messages and fees, then broadcasts it using the sync method

func (*Wallet) BuildTx

BuildTx creates a transaction with the provided data

Jump to

Keyboard shortcuts

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