evmclient

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: LGPL-3.0 Imports: 15 Imported by: 16

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 signer
	RawWithSignature(signer Signer, domainID *big.Int) ([]byte, error)
}

type EVMClient

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

func NewEVMClient

func NewEVMClient(url string, signer Signer) (*EVMClient, error)

NewEVMClient creates a client for EVMChain with provided signer

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)

type Signer added in v1.2.0

type Signer interface {
	CommonAddress() common.Address

	// Sign calculates an ECDSA signature.
	// The produced signature must be in the [R || S || V] format where V is 0 or 1.
	Sign(digestHash []byte) ([]byte, error)
}

Jump to

Keyboard shortcuts

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