Documentation ¶
Index ¶
- Variables
- func Recover(signature ethereum.Signature, data []byte) (*ethereum.Address, error)
- func Signature(account *Account, data []byte) (ethereum.Signature, error)
- type Account
- type Client
- func (e *Client) Balance(ctx context.Context, address pkgEthereum.Address) (*big.Int, error)
- func (e *Client) Block(ctx context.Context) (*types.Block, error)
- func (e *Client) BlockNumber(ctx context.Context) (*big.Int, error)
- func (e *Client) Call(ctx context.Context, call pkgEthereum.Call) ([]byte, error)
- func (e *Client) CallBlocks(ctx context.Context, call pkgEthereum.Call, blocks []int64) ([][]byte, error)
- func (e *Client) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
- func (e *Client) MultiCall(ctx context.Context, calls []pkgEthereum.Call) ([][]byte, error)
- func (e *Client) SendTransaction(ctx context.Context, transaction *pkgEthereum.Transaction) (*pkgEthereum.Hash, error)
- func (e *Client) Storage(ctx context.Context, address pkgEthereum.Address, key pkgEthereum.Hash) ([]byte, error)
- type ErrRevert
- type EthClient
- type Signer
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidSignature = errors.New("invalid Ethereum signature (V is not 27 or 28)")
View Source
var ErrInvalidSignedTxType = errors.New("unable to send transaction, SignedTx field have invalid type")
View Source
var ErrMissingAccount = errors.New("unable to find account for requested address")
View Source
var ErrMulticallNotSupported = errors.New("multicall is not supported on current chain")
Functions ¶
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func NewAccount ¶
NewAccount returns a new Account instance.
func (*Account) Passphrase ¶
Passphrase returns a password of this account.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the ethereum.Client interface.
func NewClient ¶
func NewClient(ethClient EthClient, signer pkgEthereum.Signer) *Client
NewClient returns a new Client instance.
func (*Client) BlockNumber ¶ added in v0.5.0
BlockNumber implements the ethereum.Client interface.
func (*Client) CallBlocks ¶ added in v0.5.0
func (*Client) FilterLogs ¶ added in v0.7.1
FilterLogs implements the ethereum.Client interface.
func (*Client) SendTransaction ¶
func (e *Client) SendTransaction(ctx context.Context, transaction *pkgEthereum.Transaction) (*pkgEthereum.Hash, error)
SendTransaction implements the ethereum.Client interface.
type EthClient ¶
type EthClient interface { SendTransaction(ctx context.Context, tx *types.Transaction) error StorageAt(ctx context.Context, account common.Address, key common.Hash, block *big.Int) ([]byte, error) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) CallContract(ctx context.Context, call ethereum.CallMsg, block *big.Int) ([]byte, error) NonceAt(ctx context.Context, account common.Address, block *big.Int) (uint64, error) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) SuggestGasPrice(ctx context.Context) (*big.Int, error) SuggestGasTipCap(ctx context.Context) (*big.Int, error) NetworkID(ctx context.Context) (*big.Int, error) BlockNumber(ctx context.Context) (uint64, error) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) }
EthClient represents the Ethereum client, like the ethclient.Client.
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
func NewSigner ¶
NewSigner returns a new Signer instance. If you don't want to sign any data and you only want to recover public addresses, you may use nil as an argument.
func (*Signer) SignTransaction ¶
func (s *Signer) SignTransaction(transaction *ethereum.Transaction) error
SignTransaction implements the ethereum.Signer interface.
Click to show internal directories.
Click to hide internal directories.