persist

package
v0.0.0-...-476b611 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceTypeUser ResourceType = iota
	ResourceTypeToken
	ResourceTypeCollection
	ResourceTypeGallery
	ResourceTypeAdmire
	ResourceTypeComment
	ResourceTypeCommunity
	ResourceTypePost
	ResourceTypeAllUsers
	ActionUserCreated                     Action = "UserCreated"
	ActionUserFollowedUsers               Action = "UserFollowedUsers"
	ActionUserPosted                      Action = "UserPosted"
	ActionUserPostedYourWork              Action = "UserPostedYourWork"
	ActionUserPostedFirstPost             Action = "UserPostedFirstPost"
	ActionCollectorsNoteAddedToToken      Action = "CollectorsNoteAddedToToken"
	ActionCollectionCreated               Action = "CollectionCreated"
	ActionCollectorsNoteAddedToCollection Action = "CollectorsNoteAddedToCollection"
	ActionTokensAddedToCollection         Action = "TokensAddedToCollection"
	ActionAdmiredFeedEvent                Action = "AdmiredFeedEvent"
	ActionAdmiredPost                     Action = "AdmiredPost"
	ActionAdmiredToken                    Action = "AdmiredToken"
	ActionAdmiredComment                  Action = "AdmiredComment"
	ActionCommentedOnFeedEvent            Action = "CommentedOnFeedEvent"
	ActionCommentedOnPost                 Action = "CommentedOnPost"
	ActionReplyToComment                  Action = "RepliedToComment"
	ActionMentionUser                     Action = "MentionUser"
	ActionMentionCommunity                Action = "MentionCommunity"
	ActionViewedGallery                   Action = "ViewedGallery"
	ActionViewedToken                     Action = "ViewedToken"
	ActionCollectionUpdated               Action = "CollectionUpdated"
	ActionGalleryUpdated                  Action = "GalleryUpdated"
	ActionGalleryInfoUpdated              Action = "GalleryInfoUpdated"
	ActionNewTokensReceived               Action = "NewTokensReceived"
	ActionTopActivityBadgeReceived        Action = "ActivityBadgeReceived"
	ActionAnnouncement                    Action = "Announcement"
	ActionUserFromFarcasterJoined         Action = "UserFromFarcasterJoined"
)
View Source
const (
	ReportReasonSpamAndOrBot         ReportReason = "SPAM_AND_OR_BOT"
	ReportReasonInappropriateContent              = "INAPPROPRIATE_CONTENT"
	ReportReasonSomethingElse                     = "SOMETHING_ELSE"
)

Variables

View Source
var EvmChains = util.MapKeys(evmChains)

Functions

func ContainsDBID

func ContainsDBID(pSrc []DBID, pID DBID) bool

func DBIDToNullStr

func DBIDToNullStr(id DBID) sql.NullString

func FailStep

func FailStep(status *PipelineStepStatus)

func NullStrToStr

func NullStrToStr(s sql.NullString) string

func StandardizeCollectionSections

func StandardizeCollectionSections(sections []int) []int

StandardizeCollectionSections formats the input sections to make it more convenient to parse.

func StrPtrToNullStr

func StrPtrToNullStr(s *string) sql.NullString

func ToJSONB

func ToJSONB(v any) (pgtype.JSONB, error)

func TrackStepStatus

func TrackStepStatus(ctx context.Context, status *PipelineStepStatus, name string) (func(), context.Context)

Types

type Action

type Action string

type ActionList

type ActionList []Action

type Address

type Address string

Address represents the value of an address

func (*Address) Scan

func (n *Address) Scan(value interface{}) error

Scan implements the database/sql Scanner interface for the NullString type

func (Address) String

func (n Address) String() string

func (Address) Value

func (n Address) Value() (driver.Value, error)

Value implements the database/sql driver Valuer interface for the NullString type

type AnnouncementDetails

type AnnouncementDetails struct {
	Platform             AnnouncementPlatform `json:"platform" binding:"required"`
	InternalID           string               `json:"internal_id" binding:"required"`
	ImageURL             string               `json:"image_url,omitempty"`
	Title                string               `json:"title,omitempty"`
	Description          string               `json:"description,omitempty"`
	CTAText              string               `json:"cta_text,omitempty"`
	CTALink              string               `json:"cta_link,omitempty"`
	PushNotificationText string               `json:"push_notification_text,omitempty"`
}

type AnnouncementPlatform

type AnnouncementPlatform string
const (
	AnnouncementPlatformWeb    AnnouncementPlatform = "Web"
	AnnouncementPlatformMobile AnnouncementPlatform = "Mobile"
	AnnouncementPlatformAll    AnnouncementPlatform = "All"
)

func (AnnouncementPlatform) IsValid

func (a AnnouncementPlatform) IsValid() bool

func (AnnouncementPlatform) MarshalGQL

func (c AnnouncementPlatform) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (AnnouncementPlatform) String

func (a AnnouncementPlatform) String() string

func (*AnnouncementPlatform) UnmarshalGQL

func (c *AnnouncementPlatform) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

type BlockNumber

type BlockNumber uint64

BlockNumber represents an Ethereum block number

func (BlockNumber) BigInt

func (b BlockNumber) BigInt() *big.Int

BigInt returns the ethereum block number as a big.Int

func (BlockNumber) Hex

func (b BlockNumber) Hex() string

Hex returns the ethereum block number as a hex string

func (*BlockNumber) Scan

func (b *BlockNumber) Scan(src interface{}) error

Scan implements the database/sql Scanner interface for the block number type

func (BlockNumber) String

func (b BlockNumber) String() string

func (BlockNumber) Uint64

func (b BlockNumber) Uint64() uint64

Uint64 returns the ethereum block number as a uint64

func (BlockNumber) Value

func (b BlockNumber) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface for the block number type

type BlockRange

type BlockRange [2]BlockNumber

BlockRange represents an inclusive block range

type Chain

type Chain int

Chain represents which blockchain a token is on

const (
	// ChainETH represents the Ethereum blockchain
	ChainETH Chain = iota
	// ChainArbitrum represents the Arbitrum blockchain
	ChainArbitrum
	// ChainPolygon represents the Polygon/Matic blockchain
	ChainPolygon
	// ChainOptimism represents the Optimism blockchain
	ChainOptimism
	// ChainTezos represents the Tezos blockchain
	ChainTezos
	// ChainPOAP represents a POAP
	ChainPOAP
	// ChainZora represents the Zora blockchain
	ChainZora
	// ChainBase represents the base chain
	ChainBase
	ChainBaseSepolia = Chain(84532)

	// MaxChainValue is the highest valid chain value, and should always be updated to
	// point to the most recently added chain type.
	MaxChainValue = ChainBase
)

func (Chain) BaseKeywords

func (c Chain) BaseKeywords() (image []string, anim []string)

BaseKeywords are the keywords that are default for discovering media for a given chain

func (Chain) L1Chain

func (c Chain) L1Chain() L1Chain

func (Chain) L1ChainGroup

func (c Chain) L1ChainGroup() []Chain

func (Chain) MarshalGQL

func (c Chain) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (Chain) NormalizeAddress

func (c Chain) NormalizeAddress(addr Address) string

NormalizeAddress normalizes an address for the given chain

func (*Chain) Scan

func (c *Chain) Scan(src interface{}) error

Scan implements the sql.Scanner interface for the Chain type

func (Chain) String

func (c Chain) String() string

func (*Chain) UnmarshalGQL

func (c *Chain) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*Chain) UnmarshalJSON

func (c *Chain) UnmarshalJSON(data []byte) error

UnmarshalJSON will unmarshall the JSON data into the Chain type

func (Chain) Value

func (c Chain) Value() (driver.Value, error)

Value implements the driver.Valuer interface for the Chain type

type ChainAddress

type ChainAddress struct {
	// contains filtered or unexported fields
}

func NewChainAddress

func NewChainAddress(address Address, chain Chain) ChainAddress

func (*ChainAddress) Address

func (c *ChainAddress) Address() Address

func (*ChainAddress) Chain

func (c *ChainAddress) Chain() Chain

func (*ChainAddress) GQLSetAddressFromResolver

func (c *ChainAddress) GQLSetAddressFromResolver(address Address) error

GQLSetAddressFromResolver will be called automatically from the required gqlgen resolver and should never be called manually. To set a ChainAddress's fields, use NewChainAddress.

func (*ChainAddress) GQLSetChainFromResolver

func (c *ChainAddress) GQLSetChainFromResolver(chain Chain) error

GQLSetChainFromResolver will be called automatically from the required gqlgen resolver and should never be called manually. To set a ChainAddress's fields, use NewChainAddress.

func (*ChainAddress) IsGalleryUserOrAddress

func (c *ChainAddress) IsGalleryUserOrAddress()

IsGalleryUserOrAddress is an empty function that satisfies the gqlgen IsGalleryUserOrAddress interface, allowing ChainAddress to be used in GraphQL resolvers that return the GalleryUserOrAddress type.

func (ChainAddress) MarshalJSON

func (c ChainAddress) MarshalJSON() ([]byte, error)

func (ChainAddress) String

func (c ChainAddress) String() string

func (ChainAddress) ToL1ChainAddress

func (c ChainAddress) ToL1ChainAddress() L1ChainAddress

func (*ChainAddress) UnmarshalJSON

func (c *ChainAddress) UnmarshalJSON(data []byte) error

type ChainPubKey

type ChainPubKey struct {
	// contains filtered or unexported fields
}

func NewChainPubKey

func NewChainPubKey(pubKey PubKey, chain Chain) ChainPubKey

func (*ChainPubKey) Chain

func (c *ChainPubKey) Chain() Chain

func (*ChainPubKey) GQLSetChainFromResolver

func (c *ChainPubKey) GQLSetChainFromResolver(chain Chain) error

GQLSetChainFromResolver will be called automatically from the required gqlgen resolver and should never be called manually. To set a ChainPubKey's fields, use NewChainPubKey.

func (*ChainPubKey) GQLSetPubKeyFromResolver

func (c *ChainPubKey) GQLSetPubKeyFromResolver(pubKey PubKey) error

GQLSetPubKeyFromResolver will be called automatically from the required gqlgen resolver and should never be called manually. To set a ChainPubKey's fields, use NewChainPubKey.

func (*ChainPubKey) PubKey

func (c *ChainPubKey) PubKey() PubKey

func (ChainPubKey) String

func (c ChainPubKey) String() string

func (ChainPubKey) ToChainAddress

func (c ChainPubKey) ToChainAddress() ChainAddress

ToChainAddress converts a chain pub key to a chain address

func (ChainPubKey) ToL1ChainAddress

func (c ChainPubKey) ToL1ChainAddress() L1ChainAddress

type Collection

type Collection struct {
	Version        NullInt32                        `json:"version"` // schema version for this model
	ID             DBID                             `json:"id" binding:"required"`
	CreationTime   time.Time                        `json:"created_at"`
	Deleted        NullBool                         `json:"-"`
	LastUpdated    time.Time                        `json:"last_updated"`
	Layout         TokenLayout                      `json:"layout"`
	Name           NullString                       `json:"name"`
	CollectorsNote NullString                       `json:"collectors_note"`
	OwnerUserID    DBID                             `json:"owner_user_id"`
	GalleryID      DBID                             `json:"gallery_id"`
	NFTs           []DBID                           `json:"nfts"`
	Hidden         NullBool                         `json:"hidden"` // collections can be hidden from public-viewing
	TokenSettings  map[DBID]CollectionTokenSettings `json:"token_settings"`
}

Collection represents a collection of NFTs in the application. Collection will contain the value of each NFT represented as a struct as opposed to just the ID of the NFT This struct will always be decoded from a get database operation and will be used throughout the application where CollectionDB does not apply

type CollectionDB

type CollectionDB struct {
	Version        NullInt32                        `json:"version"` // schema version for this model
	ID             DBID                             `json:"id" binding:"required"`
	CreationTime   time.Time                        `json:"created_at"`
	Deleted        NullBool                         `json:"-"`
	LastUpdated    time.Time                        `json:"last_updated"`
	Layout         TokenLayout                      `json:"layout"`
	Name           NullString                       `json:"name"`
	CollectorsNote NullString                       `json:"collectors_note"`
	OwnerUserID    DBID                             `json:"owner_user_id"`
	GalleryID      DBID                             `json:"gallery_id"`
	Tokens         []DBID                           `json:"tokens"`
	Hidden         NullBool                         `json:"hidden"` // collections can be hidden from public-viewing
	TokenSettings  map[DBID]CollectionTokenSettings `json:"token_settings"`
}

CollectionDB is the struct that represents a collection of tokens in the database CollectionDB will not store the tokens by value but instead by ID creating a join relationship between collections and tokens This struct will only be used when updating or querying the database

type CollectionRepository

type CollectionRepository interface {
	Create(context.Context, CollectionDB) (DBID, error)
	Update(context.Context, DBID, DBID, interface{}) error
	UpdateTokens(context.Context, DBID, DBID, CollectionUpdateTokensInput) error
	Delete(context.Context, DBID, DBID) error
}

CollectionRepository represents the interface for interacting with the collection persistence layer

type CollectionSectionLayout

type CollectionSectionLayout struct {
	Columns    NullInt32 `json:"columns"`
	Whitespace []int     `json:"whitespace"`
}

CollectionSectionLayout defines the layout of a section in a collection

type CollectionTokenSettings

type CollectionTokenSettings struct {
	RenderLive     bool `json:"render_live"`
	HighDefinition bool `json:"high_definition"`
}

CollectionTokenSettings represents configurable token display options per collection

func (*CollectionTokenSettings) Scan

func (s *CollectionTokenSettings) Scan(value interface{}) error

Scan implements the Scanner interface for the CollectionTokenSettings type

func (CollectionTokenSettings) Value

Value implements the driver.Valuer interface for the CollectionTokenSettings type

type CollectionUpdateDeletedInput

type CollectionUpdateDeletedInput struct {
	LastUpdated time.Time `json:"last_updated"`

	Deleted NullBool `json:"-"`
}

CollectionUpdateDeletedInput represents the data that will be changed when updating a collection's deleted status

type CollectionUpdateHiddenInput

type CollectionUpdateHiddenInput struct {
	LastUpdated time.Time `json:"last_updated"`

	Hidden NullBool `json:"hidden"`
}

CollectionUpdateHiddenInput represents the data that will be changed when updating a collection's hidden status

type CollectionUpdateInfoInput

type CollectionUpdateInfoInput struct {
	LastUpdated time.Time `json:"last_updated"`

	Name           NullString `json:"name"`
	CollectorsNote NullString `json:"collectors_note"`
}

CollectionUpdateInfoInput represents the data that will be changed when updating a collection's metadata

type CollectionUpdateTokensInput

type CollectionUpdateTokensInput struct {
	LastUpdated   time.Time                        `json:"last_updated"`
	Tokens        []DBID                           `json:"tokens"`
	Layout        TokenLayout                      `json:"layout"`
	TokenSettings map[DBID]CollectionTokenSettings `json:"token_settings"`
	Version       int                              `json:"version"`
}

CollectionUpdateTokensInput represents the data that will be changed when updating a collection's NFTs

type Comment

type Comment struct {
	ID          DBID      `json:"id"`
	CreatedAt   time.Time `json:"created_at"`
	LastUpdated time.Time `json:"last_updated"`
	FeedEventID DBID      `json:"feed_event_id"`
	ActorID     DBID      `json:"actor_id"`
	ReplyTo     DBID      `json:"reply_to"`
	Comment     string    `json:"comment"`
	Deleted     bool      `json:"deleted"`
}

type CommunityCreatorType

type CommunityCreatorType int
const (
	CommunityCreatorTypeOverride CommunityCreatorType = iota
	CommunityCreatorTypeProvider
)

type CommunityKey

type CommunityKey struct {
	Type CommunityType
	Key1 string
	Key2 string
	Key3 string
	Key4 string
}

func (CommunityKey) String

func (k CommunityKey) String() string

type CommunityType

type CommunityType int
const (
	CommunityTypeContract CommunityType = iota
	CommunityTypeArtBlocks
)

func (CommunityType) MarshalGQL

func (c CommunityType) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*CommunityType) UnmarshalGQL

func (c *CommunityType) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

type CompleteIndex

type CompleteIndex struct {
	Index  int `json:"start"`
	Length int `json:"end"`
}

func (*CompleteIndex) Scan

func (c *CompleteIndex) Scan(value interface{}) error

func (CompleteIndex) Value

func (c CompleteIndex) Value() (driver.Value, error)

type Contract

type Contract struct {
	Version      NullInt32 `json:"version"` // schema version for this model
	ID           DBID      `json:"id" binding:"required"`
	CreationTime time.Time `json:"created_at"`
	Deleted      NullBool  `json:"-"`
	LastUpdated  time.Time `json:"last_updated"`

	Chain Chain `json:"chain"`

	Address        EthereumAddress     `json:"address"`
	Symbol         NullString          `json:"symbol"`
	Name           NullString          `json:"name"`
	OwnerAddress   EthereumAddress     `json:"owner_address"`
	CreatorAddress EthereumAddress     `json:"creator_address"`
	OwnerMethod    ContractOwnerMethod `json:"owner_method"`

	LatestBlock BlockNumber `json:"latest_block"`
}

Contract represents an ethereum contract in the database

type ContractCollectionNFT

type ContractCollectionNFT struct {
	ContractName  NullString `json:"name"`
	ContractImage NullString `json:"image_url"`
}

ContractCollectionNFT represents a contract within a collection nft

type ContractGallery

type ContractGallery struct {
	Version      NullInt32 `json:"version"` // schema version for this model
	ID           DBID      `json:"id" binding:"required"`
	ParentID     DBID      `json:"parent_id"`
	CreationTime time.Time `json:"created_at"`
	Deleted      NullBool  `json:"-"`
	LastUpdated  time.Time `json:"last_updated"`

	Chain                 Chain      `json:"chain"`
	L1Chain               L1Chain    `json:"l1_chain"`
	Address               Address    `json:"address"`
	Symbol                NullString `json:"symbol"`
	Name                  NullString `json:"name"`
	Description           NullString `json:"description"`
	OwnerAddress          Address    `json:"owner_address"`
	CreatorAddress        Address    `json:"creator_address"`
	ProfileImageURL       NullString `json:"profile_image_url"`
	ProfileBannerURL      NullString `json:"profile_banner_url"`
	BadgeURL              NullString `json:"badge_url"`
	IsProviderMarkedSpam  bool       `json:"is_provider_marked_spam"`
	OverrideCreatorUserID DBID       `json:"override_creator_user_id"`

	// this will not be persisted, only used in memory for contract comparison
	Priority *int `json:"-"`
}

ContractGallery represents a smart contract in the database

func (ContractGallery) ContractIdentifiers

func (c ContractGallery) ContractIdentifiers() ContractIdentifiers

type ContractGalleryRepository

type ContractGalleryRepository interface {
	GetByID(ctx context.Context, id DBID) (ContractGallery, error)
	GetByAddress(context.Context, Address, Chain) (ContractGallery, error)
	GetByTokenIDs(context.Context, DBIDList) ([]ContractGallery, error)
	UpsertByAddress(context.Context, Address, Chain, ContractGallery) error
	BulkUpsert(context.Context, []ContractGallery, bool) ([]ContractGallery, error)
	GetOwnersByAddress(context.Context, Address, Chain, int, int) ([]TokenHolder, error)
}

ContractGalleryRepository represents a repository for interacting with persisted contracts

type ContractIdentifiers

type ContractIdentifiers struct {
	ContractAddress Address `json:"contract_address"`
	Chain           Chain   `json:"chain"`
}

ContractIdentifiers represents a unique identifier for a contract

func NewContractIdentifiers

func NewContractIdentifiers(pContractAddress Address, pChain Chain) ContractIdentifiers

NewContractIdentifiers creates a new contract identifiers

func (ContractIdentifiers) String

func (c ContractIdentifiers) String() string

type ContractOwnerMethod

type ContractOwnerMethod int
const (
	ContractOwnerMethodFailed ContractOwnerMethod = iota
	ContractOwnerMethodOwnable
	ContractOwnerMethodAlchemy
	ContractOwnerBinarySearch
)

func (*ContractOwnerMethod) Scan

func (c *ContractOwnerMethod) Scan(src interface{}) error

Scan implements the sql.Scanner interface for the Chain type

func (ContractOwnerMethod) Value

func (c ContractOwnerMethod) Value() (driver.Value, error)

Value implements the driver.Valuer interface for the Chain type

type ContractRepository

type ContractRepository interface {
	GetByAddress(context.Context, EthereumAddress) (Contract, error)
	UpdateByAddress(context.Context, EthereumAddress, ContractUpdateInput) error
	GetContractsOwnedByAddress(context.Context, EthereumAddress) ([]Contract, error)
	BulkUpsert(context.Context, []Contract) error
	MostRecentBlock(context.Context) (BlockNumber, error)
}

ContractRepository represents a repository for interacting with persisted contracts

type ContractUpdateInput

type ContractUpdateInput struct {
	Symbol         NullString      `json:"symbol"`
	Name           NullString      `json:"name"`
	OwnerAddress   EthereumAddress `json:"owner_address"`
	CreatorAddress EthereumAddress `json:"creator_address"`

	LatestBlock BlockNumber `json:"latest_block"`
}

ContractUpdateInput is the input for updating contract metadata fields

type CreateLoginAttemptInput

type CreateLoginAttemptInput struct {
	Address        Wallet     `json:"address"`
	Signature      string     `json:"signature"`
	NonceValue     string     `json:"nonce_value"`
	UserExists     bool       `json:"user_exists"`
	SignatureValid bool       `json:"signature_valid"`
	ReqHostAddr    string     `json:"req_host_addr"`
	ReqHeaders     ReqHeaders `json:"req_headers"`
}

CreateLoginAttemptInput is a type that holds the input for creating a login attempt

type CreateUserInput

type CreateUserInput struct {
	Username                   string
	Bio                        string
	Email                      *Email
	EmailStatus                EmailVerificationStatus
	ChainAddress               ChainAddress
	WalletType                 WalletType
	Universal                  bool
	EmailNotificationsSettings EmailUnsubscriptions
	PrivyDID                   *string
}

type DBID

type DBID string

DBID represents a database ID

func GenerateID

func GenerateID() DBID

GenerateID generates a application-wide unique ID

func NullStrToDBID

func NullStrToDBID(s sql.NullString) DBID

func RemoveDuplicateDBIDs

func RemoveDuplicateDBIDs(a []DBID) []DBID

RemoveDuplicateDBIDs ensures that an array of DBIDs has no repeat items

func ToDBIDs

func ToDBIDs[T any](them []T, convert func(T) (DBID, error)) ([]DBID, error)

func (*DBID) Scan

func (d *DBID) Scan(i interface{}) error

Scan implements the database/sql Scanner interface for the DBID type

func (DBID) String

func (d DBID) String() string

func (DBID) Value

func (d DBID) Value() (driver.Value, error)

Value implements the database/sql driver Valuer interface for the DBID type

type DBIDList

type DBIDList []DBID

DBIDList is a slice of DBIDs, used to implement scanner/valuer interfaces

func (*DBIDList) Scan

func (l *DBIDList) Scan(value interface{}) error

Scan implements the Scanner interface for the DBIDList type

func (DBIDList) Value

func (l DBIDList) Value() (driver.Value, error)

type DBIDTuple

type DBIDTuple [2]DBID

type DarkMode

type DarkMode int
const (
	DarkModeDisabled DarkMode = iota
	DarkModeEnabled
)

func (DarkMode) MarshalGQL

func (d DarkMode) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*DarkMode) UnmarshalGQL

func (d *DarkMode) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

type DecimalTokenID

type DecimalTokenID string

func (DecimalTokenID) BigInt

func (id DecimalTokenID) BigInt() *big.Int

BigInt returns the token ID as a big.Int

func (*DecimalTokenID) DecodeBinary

func (id *DecimalTokenID) DecodeBinary(ci *pgtype.ConnInfo, src []byte) error

func (DecimalTokenID) MarshalGQL

func (id DecimalTokenID) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (DecimalTokenID) Numeric

func (id DecimalTokenID) Numeric() pgtype.Numeric

func (*DecimalTokenID) Scan

func (id *DecimalTokenID) Scan(src interface{}) error

Scan implements the sql.Scanner interface for token IDs

func (DecimalTokenID) String

func (id DecimalTokenID) String() string

func (DecimalTokenID) ToHexTokenID

func (id DecimalTokenID) ToHexTokenID() HexTokenID

Base10String returns the token ID as a base 10 string

func (*DecimalTokenID) UnmarshalGQL

func (id *DecimalTokenID) UnmarshalGQL(v any) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (DecimalTokenID) Value

func (id DecimalTokenID) Value() (driver.Value, error)

Value implements the driver.Valuer interface for token IDs

type DecimalTokenIDList

type DecimalTokenIDList []DecimalTokenID

func (*DecimalTokenIDList) Scan

func (l *DecimalTokenIDList) Scan(value interface{}) error

func (DecimalTokenIDList) Value

func (l DecimalTokenIDList) Value() (driver.Value, error)

type Dimensions

type Dimensions struct {
	Width  int `json:"width"`
	Height int `json:"height"`
}

func (Dimensions) Valid

func (d Dimensions) Valid() bool

type EarlyAccessRepository

type EarlyAccessRepository interface {
	IsAllowedByAddresses(context.Context, []ChainAddress) (bool, error)
}

type Email

type Email string

func (*Email) Scan

func (e *Email) Scan(src interface{}) error

func (Email) String

func (e Email) String() string

func (Email) Value

func (e Email) Value() (driver.Value, error)

type EmailType

type EmailType string
const (
	EmailTypeNotifications EmailType = "notifications"
	EmailTypeAdmin         EmailType = "admin"
	EmailTypeDigest        EmailType = "digest"
	EmailTypeMarketing     EmailType = "marketing"
	EmailTypeMembersClub   EmailType = "members_club"
)

func (*EmailType) Scan

func (e *EmailType) Scan(src interface{}) error

func (EmailType) String

func (e EmailType) String() string

func (EmailType) Value

func (e EmailType) Value() (driver.Value, error)

type EmailUnsubscriptions

type EmailUnsubscriptions struct {
	All           NullBool `json:"all"`
	Notifications NullBool `json:"notifications"`
	Digest        NullBool `json:"digest"`
	Marketing     NullBool `json:"marketing"`
	MembersClub   NullBool `json:"members_club"`
}

func (*EmailUnsubscriptions) Scan

func (e *EmailUnsubscriptions) Scan(src interface{}) error

func (EmailUnsubscriptions) Value

func (e EmailUnsubscriptions) Value() (driver.Value, error)

type EmailVerificationStatus

type EmailVerificationStatus int
const (
	EmailVerificationStatusUnverified EmailVerificationStatus = iota
	EmailVerificationStatusVerified
	EmailVerificationStatusFailed
	EmailVerificationStatusAdmin
)

func (EmailVerificationStatus) IsVerified

func (e EmailVerificationStatus) IsVerified() bool

func (EmailVerificationStatus) MarshalGQL

func (e EmailVerificationStatus) MarshalGQL(w io.Writer)

func (*EmailVerificationStatus) Scan

func (e *EmailVerificationStatus) Scan(src interface{}) error

func (EmailVerificationStatus) String

func (e EmailVerificationStatus) String() string

func (*EmailVerificationStatus) UnmarshalGQL

func (e *EmailVerificationStatus) UnmarshalGQL(v interface{}) error

func (EmailVerificationStatus) Value

type ErrAddressNotOwnedByUser

type ErrAddressNotOwnedByUser struct {
	ChainAddress ChainAddress
	UserID       DBID
}

func (ErrAddressNotOwnedByUser) Error

func (e ErrAddressNotOwnedByUser) Error() string

type ErrAddressOwnedByUser

type ErrAddressOwnedByUser struct {
	ChainAddress ChainAddress
	OwnerID      DBID
}

func (ErrAddressOwnedByUser) Error

func (e ErrAddressOwnedByUser) Error() string

type ErrAdmireNotFound

type ErrAdmireNotFound struct{}

func (ErrAdmireNotFound) Error

func (e ErrAdmireNotFound) Error() string

func (ErrAdmireNotFound) Unwrap

func (e ErrAdmireNotFound) Unwrap() error

type ErrAdmireNotFoundByActorIDCommentID

type ErrAdmireNotFoundByActorIDCommentID struct {
	ActorID   DBID
	CommentID DBID
}

func (ErrAdmireNotFoundByActorIDCommentID) Error

func (ErrAdmireNotFoundByActorIDCommentID) Unwrap

type ErrAdmireNotFoundByActorIDFeedEventID

type ErrAdmireNotFoundByActorIDFeedEventID struct {
	ActorID     DBID
	FeedEventID DBID
}

func (ErrAdmireNotFoundByActorIDFeedEventID) Error

func (ErrAdmireNotFoundByActorIDFeedEventID) Unwrap

type ErrAdmireNotFoundByActorIDPostID

type ErrAdmireNotFoundByActorIDPostID struct {
	ActorID DBID
	PostID  DBID
}

func (ErrAdmireNotFoundByActorIDPostID) Error

func (ErrAdmireNotFoundByActorIDPostID) Unwrap

type ErrAdmireNotFoundByActorIDTokenID

type ErrAdmireNotFoundByActorIDTokenID struct {
	ActorID DBID
	TokenID DBID
}

func (ErrAdmireNotFoundByActorIDTokenID) Error

func (ErrAdmireNotFoundByActorIDTokenID) Unwrap

type ErrAdmireNotFoundByID

type ErrAdmireNotFoundByID struct{ ID DBID }

func (ErrAdmireNotFoundByID) Error

func (e ErrAdmireNotFoundByID) Error() string

func (ErrAdmireNotFoundByID) Unwrap

func (e ErrAdmireNotFoundByID) Unwrap() error

type ErrCollectionNotFoundByID

type ErrCollectionNotFoundByID struct {
	ID DBID
}

ErrCollectionNotFoundByID is returned when a collection is not found by ID

func (ErrCollectionNotFoundByID) Error

type ErrCommentNotFound

type ErrCommentNotFound struct{}

func (ErrCommentNotFound) Error

func (e ErrCommentNotFound) Error() string

func (ErrCommentNotFound) Unwrap

func (e ErrCommentNotFound) Unwrap() error

type ErrCommentNotFoundByID

type ErrCommentNotFoundByID struct{ ID DBID }

func (ErrCommentNotFoundByID) Error

func (e ErrCommentNotFoundByID) Error() string

func (ErrCommentNotFoundByID) Unwrap

func (e ErrCommentNotFoundByID) Unwrap() error

type ErrCommunityNotFound

type ErrCommunityNotFound struct {
	ID  DBID
	Key CommunityKey
}

func (ErrCommunityNotFound) Error

func (e ErrCommunityNotFound) Error() string

type ErrContractCreatorNotFound

type ErrContractCreatorNotFound struct {
	ContractID DBID
}

func (ErrContractCreatorNotFound) Error

type ErrContractNotFound

type ErrContractNotFound struct{}

func (ErrContractNotFound) Error

func (e ErrContractNotFound) Error() string

func (ErrContractNotFound) Unwrap

func (e ErrContractNotFound) Unwrap() error

type ErrContractNotFoundByAddress

type ErrContractNotFoundByAddress struct {
	Address Address
	Chain   Chain
}

ErrContractNotFoundByAddress is an error type for when a contract is not found by address

func (ErrContractNotFoundByAddress) Error

func (ErrContractNotFoundByAddress) Unwrap

type ErrFeedEventNotFound

type ErrFeedEventNotFound struct{}

func (ErrFeedEventNotFound) Error

func (e ErrFeedEventNotFound) Error() string

func (ErrFeedEventNotFound) Unwrap

func (e ErrFeedEventNotFound) Unwrap() error

type ErrFeedEventNotFoundByID

type ErrFeedEventNotFoundByID struct{ ID DBID }

func (ErrFeedEventNotFoundByID) Error

func (e ErrFeedEventNotFoundByID) Error() string

func (ErrFeedEventNotFoundByID) Unwrap

func (e ErrFeedEventNotFoundByID) Unwrap() error

type ErrGalleryNotFound

type ErrGalleryNotFound struct {
	ID           DBID
	CollectionID DBID
}

ErrGalleryNotFound is returned when a gallery is not found by its ID

func (ErrGalleryNotFound) Error

func (e ErrGalleryNotFound) Error() string

type ErrInvalidLayout

type ErrInvalidLayout struct {
	Layout CollectionSectionLayout
	Reason string
}

ErrInvalidLayout is returned when a layout is invalid

func (ErrInvalidLayout) Error

func (e ErrInvalidLayout) Error() string

type ErrMediaNotFound

type ErrMediaNotFound struct{}

func (ErrMediaNotFound) Error

func (e ErrMediaNotFound) Error() string

func (ErrMediaNotFound) Unwrap

func (e ErrMediaNotFound) Unwrap() error

type ErrMediaNotFoundByID

type ErrMediaNotFoundByID struct{ ID DBID }

func (ErrMediaNotFoundByID) Error

func (e ErrMediaNotFoundByID) Error() string

func (ErrMediaNotFoundByID) Unwrap

func (e ErrMediaNotFoundByID) Unwrap() error

type ErrMembershipNotFoundByID

type ErrMembershipNotFoundByID struct {
	ID DBID
}

ErrMembershipNotFoundByID represents an error when a membership is not found by its id

func (ErrMembershipNotFoundByID) Error

type ErrMembershipNotFoundByName

type ErrMembershipNotFoundByName struct {
	Name string
}

ErrMembershipNotFoundByName represents an error when a membership is not found by name

func (ErrMembershipNotFoundByName) Error

type ErrMembershipNotFoundByTokenID

type ErrMembershipNotFoundByTokenID struct {
	TokenID HexTokenID
}

ErrMembershipNotFoundByTokenID represents an error when a membership is not found by token id

func (ErrMembershipNotFoundByTokenID) Error

type ErrNonceNotFoundForAddress

type ErrNonceNotFoundForAddress struct {
	L1ChainAddress L1ChainAddress
}

ErrNonceNotFoundForAddress is returned when no nonce is found for a given address

func (ErrNonceNotFoundForAddress) Error

type ErrNotFound

type ErrNotFound struct{}

ErrNotFound is a general error for when some entity is not found. Errors should wrap this error to provide more details on what was not found (e.g. ErrUserNotFound) and how it was not found (e.g. ErrUserNotFoundByID)

func (ErrNotFound) Error

func (e ErrNotFound) Error() string

type ErrPostNotFound

type ErrPostNotFound struct{}

func (ErrPostNotFound) Error

func (e ErrPostNotFound) Error() string

func (ErrPostNotFound) Unwrap

func (e ErrPostNotFound) Unwrap() error

type ErrPostNotFoundByID

type ErrPostNotFoundByID struct{ ID DBID }

func (ErrPostNotFoundByID) Error

func (e ErrPostNotFoundByID) Error() string

func (ErrPostNotFoundByID) Unwrap

func (e ErrPostNotFoundByID) Unwrap() error

type ErrProfileImageNotFound

type ErrProfileImageNotFound struct {
	Err            error
	ProfileImageID DBID
}

func (ErrProfileImageNotFound) Error

func (e ErrProfileImageNotFound) Error() string

type ErrPushTokenBelongsToAnotherUser

type ErrPushTokenBelongsToAnotherUser struct {
	PushToken string
}

func (ErrPushTokenBelongsToAnotherUser) Error

type ErrTokenDefinitionNotFound

type ErrTokenDefinitionNotFound struct{}

func (ErrTokenDefinitionNotFound) Error

func (ErrTokenDefinitionNotFound) Unwrap

func (e ErrTokenDefinitionNotFound) Unwrap() error

type ErrTokenDefinitionNotFoundByID

type ErrTokenDefinitionNotFoundByID struct{ ID DBID }

func (ErrTokenDefinitionNotFoundByID) Error

func (ErrTokenDefinitionNotFoundByID) Unwrap

type ErrTokenNotFound

type ErrTokenNotFound struct{}

func (ErrTokenNotFound) Error

func (e ErrTokenNotFound) Error() string

func (ErrTokenNotFound) Unwrap

func (e ErrTokenNotFound) Unwrap() error

type ErrTokenNotFoundByID

type ErrTokenNotFoundByID struct {
	ID DBID
}

ErrTokenNotFoundByID is an error that is returned when a token is not found by its ID

func (ErrTokenNotFoundByID) Error

func (e ErrTokenNotFoundByID) Error() string

func (ErrTokenNotFoundByID) Unwrap

func (e ErrTokenNotFoundByID) Unwrap() error

type ErrTokenNotFoundByTokenIdentifiers

type ErrTokenNotFoundByTokenIdentifiers struct {
	Token TokenIdentifiers
}

ErrTokenNotFoundByTokenIdentifiers is an error that is returned when a token is not found by its identifiers (token ID and contract address)

func (ErrTokenNotFoundByTokenIdentifiers) Error

func (ErrTokenNotFoundByTokenIdentifiers) Unwrap

type ErrTokenNotFoundByUserTokenIdentifers

type ErrTokenNotFoundByUserTokenIdentifers struct {
	UserID DBID
	Token  TokenIdentifiers
}

func (ErrTokenNotFoundByUserTokenIdentifers) Error

func (ErrTokenNotFoundByUserTokenIdentifers) Unwrap

type ErrTokensNotFoundByContract

type ErrTokensNotFoundByContract struct {
	ContractAddress EthereumAddress
}

func (ErrTokensNotFoundByContract) Error

type ErrUnknownAction

type ErrUnknownAction struct {
	Action Action
}

func (ErrUnknownAction) Error

func (e ErrUnknownAction) Error() string

type ErrUnknownResourceType

type ErrUnknownResourceType struct {
	ResourceType ResourceType
}

func (ErrUnknownResourceType) Error

func (e ErrUnknownResourceType) Error() string

type ErrUserAlreadyExists

type ErrUserAlreadyExists struct {
	ChainAddress  ChainAddress
	Authenticator string
	Username      string
}

func (ErrUserAlreadyExists) Error

func (e ErrUserAlreadyExists) Error() string

type ErrUserNotFound

type ErrUserNotFound struct {
	UserID         DBID
	WalletID       DBID
	L1ChainAddress L1ChainAddress
	Username       string
	Email          Email
	Authenticator  string
}

ErrUserNotFound is returned when a user is not found

func (ErrUserNotFound) Error

func (e ErrUserNotFound) Error() string

type ErrUsernameNotAvailable

type ErrUsernameNotAvailable struct {
	Username string
}

func (ErrUsernameNotAvailable) Error

func (e ErrUsernameNotAvailable) Error() string

type ErrWalletAlreadyExists

type ErrWalletAlreadyExists struct {
	WalletID       DBID
	L1ChainAddress L1ChainAddress
	OwnerID        DBID
}

func (ErrWalletAlreadyExists) Error

func (e ErrWalletAlreadyExists) Error() string

type ErrWalletCreateFailed

type ErrWalletCreateFailed struct {
	ChainAddress ChainAddress
	WalletID     DBID
	Err          error
}

func (ErrWalletCreateFailed) Error

func (e ErrWalletCreateFailed) Error() string

type ErrWalletNotFound

type ErrWalletNotFound struct{}

func (ErrWalletNotFound) Error

func (e ErrWalletNotFound) Error() string

func (ErrWalletNotFound) Unwrap

func (e ErrWalletNotFound) Unwrap() error

type ErrWalletNotFoundByAddress

type ErrWalletNotFoundByAddress struct{ Address L1ChainAddress }

func (ErrWalletNotFoundByAddress) Error

func (ErrWalletNotFoundByAddress) Unwrap

func (e ErrWalletNotFoundByAddress) Unwrap() error

type ErrWalletNotFoundByID

type ErrWalletNotFoundByID struct{ ID DBID }

func (ErrWalletNotFoundByID) Error

func (e ErrWalletNotFoundByID) Error() string

func (ErrWalletNotFoundByID) Unwrap

func (e ErrWalletNotFoundByID) Unwrap() error

type EthereumAddress

type EthereumAddress string

EthereumAddress represents an Ethereum address

const ZeroAddress EthereumAddress = "0x0000000000000000000000000000000000000000"

ZeroAddress is the all-zero Ethereum address

func RemoveDuplicateAddresses

func RemoveDuplicateAddresses(a []EthereumAddress) []EthereumAddress

RemoveDuplicateAddresses ensures that an array of addresses has no repeat items

func WalletsToEthereumAddresses

func WalletsToEthereumAddresses(pWallets []Wallet) []EthereumAddress

func (EthereumAddress) Address

func (a EthereumAddress) Address() common.Address

Address returns the ethereum address byte array

func (EthereumAddress) MarshalJSON

func (a EthereumAddress) MarshalJSON() ([]byte, error)

MarshallJSON implements the json.Marshaller interface for the address type

func (*EthereumAddress) Scan

func (a *EthereumAddress) Scan(i interface{}) error

Scan implements the database/sql Scanner interface

func (EthereumAddress) String

func (a EthereumAddress) String() string

func (*EthereumAddress) UnmarshalJSON

func (a *EthereumAddress) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for the address type

func (EthereumAddress) Value

func (a EthereumAddress) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface for the address type

type EthereumAddressAtBlock

type EthereumAddressAtBlock struct {
	Address EthereumAddress `json:"address"`
	Block   BlockNumber     `json:"block"`
}

EthereumAddressAtBlock is an address connected to a block number

func (*EthereumAddressAtBlock) Scan

func (a *EthereumAddressAtBlock) Scan(src interface{}) error

Scan implements the database/sql Scanner interface for the AddressAtBlock type

func (EthereumAddressAtBlock) Value

Value implements the database/sql/driver Valuer interface for the AddressAtBlock type

type EthereumAddressList

type EthereumAddressList []EthereumAddress

EthereumAddressList is a slice of Addresses, used to implement scanner/valuer interfaces

func (*EthereumAddressList) Scan

func (l *EthereumAddressList) Scan(value interface{}) error

Scan implements the Scanner interface for the AddressList type

func (EthereumAddressList) Value

func (l EthereumAddressList) Value() (driver.Value, error)

type EthereumTokenIdentifiers

type EthereumTokenIdentifiers string

EthereumTokenIdentifiers represents a unique identifier for a token on the Ethereum Blockchain

func NewEthereumTokenIdentifiers

func NewEthereumTokenIdentifiers(pContractAddress EthereumAddress, pTokenID HexTokenID) EthereumTokenIdentifiers

NewEthereumTokenIdentifiers creates a new token identifiers

func (EthereumTokenIdentifiers) GetParts

GetParts returns the parts of the token identifiers

func (*EthereumTokenIdentifiers) Scan

func (t *EthereumTokenIdentifiers) Scan(i interface{}) error

Scan implements the database/sql Scanner interface for the TokenIdentifiers type

func (EthereumTokenIdentifiers) String

func (t EthereumTokenIdentifiers) String() string

func (EthereumTokenIdentifiers) Value

Value implements the driver.Valuer interface

type EventData

type EventData struct {
	UserBio                             string               `json:"user_bio"`
	UserFollowedBack                    bool                 `json:"user_followed_back"`
	UserRefollowed                      bool                 `json:"user_refollowed"`
	NewTokenID                          DBID                 `json:"new_token_id"`
	NewTokenQuantity                    HexString            `json:"new_token_quantity"`
	TokenCollectorsNote                 string               `json:"token_collectors_note"`
	TokenCollectionID                   DBID                 `json:"token_collection_id"`
	TokenContractID                     DBID                 `json:"token_contract_id"`
	TokenDefinitionID                   DBID                 `json:"token_definition_id"`
	CollectionTokenIDs                  DBIDList             `json:"collection_token_ids"`
	CollectionCollectorsNote            string               `json:"collection_collectors_note"`
	GalleryName                         *string              `json:"gallery_name"`
	GalleryDescription                  *string              `json:"gallery_description"`
	GalleryNewCollectionCollectorsNotes map[DBID]string      `json:"gallery_new_collection_collectors_notes"`
	GalleryNewTokenIDs                  map[DBID]DBIDList    `json:"gallery_new_token_ids"`
	GalleryNewCollections               DBIDList             `json:"gallery_new_collections"`
	GalleryNewTokenCollectorsNotes      map[DBID]string      `json:"gallery_new_token_collectors_notes"`
	ActivityBadgeThreshold              int                  `json:"activity_badge_threshold"`
	NewTopActiveUser                    bool                 `json:"new_top_active_user"`
	AnnouncementDetails                 *AnnouncementDetails `json:"announcement_details"`
}

type FallbackMedia

type FallbackMedia struct {
	ImageURL   NullString `json:"image_url,omitempty"`
	Dimensions Dimensions `json:"dimensions"`
}

func (FallbackMedia) IsServable

func (m FallbackMedia) IsServable() bool

IsServable returns true if the token's Media has enough information to serve it's assets.

func (*FallbackMedia) Scan

func (m *FallbackMedia) Scan(src interface{}) error

Scan implements the sql.Scanner interface for media

func (FallbackMedia) Value

func (m FallbackMedia) Value() (driver.Value, error)

Value implements the driver.Valuer interface for media

type FeedEntityType

type FeedEntityType int
const (
	FeedEventTypeTag FeedEntityType = iota
	PostTypeTag
)

type FeedEventData

type FeedEventData struct {
	UserBio                             string            `json:"user_bio"`
	UserFollowedIDs                     DBIDList          `json:"user_followed_ids"`
	UserFollowedBack                    []bool            `json:"user_followed_back"`
	TokenID                             DBID              `json:"token_id"`
	TokenCollectionID                   DBID              `json:"token_collection_id"`
	TokenGalleryID                      DBID              `json:"token_gallery_id"`
	TokenNewCollectorsNote              string            `json:"token_new_collectors_note"`
	CollectionID                        DBID              `json:"collection_id"`
	CollectionGalleryID                 DBID              `json:"collection_gallery_id"`
	CollectionTokenIDs                  DBIDList          `json:"collection_token_ids"`
	CollectionNewCollectorsNote         string            `json:"collection_new_collectors_note"`
	CollectionIsPreFeed                 bool              `json:"collection_is_pre_feed"`
	CollectionIsNew                     bool              `json:"collection_is_new"`
	GalleryID                           DBID              `json:"gallery_id"`
	GalleryName                         string            `json:"gallery_name"`
	GalleryDescription                  string            `json:"gallery_description"`
	GalleryNewCollectionCollectorsNotes map[DBID]string   `json:"gallery_new_collection_collectors_notes"`
	GalleryNewCollectionTokenIDs        map[DBID]DBIDList `json:"gallery_new_token_ids"`
	GalleryNewCollections               DBIDList          `json:"gallery_new_collections"`
	// this field should never be used again and should be replaced with its collection equivalent
	GalleryNewTokenCollectorsNotes           map[DBID]string          `json:"gallery_new_token_collectors_notes"`
	GalleryNewCollectionTokenCollectorsNotes map[DBID]map[DBID]string `json:"gallery_new_collection_token_collectors_notes"`
}
type Gallery struct {
	Version      NullInt32 `json:"version"` // schema version for this model
	ID           DBID      `json:"id" binding:"required"`
	CreationTime time.Time `json:"created_at"`
	Deleted      NullBool  `json:"-"`
	LastUpdated  time.Time `json:"last_updated"`

	OwnerUserID DBID         `json:"owner_user_id"`
	Collections []Collection `json:"collections"`
}

Gallery represents a group of collections of NFTS in the application. Collections are represented as structs instead of IDs This struct will be decoded from a find database operation and used throughout the application where GalleryDB is not used

type GalleryDB

type GalleryDB struct {
	Version      NullInt32 `json:"version"` // schema version for this model
	ID           DBID      `json:"id" binding:"required"`
	CreationTime time.Time `json:"created_at"`
	Deleted      NullBool  `json:"-"`
	LastUpdated  time.Time `json:"last_updated"`

	OwnerUserID DBID   `json:"owner_user_id"`
	Collections []DBID `json:"collections"`
}

GalleryDB represents a group of collections of NFTs in the database. Collections of NFTs will be represented as a list of collection IDs creating a join relationship in the database This struct will only be used in database operations

type GalleryTokenUpdateInput

type GalleryTokenUpdateInput struct {
	LastUpdated time.Time `json:"last_updated"`

	Collections []DBID `json:"collections"`
}

GalleryTokenUpdateInput represents a struct that is used to update a gallery's list of collections in the databse

type HexString

type HexString string

HexString represents a hex number of any size

func MustHexString

func MustHexString(s string) HexString

func (HexString) Add

func (hex HexString) Add(new HexString) HexString

Add adds the given hex string to the current hex string

func (HexString) BigInt

func (hex HexString) BigInt() *big.Int

BigInt returns the hex string as a big.Int

func (*HexString) Scan

func (hex *HexString) Scan(src interface{}) error

Scan implements the sql.Scanner interface for hex strings

func (HexString) String

func (hex HexString) String() string

func (HexString) Value

func (hex HexString) Value() (driver.Value, error)

Value implements the driver.Valuer interface for hex strings

type HexTokenID

type HexTokenID string

HexTokenID represents the ID of a token in hexadecimal

func MustTokenID

func MustTokenID(s string) HexTokenID

func (HexTokenID) Base10String

func (id HexTokenID) Base10String() string

Base10String returns the token ID as a base 10 string

func (HexTokenID) BigInt

func (id HexTokenID) BigInt() *big.Int

BigInt returns the token ID as a big.Int

func (HexTokenID) MarshalGQL

func (id HexTokenID) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*HexTokenID) Scan

func (id *HexTokenID) Scan(src interface{}) error

Scan implements the sql.Scanner interface for token IDs

func (HexTokenID) String

func (id HexTokenID) String() string

func (HexTokenID) ToDecimalTokenID

func (id HexTokenID) ToDecimalTokenID() DecimalTokenID

func (HexTokenID) ToInt

func (id HexTokenID) ToInt() int64

ToInt returns the token ID as a base 10 integer

func (HexTokenID) ToUint256String

func (id HexTokenID) ToUint256String() string

ToUint256String returns the uint256 hex string representation of the token id

func (*HexTokenID) UnmarshalGQL

func (id *HexTokenID) UnmarshalGQL(v any) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (HexTokenID) Value

func (id HexTokenID) Value() (driver.Value, error)

Value implements the driver.Valuer interface for token IDs

type HexTokenIDList

type HexTokenIDList []HexTokenID

func (*HexTokenIDList) Scan

func (l *HexTokenIDList) Scan(value interface{}) error

func (HexTokenIDList) Value

func (l HexTokenIDList) Value() (driver.Value, error)

type L1Chain

type L1Chain Chain

type L1ChainAddress

type L1ChainAddress struct {
	// contains filtered or unexported fields
}

func NewL1ChainAddress

func NewL1ChainAddress(address Address, chain Chain) L1ChainAddress

func (*L1ChainAddress) Address

func (c *L1ChainAddress) Address() Address

func (*L1ChainAddress) IsGalleryUserOrAddress

func (c *L1ChainAddress) IsGalleryUserOrAddress()

func (*L1ChainAddress) L1Chain

func (c *L1ChainAddress) L1Chain() L1Chain

func (L1ChainAddress) MarshalJSON

func (c L1ChainAddress) MarshalJSON() ([]byte, error)

func (L1ChainAddress) String

func (c L1ChainAddress) String() string

func (*L1ChainAddress) UnmarshalJSON

func (c *L1ChainAddress) UnmarshalJSON(data []byte) error

type Media

type Media struct {
	ThumbnailURL    NullString `json:"thumbnail_url,omitempty"`
	LivePreviewURL  NullString `json:"live_preview_url,omitempty"`
	ProfileImageURL NullString `json:"profile_image_url,omitempty"`
	MediaURL        NullString `json:"media_url,omitempty"`
	MediaType       MediaType  `json:"media_type"`
	Dimensions      Dimensions `json:"dimensions"`
}

Media represents a token's media content with processed images from metadata

func (Media) IsServable

func (m Media) IsServable() bool

IsServable returns true if the token's Media has enough information to serve it's assets.

func (*Media) Scan

func (m *Media) Scan(src interface{}) error

Scan implements the sql.Scanner interface for media

func (Media) Value

func (m Media) Value() (driver.Value, error)

Value implements the driver.Valuer interface for media

type MediaList

type MediaList []Media

MediaList is a slice of Media, used to implement scanner/valuer interfaces

func (*MediaList) Scan

func (l *MediaList) Scan(value interface{}) error

Scan implements the Scanner interface for the MediaList type

func (MediaList) Value

func (l MediaList) Value() (driver.Value, error)

type MediaType

type MediaType string

MediaType represents the type of media that a token

const (
	// MediaTypeVideo represents a video
	MediaTypeVideo MediaType = "video"
	// MediaTypeImage represents an image
	MediaTypeImage MediaType = "image"
	// MediaTypeGIF represents a gif
	MediaTypeGIF MediaType = "gif"
	// MediaTypeSVG represents an SVG
	MediaTypeSVG MediaType = "svg"
	// MediaTypeText represents plain text
	MediaTypeText MediaType = "text"
	// MediaTypeHTML represents html
	MediaTypeHTML MediaType = "html"
	// MediaTypeAudio represents audio
	MediaTypeAudio MediaType = "audio"
	// MediaTypeJSON represents json metadata
	MediaTypeJSON MediaType = "json"
	// MediaTypeAnimation represents an animation (.glb)
	MediaTypeAnimation MediaType = "animation"
	// MediaTypePDF represents a pdf
	MediaTypePDF MediaType = "pdf"
	// MediaTypeInvalid represents an invalid media type such as when a token's external metadata's API is broken or no longer exists
	MediaTypeInvalid MediaType = "invalid"
	// MediaTypeUnknown represents an unknown media type
	MediaTypeUnknown MediaType = "unknown"
	// MediaTypeSyncing represents a syncing media
	MediaTypeSyncing MediaType = "syncing"
	// MediaTypeFallback represents a fallback media
	MediaTypeFallback MediaType = "fallback"
)

func (MediaType) IsAnimationLike

func (m MediaType) IsAnimationLike() bool

IsAnimationLike returns true if the media type is a type that is expected to be like an animation and live render

func (MediaType) IsImageLike

func (m MediaType) IsImageLike() bool

IsImageLike returns true if the media type is a type that is expected to be like an image and not live render

func (MediaType) IsMorePriorityThan

func (m MediaType) IsMorePriorityThan(other MediaType) bool

IsMorePriorityThan returns true if the media type is more important than the other media type

func (MediaType) IsValid

func (m MediaType) IsValid() bool

IsValid returns true if the media type is not unknown, syncing, or invalid

func (*MediaType) Scan

func (m *MediaType) Scan(src interface{}) error

Scan implements the database/sql Scanner interface for the MediaType type

func (MediaType) String

func (m MediaType) String() string

func (MediaType) ToContentType

func (m MediaType) ToContentType() string

func (MediaType) Value

func (m MediaType) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface for the MediaType type

type MembershipRepository

type MembershipRepository interface {
	UpsertByTokenID(context.Context, HexTokenID, MembershipTier) error
	GetByTokenID(context.Context, HexTokenID) (MembershipTier, error)
	GetAll(context.Context) ([]MembershipTier, error)
}

MembershipRepository represents the interface for interacting with the persisted state of users

type MembershipTier

type MembershipTier struct {
	Version      NullInt32     `json:"version"` // schema version for this model
	ID           DBID          `json:"id" binding:"required"`
	CreationTime time.Time     `json:"created_at"`
	Deleted      NullBool      `json:"-"`
	LastUpdated  time.Time     `json:"last_updated"`
	Name         NullString    `json:"name"`
	TokenID      HexTokenID    `json:"token_id"`
	AssetURL     NullString    `json:"asset_url"`
	Owners       []TokenHolder `json:"owners"`
}

MembershipTier represents the membership tier of a user

type MentionType

type MentionType string
const (
	MentionTypeUser      MentionType = "user"
	MentionTypeCommunity MentionType = "community"
)

type NotificationData

type NotificationData struct {
	AuthedViewerIDs                []DBID                          `json:"viewer_ids,omitempty"`
	UnauthedViewerIDs              []string                        `json:"unauthed_viewer_ids,omitempty"`
	FollowerIDs                    []DBID                          `json:"follower_ids,omitempty"`
	AdmirerIDs                     []DBID                          `json:"admirer_ids,omitempty"`
	FollowedBack                   NullBool                        `json:"followed_back,omitempty"`
	Refollowed                     NullBool                        `json:"refollowed,omitempty"`
	NewTokenID                     DBID                            `json:"new_token_id,omitempty"`
	NewTokenQuantity               HexString                       `json:"new_token_quantity,omitempty"`
	OriginalCommentID              DBID                            `json:"original_comment_id,omitempty"`
	ActivityBadgeThreshold         int                             `json:"activity_badge_threshold,omitempty"`
	NewTopActiveUser               bool                            `json:"new_top_active_user,omitempty"`
	AnnouncementDetails            *AnnouncementDetails            `json:"announcement_details,omitempty"`
	UserFromFarcasterJoinedDetails *UserFromFarcasterJoinedDetails `json:"user_from_farcaster_joined_details,omitempty"`
}

func (NotificationData) Concat

func (NotificationData) Validate

func (n NotificationData) Validate() NotificationData

type NullBool

type NullBool bool

NullBool represents a bool that may be null in the DB

func (NullBool) Bool

func (n NullBool) Bool() bool

Bool returns the bool representation of the NullBool

func (NullBool) BoolPointer

func (n NullBool) BoolPointer() *bool

func (*NullBool) Scan

func (n *NullBool) Scan(value interface{}) error

Scan implements the database/sql Scanner interface for the NullBool type

func (NullBool) String

func (n NullBool) String() string

func (NullBool) Value

func (n NullBool) Value() (driver.Value, error)

Value implements the database/sql driver Valuer interface for the NullBool type

type NullInt32

type NullInt32 int32

NullInt32 represents an int32 that may be null in the DB

func (NullInt32) Int

func (n NullInt32) Int() int

Int returns the int representation of the NullInt32

func (NullInt32) Int32

func (n NullInt32) Int32() int32

Int32 returns the int32 representation of the NullInt32

func (*NullInt32) Scan

func (n *NullInt32) Scan(value interface{}) error

Scan implements the database/sql Scanner interface for the NullInt32 type

func (NullInt32) String

func (n NullInt32) String() string

func (NullInt32) Value

func (n NullInt32) Value() (driver.Value, error)

Value implements the database/sql driver Valuer interface for the NullInt32 type

type NullInt64

type NullInt64 int64

NullInt64 represents an int64 that may be null in the DB

func (NullInt64) Int64

func (n NullInt64) Int64() int64

Int64 returns the int64 representation of the NullInt64

func (*NullInt64) Scan

func (n *NullInt64) Scan(value interface{}) error

Scan implements the database/sql Scanner interface for the NullInt64 type

func (NullInt64) String

func (n NullInt64) String() string

func (NullInt64) Value

func (n NullInt64) Value() (driver.Value, error)

Value implements the database/sql driver Valuer interface for the NullInt64 type

type NullString

type NullString string

NullString represents a string that may be null in the DB

func (*NullString) Scan

func (n *NullString) Scan(value interface{}) error

Scan implements the database/sql Scanner interface for the NullString type

func (NullString) String

func (n NullString) String() string

func (NullString) Value

func (n NullString) Value() (driver.Value, error)

Value implements the database/sql driver Valuer interface for the NullString type

type OpenSeaWebhookInput

type OpenSeaWebhookInput struct {
	EventType string `json:"event_type"`
	Payload   struct {
		Chain      string `json:"chain"`
		Collection struct {
			Slug string `json:"slug"`
		} `json:"collection"`
		EventTimestamp string `json:"event_timestamp"`
		FromAccount    struct {
			Address EthereumAddress `json:"address"`
		} `json:"from_account"`
		Item struct {
			Chain struct {
				Name string `json:"name"`
			} `json:"chain"`
			Metadata  TokenMetadata `json:"metadata"`
			NFTID     OpenseaNFTID  `json:"nft_id"`
			Permalink string        `json:"permalink"`
		} `json:"item"`
		Quantity  int `json:"quantity"`
		ToAccount struct {
			Address EthereumAddress `json:"address"`
		} `json:"to_account"`
	} `json:"payload"`
}

type OpenseaNFTID

type OpenseaNFTID struct {
	Chain           Chain
	ContractAddress Address
	TokenID         HexTokenID
}

func (OpenseaNFTID) MarshalJSON

func (o OpenseaNFTID) MarshalJSON() ([]byte, error)

func (OpenseaNFTID) String

func (o OpenseaNFTID) String() string

func (*OpenseaNFTID) UnmarshalJSON

func (o *OpenseaNFTID) UnmarshalJSON(data []byte) error

type Persona

type Persona string
const (
	PersonaNone      Persona = "none"
	PersonaCollector Persona = "collector"
	PersonaCreator   Persona = "creator"
	PersonaBoth      Persona = "both"
)

func (Persona) MarshalGQL

func (p Persona) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*Persona) Scan

func (p *Persona) Scan(i interface{}) error

Scan implements the database/sql Scanner interface for the Persona type

func (*Persona) UnmarshalGQL

func (p *Persona) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (Persona) Value

func (p Persona) Value() (driver.Value, error)

Value implements the database/sql driver Valuer interface for the Persona type

type PipelineMetadata

type PipelineMetadata struct {
	MetadataRetrieval                              PipelineStepStatus `json:"metadata_retrieval,omitempty"`
	TokenInfoRetrieval                             PipelineStepStatus `json:"token_info_retrieval,omitempty"`
	MediaURLsRetrieval                             PipelineStepStatus `json:"media_urls_retrieval,omitempty"`
	AnimationContentHeaderValueRetrieval           PipelineStepStatus `json:"animation_content_header_value_retrieval,omitempty"`
	AnimationReaderRetrieval                       PipelineStepStatus `json:"animation_reader_retrieval,omitempty"`
	AnimationDetermineMediaTypeWithReader          PipelineStepStatus `json:"animation_determine_media_type_with_reader,omitempty"`
	AnimationAnimationGzip                         PipelineStepStatus `json:"animation_animation_gzip,omitempty"`
	AnimationSVGRasterize                          PipelineStepStatus `json:"animation_svg_rasterize,omitempty"`
	AnimationStoreGCP                              PipelineStepStatus `json:"animation_store_gcp,omitempty"`
	AnimationThumbnailGCP                          PipelineStepStatus `json:"animation_thumbnail_gcp,omitempty"`
	AnimationLiveRenderGCP                         PipelineStepStatus `json:"animation_live_render_gcp,omitempty"`
	ImageContentHeaderValueRetrieval               PipelineStepStatus `json:"image_content_header_value_retrieval,omitempty"`
	ImageReaderRetrieval                           PipelineStepStatus `json:"image_reader_retrieval,omitempty"`
	ImageDetermineMediaTypeWithReader              PipelineStepStatus `json:"image_determine_media_type_with_reader,omitempty"`
	ImageAnimationGzip                             PipelineStepStatus `json:"image_animation_gzip,omitempty"`
	ImageSVGRasterize                              PipelineStepStatus `json:"image_svg_rasterize,omitempty"`
	ImageStoreGCP                                  PipelineStepStatus `json:"image_store_gcp,omitempty"`
	ImageThumbnailGCP                              PipelineStepStatus `json:"image_thumbnail_gcp,omitempty"`
	ImageLiveRenderGCP                             PipelineStepStatus `json:"image_live_render_gcp,omitempty"`
	AlternateAnimationContentHeaderValueRetrieval  PipelineStepStatus `json:"alternate_animation_content_header_value_retrieval,omitempty"`
	AlternateAnimationReaderRetrieval              PipelineStepStatus `json:"alternate_animation_reader_retrieval,omitempty"`
	AlternateAnimationDetermineMediaTypeWithReader PipelineStepStatus `json:"alternate_animation_determine_media_type_with_reader,omitempty"`
	AlternateAnimationAnimationGzip                PipelineStepStatus `json:"alternate_animation_animation_gzip,omitempty"`
	AlternateAnimationSVGRasterize                 PipelineStepStatus `json:"alternate_animation_svg_rasterize,omitempty"`
	AlternateAnimationStoreGCP                     PipelineStepStatus `json:"alternate_animation_store_gcp,omitempty"`
	AlternateAnimationThumbnailGCP                 PipelineStepStatus `json:"alternate_animation_thumbnail_gcp,omitempty"`
	AlternateAnimationLiveRenderGCP                PipelineStepStatus `json:"alternate_animation_live_render_gcp,omitempty"`
	AlternateImageContentHeaderValueRetrieval      PipelineStepStatus `json:"alternate_image_content_header_value_retrieval,omitempty"`
	AlternateImageReaderRetrieval                  PipelineStepStatus `json:"alternate_image_reader_retrieval,omitempty"`
	AlternateImageDetermineMediaTypeWithReader     PipelineStepStatus `json:"alternate_image_determine_media_type_with_reader,omitempty"`
	AlternateImageAnimationGzip                    PipelineStepStatus `json:"alternate_image_animation_gzip,omitempty"`
	AlternateImageSVGRasterize                     PipelineStepStatus `json:"alternate_image_svg_rasterize,omitempty"`
	AlternateImageStoreGCP                         PipelineStepStatus `json:"alternate_image_store_gcp,omitempty"`
	AlternateImageThumbnailGCP                     PipelineStepStatus `json:"alternate_image_thumbnail_gcp,omitempty"`
	AlternateImageLiveRenderGCP                    PipelineStepStatus `json:"alternate_image_live_render_gcp,omitempty"`
	ProfileImageContentHeaderValueRetrieval        PipelineStepStatus `json:"pfp_content_header_value_retrieval,omitempty"`
	ProfileImageReaderRetrieval                    PipelineStepStatus `json:"pfp_reader_retrieval,omitempty"`
	ProfileImageDetermineMediaTypeWithReader       PipelineStepStatus `json:"pfp_determine_media_type_with_reader,omitempty"`
	ProfileImageAnimationGzip                      PipelineStepStatus `json:"pfp_animation_gzip,omitempty"`
	ProfileImageSVGRasterize                       PipelineStepStatus `json:"pfp_svg_rasterize,omitempty"`
	ProfileImageStoreGCP                           PipelineStepStatus `json:"pfp_store_gcp,omitempty"`
	ProfileImageThumbnailGCP                       PipelineStepStatus `json:"pfp_thumbnail_gcp,omitempty"`
	ProfileImageLiveRenderGCP                      PipelineStepStatus `json:"pfp_live_render_gcp,omitempty"`
	NothingCachedWithErrors                        PipelineStepStatus `json:"nothing_cached_errors,omitempty"`
	NothingCachedWithoutErrors                     PipelineStepStatus `json:"nothing_cached_no_errors,omitempty"`
	CreateMedia                                    PipelineStepStatus `json:"create_media,omitempty"`
	CreateMediaFromCachedObjects                   PipelineStepStatus `json:"create_media_from_cached_objects,omitempty"`
	CreateRawMedia                                 PipelineStepStatus `json:"create_raw_media,omitempty"`
	MediaResultComparison                          PipelineStepStatus `json:"media_result_comparison,omitempty"`
}

func (*PipelineMetadata) Scan

func (p *PipelineMetadata) Scan(value interface{}) error

func (PipelineMetadata) Value

func (p PipelineMetadata) Value() (driver.Value, error)

type PipelineStepStatus

type PipelineStepStatus string
const (
	PipelineStepStatusNotRun  PipelineStepStatus = "not_run"
	PipelineStepStatusStarted PipelineStepStatus = "started"
	PipelineStepStatusSuccess PipelineStepStatus = "success"
	PipelineStepStatusError   PipelineStepStatus = "error"
)

func (PipelineStepStatus) MarshalJSON

func (p PipelineStepStatus) MarshalJSON() ([]byte, error)

func (*PipelineStepStatus) Scan

func (p *PipelineStepStatus) Scan(value interface{}) error

func (PipelineStepStatus) String

func (p PipelineStepStatus) String() string

func (PipelineStepStatus) Value

func (p PipelineStepStatus) Value() (driver.Value, error)

type ProcessingCause

type ProcessingCause string
const (
	ProcessingCauseSync          ProcessingCause = "sync"
	ProcessingCauseSyncRetry     ProcessingCause = "sync_retry"
	ProcessingCauseRefresh       ProcessingCause = "refresh"
	ProcessingCausePostPreflight ProcessingCause = "post_preflight"
	ProcessingCauseAppMint       ProcessingCause = "app_mint"
)

func (*ProcessingCause) Scan

func (p *ProcessingCause) Scan(value interface{}) error

func (ProcessingCause) String

func (p ProcessingCause) String() string

func (ProcessingCause) Value

func (p ProcessingCause) Value() (driver.Value, error)

type ProfileImageSource

type ProfileImageSource string // ProfileImageSource represents the source of a profile image
const (
	ProfileImageSourceToken ProfileImageSource = "token"
	ProfileImageSourceENS   ProfileImageSource = "ens"
)

type PubKey

type PubKey string

PubKey represents the public key of a wallet

func (PubKey) String

func (p PubKey) String() string

type ReportReason

type ReportReason string

func (ReportReason) MarshalGQL

func (r ReportReason) MarshalGQL(w io.Writer)

func (*ReportReason) Scan

func (r *ReportReason) Scan(v any) error

func (*ReportReason) UnmarshalGQL

func (r *ReportReason) UnmarshalGQL(v any) error

func (ReportReason) Value

func (r ReportReason) Value() (driver.Value, error)

type ReqHeaders

type ReqHeaders map[string][]string

ReqHeaders is a type that holds the headers for a request

func (*ReqHeaders) Scan

func (h *ReqHeaders) Scan(src interface{}) error

Scan implements the sql.Scanner interface for the ReqHeaders type

func (ReqHeaders) Value

func (h ReqHeaders) Value() (driver.Value, error)

Value implements the driver.Valuer interface for the ReqHeaders type

type ResourceType

type ResourceType int

type Role

type Role string
const (
	RoleAdmin       Role = "ADMIN"
	RoleBetaTester  Role = "BETA_TESTER"
	RoleEarlyAccess Role = "EARLY_ACCESS"
	RoleEmailTester Role = "EMAIL_TESTER"
)

func (Role) MarshalGQL

func (r Role) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*Role) Scan

func (r *Role) Scan(i interface{}) error

Scan implements the database/sql Scanner interface for the DBID type

func (*Role) UnmarshalGQL

func (r *Role) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (Role) Value

func (r Role) Value() (driver.Value, error)

Value implements the database/sql driver Valuer interface for the DBID type

type RoleList

type RoleList []Role

func (*RoleList) Scan

func (l *RoleList) Scan(value interface{}) error

func (RoleList) Value

func (l RoleList) Value() (driver.Value, error)

type SocialProvider

type SocialProvider string
const (
	SocialProviderTwitter   SocialProvider = "Twitter"
	SocialProviderFarcaster SocialProvider = "Farcaster"
	SocialProviderLens      SocialProvider = "Lens"
)

func (SocialProvider) IsValid

func (s SocialProvider) IsValid() bool

func (*SocialProvider) Scan

func (s *SocialProvider) Scan(src interface{}) error

func (SocialProvider) String

func (s SocialProvider) String() string

func (SocialProvider) Value

func (s SocialProvider) Value() (driver.Value, error)

type SocialUserIdentifiers

type SocialUserIdentifiers struct {
	Provider SocialProvider         `json:"provider" binding:"required"`
	ID       string                 `json:"id" binding:"required"`
	Display  bool                   `json:"display"`
	Metadata map[string]interface{} `json:"metadata"`
}

func (*SocialUserIdentifiers) Scan

func (s *SocialUserIdentifiers) Scan(src interface{}) error

func (SocialUserIdentifiers) Value

func (s SocialUserIdentifiers) Value() (driver.Value, error)

type Token

type Token struct {
	Version      NullInt32 `json:"version"` // schema version for this model
	ID           DBID      `json:"id" binding:"required"`
	CreationTime time.Time `json:"created_at"`
	Deleted      NullBool  `json:"-"`
	LastUpdated  time.Time `json:"last_updated"`

	TokenType TokenType `json:"token_type"`

	Chain Chain `json:"chain"`

	Name        NullString `json:"name"`
	Description NullString `json:"description"`

	TokenURI         TokenURI                 `json:"token_uri"`
	TokenID          HexTokenID               `json:"token_id"`
	Quantity         HexString                `json:"quantity"`
	OwnerAddress     EthereumAddress          `json:"owner_address"`
	OwnershipHistory []EthereumAddressAtBlock `json:"previous_owners"`
	TokenMetadata    TokenMetadata            `json:"metadata"`
	ContractAddress  EthereumAddress          `json:"contract_address"`

	ExternalURL NullString `json:"external_url"`

	BlockNumber BlockNumber `json:"block_number"`
	IsSpam      *bool       `json:"is_spam"`
}

Token represents an individual Token token

type TokenCountType

type TokenCountType string

TokenCountType represents the query of a token count operation

const (
	// CountTypeTotal represents the total count
	CountTypeTotal TokenCountType = "total"
	// CountTypeNoMetadata represents the count of tokens without metadata
	CountTypeNoMetadata TokenCountType = "no-metadata"
	// CountTypeERC721 represents the count of ERC721 tokens
	CountTypeERC721 TokenCountType = "erc721"
	// CountTypeERC1155 represents the count of ERC1155 tokens
	CountTypeERC1155 TokenCountType = "erc1155"
)

type TokenHolder

type TokenHolder struct {
	UserID        DBID         `json:"user_id"`
	WalletIDs     []DBID       `json:"wallet_ids"`
	PreviewTokens []NullString `json:"preview_tokens"`
}

TokenHolder represents a user who owns a membership card

func (*TokenHolder) Scan

func (o *TokenHolder) Scan(src interface{}) error

Scan implements the database/sql Scanner interface for the membership owner type

func (TokenHolder) Value

func (o TokenHolder) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface for the membership owner type

type TokenHolderList

type TokenHolderList []TokenHolder

TokenHolderList is a slice of MembershipOwners, used to implement scanner/valuer interfaces

func (*TokenHolderList) Scan

func (l *TokenHolderList) Scan(value interface{}) error

func (TokenHolderList) Value

func (l TokenHolderList) Value() (driver.Value, error)

type TokenIdentifiers

type TokenIdentifiers struct {
	TokenID         HexTokenID `json:"token_id"`
	ContractAddress Address    `json:"contract_address"`
	Chain           Chain      `json:"chain"`
}

TokenIdentifiers represents a unique identifier for a token

func NewTokenIdentifiers

func NewTokenIdentifiers(pContractAddress Address, pTokenID HexTokenID, pChain Chain) TokenIdentifiers

NewTokenIdentifiers creates a new token identifiers

func (TokenIdentifiers) String

func (t TokenIdentifiers) String() string

type TokenLayout

type TokenLayout struct {
	// v0 settings
	Columns    int   `json:"columns"`
	Whitespace []int `json:"whitespace"`
	// v1 settings
	Sections      []int                     `json:"sections"`
	SectionLayout []CollectionSectionLayout `json:"section_layout"`
}

TokenLayout defines the layout of a collection of tokens

func ValidateLayout

func ValidateLayout(layout TokenLayout, tokens []DBID) (TokenLayout, error)

ValidateLayout ensures a layout is within constraints and if has unset properties, sets their defaults

func (*TokenLayout) Scan

func (l *TokenLayout) Scan(value interface{}) error

Scan implements the Scanner interface for the TokenLayout type

func (TokenLayout) Value

func (l TokenLayout) Value() (driver.Value, error)

Value implements the driver.Valuer interface for the TokenLayout type

type TokenMetadata

type TokenMetadata map[string]interface{}

TokenMetadata represents the JSON metadata for a token

func (TokenMetadata) MarshalJSON

func (m TokenMetadata) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for the TokenMetadata type

func (*TokenMetadata) Scan

func (m *TokenMetadata) Scan(src interface{}) error

Scan implements the database/sql Scanner interface for the TokenMetadata type

func (TokenMetadata) Value

func (m TokenMetadata) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface for the TokenMetadata type

type TokenOwnershipType

type TokenOwnershipType string
const (
	TokenOwnershipTypeHolder  TokenOwnershipType = "holder"
	TokenOwnershipTypeCreator TokenOwnershipType = "creator"
)

func (TokenOwnershipType) MarshalGQL

func (t TokenOwnershipType) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (TokenOwnershipType) String

func (t TokenOwnershipType) String() string

func (*TokenOwnershipType) UnmarshalGQL

func (t *TokenOwnershipType) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

type TokenProperties

type TokenProperties struct {
	HasPrimaryMedia bool `json:"has_primary_media"`
	HasThumbnail    bool `json:"has_thumbnail"`
	HasLiveRender   bool `json:"has_live_render"`
	HasDimensions   bool `json:"has_dimensions"`
	HasMetadata     bool `json:"has_metadata"`
	HasName         bool `json:"has_name"`
	HasDescription  bool `json:"has_description"`
}

func (*TokenProperties) Scan

func (t *TokenProperties) Scan(value interface{}) error

func (TokenProperties) Value

func (t TokenProperties) Value() (driver.Value, error)

type TokenType

type TokenType string

TokenType represents the contract specification of the token

const (
	// TokenTypeERC721 is the type of an ERC721 token
	TokenTypeERC721 TokenType = "ERC-721"
	// TokenTypeERC1155 is the type of an ERC1155 token
	TokenTypeERC1155 TokenType = "ERC-1155"
	// TokenTypeERC20 is the type of an ERC20 token
	TokenTypeERC20 TokenType = "ERC-20"
)

func (*TokenType) Scan

func (t *TokenType) Scan(src interface{}) error

Scan implements the database/sql Scanner interface for the TokenType type

func (TokenType) String

func (t TokenType) String() string

func (TokenType) Value

func (t TokenType) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface for the TokenType type

type TokenURI

type TokenURI string

TokenURI represents the URI for an Ethereum token

const InvalidTokenURI TokenURI = "INVALID"

InvalidTokenURI represents an invalid token URI

func (TokenURI) IsHTTP

func (uri TokenURI) IsHTTP() bool

IsHTTP returns whether a frontend could render the given URI directly

func (TokenURI) IsRenderable

func (uri TokenURI) IsRenderable() bool

IsRenderable returns whether a frontend could render the given URI directly

func (TokenURI) ReplaceID

func (uri TokenURI) ReplaceID(id HexTokenID) TokenURI

ReplaceID replaces the token's ID with the given ID

func (*TokenURI) Scan

func (uri *TokenURI) Scan(src interface{}) error

Scan implements the sql.Scanner interface for token URIs

func (TokenURI) String

func (uri TokenURI) String() string

func (TokenURI) Type

func (uri TokenURI) Type() URIType

Type returns the type of the token URI

func (TokenURI) Value

func (uri TokenURI) Value() (driver.Value, error)

Value implements the driver.Valuer interface for token URIs

type TokenUniqueIdentifiers

type TokenUniqueIdentifiers struct {
	Chain           Chain      `json:"chain"`
	ContractAddress Address    `json:"contract_address"`
	TokenID         HexTokenID `json:"token_id"`
	OwnerAddress    Address    `json:"owner_address"`
}

func (TokenUniqueIdentifiers) AsJSONKey

func (t TokenUniqueIdentifiers) AsJSONKey() string

func (*TokenUniqueIdentifiers) FromJSONKey

func (t *TokenUniqueIdentifiers) FromJSONKey(key string) error

func (*TokenUniqueIdentifiers) MarshalJSON

func (t *TokenUniqueIdentifiers) MarshalJSON() ([]byte, error)

func (TokenUniqueIdentifiers) String

func (t TokenUniqueIdentifiers) String() string

func (*TokenUniqueIdentifiers) UnmarshalJSON

func (t *TokenUniqueIdentifiers) UnmarshalJSON(data []byte) error

type TokenUpdateBalanceInput

type TokenUpdateBalanceInput struct {
	Quantity    HexString   `json:"quantity"`
	BlockNumber BlockNumber `json:"block_number"`
}

type TokenUpdateOwnerInput

type TokenUpdateOwnerInput struct {
	OwnerAddress EthereumAddress `json:"owner_address"`
	BlockNumber  BlockNumber     `json:"block_number"`
}

type TraitType

type TraitType string
const (
	TraitTypeTopActiveUser TraitType = "top_activity"
)

type Traits

type Traits map[TraitType]interface{}

func (*Traits) Scan

func (m *Traits) Scan(src interface{}) error

Scan implements the database/sql Scanner interface for the Traits type

func (Traits) Value

func (m Traits) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface for the Traits type

type URIType

type URIType string

URIType represents the type of a URI

const (
	// URITypeIPFS represents an IPFS URI
	URITypeIPFS URIType = "ipfs"
	// URITypeArweave represents an Arweave URI
	URITypeArweave URIType = "arweave"
	// URITypeHTTP represents an HTTP URI
	URITypeHTTP URIType = "http"
	// URITypeIPFSAPI represents an IPFS API URI
	URITypeIPFSAPI URIType = "ipfs-api"
	// URITypeIPFSGateway represents an IPFS Gateway URI
	URITypeIPFSGateway URIType = "ipfs-gateway"
	// URITypeArweaveGateway represents an Arweave Gateway URI
	URITypeArweaveGateway URIType = "arweave-gateway"
	// URITypeBase64JSON represents a base64 encoded JSON document
	URITypeBase64JSON URIType = "base64json"
	// URITypeBase64HTML represents a base64 encoded HTML document
	URITypeBase64HTML URIType = "base64html"
	// URITypeJSON represents a JSON document
	URITypeJSON URIType = "json"
	// URITypeBase64SVG represents a base64 encoded SVG
	URITypeBase64SVG URIType = "base64svg"
	//URITypeBase64BMP represents a base64 encoded BMP
	URITypeBase64BMP URIType = "base64bmp"
	// URITypeBase64PNG represents a base64 encoded PNG
	URITypeBase64PNG URIType = "base64png"
	// URITypeBase64JPEG represents a base64 encoded JPEG
	URITypeBase64JPEG URIType = "base64jpeg"
	// URITypeBase64GIF represents a base64 encoded GIF
	URITypeBase64GIF URIType = "base64gif"
	// URITypeBase64WAV represents a base64 encoded WAV
	URITypeBase64WAV URIType = "base64wav"
	// URITypeBase64MP3 represents a base64 encoded MP3
	URITypeBase64MP3 URIType = "base64mp3"
	// URITypeSVG represents an SVG
	URITypeSVG URIType = "svg"
	// URITypeENS represents an ENS domain
	URITypeENS URIType = "ens"
	// URITypeUnknown represents an unknown URI type
	URITypeUnknown URIType = "unknown"
	// URITypeInvalid represents an invalid URI type
	URITypeInvalid URIType = "invalid"
	// URITypeNone represents no URI
	URITypeNone URIType = "none"
)

func (URIType) IsRaw

func (u URIType) IsRaw() bool

func (URIType) ToMediaType

func (u URIType) ToMediaType() MediaType

type User

type User struct {
	Version            NullInt32  `json:"version"` // schema version for this model
	ID                 DBID       `json:"id" binding:"required"`
	CreationTime       time.Time  `json:"created_at"`
	Deleted            NullBool   `json:"-"`
	LastUpdated        time.Time  `json:"last_updated"`
	Username           NullString `json:"username"` // mutable
	UsernameIdempotent NullString `json:"username_idempotent"`
	Wallets            []Wallet   `json:"wallets"`
	Bio                NullString `json:"bio"`
	Traits             Traits     `json:"traits"`
	Universal          NullBool   `json:"universal"`
	PrimaryWalletID    NullString `json:"primary_wallet_id"`
}

User represents a user with all of their addresses

type UserFromFarcasterJoinedDetails

type UserFromFarcasterJoinedDetails struct {
	UserID DBID `json:"user_id" binding:"required"`
}

type UserLoginAttempt

type UserLoginAttempt struct {
	Version        NullInt32  `json:"version"`
	ID             DBID       `json:"id"`
	CreationTime   time.Time  `json:"created_at"`
	Deleted        NullBool   `json:"-"`
	Address        Wallet     `json:"address"`
	Signature      NullString `json:"signature"`
	NonceValue     NullString `json:"nonce_value"`
	UserExists     NullBool   `json:"user_exists"`
	SignatureValid NullBool   `json:"signature_valid"`
	ReqHostAddr    NullString `json:"req_host_addr"`
	ReqHeaders     ReqHeaders `json:"req_headers"`
}

UserLoginAttempt represents a single attempt for a user to login despite the success of the login. Can be used in debugging and logging purposes.

type UserNonce

type UserNonce struct {
	Version      NullInt32  `json:"version"`
	ID           DBID       `json:"id"`
	CreationTime time.Time  `json:"created_at"`
	Deleted      NullBool   `json:"-"`
	LastUpdated  time.Time  `json:"last_updated"`
	Value        NullString `json:"value"`
	Address      Address    `json:"address"`
	Chain        Chain      `json:"chain"`
	L1Chain      Chain      `json:"l1_chain"`
}

UserNonce represents a short lived nonce that holds a value to be signed by a user cryptographically to prove they are the owner of a given address.

type UserNotificationSettings

type UserNotificationSettings struct {
	SomeoneFollowedYou           *bool `json:"someone_followed_you,omitempty"`
	SomeoneAdmiredYourUpdate     *bool `json:"someone_admired_your_update,omitempty"`
	SomeoneCommentedOnYourUpdate *bool `json:"someone_commented_on_your_update,omitempty"`
	SomeoneViewedYourGallery     *bool `json:"someone_viewed_your_gallery,omitempty"`
}

someoneFollowedYou: Boolean someoneAdmiredYourUpdate: Boolean someoneCommentedOnYourUpdate: Boolean someoneViewedYourGallery: Boolean

func (*UserNotificationSettings) Scan

func (u *UserNotificationSettings) Scan(src interface{}) error

func (UserNotificationSettings) Value

type UserRepository

type UserRepository interface {
	UpdateByID(context.Context, DBID, interface{}) error
	Create(context.Context, CreateUserInput) (DBID, error)
	AddWallet(context.Context, DBID, ChainAddress, WalletType) error
	RemoveWallet(context.Context, DBID, DBID) error
	GetByID(context.Context, DBID) (User, error)
	GetByIDs(context.Context, []DBID) ([]User, error)
	GetByWalletID(context.Context, DBID) (User, error)
	GetByChainAddress(context.Context, ChainAddress) (User, error)
	GetByUsername(context.Context, string) (User, error)
	GetByEmail(context.Context, Email) (User, error)
	Delete(context.Context, DBID) error
	MergeUsers(context.Context, DBID, DBID) error
	AddFollower(pCtx context.Context, follower DBID, followee DBID) (refollowed bool, err error)
	RemoveFollower(pCtx context.Context, follower DBID, followee DBID) error
	FillWalletDataForUser(pCtx context.Context, user *User) error
}

UserRepository represents the interface for interacting with the persisted state of users

type UserUpdateInfoInput

type UserUpdateInfoInput struct {
	Username           NullString `json:"username"`
	UsernameIdempotent NullString `json:"username_idempotent"`
	Bio                NullString `json:"bio"`
}

UserUpdateInfoInput represents the data to be updated when updating a user

type UserUpdateNotificationSettings

type UserUpdateNotificationSettings struct {
	LastUpdated          time.Time                `json:"last_updated"`
	NotificationSettings UserNotificationSettings `json:"notification_settings"`
}

UserUpdateNotificationSettings represents the data to be updated when updating a user's notification settings

type Wallet

type Wallet struct {
	ID           DBID      `json:"id"`
	Version      NullInt64 `json:"version"`
	CreationTime time.Time `json:"created_at"`
	Deleted      NullBool  `json:"-"`
	LastUpdated  time.Time `json:"last_updated"`

	Address    Address    `json:"address"`
	Chain      Chain      `json:"chain"`
	L1Chain    L1Chain    `json:"l1_chain"`
	WalletType WalletType `json:"wallet_type"`
}

Wallet represents an address on any chain

func (*Wallet) Scan

func (w *Wallet) Scan(value interface{}) error

Scan implements the Scanner interface for the Wallet type

func (Wallet) Value

func (w Wallet) Value() (driver.Value, error)

Value implements the database/sql driver Valuer interface for the Wallet type

type WalletList

type WalletList []Wallet

func (*WalletList) Scan

func (l *WalletList) Scan(value interface{}) error

Scan implements the Scanner interface for the AddressList type

func (WalletList) Value

func (l WalletList) Value() (driver.Value, error)

type WalletType

type WalletType int

WalletType is the type of wallet used to sign a message

const (
	// WalletTypeEOA represents an externally owned account (regular wallet address)
	WalletTypeEOA WalletType = iota
	// WalletTypeGnosis represents a smart contract gnosis safe
	WalletTypeGnosis
)

func (WalletType) MarshalGQL

func (wa WalletType) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*WalletType) UnmarshalGQL

func (wa *WalletType) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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