github.com/status-im/status-go@v1.1.0/eth-node/types/whisper.go (about) 1 package types 2 3 import ( 4 "crypto/ecdsa" 5 "time" 6 ) 7 8 // Whisper represents a dark communication interface through the Ethereum 9 // network, using its very own P2P communication layer. 10 type Whisper interface { 11 PublicWhisperAPI() PublicWhisperAPI 12 13 // MinPow returns the PoW value required by this node. 14 MinPow() float64 15 // BloomFilter returns the aggregated bloom filter for all the topics of interest. 16 // The nodes are required to send only messages that match the advertised bloom filter. 17 // If a message does not match the bloom, it will tantamount to spam, and the peer will 18 // be disconnected. 19 BloomFilter() []byte 20 // SetTimeSource assigns a particular source of time to a whisper object. 21 SetTimeSource(timesource func() time.Time) 22 // GetCurrentTime returns current time. 23 GetCurrentTime() time.Time 24 MaxMessageSize() uint32 25 26 // GetPrivateKey retrieves the private key of the specified identity. 27 GetPrivateKey(id string) (*ecdsa.PrivateKey, error) 28 29 SubscribeEnvelopeEvents(events chan<- EnvelopeEvent) Subscription 30 31 // AddKeyPair imports a asymmetric private key and returns a deterministic identifier. 32 AddKeyPair(key *ecdsa.PrivateKey) (string, error) 33 // DeleteKeyPair deletes the key with the specified ID if it exists. 34 DeleteKeyPair(keyID string) bool 35 // DeleteKeyPairs removes all cryptographic identities known to the node 36 DeleteKeyPairs() error 37 AddSymKeyDirect(key []byte) (string, error) 38 AddSymKeyFromPassword(password string) (string, error) 39 DeleteSymKey(id string) bool 40 GetSymKey(id string) ([]byte, error) 41 42 Subscribe(opts *SubscriptionOptions) (string, error) 43 GetFilter(id string) Filter 44 Unsubscribe(id string) error 45 UnsubscribeMany(ids []string) error 46 47 // SyncMessages can be sent between two Mail Servers and syncs envelopes between them. 48 SyncMessages(peerID []byte, req SyncMailRequest) error 49 }