{"modulePath":"github.com/Evolution404/simcore","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package ethapi\n\nPackage ethapi implements the general Ethereum API functions.\n\n## Functions\n\n```go\nfunc AccessList(ctx context.Context, b Backend, blockNrOrHash rpc.BlockNumberOrHash, args TransactionArgs) (acl types.AccessList, gasUsed uint64, vmErr error, err error)\n```\nAccessList creates an access list for the given transaction. If the accesslist creation fails an error is returned. If the transaction itself fails, an vmErr is returned.\n\n```go\nfunc DoCall(ctx context.Context, b Backend, args TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *StateOverride, timeout time.Duration, globalGasCap uint64) (*core.ExecutionResult, error)\n```\n\n```go\nfunc DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash, gasCap uint64) (hexutil.Uint64, error)\n```\n\n```go\nfunc GetAPIs(apiBackend Backend) []rpc.API\n```\n\n```go\nfunc RPCMarshalBlock(block *types.Block, inclTx bool, fullTx bool, config *params.ChainConfig) (map[string]interface{}, error)\n```\nRPCMarshalBlock converts the given block to the RPC output which depends on fullTx. If inclTx is true transactions are returned. When fullTx is true the returned block contains full transaction details, otherwise it will only contain transaction hashes.\n\n```go\nfunc RPCMarshalHeader(head *types.Header) map[string]interface{}\n```\nRPCMarshalHeader converts the given header to the RPC output .\n\n```go\nfunc SubmitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (common.Hash, error)\n```\nSubmitTransaction is a helper function that submits tx to txPool and logs a message.\n\n## Types\n\n```go\ntype AccountResult struct {\n\tAddress      common.Address  `json:\"address\"`\n\tAccountProof []string        `json:\"accountProof\"`\n\tBalance      *hexutil.Big    `json:\"balance\"`\n\tCodeHash     common.Hash     `json:\"codeHash\"`\n\tNonce        hexutil.Uint64  `json:\"nonce\"`\n\tStorageHash  common.Hash     `json:\"storageHash\"`\n\tStorageProof []StorageResult `json:\"storageProof\"`\n}\n```\nResult structs for GetProof\n\n```go\ntype AddrLocker struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (l *AddrLocker) LockAddr(address common.Address)\n```\nLockAddr locks an account's mutex. This is used to prevent another tx getting the same nonce until the lock is released. The mutex prevents the (an identical nonce) from being read again during the time that the first transaction is being signed.\n\n```go\nfunc (l *AddrLocker) UnlockAddr(address common.Address)\n```\nUnlockAddr unlocks the mutex of the given account.\n\n```go\ntype Backend interface {\n\t// General Ethereum API\n\tSyncProgress() ethereum.SyncProgress\n\n\tSuggestGasTipCap(ctx context.Context) (*big.Int, error)\n\tFeeHistory(ctx context.Context, blockCount int, lastBlock rpc.BlockNumber, rewardPercentiles []float64) (*big.Int, [][]*big.Int, []*big.Int, []float64, error)\n\tChainDb() ethdb.Database\n\tAccountManager() *accounts.Manager\n\tExtRPCEnabled() bool\n\tRPCGasCap() uint64            // global gas cap for eth_call over rpc: DoS protection\n\tRPCEVMTimeout() time.Duration // global timeout for eth_call over rpc: DoS protection\n\tRPCTxFeeCap() float64         // global tx fee cap for all transaction related APIs\n\tUnprotectedAllowed() bool     // allows only for EIP155 transactions.\n\n\t// Blockchain API\n\tSetHead(number uint64)\n\tHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error)\n\tHeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)\n\tHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Header, error)\n\tCurrentHeader() *types.Header\n\tCurrentBlock() *types.Block\n\tBlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)\n\tBlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)\n\tBlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Block, error)\n\tStateAndHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*state.StateDB, *types.Header, error)\n\tStateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *types.Header, error)\n\tGetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error)\n\tGetTd(ctx context.Context, hash common.Hash) *big.Int\n\tGetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header, vmConfig *vm.Config) (*vm.EVM, func() error, error)\n\tSubscribeChainEvent(ch chan\u003c- core.ChainEvent) event.Subscription\n\tSubscribeChainHeadEvent(ch chan\u003c- core.ChainHeadEvent) event.Subscription\n\tSubscribeChainSideEvent(ch chan\u003c- core.ChainSideEvent) event.Subscription\n\n\t// Transaction pool API\n\tSendTx(ctx context.Context, signedTx *types.Transaction) error\n\tGetTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error)\n\tGetPoolTransactions() (types.Transactions, error)\n\tGetPoolTransaction(txHash common.Hash) *types.Transaction\n\tGetPoolNonce(ctx context.Context, addr common.Address) (uint64, error)\n\tStats() (pending int, queued int)\n\tTxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions)\n\tTxPoolContentFrom(addr common.Address) (types.Transactions, types.Transactions)\n\tSubscribeNewTxsEvent(chan\u003c- core.NewTxsEvent) event.Subscription\n\n\t// Filter API\n\tBloomStatus() (uint64, uint64)\n\tGetLogs(ctx context.Context, blockHash common.Hash) ([][]*types.Log, error)\n\tServiceFilter(ctx context.Context, session *bloombits.MatcherSession)\n\tSubscribeLogsEvent(ch chan\u003c- []*types.Log) event.Subscription\n\tSubscribePendingLogsEvent(ch chan\u003c- []*types.Log) event.Subscription\n\tSubscribeRemovedLogsEvent(ch chan\u003c- core.RemovedLogsEvent) event.Subscription\n\n\tChainConfig() *params.ChainConfig\n\tEngine() consensus.Engine\n}\n```\nBackend interface provides the common API services (that are provided by both full and light clients) with access to necessary functions.\n\n```go\ntype ExecutionResult struct {\n\tGas         uint64         `json:\"gas\"`\n\tFailed      bool           `json:\"failed\"`\n\tReturnValue string         `json:\"returnValue\"`\n\tStructLogs  []StructLogRes `json:\"structLogs\"`\n}\n```\nExecutionResult groups all structured logs emitted by the EVM while replaying a transaction in debug mode as well as transaction execution status, the amount of gas used and the return value\n\n```go\ntype OverrideAccount struct {\n\tNonce     *hexutil.Uint64              `json:\"nonce\"`\n\tCode      *hexutil.Bytes               `json:\"code\"`\n\tBalance   **hexutil.Big                `json:\"balance\"`\n\tState     *map[common.Hash]common.Hash `json:\"state\"`\n\tStateDiff *map[common.Hash]common.Hash `json:\"stateDiff\"`\n}\n```\nOverrideAccount indicates the overriding fields of account during the execution of a message call. Note, state and stateDiff can't be specified at the same time. If state is set, message execution will only use the data in the given state. Otherwise if statDiff is set, all diff will be applied first and then execute the call message.\n\n```go\ntype PrivateAccountAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPrivateAccountAPI provides an API to access accounts managed by this node. It offers methods to create, (un)lock en list accounts. Some methods accept passwords and are therefore considered private by default.\n\n```go\nfunc NewPrivateAccountAPI(b Backend, nonceLock *AddrLocker) *PrivateAccountAPI\n```\nNewPrivateAccountAPI create a new PrivateAccountAPI.\n\n```go\nfunc (s *PrivateAccountAPI) DeriveAccount(url string, path string, pin *bool) (accounts.Account, error)\n```\nDeriveAccount requests a HD wallet to derive a new account, optionally pinning it for later reuse.\n\n```go\nfunc (s *PrivateAccountAPI) EcRecover(ctx context.Context, data, sig hexutil.Bytes) (common.Address, error)\n```\nEcRecover returns the address for the account that was used to create the signature. Note, this function is compatible with eth\\_sign and personal\\_sign. As such it recovers the address of: hash = keccak256(\"\\\\x19Ethereum Signed Message:\\\\n\"${message length}${message}) addr = ecrecover(hash, signature)\n\nNote, the signature must conform to the secp256k1 curve R, S and V values, where the V value must be 27 or 28 for legacy reasons.\n\n[https://github.com/Evolution404/simcore/wiki/Management-APIs#personal\\_ecRecover](https://github.com/Evolution404/simcore/wiki/Management-APIs#personal_ecRecover)\n\n```go\nfunc (s *PrivateAccountAPI) ImportRawKey(privkey string, password string) (common.Address, error)\n```\nImportRawKey stores the given hex encoded ECDSA key into the key directory, encrypting it with the passphrase.\n\n```go\nfunc (s *PrivateAccountAPI) InitializeWallet(ctx context.Context, url string) (string, error)\n```\nInitializeWallet initializes a new wallet at the provided URL, by generating and returning a new private key.\n\n```go\nfunc (s *PrivateAccountAPI) ListAccounts() []common.Address\n```\nlistAccounts will return a list of addresses for accounts this node manages.\n\n```go\nfunc (s *PrivateAccountAPI) ListWallets() []rawWallet\n```\nListWallets will return a list of wallets this node manages.\n\n```go\nfunc (s *PrivateAccountAPI) LockAccount(addr common.Address) bool\n```\nLockAccount will lock the account associated with the given address when it's unlocked.\n\n```go\nfunc (s *PrivateAccountAPI) NewAccount(password string) (common.Address, error)\n```\nNewAccount will create a new account and returns the address for the new account.\n\n```go\nfunc (s *PrivateAccountAPI) OpenWallet(url string, passphrase *string) error\n```\nOpenWallet initiates a hardware wallet opening procedure, establishing a USB connection and attempting to authenticate via the provided passphrase. Note, the method may return an extra challenge requiring a second open (e.g. the Trezor PIN matrix challenge).\n\n```go\nfunc (s *PrivateAccountAPI) SendTransaction(ctx context.Context, args TransactionArgs, passwd string) (common.Hash, error)\n```\nSendTransaction will create a transaction from the given arguments and tries to sign it with the key associated with args.From. If the given passwd isn't able to decrypt the key it fails.\n\n```go\nfunc (s *PrivateAccountAPI) Sign(ctx context.Context, data hexutil.Bytes, addr common.Address, passwd string) (hexutil.Bytes, error)\n```\nSign calculates an Ethereum ECDSA signature for: keccack256(\"\\\\x19Ethereum Signed Message:\\\\n\" + len(message) + message))\n\nNote, the produced signature conforms to the secp256k1 curve R, S and V values, where the V value will be 27 or 28 for legacy reasons.\n\nThe key used to calculate the signature is decrypted with the given password.\n\n[https://github.com/Evolution404/simcore/wiki/Management-APIs#personal\\_sign](https://github.com/Evolution404/simcore/wiki/Management-APIs#personal_sign)\n\n```go\nfunc (s *PrivateAccountAPI) SignAndSendTransaction(ctx context.Context, args TransactionArgs, passwd string) (common.Hash, error)\n```\nSignAndSendTransaction was renamed to SendTransaction. This method is deprecated and will be removed in the future. It primary goal is to give clients time to update.\n\n```go\nfunc (s *PrivateAccountAPI) SignTransaction(ctx context.Context, args TransactionArgs, passwd string) (*SignTransactionResult, error)\n```\nSignTransaction will create a transaction from the given arguments and tries to sign it with the key associated with args.From. If the given passwd isn't able to decrypt the key it fails. The transaction is returned in RLP-form, not broadcast to other nodes\n\n```go\nfunc (s *PrivateAccountAPI) UnlockAccount(ctx context.Context, addr common.Address, password string, duration *uint64) (bool, error)\n```\nUnlockAccount will unlock the account associated with the given address with the given password for duration seconds. If duration is nil it will use a default of 300 seconds. It returns an indication if the account was unlocked.\n\n```go\nfunc (s *PrivateAccountAPI) Unpair(ctx context.Context, url string, pin string) error\n```\nUnpair deletes a pairing between wallet and geth.\n\n```go\ntype PrivateDebugAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPrivateDebugAPI is the collection of Ethereum APIs exposed over the private debugging endpoint.\n\n```go\nfunc NewPrivateDebugAPI(b Backend) *PrivateDebugAPI\n```\nNewPrivateDebugAPI creates a new API definition for the private debug methods of the Ethereum service.\n\n```go\nfunc (api *PrivateDebugAPI) ChaindbCompact() error\n```\nChaindbCompact flattens the entire key-value database into a single level, removing all unused slots and merging all keys.\n\n```go\nfunc (api *PrivateDebugAPI) ChaindbProperty(property string) (string, error)\n```\nChaindbProperty returns leveldb properties of the key-value database.\n\n```go\nfunc (api *PrivateDebugAPI) SetHead(number hexutil.Uint64)\n```\nSetHead rewinds the head of the blockchain to a previous block.\n\n```go\ntype PublicAccountAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicAccountAPI provides an API to access accounts managed by this node. It offers only methods that can retrieve accounts.\n\n```go\nfunc NewPublicAccountAPI(am *accounts.Manager) *PublicAccountAPI\n```\nNewPublicAccountAPI creates a new PublicAccountAPI.\n\n```go\nfunc (s *PublicAccountAPI) Accounts() []common.Address\n```\nAccounts returns the collection of accounts this node manages\n\n```go\ntype PublicBlockChainAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicBlockChainAPI provides an API to access the Ethereum blockchain. It offers only methods that operate on public data that is freely available to anyone.\n\n```go\nfunc NewPublicBlockChainAPI(b Backend) *PublicBlockChainAPI\n```\nNewPublicBlockChainAPI creates a new Ethereum blockchain API.\n\n```go\nfunc (s *PublicBlockChainAPI) BlockNumber() hexutil.Uint64\n```\nBlockNumber returns the block number of the chain head.\n\n```go\nfunc (s *PublicBlockChainAPI) Call(ctx context.Context, args TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *StateOverride) (hexutil.Bytes, error)\n```\nCall executes the given transaction on the state for the given block number.\n\nAdditionally, the caller can specify a batch of contract for fields overriding.\n\nNote, this function doesn't make and changes in the state/blockchain and is useful to execute and retrieve values.\n\n```go\nfunc (api *PublicBlockChainAPI) ChainId() (*hexutil.Big, error)\n```\nChainId is the EIP-155 replay-protection chain id for the current ethereum chain config.\n\n```go\nfunc (s *PublicBlockChainAPI) CreateAccessList(ctx context.Context, args TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash) (*accessListResult, error)\n```\nCreateAccessList creates a EIP-2930 type AccessList for the given transaction. Reexec and BlockNrOrHash can be specified to create the accessList on top of a certain state.\n\n```go\nfunc (s *PublicBlockChainAPI) EstimateGas(ctx context.Context, args TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash) (hexutil.Uint64, error)\n```\nEstimateGas returns an estimate of the amount of gas needed to execute the given transaction against the current pending block.\n\n```go\nfunc (s *PublicBlockChainAPI) GetBalance(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Big, error)\n```\nGetBalance returns the amount of wei for the given address in the state of the given block number. The rpc.LatestBlockNumber and rpc.PendingBlockNumber meta block numbers are also allowed.\n\n```go\nfunc (s *PublicBlockChainAPI) GetBlockByHash(ctx context.Context, hash common.Hash, fullTx bool) (map[string]interface{}, error)\n```\nGetBlockByHash returns the requested block. When fullTx is true all transactions in the block are returned in full detail, otherwise only the transaction hash is returned.\n\n```go\nfunc (s *PublicBlockChainAPI) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (map[string]interface{}, error)\n```\nGetBlockByNumber returns the requested canonical block.\n\n  - When blockNr is -1 the chain head is returned.\n  - When blockNr is -2 the pending chain head is returned.\n  - When fullTx is true all transactions in the block are returned, otherwise only the transaction hash is returned.\n\n```go\nfunc (s *PublicBlockChainAPI) GetCode(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error)\n```\nGetCode returns the code stored at the given address in the state for the given block number.\n\n```go\nfunc (s *PublicBlockChainAPI) GetHeaderByHash(ctx context.Context, hash common.Hash) map[string]interface{}\n```\nGetHeaderByHash returns the requested header by hash.\n\n```go\nfunc (s *PublicBlockChainAPI) GetHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (map[string]interface{}, error)\n```\nGetHeaderByNumber returns the requested canonical block header. \\* When blockNr is -1 the chain head is returned. \\* When blockNr is -2 the pending chain head is returned.\n\n```go\nfunc (s *PublicBlockChainAPI) GetProof(ctx context.Context, address common.Address, storageKeys []string, blockNrOrHash rpc.BlockNumberOrHash) (*AccountResult, error)\n```\nGetProof returns the Merkle-proof for a given account and optionally some storage keys.\n\n```go\nfunc (s *PublicBlockChainAPI) GetStorageAt(ctx context.Context, address common.Address, key string, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error)\n```\nGetStorageAt returns the storage from the state at the given address, key and block number. The rpc.LatestBlockNumber and rpc.PendingBlockNumber meta block numbers are also allowed.\n\n```go\nfunc (s *PublicBlockChainAPI) GetUncleByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) (map[string]interface{}, error)\n```\nGetUncleByBlockHashAndIndex returns the uncle block for the given block hash and index. When fullTx is true all transactions in the block are returned in full detail, otherwise only the transaction hash is returned.\n\n```go\nfunc (s *PublicBlockChainAPI) GetUncleByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) (map[string]interface{}, error)\n```\nGetUncleByBlockNumberAndIndex returns the uncle block for the given block hash and index. When fullTx is true all transactions in the block are returned in full detail, otherwise only the transaction hash is returned.\n\n```go\nfunc (s *PublicBlockChainAPI) GetUncleCountByBlockHash(ctx context.Context, blockHash common.Hash) *hexutil.Uint\n```\nGetUncleCountByBlockHash returns number of uncles in the block for the given block hash\n\n```go\nfunc (s *PublicBlockChainAPI) GetUncleCountByBlockNumber(ctx context.Context, blockNr rpc.BlockNumber) *hexutil.Uint\n```\nGetUncleCountByBlockNumber returns number of uncles in the block for the given block number\n\n```go\ntype PublicDebugAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicDebugAPI is the collection of Ethereum APIs exposed over the public debugging endpoint.\n\n```go\nfunc NewPublicDebugAPI(b Backend) *PublicDebugAPI\n```\nNewPublicDebugAPI creates a new API definition for the public debug methods of the Ethereum service.\n\n```go\nfunc (api *PublicDebugAPI) GetBlockRlp(ctx context.Context, number uint64) (hexutil.Bytes, error)\n```\nGetBlockRlp retrieves the RLP encoded for of a single block.\n\n```go\nfunc (api *PublicDebugAPI) GetHeaderRlp(ctx context.Context, number uint64) (hexutil.Bytes, error)\n```\nGetHeaderRlp retrieves the RLP encoded for of a single header.\n\n```go\nfunc (api *PublicDebugAPI) PrintBlock(ctx context.Context, number uint64) (string, error)\n```\nPrintBlock retrieves a block and returns its pretty printed form.\n\n```go\nfunc (api *PublicDebugAPI) SeedHash(ctx context.Context, number uint64) (string, error)\n```\nSeedHash retrieves the seed hash of a block.\n\n```go\nfunc (api *PublicDebugAPI) TestSignCliqueBlock(ctx context.Context, address common.Address, number uint64) (common.Address, error)\n```\nTestSignCliqueBlock fetches the given block number, and attempts to sign it as a clique header with the given address, returning the address of the recovered signature\n\nThis is a temporary method to debug the externalsigner integration, TODO: Remove this method when the integration is mature\n\n```go\ntype PublicEthereumAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicEthereumAPI provides an API to access Ethereum related information. It offers only methods that operate on public data that is freely available to anyone.\n\n```go\nfunc NewPublicEthereumAPI(b Backend) *PublicEthereumAPI\n```\nNewPublicEthereumAPI creates a new Ethereum protocol API.\n\n```go\nfunc (s *PublicEthereumAPI) FeeHistory(ctx context.Context, blockCount rpc.DecimalOrHex, lastBlock rpc.BlockNumber, rewardPercentiles []float64) (*feeHistoryResult, error)\n```\n\n```go\nfunc (s *PublicEthereumAPI) GasPrice(ctx context.Context) (*hexutil.Big, error)\n```\nGasPrice returns a suggestion for a gas price for legacy transactions.\n\n```go\nfunc (s *PublicEthereumAPI) MaxPriorityFeePerGas(ctx context.Context) (*hexutil.Big, error)\n```\nMaxPriorityFeePerGas returns a suggestion for a gas tip cap for dynamic fee transactions.\n\n```go\nfunc (s *PublicEthereumAPI) Syncing() (interface{}, error)\n```\nSyncing returns false in case the node is currently not syncing with the network. It can be up to date or has not yet received the latest block headers from its pears. In case it is synchronizing: - startingBlock: block number this node started to synchronise from - currentBlock:  block number this node is currently importing - highestBlock:  block number of the highest block header this node has received from peers - pulledStates:  number of state entries processed until now - knownStates:   number of known state entries that still need to be pulled\n\n```go\ntype PublicNetAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicNetAPI offers network related RPC methods\n\n```go\nfunc NewPublicNetAPI(net *p2p.Server, networkVersion uint64) *PublicNetAPI\n```\nNewPublicNetAPI creates a new net API instance.\n\n```go\nfunc (s *PublicNetAPI) Listening() bool\n```\nListening returns an indication if the node is listening for network connections.\n\n```go\nfunc (s *PublicNetAPI) PeerCount() hexutil.Uint\n```\nPeerCount returns the number of connected peers\n\n```go\nfunc (s *PublicNetAPI) Version() string\n```\nVersion returns the current ethereum protocol version.\n\n```go\ntype PublicTransactionPoolAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicTransactionPoolAPI exposes methods for the RPC interface\n\n```go\nfunc NewPublicTransactionPoolAPI(b Backend, nonceLock *AddrLocker) *PublicTransactionPoolAPI\n```\nNewPublicTransactionPoolAPI creates a new RPC service with methods specific for the transaction pool.\n\n```go\nfunc (s *PublicTransactionPoolAPI) FillTransaction(ctx context.Context, args TransactionArgs) (*SignTransactionResult, error)\n```\nFillTransaction fills the defaults (nonce, gas, gasPrice or 1559 fields) on a given unsigned transaction, and returns it to the caller for further processing (signing + broadcast).\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetBlockTransactionCountByHash(ctx context.Context, blockHash common.Hash) *hexutil.Uint\n```\nGetBlockTransactionCountByHash returns the number of transactions in the block with the given hash.\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetBlockTransactionCountByNumber(ctx context.Context, blockNr rpc.BlockNumber) *hexutil.Uint\n```\nGetBlockTransactionCountByNumber returns the number of transactions in the block with the given block number.\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetRawTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) hexutil.Bytes\n```\nGetRawTransactionByBlockHashAndIndex returns the bytes of the transaction for the given block hash and index.\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetRawTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) hexutil.Bytes\n```\nGetRawTransactionByBlockNumberAndIndex returns the bytes of the transaction for the given block number and index.\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetRawTransactionByHash(ctx context.Context, hash common.Hash) (hexutil.Bytes, error)\n```\nGetRawTransactionByHash returns the bytes of the transaction for the given hash.\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) *RPCTransaction\n```\nGetTransactionByBlockHashAndIndex returns the transaction for the given block hash and index.\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) *RPCTransaction\n```\nGetTransactionByBlockNumberAndIndex returns the transaction for the given block number and index.\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetTransactionByHash(ctx context.Context, hash common.Hash) (*RPCTransaction, error)\n```\nGetTransactionByHash returns the transaction for the given hash\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetTransactionCount(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Uint64, error)\n```\nGetTransactionCount returns the number of transactions the given address has sent for the given block number\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error)\n```\nGetTransactionReceipt returns the transaction receipt for the given transaction hash.\n\n```go\nfunc (s *PublicTransactionPoolAPI) PendingTransactions() ([]*RPCTransaction, error)\n```\nPendingTransactions returns the transactions that are in the transaction pool and have a from address that is one of the accounts this node manages.\n\n```go\nfunc (s *PublicTransactionPoolAPI) Resend(ctx context.Context, sendArgs TransactionArgs, gasPrice *hexutil.Big, gasLimit *hexutil.Uint64) (common.Hash, error)\n```\nResend accepts an existing transaction and a new gas price and limit. It will remove the given transaction from the pool and reinsert it with the new gas price and limit.\n\n```go\nfunc (s *PublicTransactionPoolAPI) SendRawTransaction(ctx context.Context, input hexutil.Bytes) (common.Hash, error)\n```\nSendRawTransaction will add the signed transaction to the transaction pool. The sender is responsible for signing the transaction and using the correct nonce.\n\n```go\nfunc (s *PublicTransactionPoolAPI) SendTransaction(ctx context.Context, args TransactionArgs) (common.Hash, error)\n```\nSendTransaction creates a transaction for the given argument, sign it and submit it to the transaction pool.\n\n```go\nfunc (s *PublicTransactionPoolAPI) Sign(addr common.Address, data hexutil.Bytes) (hexutil.Bytes, error)\n```\nSign calculates an ECDSA signature for: keccack256(\"\\\\x19Ethereum Signed Message:\\\\n\" + len(message) + message).\n\nNote, the produced signature conforms to the secp256k1 curve R, S and V values, where the V value will be 27 or 28 for legacy reasons.\n\nThe account associated with addr must be unlocked.\n\n[https://github.com/ethereum/wiki/wiki/JSON-RPC#eth\\_sign](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign)\n\n```go\nfunc (s *PublicTransactionPoolAPI) SignTransaction(ctx context.Context, args TransactionArgs) (*SignTransactionResult, error)\n```\nSignTransaction will sign the given transaction with the from account. The node needs to have the private key of the account corresponding with the given from address and it needs to be unlocked.\n\n```go\ntype PublicTxPoolAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicTxPoolAPI offers and API for the transaction pool. It only operates on data that is non confidential.\n\n```go\nfunc NewPublicTxPoolAPI(b Backend) *PublicTxPoolAPI\n```\nNewPublicTxPoolAPI creates a new tx pool service that gives information about the transaction pool.\n\n```go\nfunc (s *PublicTxPoolAPI) Content() map[string]map[string]map[string]*RPCTransaction\n```\nContent returns the transactions contained within the transaction pool.\n\n```go\nfunc (s *PublicTxPoolAPI) ContentFrom(addr common.Address) map[string]map[string]*RPCTransaction\n```\nContentFrom returns the transactions contained within the transaction pool.\n\n```go\nfunc (s *PublicTxPoolAPI) Inspect() map[string]map[string]map[string]string\n```\nInspect retrieves the content of the transaction pool and flattens it into an easily inspectable list.\n\n```go\nfunc (s *PublicTxPoolAPI) Status() map[string]hexutil.Uint\n```\nStatus returns the number of pending and queued transaction in the pool.\n\n```go\ntype RPCTransaction struct {\n\tBlockHash        *common.Hash      `json:\"blockHash\"`\n\tBlockNumber      *hexutil.Big      `json:\"blockNumber\"`\n\tFrom             common.Address    `json:\"from\"`\n\tGas              hexutil.Uint64    `json:\"gas\"`\n\tGasPrice         *hexutil.Big      `json:\"gasPrice\"`\n\tGasFeeCap        *hexutil.Big      `json:\"maxFeePerGas,omitempty\"`\n\tGasTipCap        *hexutil.Big      `json:\"maxPriorityFeePerGas,omitempty\"`\n\tHash             common.Hash       `json:\"hash\"`\n\tInput            hexutil.Bytes     `json:\"input\"`\n\tNonce            hexutil.Uint64    `json:\"nonce\"`\n\tTo               *common.Address   `json:\"to\"`\n\tTransactionIndex *hexutil.Uint64   `json:\"transactionIndex\"`\n\tValue            *hexutil.Big      `json:\"value\"`\n\tType             hexutil.Uint64    `json:\"type\"`\n\tAccesses         *types.AccessList `json:\"accessList,omitempty\"`\n\tChainID          *hexutil.Big      `json:\"chainId,omitempty\"`\n\tV                *hexutil.Big      `json:\"v\"`\n\tR                *hexutil.Big      `json:\"r\"`\n\tS                *hexutil.Big      `json:\"s\"`\n}\n```\nRPCTransaction represents a transaction that will serialize to the RPC representation of a transaction\n\n```go\ntype SignTransactionResult struct {\n\tRaw hexutil.Bytes      `json:\"raw\"`\n\tTx  *types.Transaction `json:\"tx\"`\n}\n```\nSignTransactionResult represents a RLP encoded signed transaction.\n\n```go\ntype StateOverride map[common.Address]OverrideAccount\n```\nStateOverride is the collection of overridden accounts.\n\n```go\nfunc (diff *StateOverride) Apply(state *state.StateDB) error\n```\nApply overrides the fields of specified accounts into the given state.\n\n```go\ntype StorageResult struct {\n\tKey   string       `json:\"key\"`\n\tValue *hexutil.Big `json:\"value\"`\n\tProof []string     `json:\"proof\"`\n}\n```\n\n```go\ntype StructLogRes struct {\n\tPc      uint64             `json:\"pc\"`\n\tOp      string             `json:\"op\"`\n\tGas     uint64             `json:\"gas\"`\n\tGasCost uint64             `json:\"gasCost\"`\n\tDepth   int                `json:\"depth\"`\n\tError   string             `json:\"error,omitempty\"`\n\tStack   *[]string          `json:\"stack,omitempty\"`\n\tMemory  *[]string          `json:\"memory,omitempty\"`\n\tStorage *map[string]string `json:\"storage,omitempty\"`\n}\n```\nStructLogRes stores a structured log emitted by the EVM while replaying a transaction in debug mode\n\n```go\nfunc FormatLogs(logs []logger.StructLog) []StructLogRes\n```\nFormatLogs formats EVM returned structured logs for json output\n\n```go\ntype TransactionArgs struct {\n\tFrom                 *common.Address `json:\"from\"`\n\tTo                   *common.Address `json:\"to\"`\n\tGas                  *hexutil.Uint64 `json:\"gas\"`\n\tGasPrice             *hexutil.Big    `json:\"gasPrice\"`\n\tMaxFeePerGas         *hexutil.Big    `json:\"maxFeePerGas\"`\n\tMaxPriorityFeePerGas *hexutil.Big    `json:\"maxPriorityFeePerGas\"`\n\tValue                *hexutil.Big    `json:\"value\"`\n\tNonce                *hexutil.Uint64 `json:\"nonce\"`\n\n\t// We accept \"data\" and \"input\" for backwards-compatibility reasons.\n\t// \"input\" is the newer name and should be preferred by clients.\n\t// Issue detail: https://github.com/Evolution404/simcore/issues/15628\n\tData  *hexutil.Bytes `json:\"data\"`\n\tInput *hexutil.Bytes `json:\"input\"`\n\n\t// Introduced by AccessListTxType transaction.\n\tAccessList *types.AccessList `json:\"accessList,omitempty\"`\n\tChainID    *hexutil.Big      `json:\"chainId,omitempty\"`\n}\n```\nTransactionArgs represents the arguments to construct a new transaction or a message call.\n\n```go\nfunc (args *TransactionArgs) ToMessage(globalGasCap uint64, baseFee *big.Int) (types.Message, error)\n```\nToMessage converts the transaction arguments to the Message type used by the core evm. This method is used in calls and traces that do not require a real live transaction.\n\n```go\nfunc (args *TransactionArgs) ToTransaction() *types.Transaction\n```\nToTransaction converts the arguments to a transaction. This assumes that setDefaults has been called.\n\n","path":"github.com/Evolution404/simcore/internal/ethapi","name":"ethapi","synopsis":"Package ethapi implements the general Ethereum API functions.","isRedistributable":true}
