Documentation ¶
Index ¶
Constants ¶
View Source
const ( EventBalanceHistoryUpdateStarted walletevent.EventType = "wallet-balance-history-update-started" EventBalanceHistoryUpdateFinished walletevent.EventType = "wallet-balance-history-update-finished" EventBalanceHistoryUpdateFinishedWithError walletevent.EventType = "wallet-balance-history-update-finished-with-error" )
EventBalanceHistoryUpdateStarted and EventBalanceHistoryUpdateDone are used to notify the UI that balance history is being updated
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BalanceDB ¶
type BalanceDB struct {
// contains filtered or unexported fields
}
func NewBalanceDB ¶
type DataSource ¶
type DataSource interface { HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) ChainID() uint64 Currency() string TimeNow() int64 }
DataSource used as an abstraction to fetch required data from a specific blockchain
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) GetBalanceHistory ¶
func (s *Service) GetBalanceHistory(ctx context.Context, chainIDs []uint64, address common.Address, currency string, endTimestamp int64, timeInterval TimeInterval) ([]*DataPoint, error)
GetBalanceHistory returns token count balance TODO: fetch token to FIAT exchange rates and return FIAT balance
func (*Service) StartBalanceHistory ¶
func (s *Service) StartBalanceHistory()
func (*Service) UpdateVisibleTokens ¶
type TimeInterval ¶
type TimeInterval int
const ( BalanceHistory7Days TimeInterval = iota + 1 BalanceHistory1Month BalanceHistory6Months BalanceHistory1Year BalanceHistoryAllTime )
Specific time intervals for which balance history can be fetched
Click to show internal directories.
Click to hide internal directories.