Documentation ¶
Index ¶
- type AccountDetail
- type Store
- func (s *Store) GetAccountDetail(address string) (*AccountDetail, error)
- func (s *Store) GetAllAccountDetails() ([]AccountDetail, error)
- func (s *Store) GetAllMonitoredAccounts() (map[string]*AccountDetail, error)
- func (s *Store) GetAllTokenDetails() (map[string]TokenDetail, error)
- func (s *Store) GetLastBlock(chainID uint8) (*big.Int, error)
- func (s *Store) GetTokenDetail(tokenAddress string) TokenDetail
- func (s *Store) Init() error
- func (s *Store) IsAccountMonitored(address string) (bool, error)
- func (s *Store) IsTxProcessed(txHash []byte) (bool, error)
- func (s *Store) StoreAccountDetail(detail AccountDetail) error
- func (s *Store) StoreLastBlock(blk *big.Int, chainID uint8) error
- func (s *Store) StoreProcessedTx(txHash []byte) error
- func (s *Store) UpdateTokenDetail(d TokenDetail) error
- type TokenDetail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountDetail ¶
type AccountDetail struct { Address string `json:"Address"` Name string `json:"Name"` Monitored bool `json:"Monitored,omitempty"` }
func (AccountDetail) String ¶
func (d AccountDetail) String() string
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewStore ¶
func NewStore(db db.KeyValueReaderWriter) *Store
NewStore creates a new Store with the given db.
func (*Store) GetAccountDetail ¶
func (s *Store) GetAccountDetail(address string) (*AccountDetail, error)
GetAccountDetail retrieves the detail of an Account given its address.
func (*Store) GetAllAccountDetails ¶
func (s *Store) GetAllAccountDetails() ([]AccountDetail, error)
GetAllAccountDetails retrieves all saved account details.
func (*Store) GetAllMonitoredAccounts ¶
func (s *Store) GetAllMonitoredAccounts() (map[string]*AccountDetail, error)
GetAllMonitoredAccounts retrieves all monitored account.
func (*Store) GetAllTokenDetails ¶
func (s *Store) GetAllTokenDetails() (map[string]TokenDetail, error)
func (*Store) GetLastBlock ¶
GetLastBlock retrieves the latest block for a given chainID from the db.
func (*Store) GetTokenDetail ¶
func (s *Store) GetTokenDetail(tokenAddress string) TokenDetail
func (*Store) IsAccountMonitored ¶
IsAccountMonitored checks if the given address is monitored.
func (*Store) IsTxProcessed ¶
IsTxProcessed checks if the given txHash has been processed.
func (*Store) StoreAccountDetail ¶
func (s *Store) StoreAccountDetail(detail AccountDetail) error
StoreAccountDetail stores the given AccountDetail to db.
func (*Store) StoreLastBlock ¶
StoreLastBlock stores the latest block for a given chainID to the db.
func (*Store) StoreProcessedTx ¶
StoreProcessedTx marks the given txHash as processed.
func (*Store) UpdateTokenDetail ¶
func (s *Store) UpdateTokenDetail(d TokenDetail) error
type TokenDetail ¶
type TokenDetail struct { // TokenName is the name of the token. TokenName string `json:"TokenName,omitempty" binding:"required"` // TokenAddress is the EVM address of the token. TokenAddress string `json:"TokenAddress" binding:"required"` // Decimals is the number of decimal places of the token. Decimals int `json:"Decimals" binding:"required"` // WhaleDefinition is the amount to trigger the whale alerts. WhaleDefinition float64 `json:"WhaleDefinition,omitempty"` }
Click to show internal directories.
Click to hide internal directories.