Documentation
¶
Overview ¶
Package tokendata contains the token data service
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImmutableTokenData ¶
type ImmutableTokenData interface {
// Decimals gets the number of decimals for a token
Decimals() uint8
// TokenID gets the tokenID
TokenID() string
// TokenAddress gets the Token's address
TokenAddress() string
}
ImmutableTokenData contains immutable token data (decimals and tokenID) as long as the token ID of an address does not change, this data is guaranteed to be accurate.
type Service ¶
type Service interface {
// GetTokenData attempts to get token data from the cache otherwise its fetched from the bridge config
GetTokenData(ctx context.Context, chainID uint32, token common.Address) (ImmutableTokenData, error)
// GetPoolTokenData attempts to get pool token data from the cache otherwise its fetched from the erc20 interface
GetPoolTokenData(ctx context.Context, chainID uint32, token common.Address, swapService fetcher.SwapService) (ImmutableTokenData, error)
// GetCCTPTokenData attempts to get the token symbol from the cctp contract
GetCCTPTokenData(ctx context.Context, chainID uint32, token common.Address, cctpService fetcher.CCTPService) (ImmutableTokenData, error)
}
Service provides data about tokens using either a cache or bridgeconfig cache keys sare always ${KEY_NAME}_CHAIN_ID_ADDRESS so unless a token changes tokenID's (not the other way around), data is guaranteed to be accurate.
Click to show internal directories.
Click to hide internal directories.