Documentation ¶
Index ¶
- Constants
- Variables
- func CheckIfAddressReady(hd *client.HyperdriveClient) (wallet.WalletStatus, bool, error)
- func CheckIfWalletReady(hd *client.HyperdriveClient) (wallet.WalletStatus, bool, error)
- func ClearTerminal() error
- 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 []utils.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)
- func ValidateArgCount(c *cli.Context, expectedCount int)
- func ValidateTokenType(name, value string) (string, error)
Constants ¶
const ( 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{"pt"}, Usage: "Print any TX data for transactions without signing or submitting them. Useful for masquerade mode or offline wallet operations.", } SignTxOnlyFlag *cli.BoolFlag = &cli.BoolFlag{ Name: "sign-tx-only", Aliases: []string{"st"}, Usage: "Sign any TXs and print the results, but don't submit it to the network. Useful if you want to save a TX for later or bundle it up with a service like Flashbots.", } 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 CheckIfAddressReady ¶ added in v1.0.0
func CheckIfAddressReady(hd *client.HyperdriveClient) (wallet.WalletStatus, bool, error)
Verifies the daemon has a node address ready and loaded (allows for masquerade mode support).
func CheckIfWalletReady ¶ added in v1.0.0
func CheckIfWalletReady(hd *client.HyperdriveClient) (wallet.WalletStatus, bool, error)
Verifies the daemon has a node wallet ready and loaded.
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 []utils.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.
func PromptPassword ¶
func PromptPassword(initialPrompt string, expectedFormat string, incorrectFormatPrompt string) string
Prompt for password input
func ValidateArgCount ¶ added in v1.0.0
func ValidateArgCount(c *cli.Context, expectedCount int)
Validate command argument count - only used by the CLI TODO: refactor CLI arg validation and move it out of shared
func ValidateTokenType ¶ added in v1.0.0
Validate a token type
Types ¶
This section is empty.