Documentation ¶
Index ¶
- func ConfigFilePath(filename string) string
- func ETHAddressToAsset(address common.Address, client *ethclient.Client, blockchainName string) (dia.Asset, error)
- func GetAddressesFromFile(filename string) (addresses []string, err error)
- func GetBlockData(blockNumber int64, relDB *models.RelDB, client *ethclient.Client) (blockdata dia.BlockData, err error)
- func GetBlockDataOnChain(blockNumber int64, client *ethclient.Client) (dia.BlockData, error)
- func GetBlockTimeEth(blockNumber int64, relDB *models.RelDB, client *ethclient.Client) (blockTime time.Time, err error)
- func NewETHClient() (*ethclient.Client, error)
- type TokenCaller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigFilePath ¶
func ETHAddressToAsset ¶ added in v1.2.0
func ETHAddressToAsset(address common.Address, client *ethclient.Client, blockchainName string) (dia.Asset, error)
ETHAddressToAsset takes an Ethereum address and returns the underlying token as a dia.Asset.
func GetAddressesFromFile ¶
GetAddressesFromFile fetches token addresses from a config file available here: https://etherscan.io/exportData?type=open-source-contract-codes
func GetBlockData ¶ added in v1.2.0
func GetBlockData(blockNumber int64, relDB *models.RelDB, client *ethclient.Client) (blockdata dia.BlockData, err error)
GetBlockData returns relevant block data from block with @blockNumber.
func GetBlockDataOnChain ¶ added in v1.2.0
func GetBlockTimeEth ¶ added in v1.4.2
func GetBlockTimeEth(blockNumber int64, relDB *models.RelDB, client *ethclient.Client) (blockTime time.Time, err error)
GetBlockTimeEth returns the block time of @blockNumber on Ethereum mainnet.
func NewETHClient ¶
NewETHClient returns an ethclient, using either our node for production or infura for testing
Types ¶
type TokenCaller ¶
type TokenCaller struct {
Contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
TokenCaller is an auto generated read-only Go binding around an Ethereum contract.
func NewTokenCaller ¶
func NewTokenCaller(address common.Address, caller bind.ContractCaller) (*TokenCaller, error)
NewTokenCaller creates a new read-only instance of token, bound to a specific deployed contract.