Documentation ¶
Index ¶
- Constants
- Variables
- func Confirm(initialPrompt string) bool
- func ConfirmSecureSession(warning string) bool
- func ConfirmWithIAgree(initialPrompt string) bool
- func GetDateTimeString(dateTime uint64) string
- func GetDateTimeStringOfTime(dateTime time.Time) string
- func GetMultiselectIndices[DataType any](c *cli.Context, flagName string, options []SelectionOption[DataType], ...) ([]*DataType, error)
- func GetPrettyAddress(address common.Address) string
- func InstantiateFlag[FlagType cli.Flag](prototype FlagType, description string) cli.Flag
- func ParseFloat(c *cli.Context, name string, value string, isFraction bool) (*big.Int, error)
- func PrintDepositMismatchError(rpNetwork, beaconNetwork uint64, ...)
- func PrintMultiTransactionNonceWarning()
- func PrintNetwork(currentNetwork config.Network, isNew bool) error
- func PrintTransactionBatchHashes(hd *client.HyperdriveClient, hashes []common.Hash)
- func PrintTransactionHash(hd *client.HyperdriveClient, hash common.Hash)
- func PrintTransactionHashNoCancel(hd *client.HyperdriveClient, hash common.Hash)
- func Prompt(initialPrompt string, expectedFormat string, incorrectFormatPrompt string) string
- func PromptPassword(initialPrompt string, expectedFormat string, incorrectFormatPrompt string) string
- func Select(initialPrompt string, options []string) (int, string)
- type SelectionOption
Constants ¶
const ( SignTxOnlyFlag string = "sign-tx-only" NoRestartFlag string = "no-restart" MnemonicFlag string = "mnemonic" )
Variables ¶
var ( YesFlag *cli.BoolFlag = &cli.BoolFlag{ Name: "yes", Aliases: []string{"y"}, Usage: "Automatically confirm all interactive questions", } PrintTxDataFlag *cli.BoolFlag = &cli.BoolFlag{ Name: "print-tx-data", Aliases: []string{"pd"}, Usage: "Print the TX data for transactions without signing or submitting them. Useful for masquerade mode or offline wallet operations.", } RawFlag *cli.BoolFlag = &cli.BoolFlag{ Name: "raw", } ComposeFileFlag *cli.StringSliceFlag = &cli.StringSliceFlag{ Name: "compose-file", Aliases: []string{"f"}, Usage: "Supplemental Docker compose files for custom containers to include when performing service commands such as 'start' and 'stop'; this flag may be defined multiple times", } )
Functions ¶
func ConfirmSecureSession ¶
Prompts the user to verify that there is nobody looking over their shoulder before printing sensitive information.
func ConfirmWithIAgree ¶
Prompt for 'I agree' confirmation (used on important questions to avoid a quick 'y' response from the user)
func GetDateTimeString ¶
Convert a Unix datetime to a string, or `---` if it's zero
func GetDateTimeStringOfTime ¶
Convert a Unix datetime to a string, or `---` if it's zero
func GetMultiselectIndices ¶
func GetMultiselectIndices[DataType any](c *cli.Context, flagName string, options []SelectionOption[DataType], prompt string) ([]*DataType, error)
Get the list of elements the user wants to use for a multi-select operation
func GetPrettyAddress ¶
Gets the hex string of an address, or "none" if it was the 0x0 address
func InstantiateFlag ¶
func InstantiateFlag[FlagType cli.Flag](prototype FlagType, description string) cli.Flag
func ParseFloat ¶
Parses a string representing either a floating point value or a raw wei amount into a *big.Int
func PrintDepositMismatchError ¶
func PrintDepositMismatchError(rpNetwork, beaconNetwork uint64, rpDepositAddress, beaconDepositAddress common.Address)
Prints an error message when the Beacon client is not using the deposit contract address that Hyperdrive expects
func PrintMultiTransactionNonceWarning ¶
func PrintMultiTransactionNonceWarning()
Print a warning to the console if the user set a custom nonce, but this operation involves multiple transactions
func PrintNetwork ¶
Prints what network you're currently on
func PrintTransactionBatchHashes ¶
func PrintTransactionBatchHashes(hd *client.HyperdriveClient, hashes []common.Hash)
Print a batch of transaction hashes to the console.
func PrintTransactionHash ¶
func PrintTransactionHash(hd *client.HyperdriveClient, hash common.Hash)
Print a TX's details to the console.
func PrintTransactionHashNoCancel ¶
func PrintTransactionHashNoCancel(hd *client.HyperdriveClient, hash common.Hash)
Print a TX's details to the console, but inform the user NOT to cancel it.
Types ¶
type SelectionOption ¶
type SelectionOption[DataType any] struct { // The underlying element this option represents Element *DataType // The human-readable ID of the option, used for non-interactive selection ID string // The text to display for this option when listing the available options Display string }
An option that can be selected from a list of choices in the CLI