Documentation ¶
Index ¶
- func BuildUniqueTokenAddressesFromEvents(allEvents []*chain.TransferEvent) map[common.Address]*AddressMapValue
- func DeleteTokenCache(chainId string)
- func GetGlobalTokensLoadedCount() uint
- func Init(chainId string)
- func MergeTokensIntoGlobalTokenMap(newTokens map[string]TokenDataFromSource)
- func PrintContents(addressesMap map[common.Address]*AddressMapValue)
- func RemoveUnknownTokens(addressesMap map[common.Address]*AddressMapValue) map[common.Address]*AddressMapValue
- func WriteGlobalTokenMapToCache(chainId string)
- func WriteTokenInfoToFile(filename string, tokenInfo [][]string)
- type AddressMapValue
- type AddressValue
- type TokenData
- type TokenDataFromSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildUniqueTokenAddressesFromEvents ¶
func BuildUniqueTokenAddressesFromEvents(allEvents []*chain.TransferEvent) map[common.Address]*AddressMapValue
func DeleteTokenCache ¶
func DeleteTokenCache(chainId string)
func GetGlobalTokensLoadedCount ¶
func GetGlobalTokensLoadedCount() uint
func Init ¶
func Init(chainId string)
Init is called to load just the master data for the desired chainId
func MergeTokensIntoGlobalTokenMap ¶
func MergeTokensIntoGlobalTokenMap(newTokens map[string]TokenDataFromSource)
func PrintContents ¶
func PrintContents(addressesMap map[common.Address]*AddressMapValue)
func RemoveUnknownTokens ¶
func RemoveUnknownTokens(addressesMap map[common.Address]*AddressMapValue) map[common.Address]*AddressMapValue
RemoveUnknownTokens takes a map of addresses and removes those that are not known in the global tokenMap
func WriteGlobalTokenMapToCache ¶
func WriteGlobalTokenMapToCache(chainId string)
WriteGlobalTokenMapToCache takes the whole of the tokenMap master data and dumps it all out to the local cache .csv file. If any troubles, it just does nothing.
func WriteTokenInfoToFile ¶
Types ¶
type AddressMapValue ¶
type AddressValue ¶
func SortAddressesByCount ¶
func SortAddressesByCount(uniqueAddresses map[common.Address]*AddressMapValue) []AddressValue
type TokenData ¶
type TokenData struct { // Name is the token free text name Name string // Symbol is the short token symbol or ticker Symbol string // Decimals are how many decimal places the token has (ERC20 only, 0 for ERC721) Decimals int }
TokenData is what is returned by GetTokenData calls to the tokens package
func GetTokenMasterData ¶
GetTokenMasterData returns master data for token, or correct defaults if no master data found. This function returns valid data regardless of the token type (ERC20, ERC721, ERC1155).
type TokenDataFromSource ¶
type TokenDataFromSource struct { // ChainId uniquely identifies an EVM-compatible chain see https://chainlist.org/ ChainId string // Name is the token free text name Name string // Symbol is the short token symbol or ticker Symbol string // Decimals are how many decimal places the token has (ERC20 only, 0 for ERC721) Decimals int // TokenAddress is the contract address of the token TokenAddress string }
TokenDataFromSource is token master data from source: CSV file, cache, or chain