Versions in this module Expand all Collapse all v0 v0.4.1 Nov 26, 2024 v0.3.1 Nov 26, 2024 v0.2.1 Nov 26, 2024 v0.0.1 Nov 26, 2024 Changes in this version + const DefaultDialTimeout + const ETH + const FinalizedHeaderKey + const GWei + const MaxTimeoutForFinality + var SimulatedEVMNetwork = EVMNetwork + func RPCErrorFromError(txError error) (string, error) + type ArbitrumClient struct + type ArbitrumMultinodeClient struct + type BSCClient struct + type BSCMultinodeClient struct + type CeloClient struct + func (e *CeloClient) DeployContract(contractName string, deployer ContractDeployer) (*common.Address, *types.Transaction, interface{}, error) + func (e *CeloClient) TransactionOpts(from *EthereumWallet) (*bind.TransactOpts, error) + type CeloMultinodeClient struct + type ClientImplementation string + const ArbitrumClientImplementation + const BSCClientImplementation + const CeloClientImplementation + const EthereumClientImplementation + const FantomClientImplementation + const GnosisClientImplementation + const KlaytnClientImplementation + const KromaClientImplementation + const LineaClientImplementation + const MetisClientImplementation + const OptimismClientImplementation + const PolygonClientImplementation + const PolygonZkEvmClientImplementation + const QuorumClientImplementation + const RSKClientImplementation + const ScrollClientImplementation + const WeMixClientImplementation + type ContractDeployer func(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, interface{}, error) + type ContractLoader func(address common.Address, backend bind.ContractBackend) (interface{}, error) + type EVMClient interface + AddHeaderEventSubscription func(key string, subscriber HeaderEventSubscription) + AvgBlockTime func(ctx context.Context) (time.Duration, error) + Backend func() bind.ContractBackend + BalanceAt func(ctx context.Context, address common.Address) (*big.Int, error) + CancelFinalityPolling func() + Close func() error + ConnectionIssue func() chan time.Time + ConnectionRestored func() chan time.Time + DeleteHeaderEventSubscription func(key string) + DeployBackend func() bind.DeployBackend + DeployContract func(contractName string, deployer ContractDeployer) (*common.Address, *types.Transaction, interface{}, error) + ErrorReason func(b ethereum.ContractCaller, tx *types.Transaction, receipt *types.Receipt) (string, error) + EstimateCostForPluginOperations func(amountOfOperations int) (*big.Float, error) + EstimateGas func(callMsg ethereum.CallMsg) (GasEstimations, error) + EstimateGasPrice func() (*big.Int, error) + EstimateTransactionGasCost func() (*big.Int, error) + EstimatedFinalizationTime func(ctx context.Context) (time.Duration, error) + FilterLogs func(ctx context.Context, filterQuery ethereum.FilterQuery) ([]types.Log, error) + Fund func(toAddress string, amount *big.Float, gasEstimations GasEstimations) error + GasStats func() *GasStats + Get func() interface{} + GetChainID func() *big.Int + GetClients func() []EVMClient + GetDefaultWallet func() *EthereumWallet + GetEthClient func() *ethclient.Client + GetHeaderSubscriptions func() map[string]HeaderEventSubscription + GetLatestFinalizedBlockHeader func(ctx context.Context) (*types.Header, error) + GetNetworkConfig func() *EVMNetwork + GetNetworkName func() string + GetNonceSetting func() NonceSettings + GetTxReceipt func(txHash common.Hash) (*types.Receipt, error) + GetWalletByAddress func(address common.Address) *EthereumWallet + GetWallets func() []*EthereumWallet + HeaderByHash func(ctx context.Context, hash common.Hash) (*SafeEVMHeader, error) + HeaderByNumber func(ctx context.Context, number *big.Int) (*SafeEVMHeader, error) + HeaderHashByNumber func(ctx context.Context, bn *big.Int) (string, error) + HeaderTimestampByNumber func(ctx context.Context, bn *big.Int) (uint64, error) + IsEventConfirmed func(event *types.Log) (confirmed, removed bool, err error) + IsTxConfirmed func(txHash common.Hash) (bool, error) + IsTxHeadFinalized func(txHdr, header *SafeEVMHeader) (bool, *big.Int, time.Time, error) + LatestBlockNumber func(ctx context.Context) (uint64, error) + LoadContract func(contractName string, address common.Address, loader ContractLoader) (interface{}, error) + LoadWallets func(ns EVMNetwork) error + MarkTxAsSentOnL2 func(tx *types.Transaction) error + NetworkSimulated func() bool + NewTx func(fromPrivateKey *ecdsa.PrivateKey, nonce uint64, to common.Address, ...) (*types.Transaction, error) + ParallelTransactions func(enabled bool) + PollFinality func() error + ProcessEvent func(name string, event *types.Log, confirmedChan chan bool, errorChan chan error) error + ProcessTransaction func(tx *types.Transaction) error + RawJsonRPCCall func(ctx context.Context, result interface{}, method string, params ...interface{}) error + ReturnFunds func(fromKey *ecdsa.PrivateKey) error + RevertReasonFromTx func(txHash common.Hash, abiString string) (string, interface{}, error) + SendTransaction func(ctx context.Context, tx *types.Transaction) error + SetDefaultWallet func(num int) error + SetDefaultWalletByAddress func(address common.Address) error + SetID func(id int) + SetWallets func([]*EthereumWallet) + SubscribeFilterLogs func(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) + SubscribeNewHeaders func(ctx context.Context, headerChan chan *SafeEVMHeader) (ethereum.Subscription, error) + SwitchNode func(node int) error + SyncNonce func(c EVMClient) + TransactionOpts func(from *EthereumWallet) (*bind.TransactOpts, error) + WaitForEvents func() error + WaitForFinalizedTx func(txHash common.Hash) (*big.Int, time.Time, error) + func ConcurrentEVMClient(networkSettings EVMNetwork, env *environment.Environment, existing EVMClient, ...) (EVMClient, error) + func ConnectEVMClient(networkSettings EVMNetwork, logger zerolog.Logger) (EVMClient, error) + func NewEVMClient(networkSettings EVMNetwork, env *environment.Environment, ...) (EVMClient, error) + func NewEVMClientFromNetwork(networkSettings EVMNetwork, logger zerolog.Logger) (EVMClient, error) + type EVMNetwork struct + ChainID int64 + ClientImplementation ClientImplementation + DefaultGasLimit uint64 + FinalityDepth uint64 + FinalityTag bool + GasEstimationBuffer uint64 + HTTPURLs []string + Headers http.Header + MinimumConfirmations int + Name string + PluginTransactionLimit uint64 + PrivateKeys []string + Simulated bool + SimulationType string + SupportsEIP1559 bool + TimeToReachFinality StrDuration + Timeout StrDuration + URL string + URLs []string + func LoadNetworkFromEnvironment() EVMNetwork + func (e *EVMNetwork) MustPluginTOML(networkDetails string) string + func (e *EVMNetwork) ToMap() map[string]interface{} + type EthereumClient struct + Client *ethclient.Client + DefaultWallet *EthereumWallet + FinalizedHeader atomic.Pointer[FinalizedHeader] + ID int + NetworkConfig EVMNetwork + NonceSettings *NonceSettings + Wallets []*EthereumWallet + func (e *EthereumClient) AddHeaderEventSubscription(key string, subscriber HeaderEventSubscription) + func (e *EthereumClient) AvgBlockTime(ctx context.Context) (time.Duration, error) + func (e *EthereumClient) Backend() bind.ContractBackend + func (e *EthereumClient) BalanceAt(ctx context.Context, address common.Address) (*big.Int, error) + func (e *EthereumClient) CancelFinalityPolling() + func (e *EthereumClient) Close() error + func (e *EthereumClient) ConnectionIssue() chan time.Time + func (e *EthereumClient) ConnectionRestored() chan time.Time + func (e *EthereumClient) DeleteHeaderEventSubscription(key string) + func (e *EthereumClient) DeployBackend() bind.DeployBackend + func (e *EthereumClient) DeployContract(contractName string, deployer ContractDeployer) (*common.Address, *types.Transaction, interface{}, error) + func (e *EthereumClient) ErrorReason(b ethereum.ContractCaller, tx *types.Transaction, receipt *types.Receipt) (string, error) + func (e *EthereumClient) EstimateCostForPluginOperations(amountOfOperations int) (*big.Float, error) + func (e *EthereumClient) EstimateGas(callMsg ethereum.CallMsg) (GasEstimations, error) + func (e *EthereumClient) EstimateGasPrice() (*big.Int, error) + func (e *EthereumClient) EstimateTransactionGasCost() (*big.Int, error) + func (e *EthereumClient) EstimatedFinalizationTime(ctx context.Context) (time.Duration, error) + func (e *EthereumClient) FilterLogs(ctx context.Context, filterQuery ethereum.FilterQuery) ([]types.Log, error) + func (e *EthereumClient) Fund(toAddress string, amount *big.Float, gasEstimations GasEstimations) error + func (e *EthereumClient) GasStats() *GasStats + func (e *EthereumClient) Get() interface{} + func (e *EthereumClient) GetChainID() *big.Int + func (e *EthereumClient) GetClients() []EVMClient + func (e *EthereumClient) GetDefaultWallet() *EthereumWallet + func (e *EthereumClient) GetEthClient() *ethclient.Client + func (e *EthereumClient) GetHeaderSubscriptions() map[string]HeaderEventSubscription + func (e *EthereumClient) GetLatestFinalizedBlockHeader(ctx context.Context) (*types.Header, error) + func (e *EthereumClient) GetNetworkConfig() *EVMNetwork + func (e *EthereumClient) GetNetworkName() string + func (e *EthereumClient) GetNonce(ctx context.Context, addr common.Address) (uint64, error) + func (e *EthereumClient) GetNonceSetting() NonceSettings + func (e *EthereumClient) GetTxReceipt(txHash common.Hash) (*types.Receipt, error) + func (e *EthereumClient) GetWalletByAddress(address common.Address) *EthereumWallet + func (e *EthereumClient) GetWallets() []*EthereumWallet + func (e *EthereumClient) HeaderByHash(ctx context.Context, hash common.Hash) (*SafeEVMHeader, error) + func (e *EthereumClient) HeaderByNumber(ctx context.Context, number *big.Int) (*SafeEVMHeader, error) + func (e *EthereumClient) HeaderHashByNumber(ctx context.Context, bn *big.Int) (string, error) + func (e *EthereumClient) HeaderTimestampByNumber(ctx context.Context, bn *big.Int) (uint64, error) + func (e *EthereumClient) IsEventConfirmed(event *types.Log) (confirmed, removed bool, err error) + func (e *EthereumClient) IsTxConfirmed(txHash common.Hash) (bool, error) + func (e *EthereumClient) IsTxHeadFinalized(txHdr, header *SafeEVMHeader) (bool, *big.Int, time.Time, error) + func (e *EthereumClient) LatestBlockNumber(ctx context.Context) (uint64, error) + func (e *EthereumClient) LoadContract(contractName string, contractAddress common.Address, loader ContractLoader) (interface{}, error) + func (e *EthereumClient) LoadWallets(cfg EVMNetwork) error + func (e *EthereumClient) MarkTxAsSentOnL2(tx *types.Transaction) error + func (e *EthereumClient) NetworkSimulated() bool + func (e *EthereumClient) NewTx(fromPrivateKey *ecdsa.PrivateKey, nonce uint64, to common.Address, ...) (*types.Transaction, error) + func (e *EthereumClient) ParallelTransactions(enabled bool) + func (e *EthereumClient) PeekPendingNonce(addr common.Address) (uint64, error) + func (e *EthereumClient) PollFinality() error + func (e *EthereumClient) ProcessEvent(name string, event *types.Log, confirmedChan chan bool, errorChan chan error) error + func (e *EthereumClient) ProcessTransaction(tx *types.Transaction) error + func (e *EthereumClient) RawJsonRPCCall(ctx context.Context, result interface{}, method string, params ...interface{}) error + func (e *EthereumClient) ReturnFunds(fromKey *ecdsa.PrivateKey) error + func (e *EthereumClient) RevertReasonFromTx(txHash common.Hash, abiString string) (string, interface{}, error) + func (e *EthereumClient) SendTransaction(ctx context.Context, tx *types.Transaction) error + func (e *EthereumClient) SetDefaultWallet(num int) error + func (e *EthereumClient) SetDefaultWalletByAddress(address common.Address) error + func (e *EthereumClient) SetID(id int) + func (e *EthereumClient) SetWallets(wallets []*EthereumWallet) + func (e *EthereumClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) + func (e *EthereumClient) SubscribeNewHeaders(ctx context.Context, headerChan chan *SafeEVMHeader) (ethereum.Subscription, error) + func (e *EthereumClient) SwitchNode(_ int) error + func (e *EthereumClient) SyncNonce(c EVMClient) + func (e *EthereumClient) TimeBetweenFinalizedBlocks(ctx context.Context, maxTimeToWait time.Duration) (time.Duration, error) + func (e *EthereumClient) TransactionOpts(from *EthereumWallet) (*bind.TransactOpts, error) + func (e *EthereumClient) WaitForEvents() error + func (e *EthereumClient) WaitForFinalizedTx(txHash common.Hash) (*big.Int, time.Time, error) + type EthereumMultinodeClient struct + Clients []EVMClient + DefaultClient EVMClient + func (e *EthereumMultinodeClient) AddHeaderEventSubscription(key string, subscriber HeaderEventSubscription) + func (e *EthereumMultinodeClient) AvgBlockTime(ctx context.Context) (time.Duration, error) + func (e *EthereumMultinodeClient) Backend() bind.ContractBackend + func (e *EthereumMultinodeClient) BalanceAt(ctx context.Context, address common.Address) (*big.Int, error) + func (e *EthereumMultinodeClient) CancelFinalityPolling() + func (e *EthereumMultinodeClient) Close() error + func (e *EthereumMultinodeClient) ConnectionIssue() chan time.Time + func (e *EthereumMultinodeClient) ConnectionRestored() chan time.Time + func (e *EthereumMultinodeClient) DeleteHeaderEventSubscription(key string) + func (e *EthereumMultinodeClient) DeployBackend() bind.DeployBackend + func (e *EthereumMultinodeClient) DeployContract(contractName string, deployer ContractDeployer) (*common.Address, *types.Transaction, interface{}, error) + func (e *EthereumMultinodeClient) ErrorReason(b ethereum.ContractCaller, tx *types.Transaction, receipt *types.Receipt) (string, error) + func (e *EthereumMultinodeClient) EstimateCostForPluginOperations(amountOfOperations int) (*big.Float, error) + func (e *EthereumMultinodeClient) EstimateGas(callMsg ethereum.CallMsg) (GasEstimations, error) + func (e *EthereumMultinodeClient) EstimateGasPrice() (*big.Int, error) + func (e *EthereumMultinodeClient) EstimateTransactionGasCost() (*big.Int, error) + func (e *EthereumMultinodeClient) EstimatedFinalizationTime(ctx context.Context) (time.Duration, error) + func (e *EthereumMultinodeClient) FilterLogs(ctx context.Context, filterQuery ethereum.FilterQuery) ([]types.Log, error) + func (e *EthereumMultinodeClient) Fund(toAddress string, nativeAmount *big.Float, gasEstimations GasEstimations) error + func (e *EthereumMultinodeClient) GasStats() *GasStats + func (e *EthereumMultinodeClient) Get() interface{} + func (e *EthereumMultinodeClient) GetChainID() *big.Int + func (e *EthereumMultinodeClient) GetClients() []EVMClient + func (e *EthereumMultinodeClient) GetDefaultWallet() *EthereumWallet + func (e *EthereumMultinodeClient) GetEthClient() *ethclient.Client + func (e *EthereumMultinodeClient) GetHeaderSubscriptions() map[string]HeaderEventSubscription + func (e *EthereumMultinodeClient) GetLatestFinalizedBlockHeader(ctx context.Context) (*types.Header, error) + func (e *EthereumMultinodeClient) GetNetworkConfig() *EVMNetwork + func (e *EthereumMultinodeClient) GetNetworkName() string + func (e *EthereumMultinodeClient) GetNonceSetting() NonceSettings + func (e *EthereumMultinodeClient) GetTxReceipt(txHash common.Hash) (*types.Receipt, error) + func (e *EthereumMultinodeClient) GetWalletByAddress(address common.Address) *EthereumWallet + func (e *EthereumMultinodeClient) GetWallets() []*EthereumWallet + func (e *EthereumMultinodeClient) HeaderByHash(ctx context.Context, hash common.Hash) (*SafeEVMHeader, error) + func (e *EthereumMultinodeClient) HeaderByNumber(ctx context.Context, number *big.Int) (*SafeEVMHeader, error) + func (e *EthereumMultinodeClient) HeaderHashByNumber(ctx context.Context, bn *big.Int) (string, error) + func (e *EthereumMultinodeClient) HeaderTimestampByNumber(ctx context.Context, bn *big.Int) (uint64, error) + func (e *EthereumMultinodeClient) IsEventConfirmed(event *types.Log) (confirmed, removed bool, err error) + func (e *EthereumMultinodeClient) IsTxConfirmed(txHash common.Hash) (bool, error) + func (e *EthereumMultinodeClient) IsTxHeadFinalized(txHdr, header *SafeEVMHeader) (bool, *big.Int, time.Time, error) + func (e *EthereumMultinodeClient) LatestBlockNumber(ctx context.Context) (uint64, error) + func (e *EthereumMultinodeClient) LoadContract(contractName string, address common.Address, loader ContractLoader) (interface{}, error) + func (e *EthereumMultinodeClient) LoadWallets(cfg EVMNetwork) error + func (e *EthereumMultinodeClient) MarkTxAsSentOnL2(tx *types.Transaction) error + func (e *EthereumMultinodeClient) NetworkSimulated() bool + func (e *EthereumMultinodeClient) NewTx(fromPrivateKey *ecdsa.PrivateKey, nonce uint64, to common.Address, ...) (*types.Transaction, error) + func (e *EthereumMultinodeClient) ParallelTransactions(enabled bool) + func (e *EthereumMultinodeClient) PollFinality() error + func (e *EthereumMultinodeClient) ProcessEvent(name string, event *types.Log, confirmedChan chan bool, errorChan chan error) error + func (e *EthereumMultinodeClient) ProcessTransaction(tx *types.Transaction) error + func (e *EthereumMultinodeClient) RawJsonRPCCall(ctx context.Context, result interface{}, method string, params ...interface{}) error + func (e *EthereumMultinodeClient) ReturnFunds(fromKey *ecdsa.PrivateKey) error + func (e *EthereumMultinodeClient) RevertReasonFromTx(txHash common.Hash, abiString string) (string, interface{}, error) + func (e *EthereumMultinodeClient) SendTransaction(ctx context.Context, tx *types.Transaction) error + func (e *EthereumMultinodeClient) SetDefaultWallet(num int) error + func (e *EthereumMultinodeClient) SetDefaultWalletByAddress(address common.Address) error + func (e *EthereumMultinodeClient) SetID(id int) + func (e *EthereumMultinodeClient) SetWallets(wallets []*EthereumWallet) + func (e *EthereumMultinodeClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, logs chan<- types.Log) (ethereum.Subscription, error) + func (e *EthereumMultinodeClient) SubscribeNewHeaders(ctx context.Context, headerChan chan *SafeEVMHeader) (ethereum.Subscription, error) + func (e *EthereumMultinodeClient) SwitchNode(clientID int) error + func (e *EthereumMultinodeClient) SyncNonce(c EVMClient) + func (e *EthereumMultinodeClient) TransactionOpts(from *EthereumWallet) (*bind.TransactOpts, error) + func (e *EthereumMultinodeClient) WaitForEvents() error + func (e *EthereumMultinodeClient) WaitForFinalizedTx(txHash common.Hash) (*big.Int, time.Time, error) + type EthereumWallet struct + func NewEthereumWallet(pk string) (*EthereumWallet, error) + func (e *EthereumWallet) Address() string + func (e *EthereumWallet) PrivateKey() string + func (e *EthereumWallet) RawPrivateKey() interface{} + type EventConfirmer struct + func NewEventConfirmer(eventName string, client EVMClient, event *types.Log, minConfirmations int, ...) *EventConfirmer + func (e *EventConfirmer) Complete() bool + func (e *EventConfirmer) ReceiveHeader(header NodeHeader) error + func (e *EventConfirmer) Wait() error + type FantomClient struct + type FantomMultinodeClient struct + type FinalizedHeader struct + FinalizedAt atomic.Value + LatestFinalized atomic.Value + func (f *FinalizedHeader) Complete() bool + func (f *FinalizedHeader) ReceiveHeader(header NodeHeader) error + func (f *FinalizedHeader) Wait() error + type GasEstimations struct + GasFeeCap *big.Int + GasPrice *big.Int + GasTipCap *big.Int + GasUnits uint64 + TotalGasCost *big.Int + type GasStats struct + ClientTXs []TXGasData + NodeID int + SeenHashes map[string]bool + TotalGasUsed int64 + func NewGasStats(nodeID int) *GasStats + func (g *GasStats) AddClientTXData(data TXGasData) + func (g *GasStats) PrintStats() + type GnosisClient struct + type GnosisMultinodeClient struct + type HeaderEventSubscription interface + Complete func() bool + ReceiveHeader func(header NodeHeader) error + Wait func() error + type InstantConfirmer struct + func NewInstantConfirmer(client EVMClient, txHash common.Hash, confirmedChan chan bool, _ chan error, ...) *InstantConfirmer + func (l *InstantConfirmer) Complete() bool + func (l *InstantConfirmer) ReceiveHeader(_ NodeHeader) error + func (l *InstantConfirmer) Wait() error + type KlaytnClient struct + func (k *KlaytnClient) EstimateGas(callData ethereum.CallMsg) (GasEstimations, error) + type KlaytnMultinodeClient struct + type KromaClient struct + func (o *KromaClient) EstimateGas(callData ethereum.CallMsg) (GasEstimations, error) + type KromaMultinodeClient struct + type LineaClient struct + type LineaMultinodeClient struct + type MetisClient struct + type MetisMultinodeClient struct + type NodeHeader struct + NodeID int + type NonceSettings struct + NonceMu *sync.Mutex + Nonces map[string]uint64 + type OptimismClient struct + func (o *OptimismClient) EstimateGas(callData ethereum.CallMsg) (GasEstimations, error) + type OptimismMultinodeClient struct + type PolygonClient struct + type PolygonMultinodeClient struct + type PolygonZkEvmClient struct + type PolygonZkEvmMultinodeClient struct + type QuorumClient struct + type QuorumMultinodeClient struct + type RSKClient struct + type RSKMultinodeClient struct + type SafeEVMHeader struct + BaseFee *big.Int + Hash common.Hash + Number *big.Int + Timestamp time.Time + func (h *SafeEVMHeader) UnmarshalJSON(bs []byte) error + type ScrollClient struct + type ScrollMultinodeClient struct + type StrDuration struct + func (d *StrDuration) MarshalJSON() ([]byte, error) + func (d *StrDuration) UnmarshalJSON(b []byte) error + func (d *StrDuration) UnmarshalText(b []byte) error + func (d StrDuration) MarshalText() ([]byte, error) + type TXGasData struct + CumulativeGasUsed uint64 + GasLimit uint64 + GasPrice uint64 + GasUsed uint64 + TXHash string + Value uint64 + type TransactionConfirmer struct + func NewTransactionConfirmer(client EVMClient, tx *types.Transaction, minConfirmations int, ...) *TransactionConfirmer + func (t *TransactionConfirmer) Complete() bool + func (t *TransactionConfirmer) ReceiveHeader(header NodeHeader) error + func (t *TransactionConfirmer) Wait() error + type TransactionFinalizer struct + FinalizedAt time.Time + FinalizedBy *big.Int + func NewTransactionFinalizer(client EVMClient, txHdr *SafeEVMHeader, txHash common.Hash) *TransactionFinalizer + func (tf *TransactionFinalizer) Complete() bool + func (tf *TransactionFinalizer) ReceiveHeader(header NodeHeader) error + func (tf *TransactionFinalizer) Wait() error + type WeMixClient struct + type WeMixMultinodeClient struct