Documentation ¶
Index ¶
- func ExtractContractName(importStr string) (string, error)
- func GenerateFlixID(flix *InteractionTemplate) (string, error)
- func ShaHex(value interface{}, debugKey string) string
- type Argument
- type Cadence
- type Contract
- type ContractInfos
- type Data
- type Dependency
- type Generator
- func (g Generator) CreateTemplate(ctx context.Context, code string, preFill string) (string, error)
- func (g *Generator) GenerateDepPinDepthFirst(ctx context.Context, flowkit *flowkit.Flowkit, address string, name string, ...) (details *PinDetail, err error)
- func (g *Generator) LookupImportContractInfo(contractName string) []Network
- type I18n
- type Identifier
- type IdentifierExpression
- type Import
- type InteractionExpression
- type InteractionTemplate
- func (template *InteractionTemplate) DetermineCadenceType(program *ast.Program) error
- func (flix InteractionTemplate) EncodeRLP() (result string, err error)
- func (t *InteractionTemplate) Init()
- func (t *InteractionTemplate) IsScript() bool
- func (t *InteractionTemplate) IsTransaction() bool
- func (template *InteractionTemplate) ParsePragma(program *ast.Program) error
- func (template *InteractionTemplate) ProcessImports(cadenceCode string)
- func (template *InteractionTemplate) ProcessParameters(program *ast.Program) error
- func (t *InteractionTemplate) ReplaceCadenceImports(networkName string) (string, error)
- type InteractionTemplateMessages
- type Message
- type Network
- type NetworkAddressMap
- type NetworkPin
- type Parameter
- type PinDetail
- type PragmaDeclaration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractContractName ¶
func GenerateFlixID ¶
func GenerateFlixID(flix *InteractionTemplate) (string, error)
Types ¶
type Argument ¶
type Argument struct { Expression InteractionExpression `json:"Expression"` Label string `json:"Label"` }
type Cadence ¶
type Cadence struct { Body string `json:"body"` NetworkPins []NetworkPin `json:"network_pins"` }
type ContractInfos ¶
type ContractInfos map[string]NetworkAddressMap
Same structure as core contracts, keyed by contract name
type Dependency ¶
type Dependency struct {
Contracts []Contract `json:"contracts"`
}
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewTemplateGenerator ¶
func (Generator) CreateTemplate ¶
func (*Generator) GenerateDepPinDepthFirst ¶
func (*Generator) LookupImportContractInfo ¶
type Identifier ¶
type Identifier struct {
Identifier string `json:"Identifier"`
}
type IdentifierExpression ¶
type IdentifierExpression struct {
Identifier Identifier `json:"Identifier"`
}
type InteractionExpression ¶
type InteractionExpression struct { InvokedExpression IdentifierExpression `json:"InvokedExpression"` Arguments []Argument `json:"Arguments"` Value string `json:"Value"` // Used for string expressions Type string `json:"Type"` // Used for string expressions Values []InteractionExpression `json:"Values"` // Used for array expressions }
type InteractionTemplate ¶
type InteractionTemplate struct { FType string `json:"f_type"` FVersion string `json:"f_version"` ID string `json:"id"` Data Data `json:"data"` }
func ParseFlix ¶
func ParseFlix(template string) (*InteractionTemplate, error)
func (*InteractionTemplate) DetermineCadenceType ¶
func (template *InteractionTemplate) DetermineCadenceType(program *ast.Program) error
func (InteractionTemplate) EncodeRLP ¶
func (flix InteractionTemplate) EncodeRLP() (result string, err error)
func (*InteractionTemplate) Init ¶
func (t *InteractionTemplate) Init()
func (*InteractionTemplate) IsScript ¶
func (t *InteractionTemplate) IsScript() bool
func (*InteractionTemplate) IsTransaction ¶
func (t *InteractionTemplate) IsTransaction() bool
func (*InteractionTemplate) ParsePragma ¶
func (template *InteractionTemplate) ParsePragma(program *ast.Program) error
func (*InteractionTemplate) ProcessImports ¶
func (template *InteractionTemplate) ProcessImports(cadenceCode string)
func (*InteractionTemplate) ProcessParameters ¶
func (template *InteractionTemplate) ProcessParameters(program *ast.Program) error
func (*InteractionTemplate) ReplaceCadenceImports ¶
func (t *InteractionTemplate) ReplaceCadenceImports(networkName string) (string, error)
type InteractionTemplateMessages ¶
type InteractionTemplateMessages []Message
func (InteractionTemplateMessages) GetDescription ¶
func (msgs InteractionTemplateMessages) GetDescription(placeholder string) string
func (InteractionTemplateMessages) GetTitle ¶
func (msgs InteractionTemplateMessages) GetTitle(placeholder string) string
type NetworkAddressMap ¶
Same structure as core contracts, using config network names
type NetworkPin ¶
type PinDetail ¶
type PinDetail struct { Pin string `json:"pin"` PinSelf string `json:"pin_self"` PinContractName string `json:"pin_contract_name"` PinContractAddress string `json:"pin_contract_address"` Imports []PinDetail `json:"imports"` }
func (*PinDetail) CalculatePin ¶
type PragmaDeclaration ¶
type PragmaDeclaration struct {
Expression InteractionExpression `json:"Expression"`
}
Click to show internal directories.
Click to hide internal directories.