Documentation ¶
Index ¶
- Constants
- Variables
- func Confirm(initialPrompt string) bool
- func ConfirmSecureSession(warning string) bool
- func ConfirmWithIAgree(initialPrompt string) bool
- func CreateBlockCountSetter[SettingNameType any](name string, alias string, contractName rocketpool.ContractName, ...) *cli.Command
- func CreateBoolSetter[SettingNameType any](name string, alias string, contractName rocketpool.ContractName, ...) *cli.Command
- func CreateDurationSetter[SettingNameType any](name string, alias string, contractName rocketpool.ContractName, ...) *cli.Command
- func CreateEthSetter[SettingNameType any](name string, alias string, contractName rocketpool.ContractName, ...) *cli.Command
- func CreatePercentSetter[SettingNameType any](name string, alias string, contractName rocketpool.ContractName, ...) *cli.Command
- func CreateRplSetter[SettingNameType any](name string, alias string, contractName rocketpool.ContractName, ...) *cli.Command
- func CreateSetterCategory(name string, formalName string, alias string, contract rocketpool.ContractName) *cli.Command
- func CreateUintSetter[SettingNameType any](name string, alias string, contractName rocketpool.ContractName, ...) *cli.Command
- func CreateUnboundedPercentSetter[SettingNameType any](name string, alias string, contractName rocketpool.ContractName, ...) *cli.Command
- 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 PrettyPrintError(err error)
- func PrintDepositMismatchError(rpNetwork, beaconNetwork uint64, ...)
- func PrintMultiTransactionNonceWarning()
- func PrintNetwork(currentNetwork config.Network, isNew bool) error
- func PrintTransactionBatchHashes(rp *client.Client, hashes []common.Hash)
- func PrintTransactionHash(rp *client.Client, hash common.Hash)
- func PrintTransactionHashNoCancel(rp *client.Client, 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
- type SettingType
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 the 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 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 CreateBlockCountSetter ¶
func CreateBlockCountSetter[SettingNameType any]( name string, alias string, contractName rocketpool.ContractName, settingName SettingNameType, runner func(c *cli.Context, contractName rocketpool.ContractName, settingName SettingNameType, value uint64) error, ) *cli.Command
Creates a command to propose a new setting that takes an integer value (number of blocks)
func CreateBoolSetter ¶
func CreateBoolSetter[SettingNameType any]( name string, alias string, contractName rocketpool.ContractName, settingName SettingNameType, runner func(c *cli.Context, contractName rocketpool.ContractName, settingName SettingNameType, value bool) error, ) *cli.Command
Creates a command to propose a new setting that takes a percentage value
func CreateDurationSetter ¶
func CreateDurationSetter[SettingNameType any]( name string, alias string, contractName rocketpool.ContractName, settingName SettingNameType, runner func(c *cli.Context, contractName rocketpool.ContractName, settingName SettingNameType, value time.Duration) error, ) *cli.Command
Creates a command to propose a new setting that takes a time.Duration value
func CreateEthSetter ¶
func CreateEthSetter[SettingNameType any]( name string, alias string, contractName rocketpool.ContractName, settingName SettingNameType, runner func(c *cli.Context, contractName rocketpool.ContractName, settingName SettingNameType, value *big.Int) error, ) *cli.Command
Creates a command to propose a new setting that takes an ETH value
func CreatePercentSetter ¶
func CreatePercentSetter[SettingNameType any]( name string, alias string, contractName rocketpool.ContractName, settingName SettingNameType, runner func(c *cli.Context, contractName rocketpool.ContractName, settingName SettingNameType, value *big.Int) error, ) *cli.Command
Creates a command to propose a new setting that takes a percentage value
func CreateRplSetter ¶
func CreateRplSetter[SettingNameType any]( name string, alias string, contractName rocketpool.ContractName, settingName SettingNameType, runner func(c *cli.Context, contractName rocketpool.ContractName, settingName SettingNameType, value *big.Int) error, ) *cli.Command
Creates a command to propose a new setting that takes an RPL value
func CreateSetterCategory ¶
func CreateSetterCategory(name string, formalName string, alias string, contract rocketpool.ContractName) *cli.Command
Creates a command that acts as a category container for individual setter subcommands
func CreateUintSetter ¶
func CreateUintSetter[SettingNameType any]( name string, alias string, contractName rocketpool.ContractName, settingName SettingNameType, runner func(c *cli.Context, contractName rocketpool.ContractName, settingName SettingNameType, value uint64) error, ) *cli.Command
Creates a command to propose a new setting that takes an unsigned integer value
func CreateUnboundedPercentSetter ¶
func CreateUnboundedPercentSetter[SettingNameType any]( name string, alias string, contractName rocketpool.ContractName, settingName SettingNameType, runner func(c *cli.Context, contractName rocketpool.ContractName, settingName SettingNameType, value *big.Int) error, ) *cli.Command
Creates a command to propose a new setting that takes a percentage value but can go over 100%
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 PrettyPrintError ¶
func PrettyPrintError(err error)
Prints an error in a prettier format, removing the "stack trace" if it represents a contract revert message
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 Rocket Pool 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 ¶
Print a batch of transaction hashes to the console.
func PrintTransactionHash ¶
Print a TX's details to the console.
func PrintTransactionHashNoCancel ¶
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