client

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagUseLedger      = "ledger"
	FlagUseTss         = "tss"
	FlagChainID        = "chain-id"
	FlagNode           = "node"
	FlagHeight         = "height"
	FlagTrustNode      = "trust-node"
	FlagFrom           = "from"
	FlagName           = "name"
	FlagAccountNumber  = "account-number"
	FlagSequence       = "sequence"
	FlagMemo           = "memo"
	FlagSource         = "source"
	FlagAsync          = "async"
	FlagJson           = "json"
	FlagPrintResponse  = "print-response"
	FlagDryRun         = "dry-run"
	FlagDry            = "dry"
	FlagOffline        = "offline"
	FlagGenerateOnly   = "generate-only"
	FlagIndentResponse = "indent"
)

nolint

View Source
const MinPassLength = 8

MinPassLength is the minimum acceptable password length

Variables

View Source
var (
	LineBreak = &cobra.Command{Run: func(*cobra.Command, []string) {}}
)

LineBreak can be included in a command list to provide a blank line to help with readability

Functions

func BufferStdin

func BufferStdin() *bufio.Reader

BufferStdin is used to allow reading prompts for stdin multiple times, when we read from non-tty

func ConfigCmd

func ConfigCmd() *cobra.Command

ConfigCmd returns a CLI command to interactively create a Gaia CLI config file.

func GetCheckPassword

func GetCheckPassword(prompt, prompt2 string, buf *bufio.Reader) (string, error)

GetCheckPassword will prompt for a password twice to verify they match (for creating a new password). It enforces the password length. Only parses password once if input is piped in.

func GetCommands

func GetCommands(cmds ...*cobra.Command) []*cobra.Command

GetCommands adds common flags to query commands

func GetConfirmation

func GetConfirmation(prompt string, buf *bufio.Reader) (bool, error)

GetConfirmation will request user give the confirmation from stdin. "y", "Y", "yes", "YES", and "Yes" all count as confirmations. If the input is not recognized, it will ask again.

func GetKeyBase

func GetKeyBase(db dbm.DB) keys.Keybase

GetKeyBase initializes a keybase based on the given db. The KeyBase manages all activity requiring access to a key.

func GetPassword

func GetPassword(prompt string, buf *bufio.Reader) (pass string, err error)

GetPassword will prompt for a password one-time (to sign a tx) It enforces the password length

func GetSeed

func GetSeed(prompt string, buf *bufio.Reader) (string, error)

GetSeed will request a seed phrase from stdin and trims off leading/trailing spaces

func GetString

func GetString(prompt string, buf *bufio.Reader) (string, error)

GetString simply returns the trimmed string output of a given reader.

func MockKeyBase

func MockKeyBase() keys.Keybase

MockKeyBase generates an in-memory keybase that will be discarded useful for --dry-run to generate a seed phrase without storing the key

func PostCommands

func PostCommands(cmds ...*cobra.Command) []*cobra.Command

PostCommands adds common flags for commands to post tx

func PrintPrefixed

func PrintPrefixed(msg string)

PrintPrefixed prints a string with > prefixed for use in prompts.

Types

This section is empty.

Directories

Path Synopsis
lcd

Jump to

Keyboard shortcuts

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