identity

package
v0.175.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2024 License: MPL-2.0, MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TwitterID      = "__twitter"
	PersonalSiteID = "__personal_site"
	GithubID       = "__github"
	YoutubeID      = "__youtube"
	DiscordID      = "__discord"
	TelegramID     = "__telegram"
)

static links which need to be decorated by the UI clients

Variables

View Source
var ErrorAccountVisibilityLowerThanCollectible = errors.New("account visibility lower than collectible")
View Source
var ErrorDublicateAccountAddress = errors.New("duplicate account address")
View Source
var ErrorNoAccountProvidedWithTokenOrCollectible = errors.New("no account provided with tokens or collectible")

Functions

func Slices

func Slices(compressedPubkey []byte) (res [4][]byte, err error)

compressedPubKey = |1.5 bytes chars cutoff|20 bytes emoji hash|10 bytes color hash|1.5 bytes chars cutoff|

func ToBigBase

func ToBigBase(value *big.Int, base uint64) (res [](uint64))

func ToBigInt

func ToBigInt(t *testing.T, str string) *big.Int

func ToColorID added in v0.98.3

func ToColorID(pubkey string) (int64, error)

func ToCompressedKey

func ToCompressedKey(pubkey string) ([]byte, error)

func Validate added in v0.174.8

func Validate(preferences *ProfileShowcasePreferences) error

Types

type ProfileShowcase added in v0.174.8

type ProfileShowcase struct {
	ContactID        string                            `json:"contactId"`
	Communities      []*ProfileShowcaseCommunity       `json:"communities"`
	Accounts         []*ProfileShowcaseAccount         `json:"accounts"`
	Collectibles     []*ProfileShowcaseCollectible     `json:"collectibles"`
	VerifiedTokens   []*ProfileShowcaseVerifiedToken   `json:"verifiedTokens"`
	UnverifiedTokens []*ProfileShowcaseUnverifiedToken `json:"unverifiedTokens"`
}

type ProfileShowcaseAccount added in v0.174.8

type ProfileShowcaseAccount struct {
	ContactID string `json:"contactId"`
	Address   string `json:"address"`
	Name      string `json:"name"`
	ColorID   string `json:"colorId"`
	Emoji     string `json:"emoji"`
	Order     int    `json:"order"`
}

type ProfileShowcaseAccountPreference added in v0.174.8

type ProfileShowcaseAccountPreference struct {
	Address            string                    `json:"address"`
	Name               string                    `json:"name"`
	ColorID            string                    `json:"colorId"`
	Emoji              string                    `json:"emoji"`
	ShowcaseVisibility ProfileShowcaseVisibility `json:"showcaseVisibility"`
	Order              int                       `json:"order"`
}

type ProfileShowcaseCollectible added in v0.174.8

type ProfileShowcaseCollectible struct {
	ContractAddress string `json:"contractAddress"`
	ChainID         uint64 `json:"chainId"`
	TokenID         string `json:"tokenId"`
	CommunityID     string `json:"communityId"`
	AccountAddress  string `json:"accountAddress"`
	Order           int    `json:"order"`
}

type ProfileShowcaseCollectiblePreference added in v0.174.8

type ProfileShowcaseCollectiblePreference struct {
	ContractAddress    string                    `json:"contractAddress"`
	ChainID            uint64                    `json:"chainId"`
	TokenID            string                    `json:"tokenId"`
	CommunityID        string                    `json:"communityId"`
	AccountAddress     string                    `json:"accountAddress"`
	ShowcaseVisibility ProfileShowcaseVisibility `json:"showcaseVisibility"`
	Order              int                       `json:"order"`
}

type ProfileShowcaseCommunity added in v0.174.8

type ProfileShowcaseCommunity struct {
	CommunityID      string                          `json:"communityId"`
	Order            int                             `json:"order"`
	MembershipStatus ProfileShowcaseMembershipStatus `json:"membershipStatus"`
}

type ProfileShowcaseCommunityPreference added in v0.174.8

type ProfileShowcaseCommunityPreference struct {
	CommunityID        string                    `json:"communityId"`
	ShowcaseVisibility ProfileShowcaseVisibility `json:"showcaseVisibility"`
	Order              int                       `json:"order"`
}

type ProfileShowcaseMembershipStatus added in v0.174.8

type ProfileShowcaseMembershipStatus int
const (
	ProfileShowcaseMembershipStatusUnproven ProfileShowcaseMembershipStatus = iota
	ProfileShowcaseMembershipStatusProvenMember
	ProfileShowcaseMembershipStatusNotAMember
)

type ProfileShowcasePreferences added in v0.174.8

type ProfileShowcasePreferences struct {
	Clock            uint64                                      `json:"clock"`
	Communities      []*ProfileShowcaseCommunityPreference       `json:"communities"`
	Accounts         []*ProfileShowcaseAccountPreference         `json:"accounts"`
	Collectibles     []*ProfileShowcaseCollectiblePreference     `json:"collectibles"`
	VerifiedTokens   []*ProfileShowcaseVerifiedTokenPreference   `json:"verifiedTokens"`
	UnverifiedTokens []*ProfileShowcaseUnverifiedTokenPreference `json:"unverifiedTokens"`
}

type ProfileShowcaseUnverifiedToken added in v0.174.8

type ProfileShowcaseUnverifiedToken struct {
	ContractAddress string `json:"contractAddress"`
	ChainID         uint64 `json:"chainId"`
	CommunityID     string `json:"communityId"`
	Order           int    `json:"order"`
}

type ProfileShowcaseUnverifiedTokenPreference added in v0.174.8

type ProfileShowcaseUnverifiedTokenPreference struct {
	ContractAddress    string                    `json:"contractAddress"`
	ChainID            uint64                    `json:"chainId"`
	CommunityID        string                    `json:"communityId"`
	ShowcaseVisibility ProfileShowcaseVisibility `json:"showcaseVisibility"`
	Order              int                       `json:"order"`
}

type ProfileShowcaseVerifiedToken added in v0.174.8

type ProfileShowcaseVerifiedToken struct {
	Symbol string `json:"symbol"`
	Order  int    `json:"order"`
}

type ProfileShowcaseVerifiedTokenPreference added in v0.174.8

type ProfileShowcaseVerifiedTokenPreference struct {
	Symbol             string                    `json:"symbol"`
	ShowcaseVisibility ProfileShowcaseVisibility `json:"showcaseVisibility"`
	Order              int                       `json:"order"`
}

type ProfileShowcaseVisibility added in v0.174.8

type ProfileShowcaseVisibility int
const (
	ProfileShowcaseVisibilityNoOne ProfileShowcaseVisibility = iota
	ProfileShowcaseVisibilityIDVerifiedContacts
	ProfileShowcaseVisibilityContacts
	ProfileShowcaseVisibilityEveryone
)
type SocialLink struct {
	Text string `json:"text"`
	URL  string `json:"url"`
}

func (*SocialLink) Equal added in v0.156.1

func (s *SocialLink) Equal(link *SocialLink) bool

func (*SocialLink) ToProtobuf added in v0.156.1

func (s *SocialLink) ToProtobuf() *protobuf.SocialLink
type SocialLinks []*SocialLink
func NewSocialLinks(links []*protobuf.SocialLink) SocialLinks

func (*SocialLinks) Contains added in v0.156.1

func (s *SocialLinks) Contains(link *SocialLink) bool

func (*SocialLinks) Equal added in v0.156.1

func (s *SocialLinks) Equal(links SocialLinks) bool

Equal means the same links at the same order

func (*SocialLinks) Serialize added in v0.105.1

func (s *SocialLinks) Serialize() ([]byte, error)

func (*SocialLinks) ToProtobuf added in v0.105.1

func (s *SocialLinks) ToProtobuf() []*protobuf.SocialLink

func (*SocialLinks) ToSyncProtobuf added in v0.156.1

func (s *SocialLinks) ToSyncProtobuf(clock uint64) *protobuf.SyncSocialLinks

type SocialLinksInfo added in v0.156.1

type SocialLinksInfo struct {
	Links   []*SocialLink `json:"links"`
	Removed bool          `json:"removed"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL