Documentation ¶
Overview ¶
Package cli defines constants, configurations, and utilities that are used across the Flow CLI.
Index ¶
- Constants
- Variables
- func ConfigExists() bool
- func ExecuteScript(host string, script []byte)
- func Exit(code int, msg string)
- func Exitf(code int, msg string, args ...interface{})
- func FixedPointToString(amount uint64, decimalPlaces int) string
- func FormatUFix64(flow uint64) string
- func GetAccount(host string, address flow.Address) *flow.Account
- func GetBlockByHeight(host string, height uint64) *flow.Block
- func GetBlockByID(host string, blockID flow.Identifier) *flow.Block
- func GetBlockEvents(host string, height uint64, eventType string)
- func GetCollectionByID(host string, collectionID flow.Identifier) *flow.Collection
- func GetLatestBlock(host string) *flow.Block
- func GetTransactionResult(host string, id string, sealed bool)
- func MustDecodePrivateKeyHex(sigAlgo crypto.SignatureAlgorithm, prKeyHex string) crypto.PrivateKey
- func MustDecodePublicKeyHex(sigAlgo crypto.SignatureAlgorithm, pubKeyHex string) crypto.PublicKey
- func MustSaveConfig(conf *Config)
- func RandomSeed(n int) []byte
- func SaveConfig(conf *Config) error
- func SendTransaction(host string, signerAccount *Account, tx *flow.Transaction, withResults bool)
- type Account
- type Config
Constants ¶
View Source
const ( EnvPrefix = "FLOW" DefaultSigAlgo = crypto.ECDSA_P256 DefaultHashAlgo = crypto.SHA3_256 DefaultHost = "127.0.0.1:3569" UFix64DecimalPlaces = 8 )
Variables ¶
View Source
var ConfigPath = "flow.json"
Functions ¶
func ConfigExists ¶
func ConfigExists() bool
func ExecuteScript ¶
func FixedPointToString ¶
FixedPointToString converts the given amount to a string with the given number of decimal places.
func FormatUFix64 ¶
func GetAccount ¶
func GetAccount(host string, address flow.Address) *flow.Account
func GetBlockByHeight ¶
func GetBlockByID ¶
func GetBlockByID(host string, blockID flow.Identifier) *flow.Block
func GetBlockEvents ¶
func GetCollectionByID ¶
func GetCollectionByID(host string, collectionID flow.Identifier) *flow.Collection
func GetLatestBlock ¶
func GetLatestBlock(host string) *flow.Block
func GetTransactionResult ¶
func MustDecodePrivateKeyHex ¶
func MustDecodePrivateKeyHex(sigAlgo crypto.SignatureAlgorithm, prKeyHex string) crypto.PrivateKey
func MustDecodePublicKeyHex ¶
func MustDecodePublicKeyHex(sigAlgo crypto.SignatureAlgorithm, pubKeyHex string) crypto.PublicKey
func MustSaveConfig ¶
func MustSaveConfig(conf *Config)
func RandomSeed ¶
func SaveConfig ¶
func SendTransaction ¶
Types ¶
type Account ¶
type Account struct { Address flow.Address PrivateKey crypto.PrivateKey SigAlgo crypto.SignatureAlgorithm HashAlgo crypto.HashAlgorithm }
func (*Account) MarshalJSON ¶
func (*Account) UnmarshalJSON ¶
type Config ¶
func LoadConfig ¶
func LoadConfig() *Config
func (*Config) HostWithOverride ¶
func (*Config) ServiceAccount ¶
func (*Config) SetServiceAccountKey ¶
func (c *Config) SetServiceAccountKey(privateKey crypto.PrivateKey, hashAlgo crypto.HashAlgorithm)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.