bind

package
v1.15.9 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: GPL-3.0 Imports: 17 Imported by: 16,459

Documentation

Overview

Package bind is the runtime for abigen v1 generated contract bindings. Deprecated: please use github.com/ethereum/go-ethereum/bind/v2

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoCode is returned by call and transact operations for which the requested
	// recipient contract to operate on does not exist in the state db or does not
	// have any code associated with it (i.e. self-destructed).
	ErrNoCode = bind2.ErrNoCode

	// ErrNoPendingState is raised when attempting to perform a pending state action
	// on a backend that doesn't implement PendingContractCaller.
	ErrNoPendingState = bind2.ErrNoPendingState

	// ErrNoBlockHashState is raised when attempting to perform a block hash action
	// on a backend that doesn't implement BlockHashContractCaller.
	ErrNoBlockHashState = bind2.ErrNoBlockHashState

	// ErrNoCodeAfterDeploy is returned by WaitDeployed if contract creation leaves
	// an empty contract behind.
	ErrNoCodeAfterDeploy = bind2.ErrNoCodeAfterDeploy
)
View Source
var ErrNoChainID = errors.New("no chain id specified")

ErrNoChainID is returned whenever the user failed to specify a chain id.

View Source
var ErrNotAuthorized = bind2.ErrNotAuthorized

ErrNotAuthorized is returned when an account is not properly unlocked.

Functions

func Bind

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

Bind generates a v1 contract binding. Deprecated: binding generation has moved to github.com/ethereum/go-ethereum/accounts/abi/abigen

func WaitDeployed added in v1.5.0

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

WaitDeployed waits for a contract deployment transaction and returns the on-chain contract address when it is mined. It stops waiting when ctx is canceled.

func WaitDeployedHash added in v1.15.0

func WaitDeployedHash(ctx context.Context, b DeployBackend, hash common.Hash) (common.Address, error)

WaitDeployedHash waits for a contract deployment transaction with the provided hash and returns the on-chain contract address when it is mined. It stops waiting when ctx is canceled.

func WaitMined added in v1.5.0

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

WaitMined waits for tx to be mined on the blockchain. It stops waiting when the context is canceled.

func WaitMinedHash added in v1.15.0

func WaitMinedHash(ctx context.Context, b DeployBackend, hash common.Hash) (*types.Receipt, error)

WaitMinedHash waits for a transaction with the provided hash to be mined on the blockchain. It stops waiting when the context is canceled.

Types

type BlockHashContractCaller added in v1.13.5

type BlockHashContractCaller = bind2.BlockHashContractCaller

BlockHashContractCaller defines methods to perform contract calls on a specific block hash. Call will try to discover this interface when access to a block by hash is requested. If the backend does not support the block hash state, Call returns ErrNoBlockHashState.

type BoundContract

type BoundContract = bind2.BoundContract

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

type CallOpts

type CallOpts = bind2.CallOpts

type ContractBackend

type ContractBackend = bind2.ContractBackend

ContractBackend defines the methods needed to work with contracts on a read-write basis.

type ContractCaller

type ContractCaller = bind2.ContractCaller

ContractCaller defines the methods needed to allow operating with a contract on a read only basis.

type ContractFilterer added in v1.8.0

type ContractFilterer = bind2.ContractFilterer

ContractFilterer defines the methods needed to access log events using one-off queries or continuous event subscriptions.

type ContractTransactor

type ContractTransactor = bind2.ContractTransactor

ContractTransactor defines the methods needed to allow operating with a contract on a write only basis. Besides the transacting method, the remainder are helpers used when the user does not provide some needed values, but rather leaves it up to the transactor to decide.

type DeployBackend added in v1.5.0

type DeployBackend = bind2.DeployBackend

DeployBackend wraps the operations needed by WaitMined and WaitDeployed.

type FilterOpts added in v1.8.0

type FilterOpts = bind2.FilterOpts

type MetaData added in v1.10.7

type MetaData struct {
	Bin  string            // runtime bytecode (as a hex string)
	ABI  string            // the raw ABI definition (JSON)
	Sigs map[string]string // 4byte identifier -> function signature
	// contains filtered or unexported fields
}

MetaData collects all metadata for a bound contract.

func (*MetaData) GetAbi added in v1.10.7

func (m *MetaData) GetAbi() (*abi.ABI, error)

GetAbi returns the parsed ABI definition.

type PendingContractCaller added in v1.5.0

type PendingContractCaller = bind2.PendingContractCaller

PendingContractCaller defines methods to perform contract calls on the pending state. Call will try to discover this interface when access to the pending state is requested. If the backend does not support the pending state, Call returns ErrNoPendingState.

type SignerFn

type SignerFn = bind2.SignerFn

type TransactOpts

type TransactOpts = bind2.TransactOpts

func NewClefTransactor added in v1.9.0

func NewClefTransactor(clef *external.ExternalSigner, account accounts.Account) *TransactOpts

NewClefTransactor is a utility method to easily create a transaction signer with a clef backend.

func NewKeyStoreTransactor deprecated added in v1.9.0

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

NewKeyStoreTransactor is a utility method to easily create a transaction signer from a decrypted key from a keystore.

Deprecated: Use NewKeyStoreTransactorWithChainID instead.

func NewKeyStoreTransactorWithChainID added in v1.9.25

func NewKeyStoreTransactorWithChainID(keystore *keystore.KeyStore, account accounts.Account, chainID *big.Int) (*TransactOpts, error)

NewKeyStoreTransactorWithChainID is a utility method to easily create a transaction signer from a decrypted key from a keystore.

func NewKeyedTransactor deprecated

func NewKeyedTransactor(key *ecdsa.PrivateKey) *TransactOpts

NewKeyedTransactor is a utility method to easily create a transaction signer from a single private key.

Deprecated: Use NewKeyedTransactorWithChainID instead.

func NewKeyedTransactorWithChainID added in v1.9.25

func NewKeyedTransactorWithChainID(key *ecdsa.PrivateKey, chainID *big.Int) (*TransactOpts, error)

NewKeyedTransactorWithChainID is a utility method to easily create a transaction signer from a single private key.

func NewTransactor deprecated

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

NewTransactor is a utility method to easily create a transaction signer from an encrypted json key stream and the associated passphrase.

Deprecated: Use NewTransactorWithChainID instead.

func NewTransactorWithChainID added in v1.9.25

func NewTransactorWithChainID(keyin io.Reader, passphrase string, chainID *big.Int) (*TransactOpts, error)

NewTransactorWithChainID is a utility method to easily create a transaction signer from an encrypted json key stream and the associated passphrase.

type WatchOpts added in v1.8.0

type WatchOpts = bind2.WatchOpts

Directories

Path Synopsis
v2
Package bind implements utilities for interacting with Solidity contracts.
Package bind implements utilities for interacting with Solidity contracts.

Jump to

Keyboard shortcuts

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