Documentation ¶
Index ¶
- Constants
- Variables
- func CheckTimeouts(logger zerolog.Logger, timeouts *rpc.HTTPTimeouts)
- func SupportedAPIs(blockChainAPI *BlockChainAPI, streamAPI *StreamAPI, pullAPI *PullAPI, ...) []rpc.API
- type BlockChainAPI
- func (b *BlockChainAPI) BlockNumber(ctx context.Context) (hexutil.Uint64, error)
- func (b *BlockChainAPI) Call(ctx context.Context, args ethTypes.TransactionArgs, ...) (hexutil.Bytes, error)
- func (b *BlockChainAPI) ChainId(ctx context.Context) (*hexutil.Big, error)
- func (b *BlockChainAPI) Coinbase(ctx context.Context) (common.Address, error)
- func (b *BlockChainAPI) CreateAccessList(ctx context.Context, args ethTypes.TransactionArgs, ...) (*ethTypes.AccessListResult, error)
- func (b *BlockChainAPI) EstimateGas(ctx context.Context, args ethTypes.TransactionArgs, ...) (hexutil.Uint64, error)
- func (b *BlockChainAPI) FeeHistory(ctx context.Context, blockCount math.HexOrDecimal64, lastBlock rpc.BlockNumber, ...) (*ethTypes.FeeHistoryResult, error)
- func (b *BlockChainAPI) GasPrice(ctx context.Context) (*hexutil.Big, error)
- func (b *BlockChainAPI) GetBalance(ctx context.Context, address common.Address, ...) (*hexutil.Big, error)
- func (b *BlockChainAPI) GetBlockByHash(ctx context.Context, hash common.Hash, fullTx bool) (*ethTypes.Block, error)
- func (b *BlockChainAPI) GetBlockByNumber(ctx context.Context, blockNumber rpc.BlockNumber, fullTx bool) (*ethTypes.Block, error)
- func (b *BlockChainAPI) GetBlockReceipts(ctx context.Context, blockNumberOrHash rpc.BlockNumberOrHash) ([]map[string]interface{}, error)
- func (b *BlockChainAPI) GetBlockTransactionCountByHash(ctx context.Context, blockHash common.Hash) (*hexutil.Uint, error)
- func (b *BlockChainAPI) GetBlockTransactionCountByNumber(ctx context.Context, blockNumber rpc.BlockNumber) (*hexutil.Uint, error)
- func (b *BlockChainAPI) GetCode(ctx context.Context, address common.Address, ...) (hexutil.Bytes, error)
- func (b *BlockChainAPI) GetLogs(ctx context.Context, criteria filters.FilterCriteria) ([]*types.Log, error)
- func (b *BlockChainAPI) GetProof(ctx context.Context, address common.Address, storageKeys []string, ...) (*ethTypes.AccountResult, error)
- func (b *BlockChainAPI) GetStorageAt(ctx context.Context, address common.Address, storageSlot string, ...) (hexutil.Bytes, error)
- func (b *BlockChainAPI) GetTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) (*ethTypes.Transaction, error)
- func (b *BlockChainAPI) GetTransactionByBlockNumberAndIndex(ctx context.Context, blockNumber rpc.BlockNumber, index hexutil.Uint) (*ethTypes.Transaction, error)
- func (b *BlockChainAPI) GetTransactionByHash(ctx context.Context, hash common.Hash) (*ethTypes.Transaction, error)
- func (b *BlockChainAPI) GetTransactionCount(ctx context.Context, address common.Address, ...) (*hexutil.Uint64, error)
- func (b *BlockChainAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error)
- func (b *BlockChainAPI) GetUncleByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) (map[string]interface{}, error)
- func (b *BlockChainAPI) GetUncleByBlockNumberAndIndex(ctx context.Context, blockNumber rpc.BlockNumber, index hexutil.Uint) (map[string]interface{}, error)
- func (b *BlockChainAPI) GetUncleCountByBlockHash(ctx context.Context, blockHash common.Hash) *hexutil.Uint
- func (b *BlockChainAPI) GetUncleCountByBlockNumber(ctx context.Context, blockNumber rpc.BlockNumber) *hexutil.Uint
- func (b *BlockChainAPI) Hashrate() hexutil.Uint64
- func (b *BlockChainAPI) MaxPriorityFeePerGas(ctx context.Context) (*hexutil.Big, error)
- func (b *BlockChainAPI) Mining() bool
- func (b *BlockChainAPI) SendRawTransaction(ctx context.Context, input hexutil.Bytes) (common.Hash, error)
- func (b *BlockChainAPI) Syncing(ctx context.Context) (interface{}, error)
- type DebugAPI
- func (d *DebugAPI) FlowHeightByBlock(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (uint64, error)
- func (d *DebugAPI) TraceBlockByHash(ctx context.Context, hash gethCommon.Hash, config *tracers.TraceConfig) ([]*txTraceResult, error)
- func (d *DebugAPI) TraceBlockByNumber(ctx context.Context, number rpc.BlockNumber, config *tracers.TraceConfig) ([]*txTraceResult, error)
- func (d *DebugAPI) TraceCall(ctx context.Context, args ethTypes.TransactionArgs, ...) (interface{}, error)
- func (d *DebugAPI) TraceTransaction(ctx context.Context, hash gethCommon.Hash, config *tracers.TraceConfig) (json.RawMessage, error)
- type NetAPI
- type ProfileServer
- type PullAPI
- func (api *PullAPI) GetFilterChanges(ctx context.Context, id rpc.ID) (any, error)
- func (api *PullAPI) GetFilterLogs(ctx context.Context, id rpc.ID) ([]*gethTypes.Log, error)
- func (api *PullAPI) NewBlockFilter(ctx context.Context) (rpc.ID, error)
- func (api *PullAPI) NewFilter(ctx context.Context, criteria filters.FilterCriteria) (rpc.ID, error)
- func (api *PullAPI) NewPendingTransactionFilter(ctx context.Context, fullTx *bool) (rpc.ID, error)
- func (api *PullAPI) UninstallFilter(id rpc.ID) bool
- type Server
- func (h *Server) EnableRPC(apis []rpc.API) error
- func (h *Server) EnableWS(apis []rpc.API) error
- func (h *Server) ListenAddr() string
- func (h *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (h *Server) SetListenAddr(host string, port int) error
- func (h *Server) Start() error
- func (h *Server) Stop()
- type StreamAPI
- type TxPool
- type WalletAPI
- func (w *WalletAPI) Accounts() ([]common.Address, error)
- func (w *WalletAPI) SendTransaction(ctx context.Context, args ethTypes.TransactionArgs) (common.Hash, error)
- func (w *WalletAPI) Sign(addr common.Address, data hexutil.Bytes) (hexutil.Bytes, error)
- func (w *WalletAPI) SignTransaction(ctx context.Context, args ethTypes.TransactionArgs) (*ethTypes.SignTransactionResult, error)
- type Web3API
Constants ¶
const BlockGasLimit uint64 = 120_000_000
Variables ¶
var Version = "development"
Functions ¶
func CheckTimeouts ¶
func CheckTimeouts(logger zerolog.Logger, timeouts *rpc.HTTPTimeouts)
CheckTimeouts ensures that timeout values are meaningful
Types ¶
type BlockChainAPI ¶
type BlockChainAPI struct {
// contains filtered or unexported fields
}
func NewBlockChainAPI ¶
func NewBlockChainAPI( logger zerolog.Logger, config config.Config, evm requester.Requester, blocks storage.BlockIndexer, transactions storage.TransactionIndexer, receipts storage.ReceiptIndexer, ratelimiter limiter.Store, collector metrics.Collector, indexingResumedHeight uint64, ) *BlockChainAPI
func (*BlockChainAPI) BlockNumber ¶
BlockNumber returns the block number of the chain head.
func (*BlockChainAPI) Call ¶
func (b *BlockChainAPI) Call( ctx context.Context, args ethTypes.TransactionArgs, blockNumberOrHash *rpc.BlockNumberOrHash, stateOverrides *ethTypes.StateOverride, _ *ethTypes.BlockOverrides, ) (hexutil.Bytes, error)
Call executes the given transaction on the state for the given block number. Additionally, the caller can specify a batch of contract for fields overriding. Note, this function doesn't make and changes in the state/blockchain and is useful to execute and retrieve values.
func (*BlockChainAPI) ChainId ¶
ChainId is the EIP-155 replay-protection chain id for the current Ethereum chain config.
Note, this method does not conform to EIP-695 because the configured chain ID is always returned, regardless of the current head block. We used to return an error when the chain wasn't synced up to a block where EIP-155 is enabled, but this behavior caused issues in CL clients.
func (*BlockChainAPI) Coinbase ¶
Coinbase is the address that mining rewards will be sent to (alias for Etherbase).
func (*BlockChainAPI) CreateAccessList ¶
func (b *BlockChainAPI) CreateAccessList( ctx context.Context, args ethTypes.TransactionArgs, blockNumberOrHash *rpc.BlockNumberOrHash, ) (*ethTypes.AccessListResult, error)
CreateAccessList creates an EIP-2930 type AccessList for the given transaction. Reexec and blockNumberOrHash can be specified to create the accessList on top of a certain state.
func (*BlockChainAPI) EstimateGas ¶
func (b *BlockChainAPI) EstimateGas( ctx context.Context, args ethTypes.TransactionArgs, blockNumberOrHash *rpc.BlockNumberOrHash, stateOverrides *ethTypes.StateOverride, ) (hexutil.Uint64, error)
EstimateGas returns the lowest possible gas limit that allows the transaction to run successfully at block `blockNrOrHash`, or the latest block if `blockNrOrHash` is unspecified. It returns error if the transaction would revert or if there are unexpected failures. The returned value is capped by both `args.Gas` (if non-nil & non-zero) and the backend's RPCGasCap configuration (if non-zero).
func (*BlockChainAPI) FeeHistory ¶
func (b *BlockChainAPI) FeeHistory( ctx context.Context, blockCount math.HexOrDecimal64, lastBlock rpc.BlockNumber, rewardPercentiles []float64, ) (*ethTypes.FeeHistoryResult, error)
FeeHistory returns transaction base fee per gas and effective priority fee per gas for the requested/supported block range. blockCount: Requested range of blocks. Clients will return less than the requested range if not all blocks are available. lastBlock: Highest block of the requested range. rewardPercentiles: A monotonically increasing list of percentile values. For each block in the requested range, the transactions will be sorted in ascending order by effective tip per gas and the coresponding effective tip for the percentile will be determined, accounting for gas consumed.
func (*BlockChainAPI) GasPrice ¶
GasPrice returns a suggestion for a gas price for legacy transactions.
func (*BlockChainAPI) GetBalance ¶
func (b *BlockChainAPI) GetBalance( ctx context.Context, address common.Address, blockNumberOrHash rpc.BlockNumberOrHash, ) (*hexutil.Big, error)
GetBalance 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.
func (*BlockChainAPI) GetBlockByHash ¶
func (b *BlockChainAPI) GetBlockByHash( ctx context.Context, hash common.Hash, fullTx bool, ) (*ethTypes.Block, error)
GetBlockByHash 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.
func (*BlockChainAPI) GetBlockByNumber ¶
func (b *BlockChainAPI) GetBlockByNumber( ctx context.Context, blockNumber rpc.BlockNumber, fullTx bool, ) (*ethTypes.Block, error)
GetBlockByNumber returns the requested canonical block.
- When blockNr is -1 the chain pending block is returned.
- When blockNr is -2 the chain latest block is returned.
- When blockNr is -3 the chain finalized block is returned.
- When blockNr is -4 the chain safe block is returned.
- When fullTx is true all transactions in the block are returned, otherwise only the transaction hash is returned.
func (*BlockChainAPI) GetBlockReceipts ¶
func (b *BlockChainAPI) GetBlockReceipts( ctx context.Context, blockNumberOrHash rpc.BlockNumberOrHash, ) ([]map[string]interface{}, error)
GetBlockReceipts returns the block receipts for the given block hash or number or tag.
func (*BlockChainAPI) GetBlockTransactionCountByHash ¶
func (b *BlockChainAPI) GetBlockTransactionCountByHash( ctx context.Context, blockHash common.Hash, ) (*hexutil.Uint, error)
GetBlockTransactionCountByHash returns the number of transactions in the block with the given hash.
func (*BlockChainAPI) GetBlockTransactionCountByNumber ¶
func (b *BlockChainAPI) GetBlockTransactionCountByNumber( ctx context.Context, blockNumber rpc.BlockNumber, ) (*hexutil.Uint, error)
GetBlockTransactionCountByNumber returns the number of transactions in the block with the given block number.
func (*BlockChainAPI) GetCode ¶
func (b *BlockChainAPI) GetCode( ctx context.Context, address common.Address, blockNumberOrHash rpc.BlockNumberOrHash, ) (hexutil.Bytes, error)
GetCode returns the code stored at the given address in the state for the given block number.
func (*BlockChainAPI) GetLogs ¶
func (b *BlockChainAPI) GetLogs( ctx context.Context, criteria filters.FilterCriteria, ) ([]*types.Log, error)
GetLogs returns logs matching the given argument that are stored within the state.
func (*BlockChainAPI) GetProof ¶
func (b *BlockChainAPI) GetProof( ctx context.Context, address common.Address, storageKeys []string, blockNumberOrHash rpc.BlockNumberOrHash, ) (*ethTypes.AccountResult, error)
GetProof returns the Merkle-proof for a given account and optionally some storage keys.
func (*BlockChainAPI) GetStorageAt ¶
func (b *BlockChainAPI) GetStorageAt( ctx context.Context, address common.Address, storageSlot string, blockNumberOrHash rpc.BlockNumberOrHash, ) (hexutil.Bytes, error)
GetStorageAt 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.
func (*BlockChainAPI) GetTransactionByBlockHashAndIndex ¶
func (b *BlockChainAPI) GetTransactionByBlockHashAndIndex( ctx context.Context, blockHash common.Hash, index hexutil.Uint, ) (*ethTypes.Transaction, error)
GetTransactionByBlockHashAndIndex returns the transaction for the given block hash and index.
func (*BlockChainAPI) GetTransactionByBlockNumberAndIndex ¶
func (b *BlockChainAPI) GetTransactionByBlockNumberAndIndex( ctx context.Context, blockNumber rpc.BlockNumber, index hexutil.Uint, ) (*ethTypes.Transaction, error)
GetTransactionByBlockNumberAndIndex returns the transaction for the given block number and index.
func (*BlockChainAPI) GetTransactionByHash ¶
func (b *BlockChainAPI) GetTransactionByHash( ctx context.Context, hash common.Hash, ) (*ethTypes.Transaction, error)
GetTransactionByHash returns the transaction for the given hash
func (*BlockChainAPI) GetTransactionCount ¶
func (b *BlockChainAPI) GetTransactionCount( ctx context.Context, address common.Address, blockNumberOrHash rpc.BlockNumberOrHash, ) (*hexutil.Uint64, error)
GetTransactionCount returns the number of transactions the given address has sent for the given block number.
func (*BlockChainAPI) GetTransactionReceipt ¶
func (b *BlockChainAPI) GetTransactionReceipt( ctx context.Context, hash common.Hash, ) (map[string]interface{}, error)
GetTransactionReceipt returns the transaction receipt for the given transaction hash.
func (*BlockChainAPI) GetUncleByBlockHashAndIndex ¶
func (b *BlockChainAPI) GetUncleByBlockHashAndIndex( ctx context.Context, blockHash common.Hash, index hexutil.Uint, ) (map[string]interface{}, error)
GetUncleByBlockHashAndIndex returns the uncle block for the given block hash and index.
func (*BlockChainAPI) GetUncleByBlockNumberAndIndex ¶
func (b *BlockChainAPI) GetUncleByBlockNumberAndIndex( ctx context.Context, blockNumber rpc.BlockNumber, index hexutil.Uint, ) (map[string]interface{}, error)
GetUncleByBlockNumberAndIndex returns the uncle block for the given block hash and index.
func (*BlockChainAPI) GetUncleCountByBlockHash ¶
func (b *BlockChainAPI) GetUncleCountByBlockHash( ctx context.Context, blockHash common.Hash, ) *hexutil.Uint
GetUncleCountByBlockHash returns number of uncles in the block for the given block hash
func (*BlockChainAPI) GetUncleCountByBlockNumber ¶
func (b *BlockChainAPI) GetUncleCountByBlockNumber( ctx context.Context, blockNumber rpc.BlockNumber, ) *hexutil.Uint
GetUncleCountByBlockNumber returns number of uncles in the block for the given block number
func (*BlockChainAPI) Hashrate ¶ added in v0.5.0
func (b *BlockChainAPI) Hashrate() hexutil.Uint64
Hashrate returns the number of hashes per second that the node is mining with. This can only return true for proof-of-work networks and may not be available in some clients since The Merge.
func (*BlockChainAPI) MaxPriorityFeePerGas ¶
MaxPriorityFeePerGas returns a suggestion for a gas tip cap for dynamic fee transactions.
func (*BlockChainAPI) Mining ¶ added in v0.5.0
func (b *BlockChainAPI) Mining() bool
Mining returns true if client is actively mining new blocks. This can only return true for proof-of-work networks and may not be available in some clients since The Merge.
func (*BlockChainAPI) SendRawTransaction ¶
func (b *BlockChainAPI) SendRawTransaction( ctx context.Context, input hexutil.Bytes, ) (common.Hash, error)
SendRawTransaction will add the signed transaction to the transaction pool. The sender is responsible for signing the transaction and using the correct nonce.
func (*BlockChainAPI) Syncing ¶
func (b *BlockChainAPI) Syncing(ctx context.Context) (interface{}, error)
Syncing 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 peers. In case it is synchronizing: - startingBlock: block number this node started to synchronize from - currentBlock: block number this node is currently importing - highestBlock: block number of the highest block header this node has received from peers
type DebugAPI ¶ added in v0.17.0
type DebugAPI struct {
// contains filtered or unexported fields
}
func NewDebugAPI ¶ added in v0.17.0
func NewDebugAPI( registerStore *pebble.RegisterStorage, tracer storage.TraceIndexer, blocks storage.BlockIndexer, transactions storage.TransactionIndexer, receipts storage.ReceiptIndexer, client *requester.CrossSporkClient, config config.Config, logger zerolog.Logger, collector metrics.Collector, limiter limiter.Store, ) *DebugAPI
func (*DebugAPI) FlowHeightByBlock ¶ added in v1.0.0
func (d *DebugAPI) FlowHeightByBlock( ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, ) (uint64, error)
FlowHeightByBlock returns the Flow height for the given EVM block specified either by EVM block height or EVM block hash.
func (*DebugAPI) TraceBlockByHash ¶ added in v0.17.0
func (d *DebugAPI) TraceBlockByHash( ctx context.Context, hash gethCommon.Hash, config *tracers.TraceConfig, ) ([]*txTraceResult, error)
func (*DebugAPI) TraceBlockByNumber ¶ added in v0.17.0
func (d *DebugAPI) TraceBlockByNumber( ctx context.Context, number rpc.BlockNumber, config *tracers.TraceConfig, ) ([]*txTraceResult, error)
func (*DebugAPI) TraceCall ¶ added in v1.0.0
func (d *DebugAPI) TraceCall( ctx context.Context, args ethTypes.TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash, config *tracers.TraceCallConfig, ) (interface{}, error)
func (*DebugAPI) TraceTransaction ¶ added in v0.17.0
func (d *DebugAPI) TraceTransaction( ctx context.Context, hash gethCommon.Hash, config *tracers.TraceConfig, ) (json.RawMessage, error)
TraceTransaction will return a debug execution trace of a transaction, if it exists.
type NetAPI ¶
type NetAPI struct {
// contains filtered or unexported fields
}
NetAPI offers network related RPC methods
func (*NetAPI) Listening ¶
Listening returns an indication if the node is listening for network connections.
type ProfileServer ¶ added in v0.36.4
type ProfileServer struct {
// contains filtered or unexported fields
}
func NewProfileServer ¶ added in v0.36.4
func NewProfileServer( logger zerolog.Logger, host string, port int, ) *ProfileServer
func (*ProfileServer) Close ¶ added in v0.36.4
func (s *ProfileServer) Close() error
func (*ProfileServer) ListenAddr ¶ added in v0.36.4
func (s *ProfileServer) ListenAddr() string
func (*ProfileServer) Start ¶ added in v0.36.4
func (s *ProfileServer) Start()
func (*ProfileServer) Stop ¶ added in v0.36.4
func (s *ProfileServer) Stop() error
type PullAPI ¶ added in v0.4.0
type PullAPI struct {
// contains filtered or unexported fields
}
func NewPullAPI ¶ added in v0.4.0
func NewPullAPI( logger zerolog.Logger, config config.Config, blocks storage.BlockIndexer, transactions storage.TransactionIndexer, receipts storage.ReceiptIndexer, ratelimiter limiter.Store, ) *PullAPI
func (*PullAPI) GetFilterChanges ¶ added in v0.4.0
GetFilterChanges returns the logs for the filter with the given id since last time it was called. This can be used for polling.
For pending transaction and block filters the result is []common.Hash. (pending)Log filters return []Log.
func (*PullAPI) GetFilterLogs ¶ added in v0.4.0
GetFilterLogs returns the logs for the filter with the given id. If the filter could not be found or has expired, an error is returned.
func (*PullAPI) NewBlockFilter ¶ added in v0.4.0
NewBlockFilter creates a filter that fetches blocks that are imported into the chain. It is part of the filter package since polling goes with eth_getFilterChanges.
func (*PullAPI) NewFilter ¶ added in v0.4.0
NewFilter creates a new filter and returns the filter id. It can be used to retrieve logs when the state changes. This method cannot be used to fetch logs that are already stored in the state.
Default criteria for the from and to block are "latest". Using "latest" as block number will return logs for mined blocks. Using "pending" as block number returns logs for not yet mined (pending) blocks. In case logs are removed (chain reorg) previously returned logs are returned again but with the removed property set to true.
In case "fromBlock" > "toBlock" an error is returned.
func (*PullAPI) NewPendingTransactionFilter ¶ added in v0.4.0
func (api *PullAPI) NewPendingTransactionFilter( ctx context.Context, fullTx *bool, ) (rpc.ID, error)
NewPendingTransactionFilter creates a filter that fetches pending transactions as transactions enter the pending state.
It is part of the filter package because this filter can be used through the `eth_getFilterChanges` polling method that is also used for log filters.
type Server ¶ added in v0.31.0
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ListenAddr ¶ added in v0.31.0
ListenAddr returns the listening address of the server.
func (*Server) ServeHTTP ¶ added in v0.31.0
func (h *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*Server) SetListenAddr ¶ added in v0.31.0
SetListenAddr configures the listening address of the server. The address can only be set while the server is not running.
type StreamAPI ¶ added in v0.6.0
type StreamAPI struct {
// contains filtered or unexported fields
}
func NewStreamAPI ¶ added in v0.6.0
func NewStreamAPI( logger zerolog.Logger, config config.Config, blocks storage.BlockIndexer, transactions storage.TransactionIndexer, receipts storage.ReceiptIndexer, blocksPublisher *models.Publisher[*models.Block], transactionsPublisher *models.Publisher[*gethTypes.Transaction], logsPublisher *models.Publisher[[]*gethTypes.Log], ) *StreamAPI
func (*StreamAPI) Logs ¶ added in v0.6.0
func (s *StreamAPI) Logs(ctx context.Context, criteria filters.FilterCriteria) (*rpc.Subscription, error)
Logs creates a subscription that fires for all new log that match the given filter criteria.
func (*StreamAPI) NewHeads ¶ added in v0.6.0
NewHeads send a notification each time a new block is appended to the chain.
func (*StreamAPI) NewPendingTransactions ¶ added in v0.6.0
func (s *StreamAPI) NewPendingTransactions(ctx context.Context, fullTx *bool) (*rpc.Subscription, error)
NewPendingTransactions creates a subscription that is triggered each time a transaction enters the transaction pool. If fullTx is true the full tx is sent to the client, otherwise the hash is sent.
type TxPool ¶ added in v0.12.0
type TxPool struct{}
func NewTxPoolAPI ¶ added in v0.12.0
func NewTxPoolAPI() *TxPool
func (*TxPool) ContentFrom ¶ added in v0.12.0
type WalletAPI ¶ added in v0.22.0
type WalletAPI struct {
// contains filtered or unexported fields
}
func NewWalletAPI ¶ added in v0.22.0
func NewWalletAPI(config config.Config, net *BlockChainAPI) *WalletAPI
func (*WalletAPI) Accounts ¶ added in v0.22.0
Accounts returns the collection of accounts this node manages.
func (*WalletAPI) SendTransaction ¶ added in v0.22.0
func (w *WalletAPI) SendTransaction( ctx context.Context, args ethTypes.TransactionArgs, ) (common.Hash, error)
SendTransaction creates a transaction for the given argument, sign it and submit it to the transaction pool.
func (*WalletAPI) Sign ¶ added in v0.22.0
Sign calculates an ECDSA signature for: keccak256("\x19Ethereum Signed Message:\n" + len(message) + message).
Note, 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.
The account associated with addr must be unlocked.
func (*WalletAPI) SignTransaction ¶ added in v0.22.0
func (w *WalletAPI) SignTransaction( ctx context.Context, args ethTypes.TransactionArgs, ) (*ethTypes.SignTransactionResult, error)
SignTransaction 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.
type Web3API ¶
type Web3API struct{}
Web3API offers helper utils
func (*Web3API) ClientVersion ¶
ClientVersion returns the node name