Documentation ¶
Index ¶
- Constants
- type EVM
- func (e *EVM) Call(ctx context.Context, data []byte, from common.Address, height uint64) ([]byte, error)
- func (e *EVM) EstimateGas(ctx context.Context, data []byte, from common.Address) (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) GetLatestEVMHeight(ctx context.Context) (uint64, error)
- func (e *EVM) GetNonce(ctx context.Context, address common.Address, height uint64) (uint64, error)
- func (e *EVM) SendRawTransaction(ctx context.Context, data []byte) (common.Hash, error)
- type KeyRotationSigner
- type Requester
Constants ¶
View Source
const LatestBlockHeight uint64 = math.MaxUint64 - 1
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 ¶
func (*EVM) GetLatestEVMHeight ¶ added in v0.6.0
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. 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, from common.Address, height uint64) ([]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, from common.Address) (uint64, error) // GetNonce gets nonce from the network at the given block height. GetNonce(ctx context.Context, address common.Address, height uint64) (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) // GetLatestEVMHeight returns the latest EVM height of the network. GetLatestEVMHeight(ctx context.Context) (uint64, error) }
Click to show internal directories.
Click to hide internal directories.