rpcbinding

package
v0.0.0-...-886a677 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 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

func ToEventBindingName(eventName string) string

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

func ToParameterBindingName

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

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

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

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