wallet

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Wallet

type Wallet interface {
	// The wallet configuration
	WalletConfig() *v1.WalletConfig

	// Creates a new account
	CreateAccount(name string, addrPrefix string, networkName string) error

	// Gets an account by name
	GetAccount(name string) (account.WalletAccount, error)

	// Gets Primary account
	PrimaryAccount() (account.WalletAccount, error)

	// Gets all accounts
	ListAccounts() ([]account.WalletAccount, error)

	// Signs a transaction for Cosmos compatible blockchains
	SignTx(memo string, msgs ...sdk.Msg) ([]byte, error)
}

`Wallet` is an interface that has a method `WalletConfig` that returns a `*v1.WalletConfig` and a method `CreateAccount` that takes a `string`, a `string`, and a `string` and returns an `error`. @property WalletConfig - This is the configuration of the wallet. @property {error} CreateAccount - Creates a new account @property GetAccount - Returns the account with the given name. @property PrimaryAccount - The primary account is the account that is used to sign transactions. @property ListAccounts - Returns a list of all accounts in the wallet

func NewWallet

func NewWallet() (Wallet, error)

`NewWallet` creates a new wallet with a default root account

func NewWalletFromConfig

func NewWalletFromConfig(walletConf *v1.WalletConfig) (Wallet, error)

`NewWalletFromConfig` takes a `WalletConfig` and returns a `Wallet` and an error

Directories

Path Synopsis
internal
fs

Jump to

Keyboard shortcuts

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