status-go/protocol/requests/add_contact.go

28 lines
581 B
Go
Raw Permalink Normal View History

package requests
import (
"errors"
)
var ErrAddContactInvalidID = errors.New("add-contact: invalid id")
type AddContact struct {
ID string `json:"id"`
Nickname string `json:"nickname"`
DisplayName string `json:"displayName"`
ENSName string `json:"ensName"`
CustomizationColor string `json:"customizationColor,omitempty"`
}
func (a *AddContact) Validate() error {
if len(a.ID) == 0 {
return ErrAddContactInvalidID
}
return nil
}
2022-10-14 08:50:36 +00:00
func (a *AddContact) HexID() (string, error) {
return ConvertCompressedToLegacyKey(a.ID)
}