Documentation ¶
Index ¶
- Constants
- func GetTokenPegSymbol(symbol string) string
- type DefaultStore
- type List
- type ListWrapper
- type Manager
- func (tm *Manager) DeleteCustom(chainID uint64, address common.Address) error
- func (tm *Manager) DiscoverToken(ctx context.Context, chainID uint64, address common.Address) (*Token, error)
- func (tm *Manager) FindOrCreateTokenByAddress(ctx context.Context, chainID uint64, address common.Address) *Token
- func (tm *Manager) FindSNT(chainID uint64) *Token
- func (tm *Manager) FindToken(network *params.Network, tokenSymbol string) *Token
- func (tm *Manager) FindTokenByAddress(chainID uint64, address common.Address) *Token
- func (tm *Manager) GetAllTokens() ([]*Token, error)
- func (tm *Manager) GetBalance(ctx context.Context, client chain.ClientInterface, account common.Address, ...) (*big.Int, error)
- func (tm *Manager) GetBalancesAtByChain(parent context.Context, clients map[uint64]chain.ClientInterface, ...) (map[uint64]map[common.Address]map[common.Address]*hexutil.Big, error)
- func (tm *Manager) GetBalancesByChain(parent context.Context, clients map[uint64]chain.ClientInterface, ...) (map[uint64]map[common.Address]map[common.Address]*hexutil.Big, error)
- func (tm *Manager) GetChainBalance(ctx context.Context, client chain.ClientInterface, account common.Address) (*big.Int, error)
- func (tm *Manager) GetCustoms(onlyCommunityCustoms bool) ([]*Token, error)
- func (tm *Manager) GetList() *ListWrapper
- func (tm *Manager) GetToken(chainID uint64, tokenSymbol string) *Token
- func (tm *Manager) GetTokenBalance(ctx context.Context, client chain.ClientInterface, account common.Address, ...) (*big.Int, error)
- func (tm *Manager) GetTokenBalanceAt(ctx context.Context, client chain.ClientInterface, account common.Address, ...) (*big.Int, error)
- func (tm *Manager) GetTokens(chainID uint64) ([]*Token, error)
- func (tm *Manager) GetTokensByChainIDs(chainIDs []uint64) ([]*Token, error)
- func (tm *Manager) LookupToken(chainID *uint64, tokenSymbol string) (token *Token, isNative bool)
- func (tm *Manager) LookupTokenIdentity(chainID uint64, address common.Address, native bool) *Token
- func (tm *Manager) MarkAsPreviouslyOwnedToken(token *Token, owner common.Address) error
- func (tm *Manager) SetTokens(tokens []*Token)
- func (tm *Manager) SignalCommunityTokenReceived(address common.Address, txHash common.Hash, value *big.Int, t *Token)
- func (tm *Manager) ToToken(network *params.Network) *Token
- func (tm *Manager) UpsertCustom(token Token) error
- type ManagerInterface
- type ReceivedToken
- type Token
Constants ¶
View Source
const (
EventCommunityTokenReceived walletevent.EventType = "wallet-community-token-received"
)
Variables ¶
This section is empty.
Functions ¶
func GetTokenPegSymbol ¶ added in v0.131.11
Types ¶
type DefaultStore ¶ added in v0.138.8
type DefaultStore struct {
TokenListID []*Token
}
func (*DefaultStore) GetName ¶ added in v0.171.21
func (s *DefaultStore) GetName() string
func (*DefaultStore) GetSource ¶ added in v0.171.21
func (s *DefaultStore) GetSource() string
func (*DefaultStore) GetTokens ¶ added in v0.138.8
func (s *DefaultStore) GetTokens() []*Token
func (*DefaultStore) GetUpdatedAt ¶ added in v0.171.21
func (s *DefaultStore) GetUpdatedAt() int64
func (*DefaultStore) GetVersion ¶ added in v0.171.21
func (s *DefaultStore) GetVersion() string
type ListWrapper ¶ added in v0.173.0
type Manager ¶
type Manager struct { RPCClient *rpc.Client ContractMaker *contracts.ContractMaker // contains filtered or unexported fields }
Manager is used for accessing token store. It changes the token store based on overridden tokens
func NewTokenManager ¶
func (*Manager) DeleteCustom ¶
func (*Manager) DiscoverToken ¶
func (*Manager) FindOrCreateTokenByAddress ¶ added in v0.166.7
func (*Manager) FindTokenByAddress ¶ added in v0.156.1
func (*Manager) GetAllTokens ¶ added in v0.115.5
func (*Manager) GetBalance ¶
func (*Manager) GetBalancesAtByChain ¶ added in v0.167.5
func (*Manager) GetBalancesByChain ¶ added in v0.115.5
func (*Manager) GetChainBalance ¶
func (*Manager) GetCustoms ¶
func (*Manager) GetList ¶ added in v0.171.21
func (tm *Manager) GetList() *ListWrapper
func (*Manager) GetToken ¶ added in v0.159.2
GetToken returns token by chainID and tokenSymbol. Use ToToken for native token
func (*Manager) GetTokenBalance ¶
func (*Manager) GetTokenBalanceAt ¶ added in v0.125.2
func (*Manager) GetTokensByChainIDs ¶ added in v0.154.0
func (*Manager) LookupToken ¶ added in v0.159.2
func (*Manager) LookupTokenIdentity ¶ added in v0.159.2
func (*Manager) MarkAsPreviouslyOwnedToken ¶ added in v0.171.39
func (*Manager) SignalCommunityTokenReceived ¶ added in v0.172.1
func (*Manager) UpsertCustom ¶
type ManagerInterface ¶ added in v0.166.7
type ReceivedToken ¶ added in v0.172.1
type ReceivedToken struct { Address common.Address `json:"address"` Name string `json:"name"` Symbol string `json:"symbol"` Image string `json:"image,omitempty"` ChainID uint64 `json:"chainId"` CommunityData *community.Data `json:"community_data,omitempty"` Balance *big.Int `json:"balance"` TxHash common.Hash `json:"txHash"` }
type Token ¶
type Token struct { Address common.Address `json:"address"` Name string `json:"name"` Symbol string `json:"symbol"` // Decimals defines how divisible the token is. For example, 0 would be // indivisible, whereas 18 would allow very small amounts of the token // to be traded. Decimals uint `json:"decimals"` ChainID uint64 `json:"chainId"` // PegSymbol indicates that the token is pegged to some fiat currency, using the // ISO 4217 alphabetic code. For example, an empty string means it is not // pegged, while "USD" means it's pegged to the United States Dollar. PegSymbol string `json:"pegSymbol"` Image string `json:"image,omitempty"` CommunityData *community.Data `json:"community_data,omitempty"` Verified bool `json:"verified"` TokenListID string `json:"tokenListId"` }
Click to show internal directories.
Click to hide internal directories.