flixkit

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 29 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchFlixWithContext

func FetchFlixWithContext(ctx context.Context, url string) (string, error)

func GetFlixFclCompatibility

func GetFlixFclCompatibility(flixVersion string) string

func GetTemplateVersion

func GetTemplateVersion(template string) (string, error)

Types

type Config

type Config struct {
	FlixServerURL string
	FileReader    FileReader
}

type ContractInfos

type ContractInfos map[string]NetworkAddressMap

Same structure as core contracts, keyed by contract name

type FclGenerator

type FclGenerator struct {
	Templates []string
}

func NewFclJSGenerator

func NewFclJSGenerator() *FclGenerator

func NewFclTSGenerator

func NewFclTSGenerator() *FclGenerator

func (*FclGenerator) Generate

func (g *FclGenerator) Generate(flixString string, templateLocation string) (string, error)

type FileReader

type FileReader interface {
	ReadFile(path string) ([]byte, error)
}

type FlixParameter

type FlixParameter struct {
	Name string
	Type string
}

type FlixService

type FlixService interface {
	GetTemplate(ctx context.Context, templateName string) (string, error)
	GetAndReplaceCadenceImports(ctx context.Context, templateName string, network string) (*FlowInteractionTemplateExecution, error)
}

func NewFlixService

func NewFlixService(config *Config) FlixService

type FlowInteractionTemplateCadence

type FlowInteractionTemplateCadence interface {
	GetAndReplaceCadenceImports(templateName string) (string, error)
	IsTransaction() bool
	IsScript() bool
}

type FlowInteractionTemplateExecution

type FlowInteractionTemplateExecution struct {
	Network       string
	Cadence       string
	IsTransaciton bool
	IsScript      bool
}

type FlowInteractionTemplateVersion

type FlowInteractionTemplateVersion struct {
	FVersion string `json:"f_version"`
}

type GenerateBinding

type GenerateBinding interface {
	Generate(flixString string, templateLocation string) (string, error)
}

type GenerateTemplate

type GenerateTemplate interface {
	Generate(ctx context.Context, code string, preFill string) (string, error)
}

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator(contractInfos ContractInfos, logger output.Logger) (*Generator, error)

func (Generator) Generate

func (g Generator) Generate(ctx context.Context, code string, preFill string) (string, error)

func (*Generator) GenerateDepPinDepthFirst

func (g *Generator) GenerateDepPinDepthFirst(ctx context.Context, flowkit *flowkit.Flowkit, address string, name string, height uint64) (details *v1_1.PinDetail, err error)

func (*Generator) LookupImportContractInfo

func (g *Generator) LookupImportContractInfo(contractName string) []v1_1.Network

type NetworkAddressMap

type NetworkAddressMap map[string]string

Same structure as core contracts, using config network names

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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