Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Package string `yaml:"package,omitempty"` Manifest *manifest.Manifest `yaml:"-"` Hash util.Uint160 `yaml:"hash,omitempty"` Overrides map[string]Override `yaml:"overrides,omitempty"` CallFlags map[string]callflag.CallFlag `yaml:"callflags,omitempty"` NamedTypes map[string]ExtendedType `yaml:"namedtypes,omitempty"` Types map[string]ExtendedType `yaml:"types,omitempty"` Output io.Writer `yaml:"-"` }
Config contains parameter for the generated binding.
type ContractTmpl ¶ added in v0.99.5
type ContractTmpl struct { PackageName string ContractName string Imports []string Hash string Methods []MethodTmpl }
func TemplateFromManifest ¶ added in v0.99.5
func TemplateFromManifest(cfg Config, scTypeConverter func(string, smartcontract.ParamType, *Config) (string, string)) ContractTmpl
TemplateFromManifest create a contract template using the given configuration and type conversion function. It assumes manifest to be present in the configuration and assumes it to be correct (passing IsValid check).
type ExtendedType ¶ added in v0.100.0
type ExtendedType struct { Base smartcontract.ParamType `yaml:"base"` Name string `yaml:"name,omitempty"` // Structure name, omitted for arrays, interfaces and maps. Interface string `yaml:"interface,omitempty"` // Interface type name, "iterator" only for now. Key smartcontract.ParamType `yaml:"key,omitempty"` // Key type (only simple types can be used for keys) for maps. Value *ExtendedType `yaml:"value,omitempty"` // Value type for iterators and arrays. Fields []FieldExtendedType `yaml:"fields,omitempty"` // Ordered type data for structure fields. }
type FieldExtendedType ¶ added in v0.100.0
type FieldExtendedType struct { Field string `yaml:"field"` ExtendedType `yaml:",inline"` }
type MethodTmpl ¶ added in v0.99.5
type Override ¶
type Override struct { // Package contains a fully-qualified package name. Package string // TypeName contains type name together with a package alias. TypeName string }
Override contains a package and a type to replace manifest method parameter type with.
func NewOverrideFromString ¶
NewOverrideFromString parses s and returns method parameter type override spec.
func (Override) MarshalYAML ¶
MarshalYAML implements the YAML marshaler interface.
func (*Override) UnmarshalYAML ¶
UnmarshalYAML implements the YAML Unmarshaler interface.
Click to show internal directories.
Click to hide internal directories.