rpcbinding

package
v0.105.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(cfg binding.Config) error

Generate writes Go file containing smartcontract bindings to the `cfg.Output`. It doesn't check manifest from Config for validity, incorrect manifest can lead to unexpected results.

func NewConfig

func NewConfig() binding.Config

NewConfig initializes and returns a new config instance.

func ToEventBindingName added in v0.102.0

func ToEventBindingName(eventName string) string

ToEventBindingName converts event name specified in the contract manifest to a valid go exported event structure name.

func ToParameterBindingName added in v0.102.0

func ToParameterBindingName(paramName string) string

ToParameterBindingName converts parameter name specified in the contract manifest to a valid go structure's exported field name.

Types

type ContractTmpl

type ContractTmpl struct {
	binding.ContractTmpl

	SafeMethods  []SafeMethodTmpl
	CustomEvents []CustomEventTemplate
	NamedTypes   []binding.ExtendedType

	IsNep11D  bool
	IsNep11ND bool
	IsNep17   bool

	HasReader   bool
	HasWriter   bool
	HasIterator bool
}

type CustomEventTemplate added in v0.102.0

type CustomEventTemplate struct {
	// Name is the event's name that will be used as the event structure name in
	// the resulting RPC binding. It is a valid go structure name and may differ
	// from ManifestName.
	Name string
	// ManifestName is the event's name declared in the contract manifest.
	// It may contain any UTF8 character.
	ManifestName string
	Parameters   []EventParamTmpl
}

type EventParamTmpl added in v0.102.0

type EventParamTmpl struct {
	binding.ParamTmpl

	// ExtType holds the event parameter's type information provided by Manifest,
	// i.e. simple types only.
	ExtType binding.ExtendedType
}

type SafeMethodTmpl added in v0.100.0

type SafeMethodTmpl struct {
	binding.MethodTmpl
	Unwrapper      string
	ItemTo         string
	ExtendedReturn binding.ExtendedType
}

Jump to

Keyboard shortcuts

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