Documentation ¶
Index ¶
- Constants
- func SendMessageNotifications(mnb []protocol.MessageNotificationBody)
- type API
- type CustomEvent
- type Database
- type MessageEvent
- type Notification
- type NotificationPreference
- type NotificationType
- 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 ¶
View Source
const ( CategoryTransaction PushCategory = "transaction" CategoryMessage PushCategory = "newMessage" TypeTransaction NotificationType = "transaction" TypeMessage NotificationType = "message" )
Variables ¶
This section is empty.
Functions ¶
func SendMessageNotifications ¶ added in v0.68.4
func SendMessageNotifications(mnb []protocol.MessageNotificationBody)
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 interface{} BodyType NotificationType `json:"bodyType"` 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"` }
func (*Notification) MarshalJSON ¶ added in v0.68.4
func (n *Notification) MarshalJSON() ([]byte, error)
func (*Notification) UnmarshalJSON ¶ added in v0.68.4
func (n *Notification) UnmarshalJSON(data []byte) error
type NotificationPreference ¶
type NotificationType ¶ added in v0.68.4
type NotificationType string
type PushCategory ¶
type PushCategory string
type Service ¶
type Service struct { WatchingEnabled bool // 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"` MaxKnownBlocks map[common.Address]*big.Int `json:"max-known-blocks"` }
TransactionEvent - structure used to pass messages from wallet to bus
Click to show internal directories.
Click to hide internal directories.