identity

package
v0.179.28 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MPL-2.0, MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var ErrorExceedMaxProfileShowcaseAccountsLimit = errors.New("exeed maximum profile showcase accounts limit")
View Source
var ErrorExceedMaxProfileShowcaseCollectiblesLimit = errors.New("exeed maximum profile showcase collectibles limit")
View Source
var ErrorExceedMaxProfileShowcaseCommunitiesLimit = errors.New("exeed maximum profile showcase communities limit")
View Source
var ErrorExceedMaxProfileShowcaseSocialLinksLimit = errors.New("exeed maximum profile showcase communities limit")
View Source
var ErrorExceedMaxProfileShowcaseUnverifiedTokensLimit = errors.New("exeed maximum profile showcase unverified tokens limit")
View Source
var ErrorExceedMaxProfileShowcaseVerifiedTokensLimit = errors.New("exeed maximum profile showcase verified tokens limit")
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"`
	SocialLinks      []*ProfileShowcaseSocialLink      `json:"socialLinks"`
}

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"`
	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"`
	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"`
	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"`
	Grant            []byte                          `json:"grant,omitempty"`
}

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"`
	SocialLinks      []*ProfileShowcaseSocialLinkPreference      `json:"socialLinks"`
}
type ProfileShowcaseSocialLink struct {
	URL   string `json:"url"`
	Text  string `json:"text"`
	Order int    `json:"order"`
}

type ProfileShowcaseSocialLinkPreference added in v0.176.1

type ProfileShowcaseSocialLinkPreference struct {
	URL                string                    `json:"url"`
	Text               string                    `json:"text"`
	ShowcaseVisibility ProfileShowcaseVisibility `json:"showcaseVisibility"`
	Order              int                       `json:"order"`
}

type ProfileShowcaseUnverifiedToken added in v0.174.8

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

type ProfileShowcaseUnverifiedTokenPreference added in v0.174.8

type ProfileShowcaseUnverifiedTokenPreference struct {
	ContractAddress    string                    `json:"contractAddress"`
	ChainID            uint64                    `json:"chainId"`
	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
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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