cli

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

This work is licensed and released under GNU GPL v3 or any other later versions. The full text of the license is below/ found at <http://www.gnu.org/licenses/>

(c) 2023 Rocket Pool Pty Ltd. Modified under GNU GPL v3. [1.5.0]

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This work is licensed and released under GNU GPL v3 or any other later versions. The full text of the license is below/ found at <http://www.gnu.org/licenses/>

(c) 2023 Rocket Pool Pty Ltd. Modified under GNU GPL v3. [1.5.0]

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This work is licensed and released under GNU GPL v3 or any other later versions. The full text of the license is below/ found at <http://www.gnu.org/licenses/>

(c) 2023 Rocket Pool Pty Ltd. Modified under GNU GPL v3. [1.5.0]

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This work is licensed and released under GNU GPL v3 or any other later versions. The full text of the license is below/ found at <http://www.gnu.org/licenses/>

(c) 2023 Rocket Pool Pty Ltd. Modified under GNU GPL v3. [1.5.0]

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckClientStatus

func CheckClientStatus(staderClient *stader.Client) error

Check the status of the Execution and Consensus client(s) and provision the API with them

func Confirm

func Confirm(initialPrompt string) bool

Prompt for confirmation

func ConfirmSecureSession

func ConfirmSecureSession(warning string) bool

Prompts the user to verify that there is nobody looking over their shoulder before printing sensitive information.

func GetDateTimeString

func GetDateTimeString(dateTime uint64) string

Convert a Unix datetime to a string, or `---` if it's zero

func GetPrettyAddress

func GetPrettyAddress(address common.Address) string

Gets the hex string of an address, or "none" if it was the 0x0 address

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 PrintError added in v1.5.0

func PrintError(msg string)

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

func PrintNetwork(staderClient *stader.Client) error

Prints what network you're currently on

func PrintTransactionHash

func PrintTransactionHash(staderClient *stader.Client, hash common.Hash)

Print a TX's details to the console.

func PrintTransactionHashNoCancel

func PrintTransactionHashNoCancel(staderClient *stader.Client, hash common.Hash)

Print a TX's details to the console, but inform the user NOT to cancel it.

func PrintWarning added in v1.5.0

func PrintWarning(msg string)

func Prompt

func Prompt(initialPrompt string, expectedFormat string, incorrectFormatPrompt string) string

Prompt for user input

func PromptPassword

func PromptPassword(initialPrompt string, expectedFormat string, incorrectFormatPrompt string) string

Prompt for password input

func Select

func Select(initialPrompt string, options []string) (int, string)

Prompt for user selection

func ValidateAddress

func ValidateAddress(name, value string) (common.Address, error)

Validate an address

func ValidateArgCount

func ValidateArgCount(c *cli.Context, count int) error

Validate command argument count

func ValidateBigInt

func ValidateBigInt(name, value string) (*big.Int, error)

Validate a big int

func ValidateBool

func ValidateBool(name, value string) (bool, error)

Validate a boolean value

func ValidateDepositEthAmount

func ValidateDepositEthAmount(name, value string) (float64, error)

Validate a deposit amount in ether

func ValidateDepositWeiAmount

func ValidateDepositWeiAmount(name, value string) (*big.Int, error)

Validate a deposit amount in wei

func ValidateEthAmount

func ValidateEthAmount(name, value string) (float64, error)

Validate an ether amount

func ValidateFraction

func ValidateFraction(name, value string) (float64, error)

Validate a fraction

func ValidateNodePassword

func ValidateNodePassword(name, value string) (string, error)

Validate a node password

func ValidatePercentage

func ValidatePercentage(name, value string) (float64, error)

Validate a percentage

func ValidatePositiveEthAmount

func ValidatePositiveEthAmount(name, value string) (float64, error)

Validate a positive ether amount

func ValidatePositiveOrZeroWeiAmount

func ValidatePositiveOrZeroWeiAmount(name, value string) (*big.Int, error)

Validate a positive or zero wei amount

func ValidatePositiveUint

func ValidatePositiveUint(name, value string) (uint64, error)

Validate a positive unsigned integer value

func ValidatePositiveWeiAmount

func ValidatePositiveWeiAmount(name, value string) (*big.Int, error)

Validate a positive wei amount

func ValidatePubkey

func ValidatePubkey(name, value string) (types.ValidatorPubkey, error)

Validate a validator pubkey

func ValidateTimezoneLocation

func ValidateTimezoneLocation(name, value string) (string, error)

Validate a timezone location

func ValidateTokenType

func ValidateTokenType(name, value string) (string, error)

Validate a token type

func ValidateTxHash

func ValidateTxHash(name, value string) (common.Hash, error)

Validate a transaction hash

func ValidateUint

func ValidateUint(name, value string) (uint64, error)

Validate an unsigned integer value

func ValidateWalletMnemonic

func ValidateWalletMnemonic(name, value string) (string, error)

Validate a wallet mnemonic phrase

func ValidateWeiAmount

func ValidateWeiAmount(name, value string) (*big.Int, error)

Validate a wei amount

Types

This section is empty.

Jump to

Keyboard shortcuts

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