Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ETHToken = &Token{ Address: common.HexToAddress("0x0"), Symbol: "ETH", Decimals: 18, }
To unify transfers processing we mimic ETH to be a token. Address is set to 0 and not used for this "token".
Functions ¶
This section is empty.
Types ¶
type TokensDB ¶
type TokensDB interface { AddToken(token *Token) error GetToken(addr common.Address) (*Token, error) Close() }
func NewTokensDB ¶
type TokensManager ¶
type TokensManager interface { // Returns token for the given contract address or error. // For unknown tokens this fetches token details from the contract. // NOT THREAD SAFE GetToken(ctx context.Context, contractAddress common.Address) (*Token, error) // Returns token's balance for the given address or error. FetchBalance(ctx context.Context, token *Token, addr common.Address) (*big.Int, error) }
func NewTokensManager ¶
func NewTokensManager(client *ethclient.Client, tdb TokensDB) TokensManager
Click to show internal directories.
Click to hide internal directories.