2023-06-12 15:17:37 +00:00
|
|
|
package requests
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"github.com/status-im/status-go/eth-node/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
ErrCheckCommunityChannelPermissionsInvalidID = errors.New("check-community-channel-permissions: invalid id")
|
|
|
|
ErrCheckCommunityChannelPermissionsInvalidChatID = errors.New("check-community-channel-permissions: invalid chat id")
|
|
|
|
)
|
|
|
|
|
|
|
|
type CheckCommunityChannelPermissions struct {
|
|
|
|
CommunityID types.HexBytes
|
|
|
|
ChatID string
|
2023-08-18 19:50:23 +00:00
|
|
|
Addresses []string `json:"addresses"`
|
2023-06-12 15:17:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (u *CheckCommunityChannelPermissions) Validate() error {
|
|
|
|
if len(u.CommunityID) == 0 {
|
|
|
|
return ErrCheckCommunityChannelPermissionsInvalidID
|
|
|
|
}
|
|
|
|
if len(u.ChatID) == 0 {
|
|
|
|
return ErrCheckCommunityChannelPermissionsInvalidChatID
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|