Documentation ¶
Index ¶
- Constants
- Variables
- func ContainsDBID(pSrc []DBID, pID DBID) bool
- func DBIDToNullStr(id DBID) sql.NullString
- func FailStep(status *PipelineStepStatus)
- func NullStrToStr(s sql.NullString) string
- func StandardizeCollectionSections(sections []int) []int
- func StrPtrToNullStr(s *string) sql.NullString
- func ToJSONB(v any) (pgtype.JSONB, error)
- func TrackStepStatus(ctx context.Context, status *PipelineStepStatus, name string) (func(), context.Context)
- type Action
- type ActionList
- type Address
- type AnnouncementDetails
- type AnnouncementPlatform
- type BlockNumber
- type BlockRange
- type Chain
- func (c Chain) BaseKeywords() (image []string, anim []string)
- func (c Chain) L1Chain() L1Chain
- func (c Chain) L1ChainGroup() []Chain
- func (c Chain) MarshalGQL(w io.Writer)
- func (c Chain) NormalizeAddress(addr Address) string
- func (c *Chain) Scan(src interface{}) error
- func (c Chain) String() string
- func (c *Chain) UnmarshalGQL(v interface{}) error
- func (c *Chain) UnmarshalJSON(data []byte) error
- func (c Chain) Value() (driver.Value, error)
- type ChainAddress
- func (c *ChainAddress) Address() Address
- func (c *ChainAddress) Chain() Chain
- func (c *ChainAddress) GQLSetAddressFromResolver(address Address) error
- func (c *ChainAddress) GQLSetChainFromResolver(chain Chain) error
- func (c *ChainAddress) IsGalleryUserOrAddress()
- func (c ChainAddress) MarshalJSON() ([]byte, error)
- func (c ChainAddress) String() string
- func (c ChainAddress) ToL1ChainAddress() L1ChainAddress
- func (c *ChainAddress) UnmarshalJSON(data []byte) error
- type ChainPubKey
- func (c *ChainPubKey) Chain() Chain
- func (c *ChainPubKey) GQLSetChainFromResolver(chain Chain) error
- func (c *ChainPubKey) GQLSetPubKeyFromResolver(pubKey PubKey) error
- func (c *ChainPubKey) PubKey() PubKey
- func (c ChainPubKey) String() string
- func (c ChainPubKey) ToChainAddress() ChainAddress
- func (c ChainPubKey) ToL1ChainAddress() L1ChainAddress
- type Collection
- type CollectionDB
- type CollectionRepository
- type CollectionSectionLayout
- type CollectionTokenSettings
- type CollectionUpdateDeletedInput
- type CollectionUpdateHiddenInput
- type CollectionUpdateInfoInput
- type CollectionUpdateTokensInput
- type Comment
- type CommunityCreatorType
- type CommunityKey
- type CommunityType
- type CompleteIndex
- type Contract
- type ContractCollectionNFT
- type ContractGallery
- type ContractGalleryRepository
- type ContractIdentifiers
- type ContractOwnerMethod
- type ContractRepository
- type ContractUpdateInput
- type CreateLoginAttemptInput
- type CreateUserInput
- type DBID
- type DBIDList
- type DBIDTuple
- type DarkMode
- type DecimalTokenID
- func (id DecimalTokenID) BigInt() *big.Int
- func (id *DecimalTokenID) DecodeBinary(ci *pgtype.ConnInfo, src []byte) error
- func (id DecimalTokenID) MarshalGQL(w io.Writer)
- func (id DecimalTokenID) Numeric() pgtype.Numeric
- func (id *DecimalTokenID) Scan(src interface{}) error
- func (id DecimalTokenID) String() string
- func (id DecimalTokenID) ToHexTokenID() HexTokenID
- func (id *DecimalTokenID) UnmarshalGQL(v any) error
- func (id DecimalTokenID) Value() (driver.Value, error)
- type DecimalTokenIDList
- type Dimensions
- type EarlyAccessRepository
- type Email
- type EmailType
- type EmailUnsubscriptions
- type EmailVerificationStatus
- func (e EmailVerificationStatus) IsVerified() bool
- func (e EmailVerificationStatus) MarshalGQL(w io.Writer)
- func (e *EmailVerificationStatus) Scan(src interface{}) error
- func (e EmailVerificationStatus) String() string
- func (e *EmailVerificationStatus) UnmarshalGQL(v interface{}) error
- func (e EmailVerificationStatus) Value() (driver.Value, error)
- type ErrAddressNotOwnedByUser
- type ErrAddressOwnedByUser
- type ErrAdmireNotFound
- type ErrAdmireNotFoundByActorIDCommentID
- type ErrAdmireNotFoundByActorIDFeedEventID
- type ErrAdmireNotFoundByActorIDPostID
- type ErrAdmireNotFoundByActorIDTokenID
- type ErrAdmireNotFoundByID
- type ErrCollectionNotFoundByID
- type ErrCommentNotFound
- type ErrCommentNotFoundByID
- type ErrCommunityNotFound
- type ErrContractCreatorNotFound
- type ErrContractNotFound
- type ErrContractNotFoundByAddress
- type ErrFeedEventNotFound
- type ErrFeedEventNotFoundByID
- type ErrGalleryNotFound
- type ErrInvalidLayout
- type ErrMediaNotFound
- type ErrMediaNotFoundByID
- type ErrMembershipNotFoundByID
- type ErrMembershipNotFoundByName
- type ErrMembershipNotFoundByTokenID
- type ErrNonceNotFoundForAddress
- type ErrNotFound
- type ErrPostNotFound
- type ErrPostNotFoundByID
- type ErrProfileImageNotFound
- type ErrPushTokenBelongsToAnotherUser
- type ErrTokenDefinitionNotFound
- type ErrTokenDefinitionNotFoundByID
- type ErrTokenNotFound
- type ErrTokenNotFoundByID
- type ErrTokenNotFoundByTokenIdentifiers
- type ErrTokenNotFoundByUserTokenIdentifers
- type ErrTokensNotFoundByContract
- type ErrUnknownAction
- type ErrUnknownResourceType
- type ErrUserAlreadyExists
- type ErrUserNotFound
- type ErrUsernameNotAvailable
- type ErrWalletAlreadyExists
- type ErrWalletCreateFailed
- type ErrWalletNotFound
- type ErrWalletNotFoundByAddress
- type ErrWalletNotFoundByID
- type EthereumAddress
- func (a EthereumAddress) Address() common.Address
- func (a EthereumAddress) MarshalJSON() ([]byte, error)
- func (a *EthereumAddress) Scan(i interface{}) error
- func (a EthereumAddress) String() string
- func (a *EthereumAddress) UnmarshalJSON(b []byte) error
- func (a EthereumAddress) Value() (driver.Value, error)
- type EthereumAddressAtBlock
- type EthereumAddressList
- type EthereumTokenIdentifiers
- type EventData
- type FallbackMedia
- type FeedEntityType
- type FeedEventData
- type Gallery
- type GalleryDB
- type GalleryTokenUpdateInput
- type HexString
- type HexTokenID
- func (id HexTokenID) Base10String() string
- func (id HexTokenID) BigInt() *big.Int
- func (id HexTokenID) MarshalGQL(w io.Writer)
- func (id *HexTokenID) Scan(src interface{}) error
- func (id HexTokenID) String() string
- func (id HexTokenID) ToDecimalTokenID() DecimalTokenID
- func (id HexTokenID) ToInt() int64
- func (id HexTokenID) ToUint256String() string
- func (id *HexTokenID) UnmarshalGQL(v any) error
- func (id HexTokenID) Value() (driver.Value, error)
- type HexTokenIDList
- type L1Chain
- type L1ChainAddress
- type Media
- type MediaList
- type MediaType
- func (m MediaType) IsAnimationLike() bool
- func (m MediaType) IsImageLike() bool
- func (m MediaType) IsMorePriorityThan(other MediaType) bool
- func (m MediaType) IsValid() bool
- func (m *MediaType) Scan(src interface{}) error
- func (m MediaType) String() string
- func (m MediaType) ToContentType() string
- func (m MediaType) Value() (driver.Value, error)
- type MembershipRepository
- type MembershipTier
- type MentionType
- type NotificationData
- type NullBool
- type NullInt32
- type NullInt64
- type NullString
- type OpenSeaWebhookInput
- type OpenseaNFTID
- type Persona
- type PipelineMetadata
- type PipelineStepStatus
- type ProcessingCause
- type ProfileImageSource
- type PubKey
- type ReportReason
- type ReqHeaders
- type ResourceType
- type Role
- type RoleList
- type SocialProvider
- type SocialUserIdentifiers
- type Socials
- type Token
- type TokenCountType
- type TokenHolder
- type TokenHolderList
- type TokenIdentifiers
- type TokenLayout
- type TokenMetadata
- type TokenOwnershipType
- type TokenProperties
- type TokenType
- type TokenURI
- type TokenUniqueIdentifiers
- type TokenUpdateBalanceInput
- type TokenUpdateOwnerInput
- type TraitType
- type Traits
- type URIType
- type User
- type UserFromFarcasterJoinedDetails
- type UserLoginAttempt
- type UserNonce
- type UserNotificationSettings
- type UserRepository
- type UserUpdateInfoInput
- type UserUpdateNotificationSettings
- type Wallet
- type WalletList
- type WalletType
Constants ¶
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" )
const ( ReportReasonSpamAndOrBot ReportReason = "SPAM_AND_OR_BOT" ReportReasonInappropriateContent = "INAPPROPRIATE_CONTENT" ReportReasonSomethingElse = "SOMETHING_ELSE" )
Variables ¶
var AllChains = []Chain{ChainETH, ChainArbitrum, ChainPolygon, ChainOptimism, ChainTezos, ChainPOAP, ChainZora, ChainBase}
var AllSocialProviders = []SocialProvider{ SocialProviderTwitter, SocialProviderFarcaster, SocialProviderLens, }
var EvmChains = util.MapKeys(evmChains)
var L1ChainGroups = map[L1Chain][]Chain{ L1Chain(ChainETH): EvmChains, L1Chain(ChainTezos): {ChainTezos}, }
var L1Chains = map[Chain]L1Chain{ ChainPOAP: L1Chain(ChainETH), ChainOptimism: L1Chain(ChainETH), ChainPolygon: L1Chain(ChainETH), ChainArbitrum: L1Chain(ChainETH), ChainZora: L1Chain(ChainETH), ChainBase: L1Chain(ChainETH), ChainETH: L1Chain(ChainETH), ChainTezos: L1Chain(ChainTezos), ChainBaseSepolia: L1Chain(ChainETH), }
Functions ¶
func ContainsDBID ¶
func DBIDToNullStr ¶
func DBIDToNullStr(id DBID) sql.NullString
func FailStep ¶
func FailStep(status *PipelineStepStatus)
func NullStrToStr ¶
func NullStrToStr(s sql.NullString) string
func StandardizeCollectionSections ¶
StandardizeCollectionSections formats the input sections to make it more convenient to parse.
func StrPtrToNullStr ¶
func StrPtrToNullStr(s *string) sql.NullString
func TrackStepStatus ¶
Types ¶
type ActionList ¶
type ActionList []Action
type Address ¶
type Address string
Address represents the value of an address
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
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 ¶
BaseKeywords are the keywords that are default for discovering media for a given chain
func (Chain) L1ChainGroup ¶
func (Chain) MarshalGQL ¶
MarshalGQL implements the graphql.Marshaler interface
func (Chain) NormalizeAddress ¶
NormalizeAddress normalizes an address for the given chain
func (*Chain) UnmarshalGQL ¶
UnmarshalGQL implements the graphql.Unmarshaler interface
func (*Chain) UnmarshalJSON ¶
UnmarshalJSON will unmarshall the JSON data into 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
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 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 ¶
func (*CompleteIndex) Scan ¶
func (c *CompleteIndex) Scan(value interface{}) 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
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 NullStrToDBID ¶
func NullStrToDBID(s sql.NullString) DBID
func RemoveDuplicateDBIDs ¶
RemoveDuplicateDBIDs ensures that an array of DBIDs has no repeat items
type DBIDList ¶
type DBIDList []DBID
DBIDList is a slice of DBIDs, used to implement scanner/valuer interfaces
type DarkMode ¶
type DarkMode int
func (DarkMode) MarshalGQL ¶
MarshalGQL implements the graphql.Marshaler interface
func (*DarkMode) UnmarshalGQL ¶
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
type DecimalTokenIDList ¶
type DecimalTokenIDList []DecimalTokenID
func (*DecimalTokenIDList) Scan ¶
func (l *DecimalTokenIDList) Scan(value interface{}) error
type Dimensions ¶
func (Dimensions) Valid ¶
func (d Dimensions) Valid() bool
type EarlyAccessRepository ¶
type EarlyAccessRepository interface {
IsAllowedByAddresses(context.Context, []ChainAddress) (bool, 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
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
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 ¶
func (ErrAdmireNotFoundByActorIDCommentID) Error ¶
func (e ErrAdmireNotFoundByActorIDCommentID) Error() string
func (ErrAdmireNotFoundByActorIDCommentID) Unwrap ¶
func (e ErrAdmireNotFoundByActorIDCommentID) Unwrap() error
type ErrAdmireNotFoundByActorIDFeedEventID ¶
func (ErrAdmireNotFoundByActorIDFeedEventID) Error ¶
func (e ErrAdmireNotFoundByActorIDFeedEventID) Error() string
func (ErrAdmireNotFoundByActorIDFeedEventID) Unwrap ¶
func (e ErrAdmireNotFoundByActorIDFeedEventID) Unwrap() error
type ErrAdmireNotFoundByActorIDPostID ¶
func (ErrAdmireNotFoundByActorIDPostID) Error ¶
func (e ErrAdmireNotFoundByActorIDPostID) Error() string
func (ErrAdmireNotFoundByActorIDPostID) Unwrap ¶
func (e ErrAdmireNotFoundByActorIDPostID) Unwrap() error
type ErrAdmireNotFoundByActorIDTokenID ¶
func (ErrAdmireNotFoundByActorIDTokenID) Error ¶
func (e ErrAdmireNotFoundByActorIDTokenID) Error() string
func (ErrAdmireNotFoundByActorIDTokenID) Unwrap ¶
func (e ErrAdmireNotFoundByActorIDTokenID) Unwrap() error
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 ¶
func (e ErrCollectionNotFoundByID) Error() string
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 ¶
func (e ErrContractCreatorNotFound) Error() string
type ErrContractNotFound ¶
type ErrContractNotFound struct{}
func (ErrContractNotFound) Error ¶
func (e ErrContractNotFound) Error() string
func (ErrContractNotFound) Unwrap ¶
func (e ErrContractNotFound) Unwrap() error
type ErrContractNotFoundByAddress ¶
ErrContractNotFoundByAddress is an error type for when a contract is not found by address
func (ErrContractNotFoundByAddress) Error ¶
func (e ErrContractNotFoundByAddress) Error() string
func (ErrContractNotFoundByAddress) Unwrap ¶
func (e ErrContractNotFoundByAddress) Unwrap() error
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 ¶
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 ¶
func (e ErrMembershipNotFoundByID) Error() string
type ErrMembershipNotFoundByName ¶
type ErrMembershipNotFoundByName struct {
Name string
}
ErrMembershipNotFoundByName represents an error when a membership is not found by name
func (ErrMembershipNotFoundByName) Error ¶
func (e ErrMembershipNotFoundByName) Error() string
type ErrMembershipNotFoundByTokenID ¶
type ErrMembershipNotFoundByTokenID struct {
TokenID HexTokenID
}
ErrMembershipNotFoundByTokenID represents an error when a membership is not found by token id
func (ErrMembershipNotFoundByTokenID) Error ¶
func (e ErrMembershipNotFoundByTokenID) Error() string
type ErrNonceNotFoundForAddress ¶
type ErrNonceNotFoundForAddress struct {
L1ChainAddress L1ChainAddress
}
ErrNonceNotFoundForAddress is returned when no nonce is found for a given address
func (ErrNonceNotFoundForAddress) Error ¶
func (e ErrNonceNotFoundForAddress) Error() string
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 ¶
func (ErrProfileImageNotFound) Error ¶
func (e ErrProfileImageNotFound) Error() string
type ErrPushTokenBelongsToAnotherUser ¶
type ErrPushTokenBelongsToAnotherUser struct {
PushToken string
}
func (ErrPushTokenBelongsToAnotherUser) Error ¶
func (e ErrPushTokenBelongsToAnotherUser) Error() string
type ErrTokenDefinitionNotFound ¶
type ErrTokenDefinitionNotFound struct{}
func (ErrTokenDefinitionNotFound) Error ¶
func (e ErrTokenDefinitionNotFound) Error() string
func (ErrTokenDefinitionNotFound) Unwrap ¶
func (e ErrTokenDefinitionNotFound) Unwrap() error
type ErrTokenDefinitionNotFoundByID ¶
type ErrTokenDefinitionNotFoundByID struct{ ID DBID }
func (ErrTokenDefinitionNotFoundByID) Error ¶
func (e ErrTokenDefinitionNotFoundByID) Error() string
func (ErrTokenDefinitionNotFoundByID) Unwrap ¶
func (e ErrTokenDefinitionNotFoundByID) Unwrap() error
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 (e ErrTokenNotFoundByTokenIdentifiers) Error() string
func (ErrTokenNotFoundByTokenIdentifiers) Unwrap ¶
func (e ErrTokenNotFoundByTokenIdentifiers) Unwrap() error
type ErrTokenNotFoundByUserTokenIdentifers ¶
type ErrTokenNotFoundByUserTokenIdentifers struct { UserID DBID Token TokenIdentifiers }
func (ErrTokenNotFoundByUserTokenIdentifers) Error ¶
func (e ErrTokenNotFoundByUserTokenIdentifers) Error() string
func (ErrTokenNotFoundByUserTokenIdentifers) Unwrap ¶
func (e ErrTokenNotFoundByUserTokenIdentifers) Unwrap() error
type ErrTokensNotFoundByContract ¶
type ErrTokensNotFoundByContract struct {
ContractAddress EthereumAddress
}
func (ErrTokensNotFoundByContract) Error ¶
func (e ErrTokensNotFoundByContract) Error() string
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 (e ErrWalletNotFoundByAddress) Error() string
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
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
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
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 ¶
func (t EthereumTokenIdentifiers) GetParts() (EthereumAddress, HexTokenID, error)
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
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
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 ¶
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 ¶
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
type HexTokenIDList ¶
type HexTokenIDList []HexTokenID
func (*HexTokenIDList) Scan ¶
func (l *HexTokenIDList) Scan(value interface{}) error
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 ¶
IsServable returns true if the token's Media has enough information to serve it's assets.
type MediaList ¶
type MediaList []Media
MediaList is a slice of Media, used to implement scanner/valuer interfaces
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 ¶
IsAnimationLike returns true if the media type is a type that is expected to be like an animation and live render
func (MediaType) IsImageLike ¶
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 ¶
IsMorePriorityThan returns true if the media type is more important than the other media type
func (MediaType) IsValid ¶
IsValid returns true if the media type is not unknown, syncing, or invalid
func (MediaType) ToContentType ¶
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 (n NotificationData) Concat(other NotificationData) NotificationData
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) BoolPointer ¶
type NullInt32 ¶
type NullInt32 int32
NullInt32 represents an int32 that may be null in the DB
type NullInt64 ¶
type NullInt64 int64
NullInt64 represents an int64 that may be null in the DB
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
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
func (Persona) MarshalGQL ¶
MarshalGQL implements the graphql.Marshaler interface
func (*Persona) UnmarshalGQL ¶
UnmarshalGQL implements the graphql.Unmarshaler interface
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
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
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
type ProfileImageSource ¶
type ProfileImageSource string // ProfileImageSource represents the source of a profile image
const ( ProfileImageSourceToken ProfileImageSource = "token" ProfileImageSourceENS ProfileImageSource = "ens" )
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
type ReqHeaders ¶
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
type ResourceType ¶
type ResourceType int
type Role ¶
type Role string
func (Role) MarshalGQL ¶
MarshalGQL implements the graphql.Marshaler interface
func (*Role) UnmarshalGQL ¶
UnmarshalGQL implements the graphql.Unmarshaler interface
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
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
type Socials ¶
type Socials map[SocialProvider]SocialUserIdentifiers
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
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
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
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
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
type TokenType ¶
type TokenType string
TokenType represents the contract specification of the token
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) IsRenderable ¶
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
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 Traits ¶
type Traits map[TraitType]interface{}
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) ToMediaType ¶
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
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
type WalletList ¶
type WalletList []Wallet
func (*WalletList) Scan ¶
func (l *WalletList) Scan(value interface{}) error
Scan implements the Scanner interface for the AddressList type
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