util

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const AlreadyInstalled = 2
View Source
const CancelInstall = 1
View Source
const EnvPrefix = "FLOW"

Variables

View Source
var TestID = flow.HexToID("24993fc99f81641c45c0afa307e683b4f08d407d90041aa9439f487acb33d633")

Functions

func AccountNamePrompt

func AccountNamePrompt(accountNames []string) string

func AddToGitIgnore

func AddToGitIgnore(filename string, loader flowkit.ReaderWriter) error

AddToGitIgnore adds a new line to the .gitignore if one doesn't exist it creates it.

func AddressPromptOrEmpty added in v1.17.0

func AddressPromptOrEmpty(label, errorMessage string) string

func ApproveTransactionForBuildingPrompt

func ApproveTransactionForBuildingPrompt(transaction *flow.Transaction) bool

func ApproveTransactionForSendingPrompt

func ApproveTransactionForSendingPrompt(transaction *flow.Transaction) bool

func ApproveTransactionForSigningPrompt

func ApproveTransactionForSigningPrompt(transaction *flow.Transaction) bool

func ApproveTransactionPrompt

func ApproveTransactionPrompt(tx *flow.Transaction, promptMsg string) bool

func AutocompletionPrompt

func AutocompletionPrompt() (string, string)

func CreateAccountNetworkPrompt

func CreateAccountNetworkPrompt() (string, config.Network)

func CreateTabWriter

func CreateTabWriter(b *bytes.Buffer) *tabwriter.Writer

func Exit

func Exit(code int, msg string)

func GenericBoolPrompt added in v1.12.0

func GenericBoolPrompt(msg string) bool

func GetAddressNetwork

func GetAddressNetwork(address flowsdk.Address) (flowsdk.ChainID, error)

GetAddressNetwork returns the chain ID for an address.

func InstallPathPrompt

func InstallPathPrompt(defaultPath string) string

func InstallPrompt

func InstallPrompt() int

func MessageWithEmojiPrefix added in v1.18.0

func MessageWithEmojiPrefix(emoji string, message string) string

func NamePrompt

func NamePrompt() string

func NewNetworkPrompt

func NewNetworkPrompt() map[string]string

func PrintEmoji added in v1.18.0

func PrintEmoji(emoji string) string

func RemoveAccountPrompt

func RemoveAccountPrompt(accounts config.Accounts) string

func RemoveContractFromFlowJSONPrompt added in v1.3.2

func RemoveContractFromFlowJSONPrompt(contractName string) bool

func RemoveContractPrompt

func RemoveContractPrompt(contracts config.Contracts) string

func RemoveDeploymentPrompt

func RemoveDeploymentPrompt(deployments config.Deployments) (account string, network string)

func RemoveNetworkPrompt

func RemoveNetworkPrompt(networks config.Networks) string

func ReportCrash

func ReportCrash() bool

func ScaffoldPrompt

func ScaffoldPrompt(logger output.Logger, scaffoldItems []ScaffoldItem) int

func ShowContractDiffPrompt

func ShowContractDiffPrompt(logger output.Logger) func([]byte, []byte) bool

ShowContractDiffPrompt shows a diff between the new contract and the existing contract and asks the user if they wish to continue with the deployment returns true if the user wishes to continue with the deployment and false otherwise

func TestMocks

TestMocks creates mock flowkit services, an empty state and a mock reader writer

func ValidateECDSAP256Pub

func ValidateECDSAP256Pub(key string) error

ValidateECDSAP256Pub attempt to decode the hex string representation of a ECDSA P256 public key

func WantToUseMainnetVersionPrompt

func WantToUseMainnetVersionPrompt() bool

Types

type AccountData

type AccountData struct {
	Name     string
	Address  string
	SigAlgo  string
	HashAlgo string
	Key      string
	KeyIndex string
}

func NewAccountPrompt

func NewAccountPrompt() *AccountData

type ContractData

type ContractData struct {
	Name     string
	Source   string
	Emulator string
	Testnet  string
	Mainnet  string
}

func NewContractPrompt

func NewContractPrompt() *ContractData

type DeploymentData

type DeploymentData struct {
	Network   string
	Account   string
	Contracts []string
}

func AddContractToDeploymentPrompt added in v1.16.0

func AddContractToDeploymentPrompt(networkName string, accounts accounts.Accounts, contractName string) *DeploymentData

AddContractToDeploymentPrompt prompts a user to select an account to deploy a given contract on a given network

func NewDeploymentPrompt

func NewDeploymentPrompt(
	networks config.Networks,
	accounts config.Accounts,
	contracts config.Contracts,
) *DeploymentData

type ScaffoldItem added in v1.1.1

type ScaffoldItem struct {
	Index    int
	Title    string
	Category string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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