{"modulePath":"github.com/GoPlugin/pluginV2","version":"v0.5.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package client\n\n## Constants\n\n```go\nconst (\n\tNonceTooLow = iota\n\t// Nethermind specific error. Nethermind throws a NonceGap error when the tx nonce is greater than current_nonce + tx_count_in_mempool, instead of keeping the tx in mempool.\n\t// See: https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.TxPool/Filters/GapNonceFilter.cs\n\tNonceTooHigh\n\tReplacementTransactionUnderpriced\n\tLimitReached\n\tTransactionAlreadyInMempool\n\tTerminallyUnderpriced\n\tInsufficientEth\n\tTxFeeExceedsCap\n\t// Note: L2FeeTooLow/L2FeeTooHigh/L2Full have a very specific meaning specific\n\t// to L2s (Arbitrum and clones). Do not implement this for non-L2\n\t// chains. This is potentially confusing because some RPC nodes e.g.\n\t// Nethermind implement an error called `FeeTooLow` which has distinct\n\t// meaning from this one.\n\tL2FeeTooLow\n\tL2FeeTooHigh\n\tL2Full\n\tTransactionAlreadyMined\n\tFatal\n)\n```\n\n```go\nconst (\n\t// NodeStateUndialed is the first state of a virgin node\n\tNodeStateUndialed = NodeState(iota)\n\t// NodeStateDialed is after a node has successfully dialed but before it has verified the correct chain ID\n\tNodeStateDialed\n\t// NodeStateInvalidChainID is after chain ID verification failed\n\tNodeStateInvalidChainID\n\t// NodeStateAlive is a healthy node after chain ID verification succeeded\n\tNodeStateAlive\n\t// NodeStateUnreachable is a node that cannot be dialed or has disconnected\n\tNodeStateUnreachable\n\t// NodeStateOutOfSync is a node that is accepting connections but exceeded\n\t// the failure threshold without sending any new heads. It will be\n\t// disconnected, then put into a revive loop and re-awakened after redial\n\t// if a new head arrives\n\tNodeStateOutOfSync\n\t// NodeStateUnusable is a sendonly node that has an invalid URL that can never be reached\n\tNodeStateUnusable\n\t// NodeStateClosed is after the connection has been closed and the node is at the end of its lifecycle\n\tNodeStateClosed\n)\n```\n\n```go\nconst (\n\tNodeSelectionMode_HighestHead     = \"HighestHead\"\n\tNodeSelectionMode_RoundRobin      = \"RoundRobin\"\n\tNodeSelectionMode_TotalDifficulty = \"TotalDifficulty\"\n)\n```\n\n```go\nconst NullClientChainID = 0\n```\nNullClientChainID the ChainID that nullclient will return 0 is never used as a real chain ID so makes sense as a dummy value here\n\n## Variables\n\n```go\nvar (\n\t// PromEVMPoolRPCNodeStates reports current RPC node state\n\tPromEVMPoolRPCNodeStates = promauto.NewGaugeVec(prometheus.GaugeOpts{\n\t\tName: \"evm_pool_rpc_node_states\",\n\t\tHelp: \"The number of RPC nodes currently in the given state for the given chain\",\n\t}, []string{\"evmChainID\", \"state\"})\n)\n```\n\n## Functions\n\n```go\nfunc ContextWithDefaultTimeoutFromChan(chStop \u003c-chan struct{}) (ctx context.Context, cancel context.CancelFunc)\n```\n\n```go\nfunc NewClientWithNodes(logger logger.Logger, cfg PoolConfig, primaryNodes []Node, sendOnlyNodes []SendOnlyNode, chainID *big.Int) (*client, error)\n```\nNewClientWithNodes instantiates a client from a list of nodes Currently only supports one primary\n\n```go\nfunc ToBlockNumArg(number *big.Int) string\n```\n\n## Types\n\n```go\ntype BatchSender interface {\n\tBatchCallContext(ctx context.Context, b []rpc.BatchElem) error\n}\n```\n\n```go\ntype CallArgs struct {\n\tFrom common.Address `json:\"from\"`\n\tTo   common.Address `json:\"to\"`\n\tData hexutil.Bytes  `json:\"data\"`\n}\n```\nCallArgs represents the data used to call the balance method of a contract. \"To\" is the address of the ERC contract. \"Data\" is the message sent to the contract. \"From\" is the sender address.\n\n```go\ntype Client interface {\n\tDial(ctx context.Context) error\n\tClose()\n\tChainID() *big.Int\n\t// NodeStates returns a map of node Name-\u003enode state\n\t// It might be nil or empty, e.g. for mock clients etc\n\tNodeStates() map[string]string\n\n\tGetERC20Balance(ctx context.Context, address common.Address, contractAddress common.Address) (*big.Int, error)\n\tGetLINKBalance(ctx context.Context, linkAddress common.Address, address common.Address) (*assets.Link, error)\n\tGetEthBalance(ctx context.Context, account common.Address, blockNumber *big.Int) (*assets.Eth, error)\n\n\t// Wrapped RPC methods\n\tCallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error\n\tBatchCallContext(ctx context.Context, b []rpc.BatchElem) error\n\t// BatchCallContextAll calls BatchCallContext for every single node including\n\t// sendonlys.\n\t// CAUTION: This should only be used for mass re-transmitting transactions, it\n\t// might have unexpected effects to use it for anything else.\n\tBatchCallContextAll(ctx context.Context, b []rpc.BatchElem) error\n\n\t// HeadByNumber and HeadByHash is a reimplemented version due to a\n\t// difference in how block header hashes are calculated by Parity nodes\n\t// running on Kovan, Avalanche and potentially others. We have to return our own wrapper type to capture the\n\t// correct hash from the RPC response.\n\tHeadByNumber(ctx context.Context, n *big.Int) (*evmtypes.Head, error)\n\tHeadByHash(ctx context.Context, n common.Hash) (*evmtypes.Head, error)\n\tSubscribeNewHead(ctx context.Context, ch chan\u003c- *evmtypes.Head) (ethereum.Subscription, error)\n\n\t// Wrapped Geth client methods\n\tSendTransaction(ctx context.Context, tx *types.Transaction) error\n\tPendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)\n\tPendingNonceAt(ctx context.Context, account common.Address) (uint64, error)\n\tNonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)\n\tTransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)\n\tBlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)\n\tBlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)\n\tBalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)\n\tFilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)\n\tSubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan\u003c- types.Log) (ethereum.Subscription, error)\n\tEstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error)\n\tSuggestGasPrice(ctx context.Context) (*big.Int, error)\n\tCallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)\n\tCodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)\n\n\t// bind.ContractBackend methods\n\tHeaderByNumber(context.Context, *big.Int) (*types.Header, error)\n\tHeaderByHash(context.Context, common.Hash) (*types.Header, error)\n\tSuggestGasTipCap(ctx context.Context) (*big.Int, error)\n}\n```\nClient is the interface used to interact with an ethereum node.\n\n```go\ntype ClientErrors = map[int]*regexp.Regexp\n```\n\n```go\ntype JsonError struct {\n\tCode    int         `json:\"code\"`\n\tMessage string      `json:\"message\"`\n\tData    interface{} `json:\"data,omitempty\"`\n}\n```\ngo-ethereum@v1.10.0/rpc/json.go\n\n```go\nfunc ExtractRPCError(baseErr error) (*JsonError, error)\n```\nExtractRPCError attempts to extract a full JsonError (including revert reason details) from an error returned by a CallContract to an external RPC. As per [https://github.com/ethereum/go-ethereum/blob/c49e065fea78a5d3759f7853a608494913e5824e/internal/ethapi/api.go#L974](https://github.com/ethereum/go-ethereum/blob/c49e065fea78a5d3759f7853a608494913e5824e/internal/ethapi/api.go#L974) CallContract server side for a revert will return an error which contains either:\n\n  - The error directly from the EVM if there's no data (no revert reason, like an index out of bounds access) which when marshalled will only have a Message.\n  - An error which implements rpc.DataError which when marshalled will have a Data field containing the execution result. If the revert not a custom Error (solidity \u003e= 0.8.0), like require(1 == 2, \"revert\"), then geth and forks will automatically parse the string and put it in the message. If its a custom error, it's up to the client to decode the Data field which will be the abi encoded data of the custom error, i.e. revert MyCustomError(10) -\u003e keccak(MyCustomError(uint256))\\[:4] || abi.encode(10).\n\nHowever, it appears that RPCs marshal this in different ways into a JsonError object received client side, some adding \"Reverted\" prefixes, removing the method signature etc. To avoid RPC specific parsing and support custom errors we return the full object returned from the RPC with a String() method that stringifies all fields for logging so no information is lost. Some examples: kovan (parity) { \"error\": { \"code\" : -32015, \"data\": \"Reverted 0xABC123...\", \"message\": \"VM execution error.\" } } // revert reason always omitted from message. rinkeby / ropsten (geth) { \"error\":  { \"code\": 3, \"data\": \"0xABC123...\", \"message\": \"execution reverted: hello world\" } } // revert reason automatically parsed if a simple require and included in message.\n\n```go\nfunc ExtractRPCErrorOrNil(err error) *JsonError\n```\n\n```go\nfunc (err *JsonError) Error() string\n```\n\n```go\nfunc (err *JsonError) String() string\n```\n\n```go\ntype Node interface {\n\tStart(ctx context.Context) error\n\tClose() error\n\n\t// State returns NodeState\n\tState() NodeState\n\t// StateAndLatest returns NodeState with the latest received block number \u0026 total difficulty.\n\tStateAndLatest() (state NodeState, blockNum int64, totalDifficulty *utils.Big)\n\t// Name is a unique identifier for this node.\n\tName() string\n\tChainID() *big.Int\n\n\tCallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error\n\tBatchCallContext(ctx context.Context, b []rpc.BatchElem) error\n\tSendTransaction(ctx context.Context, tx *types.Transaction) error\n\tPendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)\n\tPendingNonceAt(ctx context.Context, account common.Address) (uint64, error)\n\tNonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)\n\tTransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)\n\tBlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)\n\tBlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)\n\tBalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)\n\tFilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)\n\tSubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan\u003c- types.Log) (ethereum.Subscription, error)\n\tEstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error)\n\tSuggestGasPrice(ctx context.Context) (*big.Int, error)\n\tCallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)\n\tCodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)\n\tHeaderByNumber(context.Context, *big.Int) (*types.Header, error)\n\tHeaderByHash(context.Context, common.Hash) (*types.Header, error)\n\tSuggestGasTipCap(ctx context.Context) (*big.Int, error)\n\tEthSubscribe(ctx context.Context, channel chan\u003c- *evmtypes.Head, args ...interface{}) (ethereum.Subscription, error)\n\n\tString() string\n}\n```\nNode represents a client that connects to an ethereum-compatible RPC node\n\n```go\nfunc NewNode(nodeCfg NodeConfig, lggr logger.Logger, wsuri url.URL, httpuri *url.URL, name string, id int32, chainID *big.Int) Node\n```\nNewNode returns a new \\*node as Node\n\n```go\ntype NodeConfig interface {\n\tNodeNoNewHeadsThreshold() time.Duration\n\tNodePollFailureThreshold() uint32\n\tNodePollInterval() time.Duration\n\tNodeSelectionMode() string\n\tNodeSyncThreshold() uint32\n}\n```\nNodeConfig allows configuration of the node\n\n```go\ntype NodeSelector interface {\n\t// Select returns a Node, or nil if none can be selected.\n\t// Implementation must be thread-safe.\n\tSelect() Node\n\t// Name returns the strategy name, e.g. \"HighestHead\" or \"RoundRobin\"\n\tName() string\n}\n```\nNodeSelector represents a strategy to select the next node from the pool.\n\n```go\nfunc NewHighestHeadNodeSelector(nodes []Node) NodeSelector\n```\n\n```go\nfunc NewRoundRobinSelector(nodes []Node) NodeSelector\n```\n\n```go\nfunc NewTotalDifficultyNodeSelector(nodes []Node) NodeSelector\n```\n\n```go\ntype NodeState int\n```\nNodeState represents the current state of the node Node is a FSM (finite state machine)\n\n```go\nfunc (n NodeState) GoString() string\n```\nGoString prints a prettier state\n\n```go\nfunc (n NodeState) String() string\n```\n\n```go\ntype NullClient struct {\n\t// contains filtered or unexported fields\n}\n```\nNullClient satisfies the Client but has no side effects\n\n```go\nfunc NewNullClient(cid *big.Int, lggr logger.Logger) *NullClient\n```\n\n```go\nfunc (nc *NullClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)\n```\n\n```go\nfunc (nc *NullClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error\n```\n\n```go\nfunc (nc *NullClient) BatchCallContextAll(ctx context.Context, b []rpc.BatchElem) error\n```\nBatchCallContextAll implements evmclient.Client interface\n\n```go\nfunc (nc *NullClient) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)\n```\n\n```go\nfunc (nc *NullClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)\n```\n\n```go\nfunc (nc *NullClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error\n```\n\n```go\nfunc (nc *NullClient) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)\n```\n\n```go\nfunc (nc *NullClient) ChainID() *big.Int\n```\n\n```go\nfunc (nc *NullClient) Close()\n```\n\n```go\nfunc (nc *NullClient) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)\n```\n\n```go\nfunc (nc *NullClient) Dial(context.Context) error\n```\n\n```go\nfunc (nc *NullClient) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error)\n```\n\n```go\nfunc (nc *NullClient) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)\n```\n\n```go\nfunc (nc *NullClient) GetERC20Balance(ctx context.Context, address common.Address, contractAddress common.Address) (*big.Int, error)\n```\n\n```go\nfunc (nc *NullClient) GetEthBalance(context.Context, common.Address, *big.Int) (*assets.Eth, error)\n```\n\n```go\nfunc (nc *NullClient) GetLINKBalance(ctx context.Context, linkAddress common.Address, address common.Address) (*assets.Link, error)\n```\n\n```go\nfunc (nc *NullClient) HeadByHash(ctx context.Context, h common.Hash) (*evmtypes.Head, error)\n```\n\n```go\nfunc (nc *NullClient) HeadByNumber(ctx context.Context, n *big.Int) (*evmtypes.Head, error)\n```\n\n```go\nfunc (nc *NullClient) HeaderByHash(ctx context.Context, h common.Hash) (*types.Header, error)\n```\n\n```go\nfunc (nc *NullClient) HeaderByNumber(ctx context.Context, n *big.Int) (*types.Header, error)\n```\n\n```go\nfunc (nc *NullClient) NodeStates() map[string]string\n```\nNodeStates implements evmclient.Client\n\n```go\nfunc (nc *NullClient) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)\n```\n\n```go\nfunc (nc *NullClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)\n```\n\n```go\nfunc (nc *NullClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)\n```\n\n```go\nfunc (nc *NullClient) SendTransaction(ctx context.Context, tx *types.Transaction) error\n```\n\n```go\nfunc (nc *NullClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan\u003c- types.Log) (ethereum.Subscription, error)\n```\n\n```go\nfunc (nc *NullClient) SubscribeNewHead(ctx context.Context, ch chan\u003c- *evmtypes.Head) (ethereum.Subscription, error)\n```\n\n```go\nfunc (nc *NullClient) SuggestGasPrice(ctx context.Context) (*big.Int, error)\n```\n\n```go\nfunc (nc *NullClient) SuggestGasTipCap(ctx context.Context) (tipCap *big.Int, err error)\n```\n\n```go\nfunc (nc *NullClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)\n```\n\n```go\ntype Pool struct {\n\tutils.StartStopOnce\n\t// contains filtered or unexported fields\n}\n```\nPool represents an abstraction over one or more primary nodes It is responsible for liveness checking and balancing queries across live nodes\n\n```go\nfunc NewPool(logger logger.Logger, cfg PoolConfig, nodes []Node, sendonlys []SendOnlyNode, chainID *big.Int) *Pool\n```\n\n```go\nfunc (p *Pool) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)\n```\n\n```go\nfunc (p *Pool) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error\n```\n\n```go\nfunc (p *Pool) BatchCallContextAll(ctx context.Context, b []rpc.BatchElem) error\n```\nBatchCallContextAll calls BatchCallContext for every single node including sendonlys. CAUTION: This should only be used for mass re-transmitting transactions, it might have unexpected effects to use it for anything else.\n\n```go\nfunc (p *Pool) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)\n```\n\n```go\nfunc (p *Pool) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)\n```\n\n```go\nfunc (p *Pool) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error\n```\n\n```go\nfunc (p *Pool) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)\n```\n\n```go\nfunc (p *Pool) ChainID() *big.Int\n```\n\n```go\nfunc (p *Pool) Close() error\n```\nClose tears down the pool and closes all nodes\n\n```go\nfunc (p *Pool) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)\n```\n\n```go\nfunc (p *Pool) Dial(ctx context.Context) error\n```\nDial starts every node in the pool\n\nNodes handle their own redialing and runloops, so this function does not return any error if the nodes aren't available\n\n```go\nfunc (p *Pool) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error)\n```\n\n```go\nfunc (p *Pool) EthSubscribe(ctx context.Context, channel chan\u003c- *evmtypes.Head, args ...interface{}) (ethereum.Subscription, error)\n```\nEthSubscribe implements evmclient.Client\n\n```go\nfunc (p *Pool) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)\n```\n\n```go\nfunc (p *Pool) HeaderByHash(ctx context.Context, h common.Hash) (*types.Header, error)\n```\n\n```go\nfunc (p *Pool) HeaderByNumber(ctx context.Context, n *big.Int) (*types.Header, error)\n```\nbind.ContractBackend methods\n\n```go\nfunc (p *Pool) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)\n```\n\n```go\nfunc (p *Pool) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)\n```\n\n```go\nfunc (p *Pool) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)\n```\n\n```go\nfunc (p *Pool) SendTransaction(ctx context.Context, tx *types.Transaction) error\n```\nWrapped Geth client methods\n\n```go\nfunc (p *Pool) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan\u003c- types.Log) (ethereum.Subscription, error)\n```\n\n```go\nfunc (p *Pool) SuggestGasPrice(ctx context.Context) (*big.Int, error)\n```\n\n```go\nfunc (p *Pool) SuggestGasTipCap(ctx context.Context) (*big.Int, error)\n```\n\n```go\nfunc (p *Pool) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)\n```\n\n```go\ntype PoolConfig interface {\n\tNodeSelectionMode() string\n\tNodeNoNewHeadsThreshold() time.Duration\n}\n```\nPoolConfig represents settings for the Pool\n\n```go\ntype SendError struct {\n\t// contains filtered or unexported fields\n}\n```\nfatal means this transaction can never be accepted even with a different nonce or higher gas price\n\n```go\nfunc NewFatalSendError(e error) *SendError\n```\n\n```go\nfunc NewSendError(e error) *SendError\n```\n\n```go\nfunc NewSendErrorS(s string) *SendError\n```\n\n```go\nfunc (s *SendError) CauseStr() string\n```\nCauseStr returns the string of the original error\n\n```go\nfunc (s *SendError) Error() string\n```\n\n```go\nfunc (s *SendError) Fatal() bool\n```\nFatal indicates whether the error should be considered fatal or not Fatal errors mean that no matter how many times the send is retried, no node will ever accept it\n\n```go\nfunc (s *SendError) IsInsufficientEth() bool\n```\n\n```go\nfunc (s *SendError) IsL2FeeTooHigh() bool\n```\nIsL2FeeTooHigh is an l2-specific error returned when total fee is too high\n\n```go\nfunc (s *SendError) IsL2Full() bool\n```\nIsL2Full is an l2-specific error returned when the queue or mempool is full.\n\n```go\nfunc (s *SendError) IsNonceTooHighError() bool\n```\n\n```go\nfunc (s *SendError) IsNonceTooLowError() bool\n```\n\n```go\nfunc (s *SendError) IsReplacementUnderpriced() bool\n```\nIsReplacementUnderpriced indicates that a transaction already exists in the mempool with this nonce but a different gas price or payload\n\n```go\nfunc (s *SendError) IsTemporarilyUnderpriced() bool\n```\n\n```go\nfunc (s *SendError) IsTerminallyUnderpriced() bool\n```\nIsTerminallyUnderpriced indicates that this transaction is so far underpriced the node won't even accept it in the first place\n\n```go\nfunc (s *SendError) IsTimeout() bool\n```\nIsTimeout indicates if the error was caused by an exceeded context deadline\n\n```go\nfunc (s *SendError) IsTransactionAlreadyInMempool() bool\n```\nGeth/parity returns this error if the transaction is already in the node's mempool\n\n```go\nfunc (s *SendError) IsTransactionAlreadyMined() bool\n```\nIsTransactionAlreadyMined - Harmony returns this error if the transaction has already been mined\n\n```go\nfunc (s *SendError) IsTxFeeExceedsCap() bool\n```\nIsTxFeeExceedsCap returns true if the transaction and gas price are combined in some way that makes the total transaction too expensive for the eth node to accept at all. No amount of retrying at this or higher gas prices can ever succeed.\n\n```go\nfunc (s *SendError) L2FeeTooLow() bool\n```\nL2FeeTooLow is an l2-specific error returned when total fee is too low\n\n```go\ntype SendOnlyNode interface {\n\t// Start may attempt to connect to the node, but should only return error for misconfiguration - never for temporary errors.\n\tStart(context.Context) error\n\tClose() error\n\n\tChainID() (chainID *big.Int)\n\n\tSendTransaction(ctx context.Context, tx *types.Transaction) error\n\tBatchCallContext(ctx context.Context, b []rpc.BatchElem) error\n\n\tString() string\n\t// State returns NodeState\n\tState() NodeState\n\t// Name is a unique identifier for this node.\n\tName() string\n}\n```\nSendOnlyNode represents one ethereum node used as a sendonly\n\n```go\nfunc NewSendOnlyNode(lggr logger.Logger, httpuri url.URL, name string, chainID *big.Int) SendOnlyNode\n```\nNewSendOnlyNode returns a new sendonly node\n\n```go\ntype SimulatedBackendClient struct {\n\t// contains filtered or unexported fields\n}\n```\nSimulatedBackendClient is an Client implementation using a simulated blockchain backend. Note that not all RPC methods are implemented here.\n\n```go\nfunc NewSimulatedBackendClient(t testing.TB, b *backends.SimulatedBackend, chainId *big.Int) *SimulatedBackendClient\n```\nNewSimulatedBackendClient creates an eth client backed by a simulated backend.\n\n```go\nfunc (c *SimulatedBackendClient) Backend() *backends.SimulatedBackend\n```\n\n```go\nfunc (c *SimulatedBackendClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)\n```\nBalanceAt gets balance as of a specified block.\n\n```go\nfunc (c *SimulatedBackendClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error\n```\nBatchCallContext makes a batch rpc call.\n\n```go\nfunc (c *SimulatedBackendClient) BatchCallContextAll(ctx context.Context, b []rpc.BatchElem) error\n```\nBatchCallContextAll makes a batch rpc call.\n\n```go\nfunc (c *SimulatedBackendClient) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)\n```\nBlockByNumber returns a geth block type.\n\n```go\nfunc (c *SimulatedBackendClient) BlockByNumber(ctx context.Context, n *big.Int) (*types.Block, error)\n```\nBlockByNumber returns a geth block type.\n\n```go\nfunc (c *SimulatedBackendClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error\n```\nCallContext mocks the ethereum client RPC calls used by chainlink, copying the return value into result.\n\n```go\nfunc (c *SimulatedBackendClient) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)\n```\nCallContract calls a contract.\n\n```go\nfunc (c *SimulatedBackendClient) ChainID() *big.Int\n```\nChainID returns the ethereum ChainID.\n\n```go\nfunc (c *SimulatedBackendClient) Close()\n```\nClose does nothing. We ought not close the underlying backend here since other simulated clients might still be using it\n\n```go\nfunc (c *SimulatedBackendClient) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)\n```\nCodeAt gets the code associated with an account as of a specified block.\n\n```go\nfunc (c *SimulatedBackendClient) Commit() common.Hash\n```\nCommit imports all the pending transactions as a single block and starts a fresh new state.\n\n```go\nfunc (c *SimulatedBackendClient) Dial(context.Context) error\n```\nDial noop for the sim.\n\n```go\nfunc (c *SimulatedBackendClient) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)\n```\nEstimateGas estimates gas for a msg.\n\n```go\nfunc (c *SimulatedBackendClient) FilterLogs(ctx context.Context, q ethereum.FilterQuery) (logs []types.Log, err error)\n```\nFilterLogs returns all logs that respect the passed filter query.\n\n```go\nfunc (c *SimulatedBackendClient) GetERC20Balance(ctx context.Context, address common.Address, contractAddress common.Address) (balance *big.Int, err error)\n```\nGetERC20Balance returns the balance of the given address for the token contract address.\n\n```go\nfunc (c *SimulatedBackendClient) GetEthBalance(ctx context.Context, account common.Address, blockNumber *big.Int) (*assets.Eth, error)\n```\nGetEthBalance helper to get eth balance\n\n```go\nfunc (c *SimulatedBackendClient) GetLINKBalance(ctx context.Context, linkAddress common.Address, address common.Address) (*assets.Link, error)\n```\nGetLINKBalance get link balance.\n\n```go\nfunc (c *SimulatedBackendClient) HeadByHash(ctx context.Context, h common.Hash) (*evmtypes.Head, error)\n```\nHeadByHash returns our own header type.\n\n```go\nfunc (c *SimulatedBackendClient) HeadByNumber(ctx context.Context, n *big.Int) (*evmtypes.Head, error)\n```\nHeadByNumber returns our own header type.\n\n```go\nfunc (c *SimulatedBackendClient) HeaderByHash(ctx context.Context, h common.Hash) (*types.Header, error)\n```\n\n```go\nfunc (c *SimulatedBackendClient) HeaderByNumber(ctx context.Context, n *big.Int) (*types.Header, error)\n```\nHeaderByNumber returns the geth header type.\n\n```go\nfunc (c *SimulatedBackendClient) NodeStates() map[string]string\n```\nNodeStates implements evmclient.Client\n\n```go\nfunc (c *SimulatedBackendClient) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)\n```\nNonceAt gets nonce as of a specified block.\n\n```go\nfunc (c *SimulatedBackendClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)\n```\nPendingCodeAt gets the latest code.\n\n```go\nfunc (c *SimulatedBackendClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)\n```\nPendingNonceAt gets pending nonce i.e. mempool nonce.\n\n```go\nfunc (c *SimulatedBackendClient) SendTransaction(ctx context.Context, tx *types.Transaction) error\n```\nSendTransaction sends a transaction.\n\n```go\nfunc (c *SimulatedBackendClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, channel chan\u003c- types.Log) (ethereum.Subscription, error)\n```\nSubscribeFilterLogs registers a subscription for push notifications of logs from a given address.\n\n```go\nfunc (c *SimulatedBackendClient) SubscribeNewHead(\n\tctx context.Context,\n\tchannel chan\u003c- *evmtypes.Head,\n) (ethereum.Subscription, error)\n```\nSubscribeNewHead registers a subscription for push notifications of new blocks. Note the sim's API only accepts types.Head so we have this goroutine to convert those into evmtypes.Head.\n\n```go\nfunc (c *SimulatedBackendClient) SuggestGasPrice(ctx context.Context) (*big.Int, error)\n```\nSuggestGasPrice recommends a gas price.\n\n```go\nfunc (c *SimulatedBackendClient) SuggestGasTipCap(ctx context.Context) (tipCap *big.Int, err error)\n```\nSuggestGasTipCap suggests a gas tip cap.\n\n```go\nfunc (c *SimulatedBackendClient) TransactionReceipt(ctx context.Context, receipt common.Hash) (*types.Receipt, error)\n```\nTransactionReceipt returns the transaction receipt for the given transaction hash.\n\n```go\ntype Subscription interface {\n\tErr() \u003c-chan error\n\tUnsubscribe()\n}\n```\nThis interface only exists so that we can generate a mock for it.  It is identical to \\`ethereum.Subscription\\`.\n\n```go\ntype TxSender interface {\n\tSendTransaction(ctx context.Context, tx *types.Transaction) error\n\tChainID(context.Context) (*big.Int, error)\n}\n```\n\n","path":"github.com/GoPlugin/pluginV2/core/chains/evm/client","name":"client","synopsis":"","isRedistributable":true}
