Documentation
¶
Index ¶
- type ERC20Token
- type PairHandler
- func (ph *PairHandler) AddPair(token0, token1 ERC20Token)
- func (ph *PairHandler) AddProtocolPair(ctx context.Context, protocolName, contractAddress string, pair TokenPair)
- func (ph *PairHandler) FindProtocolsForPair(token0Address, token1Address string) []ProtocolPair
- func (ph *PairHandler) GetPair(token0Address, token1Address string) (TokenPair, bool)
- func (ph *PairHandler) GetProtocolPairs(token0Address, token1Address string) []ProtocolPair
- type ProtocolPair
- type TokenHandler
- type TokenPair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ERC20Token ¶
ERC20Token represents a single ERC20 token
func NewERC20Token ¶
func NewERC20Token(address common.Address, symbol string, decimals uint8) ERC20Token
type PairHandler ¶
type PairHandler struct { Pairs map[string]TokenPair ProtocolPairs map[string][]ProtocolPair // contains filtered or unexported fields }
PairHandler manages operations related to token pairs
func NewPairHandler ¶
func NewPairHandler(redisUrl string) *PairHandler
NewPairHandler creates a new PairHandler instance
func (*PairHandler) AddPair ¶
func (ph *PairHandler) AddPair(token0, token1 ERC20Token)
AddPair adds a new token pair to the handler
func (*PairHandler) AddProtocolPair ¶
func (ph *PairHandler) AddProtocolPair(ctx context.Context, protocolName, contractAddress string, pair TokenPair)
AddProtocolPair adds a new protocol pair to the handler
func (*PairHandler) FindProtocolsForPair ¶
func (ph *PairHandler) FindProtocolsForPair(token0Address, token1Address string) []ProtocolPair
FindProtocolsForPair finds all protocols that include the specified token pair
func (*PairHandler) GetPair ¶
func (ph *PairHandler) GetPair(token0Address, token1Address string) (TokenPair, bool)
GetPair retrieves a token pair from the handler
func (*PairHandler) GetProtocolPairs ¶
func (ph *PairHandler) GetProtocolPairs(token0Address, token1Address string) []ProtocolPair
GetProtocolPairs retrieves all protocol pairs for a given token pair
type ProtocolPair ¶
ProtocolPair represents a DeFi protocol contract address and its associated token pair
func NewProtocolPair ¶
func NewProtocolPair(protocolName, contractAddress string, pair TokenPair) ProtocolPair
type TokenHandler ¶
type TokenHandler struct {
// contains filtered or unexported fields
}
func NewTokenHandler ¶
func NewTokenHandler(redisUrl string, nodeUrl string) *TokenHandler
func (*TokenHandler) GetTokenData ¶
type TokenPair ¶
type TokenPair struct { Token0 ERC20Token Token1 ERC20Token }
TokenPair represents a pair of ERC20 tokens
func NewTokenPair ¶
func NewTokenPair(token0, token1 ERC20Token) TokenPair
Click to show internal directories.
Click to hide internal directories.