Documentation ¶
Index ¶
Constants ¶
const ( DefaultCadenceDirectory = "cadence" ContractType = "contract" TransactionType = "transaction" ScriptType = "script" )
Variables ¶
var DevCommand = &command.Command{ Cmd: &cobra.Command{ Use: "dev", Short: "Build your Flow project", Args: cobra.ExactArgs(0), Example: "flow dev", GroupID: "super", }, Flags: &devFlags, RunS: dev, }
var FlixCmd = &cobra.Command{ Use: "flix", Short: "execute, generate, package", TraverseChildren: true, GroupID: "tools", }
var GenerateCommand = &cobra.Command{ Use: "generate", Short: "Generate template files for common Cadence code", GroupID: "super", Aliases: []string{"g"}, }
var GenerateContractCommand = &command.Command{ Cmd: &cobra.Command{ Use: "contract <name>", Short: "Generate Cadence smart contract template", Example: "flow generate contract HelloWorld", Args: cobra.ExactArgs(1), }, Flags: &generateFlags, RunS: generateContract, }
var GenerateScriptCommand = &command.Command{ Cmd: &cobra.Command{ Use: "script <name>", Short: "Generate a Cadence script template", Example: "flow generate script SomeScript", Args: cobra.ExactArgs(1), }, Flags: &generateFlags, RunS: generateScript, }
var GenerateTransactionCommand = &command.Command{ Cmd: &cobra.Command{ Use: "transaction <name>", Short: "Generate a Cadence transaction template", Example: "flow generate transaction SomeTransaction", Args: cobra.ExactArgs(1), }, Flags: &generateFlags, RunS: generateTransaction, }
var SetupCommand = &command.Command{ Cmd: &cobra.Command{ Use: "init <project name>", Short: "Start a new Flow project", Example: "flow setup my-project", Args: cobra.MaximumNArgs(1), GroupID: "super", }, Flags: &setupFlags, Run: create, }
TODO: Add --config-only flag
Functions ¶
This section is empty.
Types ¶
type Contract ¶ added in v1.20.0
Contract contains properties for contracts
func (Contract) GetAccount ¶ added in v1.20.0
GetAccount returns the account of the contract
func (Contract) GetTemplate ¶ added in v1.20.0
GetTemplate returns the template of the contract
type Generator ¶ added in v1.20.0
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶ added in v1.20.0
func (*Generator) Create ¶ added in v1.20.0
func (g *Generator) Create(typeNames TemplateMap) error
type ScriptTemplate ¶ added in v1.20.0
ScriptTemplate contains only a name property for scripts and transactions
func (ScriptTemplate) GetAccount ¶ added in v1.20.0
func (o ScriptTemplate) GetAccount() string
GetAccount returns an empty string for scripts and transactions
func (ScriptTemplate) GetData ¶ added in v1.20.0
func (o ScriptTemplate) GetData() map[string]interface{}
GetData returns the data of the script or transaction
func (ScriptTemplate) GetName ¶ added in v1.20.0
func (o ScriptTemplate) GetName() string
GetName returns the name of the script or transaction
func (ScriptTemplate) GetTemplate ¶ added in v1.20.0
func (o ScriptTemplate) GetTemplate() string
GetTemplate returns an empty string for scripts and transactions
type TemplateItem ¶ added in v1.20.0
type TemplateItem interface { GetName() string GetTemplate() string GetAccount() string GetData() map[string]interface{} }
TemplateItem is an interface for different template types
type TemplateMap ¶ added in v1.20.0
type TemplateMap map[string][]TemplateItem
TemplateMap holds all templates with flexibility
type TransactionTemplate ¶ added in v1.20.0
TransactionTemplate contains only a name property for scripts and transactions
func (TransactionTemplate) GetAccount ¶ added in v1.20.0
func (o TransactionTemplate) GetAccount() string
GetAccount returns an empty string for scripts and transactions
func (TransactionTemplate) GetData ¶ added in v1.20.0
func (o TransactionTemplate) GetData() map[string]interface{}
GetData returns the data of the script or transaction
func (TransactionTemplate) GetName ¶ added in v1.20.0
func (o TransactionTemplate) GetName() string
GetName returns the name of the script or transaction
func (TransactionTemplate) GetTemplate ¶ added in v1.20.0
func (o TransactionTemplate) GetTemplate() string
GetTemplate returns an empty string for scripts and transactions