Documentation
¶
Index ¶
- Constants
- func ExtractFunctionSelector(s string) string
- func GetBlockReceiptsParams(blockNum *big.Int) []interface{}
- func GetBlockWithTransactionsParams(blockNum *big.Int) []interface{}
- func GetBlockWithoutTransactionsParams(blockNum *big.Int) []interface{}
- func GetLogsParams(blockNum *big.Int) []interface{}
- func GetTransactionParams(txHash string) []interface{}
- func TraceBlockParams(blockNum *big.Int) []interface{}
- type BlocksPerRequestConfig
- type Client
- func (rpc *Client) Close()
- func (rpc *Client) GetBlocks(ctx context.Context, blockNumbers []*big.Int) []GetBlocksResult
- func (rpc *Client) GetBlocksPerRequest() BlocksPerRequestConfig
- func (rpc *Client) GetChainID() *big.Int
- func (rpc *Client) GetFullBlocks(ctx context.Context, blockNumbers []*big.Int) []GetFullBlockResult
- func (rpc *Client) GetLatestBlockNumber(ctx context.Context) (*big.Int, error)
- func (rpc *Client) GetTransactions(ctx context.Context, txHashes []string) []GetTransactionsResult
- func (rpc *Client) GetURL() string
- func (rpc *Client) HasCode(ctx context.Context, address string) (bool, error)
- func (rpc *Client) IsWebsocket() bool
- func (rpc *Client) SupportsTraceBlock() bool
- type GetBlocksResult
- type GetFullBlockResult
- type GetTransactionsResult
- type IRPCClient
- type RPCFetchBatchResult
Constants ¶
View Source
const ( DEFAULT_BLOCKS_PER_REQUEST = 1000 DEFAULT_LOGS_PER_REQUEST = 100 DEFAULT_TRACES_PER_REQUEST = 100 DEFAULT_RECEIPTS_PER_REQUEST = 250 )
TODO: we should detect this automatically
Variables ¶
This section is empty.
Functions ¶
func ExtractFunctionSelector ¶
*
- Extracts the function selector (first 4 bytes) from a transaction input.
func GetBlockReceiptsParams ¶
func GetLogsParams ¶
func GetTransactionParams ¶
func GetTransactionParams(txHash string) []interface{}
func TraceBlockParams ¶
Types ¶
type BlocksPerRequestConfig ¶
func GetBlockPerRequestConfig ¶
func GetBlockPerRequestConfig() BlocksPerRequestConfig
type Client ¶
type Client struct { RPCClient *gethRpc.Client EthClient *ethclient.Client // contains filtered or unexported fields }
func (*Client) GetBlocksPerRequest ¶
func (rpc *Client) GetBlocksPerRequest() BlocksPerRequestConfig
func (*Client) GetChainID ¶
func (*Client) GetFullBlocks ¶
func (*Client) GetLatestBlockNumber ¶
func (*Client) GetTransactions ¶
func (rpc *Client) GetTransactions(ctx context.Context, txHashes []string) []GetTransactionsResult
func (*Client) IsWebsocket ¶
func (*Client) SupportsTraceBlock ¶
type GetBlocksResult ¶
func SerializeBlocks ¶
func SerializeBlocks(chainId *big.Int, blocks []RPCFetchBatchResult[*big.Int, common.RawBlock]) []GetBlocksResult
type GetFullBlockResult ¶
func SerializeFullBlocks ¶
func SerializeFullBlocks(chainId *big.Int, blocks []RPCFetchBatchResult[*big.Int, common.RawBlock], logs []RPCFetchBatchResult[*big.Int, common.RawLogs], traces []RPCFetchBatchResult[*big.Int, common.RawTraces], receipts []RPCFetchBatchResult[*big.Int, common.RawReceipts]) []GetFullBlockResult
type GetTransactionsResult ¶
type GetTransactionsResult struct { Error error Data common.Transaction }
func SerializeTransactions ¶
func SerializeTransactions(chainId *big.Int, transactions []RPCFetchBatchResult[string, common.RawTransaction]) []GetTransactionsResult
type IRPCClient ¶
type IRPCClient interface { GetFullBlocks(ctx context.Context, blockNumbers []*big.Int) []GetFullBlockResult GetBlocks(ctx context.Context, blockNumbers []*big.Int) []GetBlocksResult GetTransactions(ctx context.Context, txHashes []string) []GetTransactionsResult GetLatestBlockNumber(ctx context.Context) (*big.Int, error) GetChainID() *big.Int GetURL() string GetBlocksPerRequest() BlocksPerRequestConfig IsWebsocket() bool SupportsTraceBlock() bool HasCode(ctx context.Context, address string) (bool, error) Close() }
func Initialize ¶
func Initialize() (IRPCClient, error)
func InitializeSimpleRPCWithUrl ¶
func InitializeSimpleRPCWithUrl(url string) (IRPCClient, error)
Click to show internal directories.
Click to hide internal directories.