Documentation
¶
Overview ¶
Package bind is the runtime for abigen v1 generated contract bindings. Deprecated: please use github.com/ethereum/go-ethereum/bind/v2
Index ¶
- Variables
- func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]string, ...) (string, error)
- func WaitDeployed(ctx context.Context, b DeployBackend, tx *types.Transaction) (common.Address, error)
- func WaitDeployedHash(ctx context.Context, b DeployBackend, hash common.Hash) (common.Address, error)
- func WaitMined(ctx context.Context, b DeployBackend, tx *types.Transaction) (*types.Receipt, error)
- func WaitMinedHash(ctx context.Context, b DeployBackend, hash common.Hash) (*types.Receipt, error)
- type BlockHashContractCaller
- type BoundContract
- type CallOpts
- type ContractBackend
- type ContractCaller
- type ContractFilterer
- type ContractTransactor
- type DeployBackend
- type FilterOpts
- type MetaData
- type PendingContractCaller
- type SignerFn
- type TransactOpts
- func NewClefTransactor(clef *external.ExternalSigner, account accounts.Account) *TransactOpts
- func NewKeyStoreTransactor(keystore *keystore.KeyStore, account accounts.Account) (*TransactOpts, error)deprecated
- func NewKeyStoreTransactorWithChainID(keystore *keystore.KeyStore, account accounts.Account, chainID *big.Int) (*TransactOpts, error)
- func NewKeyedTransactor(key *ecdsa.PrivateKey) *TransactOptsdeprecated
- func NewKeyedTransactorWithChainID(key *ecdsa.PrivateKey, chainID *big.Int) (*TransactOpts, error)
- func NewTransactor(keyin io.Reader, passphrase string) (*TransactOpts, error)deprecated
- func NewTransactorWithChainID(keyin io.Reader, passphrase string, chainID *big.Int) (*TransactOpts, error)
- type WatchOpts
Constants ¶
This section is empty.
Variables ¶
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 )
var ErrNoChainID = errors.New("no chain id specified")
ErrNoChainID is returned whenever the user failed to specify a chain id.
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
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 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.
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 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 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.
Directories
¶
Path | Synopsis |
---|---|
Package bind implements utilities for interacting with Solidity contracts.
|
Package bind implements utilities for interacting with Solidity contracts. |