Documentation ¶
Index ¶
- Constants
- func PushMessages(ns []*Notification)
- type API
- type CustomEvent
- type Database
- type MessageEvent
- type Notification
- type NotificationAuthor
- type NotificationBody
- 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() 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" CategoryGroupInvite PushCategory = "groupInvite" CategoryCommunityRequestToJoin = "communityRequestToJoin" TypeTransaction NotificationType = "transaction" TypeMessage NotificationType = "message" )
Variables ¶
This section is empty.
Functions ¶
func PushMessages ¶ added in v0.74.2
func PushMessages(ns []*Notification)
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 Platform float32 Body NotificationBody BodyType NotificationType Title string Message string Category PushCategory Deeplink string Image string IsScheduled bool ScheduledTime string IsConversation bool IsGroupConversation bool ConversationID string Timestamp uint64 Author NotificationAuthor Deleted bool }
func (*Notification) MarshalJSON ¶ added in v0.68.4
func (n *Notification) MarshalJSON() ([]byte, error)
type NotificationAuthor ¶ added in v0.74.2
type NotificationBody ¶ added in v0.74.2
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"` 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.