evmclient

package
v1.0.47 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2023 License: LGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonTransaction

type CommonTransaction interface {
	// Hash returns the transaction hash.
	Hash() common.Hash

	// RawWithSignature Returns signed transaction by provided private key
	RawWithSignature(key *ecdsa.PrivateKey, domainID *big.Int) ([]byte, error)
}

type EVMClient

type EVMClient struct {
	*ethclient.Client
	// contains filtered or unexported fields
}

func NewEVMClient

func NewEVMClient(url string, privateKey *ecdsa.PrivateKey) (*EVMClient, error)

NewEVMClient creates a client for EVMChain with provided private key.

func (*EVMClient) BaseFee

func (c *EVMClient) BaseFee() (*big.Int, error)

func (*EVMClient) CallContext

func (c *EVMClient) CallContext(ctx context.Context, target interface{}, rpcMethod string, args ...interface{}) error

func (*EVMClient) CallContract

func (c *EVMClient) CallContract(ctx context.Context, callArgs map[string]interface{}, blockNumber *big.Int) ([]byte, error)

func (*EVMClient) FetchEventLogs

func (c *EVMClient) FetchEventLogs(ctx context.Context, contractAddress common.Address, event string, startBlock *big.Int, endBlock *big.Int) ([]types.Log, error)

func (*EVMClient) From

func (c *EVMClient) From() common.Address

func (*EVMClient) GetTransactionByHash

func (c *EVMClient) GetTransactionByHash(h common.Hash) (tx *types.Transaction, isPending bool, err error)

func (*EVMClient) LatestBlock

func (c *EVMClient) LatestBlock() (*big.Int, error)

LatestBlock returns the latest block from the current chain

func (*EVMClient) LockNonce

func (c *EVMClient) LockNonce()

func (*EVMClient) PendingCallContract

func (c *EVMClient) PendingCallContract(ctx context.Context, callArgs map[string]interface{}) ([]byte, error)

func (*EVMClient) RelayerAddress

func (c *EVMClient) RelayerAddress() common.Address

func (*EVMClient) SendRawTransaction

func (c *EVMClient) SendRawTransaction(ctx context.Context, tx []byte) error

SendRawTransaction accepts rlp-encode of signed transaction and sends it via RPC call

func (*EVMClient) SignAndSendTransaction

func (c *EVMClient) SignAndSendTransaction(ctx context.Context, tx CommonTransaction) (common.Hash, error)

func (*EVMClient) SubscribePendingTransactions

func (c *EVMClient) SubscribePendingTransactions(ctx context.Context, ch chan<- common.Hash) (*rpc.ClientSubscription, error)

func (*EVMClient) UnlockNonce

func (c *EVMClient) UnlockNonce()

func (*EVMClient) UnsafeIncreaseNonce

func (c *EVMClient) UnsafeIncreaseNonce() error

func (*EVMClient) UnsafeNonce

func (c *EVMClient) UnsafeNonce() (*big.Int, error)

func (*EVMClient) WaitAndReturnTxReceipt

func (c *EVMClient) WaitAndReturnTxReceipt(h common.Hash) (*types.Receipt, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL