bind

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package bind generates Ethereum contract Go bindings.

Detailed usage document and tutorial available on the go-ethereum Wiki page: https://github.com/ethereum/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts

Index

Constants

View Source
const (
	LangGo Lang = iota
	LangJava
	LangObjC

	PlatformEth  Platform = "ethereum"
	PlatformKlay Platform = "klaytn"
)

Variables

This section is empty.

Functions

func Bind

func Bind(
	bindFile, wrapFile *os.File,
	contractName, contractABI, pkg string,
	customs Customs, plat Platform, lang Lang,
) error

Bind generates a Go wrapper around a contract ABI. This wrapper isn't meant to be used as is in client code, but rather as an intermediate struct which enforces compile time type safety and naming convention opposed to having to manually maintain hard coded strings that break on runtime.

func RenderBind

func RenderBind(data *tmplData, lang Lang) (string, error)

func RenderWrap

func RenderWrap(data *tmplData, lang Lang) (string, error)

Types

type Customs

type Customs struct {
	Structs map[string]string
	Imports map[string]string
	Methods map[string]bool
}

type Lang

type Lang int

Lang is a target programming language selector to generate bindings for.

type Platform

type Platform string

Jump to

Keyboard shortcuts

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