Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidTDFormat = errors.New("invalid td format")
)
Functions ¶
This section is empty.
Types ¶
type Balancer ¶ added in v0.2.0
type Balancer interface {
// BalanceOf returns the balances of ETH and multiple erc20 tokens for multiple accounts
BalanceOf(context.Context, *big.Int, map[ethCommon.Address]map[ethCommon.Address]struct{}) (map[ethCommon.Address]map[ethCommon.Address]*big.Int, error)
}
Balancer is a wrapper interface to batch get balances
type EthClient ¶
type EthClient interface {
Balancer
BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error)
SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error)
DumpBlock(ctx context.Context, blockNr int64) (*state.Dump, error)
BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
ModifiedAccountStatesByNumber(ctx context.Context, num uint64) (*state.DirtyDump, error)
CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)
GetERC20(ctx context.Context, addr common.Address, num int64) (*model.ERC20, error)
GetTotalDifficulty(ctx context.Context, hash common.Hash) (*big.Int, error)
GetBlockReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error)
// Get ETH transfer logs
GetTransferLogs(ctx context.Context, hash common.Hash) ([]*types.TransferLog, error)
BatchBalanceAt(ctx context.Context, accounts []common.Address, blockNumber *big.Int) ([]*big.Int, error)
BatchCallContract(ctx context.Context, msgs []*ethereum.CallMsg, blockNumber *big.Int) ([][]byte, error)
Close()
}
Click to show internal directories.
Click to hide internal directories.