eth

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2021 License: AGPL-3.0 Imports: 18 Imported by: 24

Documentation

Index

Constants

View Source
const MAX_BATCH_SIZE = 100

Variables

View Source
var (
	ErrInvalidAbiFile   = errors.New("invalid abi")
	ErrMissingAbiFile   = errors.New("missing abi")
	ErrApiRequestFailed = errors.New("etherscan api request failed")
)
View Source
var ErrEmptyHeader = errors.New("empty header returned over RPC")

Functions

func GenURL

func GenURL(network string) string

func ParseAbi

func ParseAbi(abiString string) (abi.ABI, error)

func ParseAbiFile

func ParseAbiFile(abiFilePath string) (abi.ABI, error)

func ReadAbiFile

func ReadAbiFile(abiFilePath string) (string, error)

Types

type BlockChain

type BlockChain struct {
	// contains filtered or unexported fields
}

func NewBlockChain

func NewBlockChain(ethClient core.EthClient, rpcClient core.RpcClient, node core.Node, converter converters.TransactionConverter) *BlockChain

func (*BlockChain) BatchGetStorageAt added in v0.1.0

func (blockChain *BlockChain) BatchGetStorageAt(account common.Address, keys []common.Hash, blockNumber *big.Int) (map[common.Hash][]byte, error)

func (*BlockChain) ChainHead added in v0.1.1

func (blockChain *BlockChain) ChainHead() (*big.Int, error)

func (*BlockChain) FetchContractData

func (blockChain *BlockChain) FetchContractData(abiJSON string, address string, method string, methodArgs []interface{}, result interface{}, blockNumber int64) error

func (*BlockChain) GetEthLogsWithCustomQuery

func (blockChain *BlockChain) GetEthLogsWithCustomQuery(query ethereum.FilterQuery) ([]types.Log, error)

func (*BlockChain) GetHeaderByNumber

func (blockChain *BlockChain) GetHeaderByNumber(blockNumber int64) (header core.Header, err error)

func (*BlockChain) GetHeadersByNumbers

func (blockChain *BlockChain) GetHeadersByNumbers(blockNumbers []int64) (header []core.Header, err error)

func (*BlockChain) GetTransactions

func (blockChain *BlockChain) GetTransactions(transactionHashes []common.Hash) ([]core.TransactionModel, error)

func (*BlockChain) Node

func (blockChain *BlockChain) Node() core.Node

type EtherScanAPI

type EtherScanAPI struct {
	// contains filtered or unexported fields
}

func NewEtherScanClient

func NewEtherScanClient(url string) *EtherScanAPI

func (*EtherScanAPI) GetAbi

func (e *EtherScanAPI) GetAbi(contractAddress, apiKey string) (string, error)

https://api.etherscan.io/api?module=contract&action=getabi&address=%s

type Response

type Response struct {
	Status  string
	Message string
	Result  string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL