github.com/status-im/status-go@v1.1.0/services/gif/service.go (about) 1 package gif 2 3 import ( 4 "github.com/ethereum/go-ethereum/p2p" 5 "github.com/ethereum/go-ethereum/rpc" 6 7 "github.com/status-im/status-go/multiaccounts/accounts" 8 ) 9 10 // Service represents out own implementation of personal sign operations. 11 type Service struct { 12 accountsDB *accounts.Database 13 } 14 15 // New returns a new Service. 16 func NewService(db *accounts.Database) *Service { 17 return &Service{accountsDB: db} 18 } 19 20 // Protocols returns a new protocols list. In this case, there are none. 21 func (s *Service) Protocols() []p2p.Protocol { 22 return []p2p.Protocol{} 23 } 24 25 // APIs returns a list of new APIs. 26 func (s *Service) APIs() []rpc.API { 27 return []rpc.API{ 28 { 29 Namespace: "gif", 30 Version: "0.1.0", 31 Service: NewGifAPI(s.accountsDB), 32 Public: true, 33 }, 34 } 35 } 36 37 // Start is run when a service is started. 38 func (s *Service) Start() error { 39 return nil 40 } 41 42 // Stop is run when a service is stopped. 43 func (s *Service) Stop() error { 44 return nil 45 }