Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrPublicKeyIsEmpty thrown when public key is empty ErrPublicKeyIsEmpty = errors.New("public key is empty") // ErrInvalidPublicKey thrown when public key is invalid ErrInvalidPublicKey = errors.New("invalid public key") // ErrInvalidAddress thrown when address is invalid or not registered ErrInvalidAddress = errors.New("invalid address") // ErrPubKeyNotRegistered thrown when public key is not registered ErrPubKeyNotRegistered = errors.New("public key is not registered") )
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account interface { // RegisterAccount registers an account public key Register(ctx context.Context, pubKey string) error // GetPublicKey returns the base58 public key for the given address GetPublicKey(ctx context.Context, address string) (string, error) }
Account defines an interface API for registerening account addresses and their public keys
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is impementation of the Account interface
func NewService ¶
func NewService(db immudb.ImmuClient, logger *zap.SugaredLogger) *Service
NewService creates a new account service
func (Service) GetPublicKey ¶
GetPublicKey implements method of the Account interface, it takes blockchain address and returns the base58 encoded public key
Click to show internal directories.
Click to hide internal directories.