bind

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: GPL-3.0 Imports: 25 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoCode = errors.New("no contract code at given address")

	ErrNoPendingState = errors.New("backend does not support pending state")

	ErrNoCodeAfterDeploy = errors.New("no contract code after deployment")
)

Functions

func Bind

func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]string, pkg string, lang Lang, libs map[string]string, aliases map[string]string) (string, error)

func WaitDeployed

func WaitDeployed(ctx context.Context, b DeployBackend, tx *types.Transaction) (common.Address, error)

func WaitMined

func WaitMined(ctx context.Context, b DeployBackend, tx *types.Transaction) (*types.Receipt, error)

Types

type BoundContract

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

func DeployContract

func DeployContract(opts *TransactOpts, abi abi.ABI, bytecode []byte, backend ContractBackend, params ...interface{}) (common.Address, *types.Transaction, *BoundContract, error)

func NewBoundContract

func NewBoundContract(address common.Address, abi abi.ABI, caller ContractCaller, transactor ContractTransactor, filterer ContractFilterer) *BoundContract

func (*BoundContract) Call

func (c *BoundContract) Call(opts *CallOpts, result interface{}, method string, params ...interface{}) error

func (*BoundContract) FilterLogs

func (c *BoundContract) FilterLogs(opts *FilterOpts, name string, query ...[]interface{}) (chan types.Log, event.Subscription, error)

func (*BoundContract) Transact

func (c *BoundContract) Transact(opts *TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

func (*BoundContract) Transfer

func (c *BoundContract) Transfer(opts *TransactOpts) (*types.Transaction, error)

func (*BoundContract) UnpackLog

func (c *BoundContract) UnpackLog(out interface{}, event string, log types.Log) error

func (*BoundContract) UnpackLogIntoMap

func (c *BoundContract) UnpackLogIntoMap(out map[string]interface{}, event string, log types.Log) error

func (*BoundContract) WatchLogs

func (c *BoundContract) WatchLogs(opts *WatchOpts, name string, query ...[]interface{}) (chan types.Log, event.Subscription, error)

type CallOpts

type CallOpts struct {
	Pending     bool
	From        common.Address
	BlockNumber *big.Int
	Context     context.Context
}

type ContractBackend

type ContractBackend interface {
	ContractCaller
	ContractTransactor
	ContractFilterer
}

type ContractCaller

type ContractCaller interface {
	CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)

	CallContract(ctx context.Context, call neatio.CallMsg, blockNumber *big.Int) ([]byte, error)
}

type ContractFilterer

type ContractFilterer interface {
	FilterLogs(ctx context.Context, query neatio.FilterQuery) ([]types.Log, error)

	SubscribeFilterLogs(ctx context.Context, query neatio.FilterQuery, ch chan<- types.Log) (neatio.Subscription, error)
}

type ContractTransactor

type ContractTransactor interface {
	PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)

	PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)

	SuggestGasPrice(ctx context.Context) (*big.Int, error)

	EstimateGas(ctx context.Context, call neatio.CallMsg) (gas uint64, err error)

	SendTransaction(ctx context.Context, tx *types.Transaction) error
}

type DeployBackend

type DeployBackend interface {
	TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
	CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)
}

type FilterOpts

type FilterOpts struct {
	Start uint64
	End   *uint64

	Context context.Context
}

type Lang

type Lang int
const (
	LangGo Lang = iota
	LangJava
	LangObjC
)

type PendingContractCaller

type PendingContractCaller interface {
	PendingCodeAt(ctx context.Context, contract common.Address) ([]byte, error)

	PendingCallContract(ctx context.Context, call neatio.CallMsg) ([]byte, error)
}

type TransactOpts

type TransactOpts struct {
	From   common.Address
	Nonce  *big.Int
	Signer SignerFn

	Value    *big.Int
	GasPrice *big.Int
	GasLimit uint64

	Context context.Context
}

func NewKeyStoreTransactor

func NewKeyStoreTransactor(keystore *keystore.KeyStore, account accounts.Account) (*TransactOpts, error)

func NewKeyedTransactor

func NewKeyedTransactor(key *ecdsa.PrivateKey) *TransactOpts

func NewTransactor

func NewTransactor(keyin io.Reader, passphrase string) (*TransactOpts, error)

type WatchOpts

type WatchOpts struct {
	Start   *uint64
	Context context.Context
}

Jump to

Keyboard shortcuts

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