Documentation ¶
Index ¶
- type EVM
- func (e *EVM) Call(ctx context.Context, data []byte) ([]byte, error)
- func (e *EVM) EstimateGas(ctx context.Context, data []byte) (uint64, error)
- func (e *EVM) GetBalance(ctx context.Context, address common.Address, height uint64) (*big.Int, error)
- func (e *EVM) GetCode(ctx context.Context, address common.Address, height uint64) ([]byte, error)
- func (e *EVM) GetNonce(ctx context.Context, address common.Address) (uint64, error)
- func (e *EVM) SendRawTransaction(ctx context.Context, data []byte) (common.Hash, error)
- type KeyRotationSigner
- type Requester
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EVM ¶
type EVM struct {
// contains filtered or unexported fields
}
func (*EVM) EstimateGas ¶
func (*EVM) GetBalance ¶
type KeyRotationSigner ¶
type KeyRotationSigner struct {
// contains filtered or unexported fields
}
KeyRotationSigner is a crypto signer that contains a pool of key pairs to sign with, and it rotates the key used for each signing request. This allows for faster submission of transactions to the network, due to a sequence number not being reused between different keys used. It also contains logic to queue up signature requests and in case there are more transactions pending than the keys in the pool it will wait for transactions to get executed so the new sequence key can be obtained. The signer is concurrency-safe.
func NewKeyRotationSigner ¶
func NewKeyRotationSigner(keys []crypto.PrivateKey, hashAlgo crypto.HashAlgorithm) (*KeyRotationSigner, error)
func (*KeyRotationSigner) PublicKey ¶
func (k *KeyRotationSigner) PublicKey() crypto.PublicKey
PublicKey returns the current public key which is available for signing.
type Requester ¶
type Requester interface { // SendRawTransaction will submit signed transaction data to the network. // The submitted EVM transaction hash is returned. SendRawTransaction(ctx context.Context, data []byte) (common.Hash, error) // GetBalance returns the amount of wei for the given address in the state of the // given block height. // todo in future this should be deprecated for local data GetBalance(ctx context.Context, address common.Address, height uint64) (*big.Int, error) // Call executes the given signed transaction data on the state for the given block number. // Note, this function doesn't make and changes in the state/blockchain and is // useful to execute and retrieve values. Call(ctx context.Context, data []byte) ([]byte, error) // EstimateGas executes the given signed transaction data on the state. // Note, this function doesn't make any changes in the state/blockchain and is // useful to executed and retrieve the gas consumption and possible failures. EstimateGas(ctx context.Context, data []byte) (uint64, error) // GetNonce gets nonce from the network. GetNonce(ctx context.Context, address common.Address) (uint64, error) // GetCode returns the code stored at the given address in // the state for the given block number. GetCode(ctx context.Context, address common.Address, height uint64) ([]byte, error) }
Click to show internal directories.
Click to hide internal directories.