addresslookup

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: MIT Imports: 11 Imported by: 1

README

A service to query address information, either from the blockchain, APIs and local data.

Ethplorer:

Documentation

Overview

Tools for dealing with Ethereum addresses: AddressDetail struct, read & write token JSON, get from DB

Index

Constants

This section is empty.

Variables

View Source
var JsonUrlAddresses string = "https://metachris.github.io/go-ethutils/addresslookup/json/addresses.json"
View Source
var JsonUrlEtherscanTopminers string = "https://metachris.github.io/go-ethutils/addresslookup/json/topminers-etherscan.json"
View Source
var JsonUrlEthplorerExchangeAddresses string = "https://metachris.github.io/go-ethutils/addresslookup/json/ethplorer-exchanges.json"

Functions

func GetAddressDetailMap

func GetAddressDetailMap(filename string) (ret map[string]addressdetail.AddressDetail, err error)

func GetAddressesFromJsonFile

func GetAddressesFromJsonFile(filename string) (details []addressdetail.AddressDetail, err error)

func GetAddressesFromJsonUrl

func GetAddressesFromJsonUrl(url string) (details []addressdetail.AddressDetail, err error)

Types

type AddressLookupService

type AddressLookupService struct {
	Client *ethclient.Client

	// Initialize address cache with data from JSON
	Cache map[string]addressdetail.AddressDetail
}

func NewAddressLookupService

func NewAddressLookupService(client *ethclient.Client) *AddressLookupService

func (*AddressLookupService) AddAddressDetailToCache

func (ads *AddressLookupService) AddAddressDetailToCache(detail addressdetail.AddressDetail)

func (*AddressLookupService) AddAddressDetailsToCache

func (ads *AddressLookupService) AddAddressDetailsToCache(details []addressdetail.AddressDetail)

func (*AddressLookupService) AddAddressesFromJsonUrl added in v0.4.2

func (ads *AddressLookupService) AddAddressesFromJsonUrl(url string) error

func (*AddressLookupService) AddAllAddresses added in v0.4.4

func (ads *AddressLookupService) AddAllAddresses() error

func (*AddressLookupService) ClearCache

func (ads *AddressLookupService) ClearCache()

func (*AddressLookupService) EnsureIsLoaded

func (ads *AddressLookupService) EnsureIsLoaded(a *addressdetail.AddressDetail)

func (*AddressLookupService) GetAddressDetail

func (ads *AddressLookupService) GetAddressDetail(address string) (detail addressdetail.AddressDetail, found bool)

GetAddressDetail returns the addressdetail.AddressDetail from JSON. If not exists then query the Blockchain and caches it for future use

func (*AddressLookupService) GetAddressDetailFromBlockchain

func (ads *AddressLookupService) GetAddressDetailFromBlockchain(address string) (detail addressdetail.AddressDetail, found bool)

type EthplorerServiceResponse added in v0.4.4

type EthplorerServiceResponse struct {
	PublicTags []string `json:"publicTags"`
	IsContract bool     `json:"isContract"`
}

func EthplorerServiceAddressLookup added in v0.4.4

func EthplorerServiceAddressLookup(addr string) (res EthplorerServiceResponse, err error)

Jump to

Keyboard shortcuts

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