Documentation ¶
Index ¶
- Constants
- Variables
- func GenURL(network string) string
- func ParseAbi(abiString string) (abi.ABI, error)
- func ParseAbiFile(abiFilePath string) (abi.ABI, error)
- func ReadAbiFile(abiFilePath string) (string, error)
- type BlockChain
- func (blockChain *BlockChain) BatchGetStorageAt(account common.Address, keys []common.Hash, blockNumber *big.Int) (map[common.Hash][]byte, error)
- func (blockChain *BlockChain) ChainHead() (*big.Int, error)
- func (blockChain *BlockChain) FetchContractData(abiJSON string, address string, method string, methodArgs []interface{}, ...) error
- func (blockChain *BlockChain) GetEthLogsWithCustomQuery(query ethereum.FilterQuery) ([]types.Log, error)
- func (blockChain *BlockChain) GetHeaderByNumber(blockNumber int64) (header core.Header, err error)
- func (blockChain *BlockChain) GetHeadersByNumbers(blockNumbers []int64) (header []core.Header, err error)
- func (blockChain *BlockChain) GetTransactions(transactionHashes []common.Hash) ([]core.TransactionModel, error)
- func (blockChain *BlockChain) Node() core.Node
- type EtherScanAPI
- type Response
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 ReadAbiFile ¶
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) ChainHead ¶ added in v0.1.1
func (blockChain *BlockChain) ChainHead() (*big.Int, error)
func (*BlockChain) FetchContractData ¶
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
Click to show internal directories.
Click to hide internal directories.