Documentation
¶
Index ¶
- type API
- type CustomEvent
- type Database
- type MessageEvent
- type Notification
- type NotificationPreference
- type PushCategory
- type Service
- func (s *Service) APIs() []rpc.API
- func (s *Service) IsStarted() bool
- func (s *Service) IsWatchingWallet() bool
- func (s *Service) Protocols() []p2p.Protocol
- func (s *Service) Start(_ *p2p.Server) error
- func (s *Service) StartWalletWatcher()
- func (s *Service) Stop() error
- func (s *Service) StopWalletWatcher()
- func (s *Service) SubscribeWallet(publisher *event.Feed) error
- type TransactionEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) NotificationPreferences ¶
func (api *API) NotificationPreferences(ctx context.Context) ([]NotificationPreference, error)
type CustomEvent ¶
type CustomEvent struct{}
CustomEvent - structure used to pass custom user set messages to bus
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) ChangeWalletPreference ¶
func (*Database) GetPreferences ¶
func (db *Database) GetPreferences() (rst []NotificationPreference, err error)
func (*Database) GetWalletPreference ¶
func (db *Database) GetWalletPreference() (rst NotificationPreference, err error)
type MessageEvent ¶
type MessageEvent struct{}
MessageEvent - structure used to pass messages from chat to bus
type Notification ¶
type Notification struct { ID common.Hash `json:"id"` Platform float32 `json:"platform,omitempty"` Body notificationBody `json:"body"` Category PushCategory `json:"category,omitempty"` Deeplink string `json:"deepLink,omitempty"` Image string `json:"imageUrl,omitempty"` IsScheduled bool `json:"isScheduled,omitempty"` ScheduledTime string `json:"scheduleTime,omitempty"` }
type NotificationPreference ¶
type PushCategory ¶
type PushCategory string
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service keeps the state of message bus
func (*Service) IsWatchingWallet ¶
IsWatchingWallet - check if local-notifications are subscribed to wallet updates
func (*Service) StartWalletWatcher ¶
func (s *Service) StartWalletWatcher()
StartWalletWatcher - Forward wallet events to notifications
func (*Service) StopWalletWatcher ¶
func (s *Service) StopWalletWatcher()
StopWalletWatcher - stops watching for new wallet events
type TransactionEvent ¶
type TransactionEvent struct { Type string `json:"type"` BlockNumber *big.Int `json:"block-number"` Accounts []common.Address `json:"accounts"` NewTransactionsPerAccount map[common.Address]int `json:"new-transactions"` ERC20 bool `json:"erc20"` }
TransactionEvent - structure used to pass messages from wallet to bus
Click to show internal directories.
Click to hide internal directories.