2021-10-25 10:25:37 +00:00
|
|
|
package requests
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"github.com/status-im/status-go/eth-node/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
var ErrAddContactInvalidID = errors.New("add-contact: invalid id")
|
|
|
|
|
|
|
|
type AddContact struct {
|
|
|
|
ID types.HexBytes `json:"id"`
|
|
|
|
Nickname string `json:"nickname"`
|
2021-10-29 15:18:21 +00:00
|
|
|
ENSName string `json:"ensName"`
|
2021-10-25 10:25:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *AddContact) Validate() error {
|
|
|
|
if len(a.ID) == 0 {
|
|
|
|
return ErrAddContactInvalidID
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|