Documentation ¶
Index ¶
- type ContractLogFilterer
- type Eth
- func (e *Eth) Log(msg string, ctx ...interface{})
- func (e *Eth) NewHandleNonceBackend(handleAddresses []common.Address) *Eth
- func (e *Eth) NewSession(key *ecdsa.PrivateKey) *Session
- func (e *Eth) UpdateSuggestedGasPrice(ctx context.Context) error
- func (e *Eth) WaitForTxReceipt(ctx context.Context, txHash common.Hash) (tr *types.Receipt, err error)
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContractLogFilterer ¶
type ContractLogFilterer struct {
// contains filtered or unexported fields
}
ContractLogFilterer extends FilterLogs method of bind.BoundContract struct to allow filter multiple events
func NewContractLogFilterer ¶
func NewContractLogFilterer(address common.Address, abi abi.ABI, filterer bind.ContractFilterer) *ContractLogFilterer
NewContractLogFilterer creates a instance of ContractLogFilterer.
func (*ContractLogFilterer) FilterLogs ¶
func (c *ContractLogFilterer) FilterLogs(opts *bind.FilterOpts, names []string, query ...[]interface{}) (chan types.Log, event.Subscription, error)
FilterLogs filters contract logs for past blocks, returning the necessary channels to construct a strongly typed bound iterator on top of them.
type Eth ¶
Eth simplifies some operations with the Ethereum network
func (*Eth) NewHandleNonceBackend ¶
NewHandleNonceBackend returns new instance of Eth which internally handles nonce of the given addresses. It still calls PendingNonceAt of inner backend, but returns PendingNonceAt as a maximum of pending nonce in block-chain and internally stored nonce. It increments nonce for the given addresses after each successfully sent transaction (transaction may eventually fail in block-cain). Implementation is not thread-safe and should be used within one goroutine because otherwise invocations of PendingNonceAt and SendTransaction should be done atomically to have sequence of nonce without gaps (so that nonce would be equal to number of transactions sent).
func (*Eth) NewSession ¶
func (e *Eth) NewSession(key *ecdsa.PrivateKey) *Session
NewSession creates an instance of Session
func (*Eth) UpdateSuggestedGasPrice ¶
UpdateSuggestedGasPrice initializes suggested gas price from backend
type Session ¶
type Session struct { *Eth TransactOpts bind.TransactOpts }
Session provides holds basic pre-configured parameters like backend, authorization, logging
func (*Session) IsEnoughFunds ¶
func (s *Session) IsEnoughFunds(ctx context.Context, gasLimit int64) (enough bool, minBalance *big.Int, err error)
IsEnoughFunds retrieves current account balance and checks if it's enough funds given gas limit. SetGasPrice needs to be called with non-nil parameter before calling this method.