{"modulePath":"github.com/Evolution404/simcore","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package ethclient\n\nPackage ethclient provides a client for the Ethereum RPC API.\n\n## Types\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\nClient defines typed wrappers for the Ethereum RPC API.\n\n```go\nfunc Dial(rawurl string) (*Client, error)\n```\nDial connects a client to the given URL.\n\n```go\nfunc DialContext(ctx context.Context, rawurl string) (*Client, error)\n```\n\n```go\nfunc NewClient(c *rpc.Client) *Client\n```\nNewClient creates a client that uses the given RPC client.\n\n```go\nfunc (ec *Client) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)\n```\nBalanceAt returns the wei balance of the given account. The block number can be nil, in which case the balance is taken from the latest known block.\n\n```go\nfunc (ec *Client) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)\n```\nBlockByHash returns the given full block.\n\nNote that loading full blocks requires two requests. Use HeaderByHash if you don't need all transactions or uncle headers.\n\n```go\nfunc (ec *Client) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)\n```\nBlockByNumber returns a block from the current canonical chain. If number is nil, the latest known block is returned.\n\nNote that loading full blocks requires two requests. Use HeaderByNumber if you don't need all transactions or uncle headers.\n\n```go\nfunc (ec *Client) BlockNumber(ctx context.Context) (uint64, error)\n```\nBlockNumber returns the most recent block number\n\n```go\nfunc (ec *Client) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)\n```\nCallContract executes a message call transaction, which is directly executed in the VM of the node, but never mined into the blockchain.\n\nblockNumber selects the block height at which the call runs. It can be nil, in which case the code is taken from the latest known block. Note that state from very old blocks might not be available.\n\n```go\nfunc (ec *Client) ChainID(ctx context.Context) (*big.Int, error)\n```\nChainID retrieves the current chain ID for transaction replay protection.\n\n```go\nfunc (ec *Client) Close()\n```\n\n```go\nfunc (ec *Client) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)\n```\nCodeAt returns the contract code of the given account. The block number can be nil, in which case the code is taken from the latest known block.\n\n```go\nfunc (ec *Client) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)\n```\nEstimateGas tries to estimate the gas needed to execute a specific transaction based on the current pending state of the backend blockchain. There is no guarantee that this is the true gas limit requirement as other transactions may be added or removed by miners, but it should provide a basis for setting a reasonable default.\n\n```go\nfunc (ec *Client) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)\n```\nFilterLogs executes a filter query.\n\n```go\nfunc (ec *Client) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)\n```\nHeaderByHash returns the block header with the given hash.\n\n```go\nfunc (ec *Client) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)\n```\nHeaderByNumber returns a block header from the current canonical chain. If number is nil, the latest known header is returned.\n\n```go\nfunc (ec *Client) NetworkID(ctx context.Context) (*big.Int, error)\n```\nNetworkID returns the network ID (also known as the chain ID) for this chain.\n\n```go\nfunc (ec *Client) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)\n```\nNonceAt returns the account nonce of the given account. The block number can be nil, in which case the nonce is taken from the latest known block.\n\n```go\nfunc (ec *Client) PendingBalanceAt(ctx context.Context, account common.Address) (*big.Int, error)\n```\nPendingBalanceAt returns the wei balance of the given account in the pending state.\n\n```go\nfunc (ec *Client) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error)\n```\nPendingCallContract executes a message call transaction using the EVM. The state seen by the contract call is the pending state.\n\n```go\nfunc (ec *Client) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)\n```\nPendingCodeAt returns the contract code of the given account in the pending state.\n\n```go\nfunc (ec *Client) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)\n```\nPendingNonceAt returns the account nonce of the given account in the pending state. This is the nonce that should be used for the next transaction.\n\n```go\nfunc (ec *Client) PendingStorageAt(ctx context.Context, account common.Address, key common.Hash) ([]byte, error)\n```\nPendingStorageAt returns the value of key in the contract storage of the given account in the pending state.\n\n```go\nfunc (ec *Client) PendingTransactionCount(ctx context.Context) (uint, error)\n```\nPendingTransactionCount returns the total number of transactions in the pending state.\n\n```go\nfunc (ec *Client) SendTransaction(ctx context.Context, tx *types.Transaction) error\n```\nSendTransaction injects a signed transaction into the pending pool for execution.\n\nIf the transaction was a contract creation use the TransactionReceipt method to get the contract address after the transaction has been mined.\n\n```go\nfunc (ec *Client) StorageAt(ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error)\n```\nStorageAt returns the value of key in the contract storage of the given account. The block number can be nil, in which case the value is taken from the latest known block.\n\n```go\nfunc (ec *Client) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan\u003c- types.Log) (ethereum.Subscription, error)\n```\nSubscribeFilterLogs subscribes to the results of a streaming filter query.\n\n```go\nfunc (ec *Client) SubscribeNewHead(ctx context.Context, ch chan\u003c- *types.Header) (ethereum.Subscription, error)\n```\nSubscribeNewHead subscribes to notifications about the current blockchain head on the given channel.\n\n```go\nfunc (ec *Client) SuggestGasPrice(ctx context.Context) (*big.Int, error)\n```\nSuggestGasPrice retrieves the currently suggested gas price to allow a timely execution of a transaction.\n\n```go\nfunc (ec *Client) SuggestGasTipCap(ctx context.Context) (*big.Int, error)\n```\nSuggestGasTipCap retrieves the currently suggested gas tip cap after 1559 to allow a timely execution of a transaction.\n\n```go\nfunc (ec *Client) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error)\n```\nSyncProgress retrieves the current progress of the sync algorithm. If there's no sync currently running, it returns nil.\n\n```go\nfunc (ec *Client) TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error)\n```\nTransactionByHash returns the transaction with the given hash.\n\n```go\nfunc (ec *Client) TransactionCount(ctx context.Context, blockHash common.Hash) (uint, error)\n```\nTransactionCount returns the total number of transactions in the given block.\n\n```go\nfunc (ec *Client) TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error)\n```\nTransactionInBlock returns a single transaction at index in the given block.\n\n```go\nfunc (ec *Client) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)\n```\nTransactionReceipt returns the receipt of a transaction by transaction hash. Note that the receipt is not available for pending transactions.\n\n```go\nfunc (ec *Client) TransactionSender(ctx context.Context, tx *types.Transaction, block common.Hash, index uint) (common.Address, error)\n```\nTransactionSender returns the sender address of the given transaction. The transaction must be known to the remote node and included in the blockchain at the given block and index. The sender is the one derived by the protocol at the time of inclusion.\n\nThere is a fast-path for transactions retrieved by TransactionByHash and TransactionInBlock. Getting their sender address can be done without an RPC interaction.\n\n","path":"github.com/Evolution404/simcore/ethclient","name":"ethclient","synopsis":"Package ethclient provides a client for the Ethereum RPC API.","isRedistributable":true}
