publicapi

package
v0.0.0-...-7601700 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 73 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMintAlreadyClaimed = fmt.Errorf("already claimed mint for this collection")
View Source
var ErrMintTxPending = fmt.Errorf("transaction is pending")
View Source
var ErrOnlyRemoveOwnAdmire = errors.New("only the actor who created the admire can remove it")
View Source
var ErrOnlyRemoveOwnComment = errors.New("only the actor who created the comment can remove it")
View Source
var ErrProfileImageNotTokenOwner = errors.New("user is not an owner of the token")
View Source
var ErrProfileImageNotWalletOwner = errors.New("user is not the owner of the wallet")
View Source
var ErrProfileImageTooManySources = errors.New("too many profile image sources provided")
View Source
var ErrProfileImageUnknownSource = errors.New("unknown profile image source to use")
View Source
var ErrTokensNotOwnedByUser = errors.New("not all tokens are owned by user")

Functions

func AddTo

func AddTo(ctx *gin.Context, api *PublicAPI)

AddTo adds the specified PublicAPI to a gin context

func GetOnboardingUserRecommendationsBootstrap

func GetOnboardingUserRecommendationsBootstrap(q *db.Queries) func(ctx context.Context) ([]persist.DBID, error)

GetOnboardingUserRecommendationsBootstrap returns a function that when called returns a list of recommended users.

func PushTo

func PushTo(ctx context.Context, api *PublicAPI) context.Context

PushTo pushes the specified PublicAPI onto the context stack and returns the new context

Types

type AuthAPI

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

func (AuthAPI) ForceAuthTokenRefresh

func (api AuthAPI) ForceAuthTokenRefresh(ctx context.Context, userID persist.DBID) error

func (AuthAPI) GenerateQRCodeLoginToken

func (api AuthAPI) GenerateQRCodeLoginToken(ctx context.Context) (string, error)

func (AuthAPI) GetAuthNonce

func (api AuthAPI) GetAuthNonce(ctx context.Context) (nonce string, message string, err error)

func (AuthAPI) Login

func (api AuthAPI) Login(ctx context.Context, authenticator auth.Authenticator) (persist.DBID, error)

func (AuthAPI) Logout

func (api AuthAPI) Logout(ctx context.Context)

func (AuthAPI) NewDebugAuthenticator

func (api AuthAPI) NewDebugAuthenticator(ctx context.Context, debugParams model.DebugAuth) (auth.Authenticator, error)

func (AuthAPI) NewMagicLinkAuthenticator

func (api AuthAPI) NewMagicLinkAuthenticator(token token.Token) auth.Authenticator

func (AuthAPI) NewNeynarAuthenticator

func (api AuthAPI) NewNeynarAuthenticator(custodyAddress persist.ChainPubKey, primaryAddress *persist.ChainPubKey, nonce string, message string, signature string, walletType persist.WalletType) auth.Authenticator

func (AuthAPI) NewNonceAuthenticator

func (api AuthAPI) NewNonceAuthenticator(chainAddress persist.ChainPubKey, nonce string, message string, signature string, walletType persist.WalletType) auth.Authenticator

func (AuthAPI) NewOneTimeLoginTokenAuthenticator

func (api AuthAPI) NewOneTimeLoginTokenAuthenticator(loginToken string) auth.Authenticator

func (AuthAPI) NewPrivyAuthenticator

func (api AuthAPI) NewPrivyAuthenticator(authToken string) auth.Authenticator

type CardAPI

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

func (*CardAPI) MintPremiumCardToWallet

func (api *CardAPI) MintPremiumCardToWallet(ctx context.Context, input model.MintPremiumCardToWalletInput) (string, error)

type CollectionAPI

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

func (CollectionAPI) CreateCollection

func (api CollectionAPI) CreateCollection(ctx context.Context, galleryID persist.DBID, name string, collectorsNote string, tokens []persist.DBID, layout persist.TokenLayout, tokenSettings map[persist.DBID]persist.CollectionTokenSettings, caption *string) (*db.Collection, *db.FeedEvent, error)

func (CollectionAPI) DeleteCollection

func (api CollectionAPI) DeleteCollection(ctx context.Context, collectionID persist.DBID) error

func (CollectionAPI) GetCollectionById

func (api CollectionAPI) GetCollectionById(ctx context.Context, collectionID persist.DBID) (*db.Collection, error)

func (CollectionAPI) GetCollectionsByGalleryId

func (api CollectionAPI) GetCollectionsByGalleryId(ctx context.Context, galleryID persist.DBID) ([]db.Collection, error)

func (CollectionAPI) GetCollectionsByIds

func (api CollectionAPI) GetCollectionsByIds(ctx context.Context, collectionIDs []persist.DBID) ([]*db.Collection, []error)

func (CollectionAPI) GetTopCollectionsForCommunity

func (api CollectionAPI) GetTopCollectionsForCommunity(ctx context.Context, chainAddress persist.ChainAddress, before, after *string, first, last *int) (c []db.Collection, pageInfo PageInfo, err error)

func (CollectionAPI) UpdateCollectionGallery

func (api CollectionAPI) UpdateCollectionGallery(ctx context.Context, collectionID, galleryID persist.DBID) (persist.DBID, error)

UpdateCollectionGallery updates the gallery of a collection and returns the ID of the old gallery.

func (CollectionAPI) UpdateCollectionHidden

func (api CollectionAPI) UpdateCollectionHidden(ctx context.Context, collectionID persist.DBID, hidden bool) error

func (CollectionAPI) UpdateCollectionInfo

func (api CollectionAPI) UpdateCollectionInfo(ctx context.Context, collectionID persist.DBID, name string, collectorsNote string) error

func (CollectionAPI) UpdateCollectionTokens

func (api CollectionAPI) UpdateCollectionTokens(ctx context.Context, collectionID persist.DBID, tokens []persist.DBID, layout persist.TokenLayout, tokenSettings map[persist.DBID]persist.CollectionTokenSettings, caption *string) (*db.FeedEvent, error)

type CommunityAPI

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

func (CommunityAPI) GetCommunityByID

func (api CommunityAPI) GetCommunityByID(ctx context.Context, communityID persist.DBID) (*db.Community, error)

func (CommunityAPI) GetCommunityByKey

func (api CommunityAPI) GetCommunityByKey(ctx context.Context, communityKey persist.CommunityKey) (*db.Community, error)

func (CommunityAPI) GetCreatorsByCommunityID

func (api CommunityAPI) GetCreatorsByCommunityID(ctx context.Context, communityID persist.DBID) ([]db.GetCreatorsByCommunityIDRow, error)

func (CommunityAPI) GetFrameTokensByCommunityID

func (api CommunityAPI) GetFrameTokensByCommunityID(ctx context.Context, communityID persist.DBID, limit int32) ([]db.Token, error)

GetFrameTokensByCommunityID is temporary and shouldn't be used outside of the TokensForFrame resolver

func (CommunityAPI) PaginateHoldersByCommunityID

func (api CommunityAPI) PaginateHoldersByCommunityID(ctx context.Context, communityID persist.DBID, before, after *string, first, last *int) ([]db.User, PageInfo, error)

func (CommunityAPI) PaginatePostsByCommunityID

func (api CommunityAPI) PaginatePostsByCommunityID(ctx context.Context, communityID persist.DBID, before, after *string, first, last *int) ([]db.Post, PageInfo, error)

func (CommunityAPI) PaginateTokensByCommunityID

func (api CommunityAPI) PaginateTokensByCommunityID(ctx context.Context, communityID persist.DBID, before, after *string, first, last *int) ([]db.Token, PageInfo, error)

type ContractAPI

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

func (ContractAPI) GetChildContractsByParentID

func (api ContractAPI) GetChildContractsByParentID(ctx context.Context, contractID persist.DBID, before, after *string, first, last *int) ([]db.Contract, PageInfo, error)

func (ContractAPI) GetCommunityOwnersByContractAddress

func (api ContractAPI) GetCommunityOwnersByContractAddress(ctx context.Context, contractAddress persist.ChainAddress, before, after *string, first, last *int, onlyGalleryUsers bool) ([]db.User, PageInfo, error)

func (ContractAPI) GetCommunityPostsByContractID

func (api ContractAPI) GetCommunityPostsByContractID(ctx context.Context, contractID persist.DBID, before, after *string, first, last *int) ([]db.Post, PageInfo, error)

func (ContractAPI) GetCommunityPostsByContractIDAndProjectID

func (api ContractAPI) GetCommunityPostsByContractIDAndProjectID(ctx context.Context, contractID persist.DBID, projectID int, before, after *string, first, last *int) ([]db.Post, PageInfo, error)

------ Temporary ------

func (ContractAPI) GetContractByAddress

func (api ContractAPI) GetContractByAddress(ctx context.Context, contractAddress persist.ChainAddress) (*db.Contract, error)

func (ContractAPI) GetContractByID

func (api ContractAPI) GetContractByID(ctx context.Context, contractID persist.DBID) (*db.Contract, error)

func (ContractAPI) GetContractCreatorByContractID

func (api ContractAPI) GetContractCreatorByContractID(ctx context.Context, contractID persist.DBID) (db.ContractCreator, error)

func (ContractAPI) GetContractsDisplayedByUserID

func (api ContractAPI) GetContractsDisplayedByUserID(ctx context.Context, userID persist.DBID) ([]db.Contract, error)

func (ContractAPI) GetPreviewURLsByContractIDandUserID

func (api ContractAPI) GetPreviewURLsByContractIDandUserID(ctx context.Context, userID, contractID persist.DBID) ([]string, error)

func (ContractAPI) RefreshContract

func (api ContractAPI) RefreshContract(ctx context.Context, contractID persist.DBID) error

RefreshContract refreshes the metadata for a given contract DBID

type EnsAvatar

type EnsAvatar struct {
	WalletID persist.DBID
	Domain   string
	URI      string
}

type ErrTokenRefreshFailed

type ErrTokenRefreshFailed struct {
	Message string
}

ErrTokenRefreshFailed is a generic error that wraps all other OpenSea sync failures. Should be removed once we stop using OpenSea to sync NFTs.

func (ErrTokenRefreshFailed) Error

func (e ErrTokenRefreshFailed) Error() string

type FeedAPI

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

func (FeedAPI) BanUser

func (api FeedAPI) BanUser(ctx context.Context, userId persist.DBID, reason persist.ReportReason) error

func (FeedAPI) DeletePostById

func (api FeedAPI) DeletePostById(ctx context.Context, postID persist.DBID) error

func (FeedAPI) ForYouFeed

func (api FeedAPI) ForYouFeed(ctx context.Context, before, after *string, first, last *int) ([]any, PageInfo, error)

func (FeedAPI) GetFeedEventById

func (api FeedAPI) GetFeedEventById(ctx context.Context, feedEventID persist.DBID) (*db.FeedEvent, error)

func (FeedAPI) GetPostById

func (api FeedAPI) GetPostById(ctx context.Context, postID persist.DBID) (*db.Post, error)

func (FeedAPI) GetRawEventById

func (api FeedAPI) GetRawEventById(ctx context.Context, eventID persist.DBID) (*db.Event, error)

func (FeedAPI) GlobalFeed

func (api FeedAPI) GlobalFeed(ctx context.Context, before *string, after *string, first *int, last *int) ([]any, PageInfo, error)

func (FeedAPI) PersonalFeed

func (api FeedAPI) PersonalFeed(ctx context.Context, before *string, after *string, first *int, last *int) ([]any, PageInfo, error)

func (FeedAPI) PostTokens

func (api FeedAPI) PostTokens(ctx context.Context, tokenIDs []persist.DBID, mentions []*model.MentionInput, caption, mintURL *string) (persist.DBID, error)

func (FeedAPI) ReferralPostPreflight

func (api FeedAPI) ReferralPostPreflight(ctx context.Context, t persist.TokenIdentifiers) error

func (FeedAPI) ReferralPostToken

func (api FeedAPI) ReferralPostToken(ctx context.Context, t persist.TokenIdentifiers, caption, mintURL *string) (persist.DBID, error)

func (FeedAPI) TrendingFeed

func (api FeedAPI) TrendingFeed(ctx context.Context, before *string, after *string, first *int, last *int) ([]any, PageInfo, error)

func (FeedAPI) TrendingUsers

func (api FeedAPI) TrendingUsers(ctx context.Context, report model.Window) ([]db.User, error)

func (FeedAPI) UnbanUser

func (api FeedAPI) UnbanUser(ctx context.Context, userId persist.DBID) error

func (FeedAPI) UserFeed

func (api FeedAPI) UserFeed(ctx context.Context, userID persist.DBID, before *string, after *string, first *int, last *int) ([]db.Post, PageInfo, error)

type GalleryAPI

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

func (GalleryAPI) CreateGallery

func (api GalleryAPI) CreateGallery(ctx context.Context, name, description *string, position string) (db.Gallery, error)

func (GalleryAPI) DeleteGallery

func (api GalleryAPI) DeleteGallery(ctx context.Context, galleryID persist.DBID) error

func (GalleryAPI) GetGalleriesByUserId

func (api GalleryAPI) GetGalleriesByUserId(ctx context.Context, userID persist.DBID) ([]db.Gallery, error)

func (GalleryAPI) GetGalleriesDisplayingCommunityID

func (api GalleryAPI) GetGalleriesDisplayingCommunityID(ctx context.Context, communityID persist.DBID, before *string, after *string,
	first *int, last *int) ([]db.Gallery, [][]persist.Media, [][]time.Time, PageInfo, error)

func (GalleryAPI) GetGalleryByCollectionId

func (api GalleryAPI) GetGalleryByCollectionId(ctx context.Context, collectionID persist.DBID) (*db.Gallery, error)

func (GalleryAPI) GetGalleryById

func (api GalleryAPI) GetGalleryById(ctx context.Context, galleryID persist.DBID) (*db.Gallery, error)

func (GalleryAPI) GetTokenPreviewsByGalleryID

func (api GalleryAPI) GetTokenPreviewsByGalleryID(ctx context.Context, galleryID persist.DBID) ([]db.TokenMedia, error)

func (GalleryAPI) GetViewerGalleryById

func (api GalleryAPI) GetViewerGalleryById(ctx context.Context, galleryID persist.DBID) (*db.Gallery, error)

func (GalleryAPI) PublishGallery

func (api GalleryAPI) PublishGallery(ctx context.Context, update model.PublishGalleryInput) error

func (GalleryAPI) UpdateGallery

func (api GalleryAPI) UpdateGallery(ctx context.Context, update model.UpdateGalleryInput) (db.Gallery, error)

func (GalleryAPI) UpdateGalleryCollections

func (api GalleryAPI) UpdateGalleryCollections(ctx context.Context, galleryID persist.DBID, collections []persist.DBID) error

func (GalleryAPI) UpdateGalleryHidden

func (api GalleryAPI) UpdateGalleryHidden(ctx context.Context, galleryID persist.DBID, hidden bool) (db.Gallery, error)

func (GalleryAPI) UpdateGalleryInfo

func (api GalleryAPI) UpdateGalleryInfo(ctx context.Context, galleryID persist.DBID, name, description *string) error

func (GalleryAPI) UpdateGalleryPositions

func (api GalleryAPI) UpdateGalleryPositions(ctx context.Context, positions []*model.GalleryPositionInput) error

func (GalleryAPI) ViewGallery

func (api GalleryAPI) ViewGallery(ctx context.Context, galleryID persist.DBID) (db.Gallery, error)

type InteractionAPI

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

func (InteractionAPI) AdmireComment

func (api InteractionAPI) AdmireComment(ctx context.Context, commentID persist.DBID) (persist.DBID, error)

func (InteractionAPI) AdmireFeedEvent

func (api InteractionAPI) AdmireFeedEvent(ctx context.Context, feedEventID persist.DBID) (persist.DBID, error)

func (InteractionAPI) AdmirePost

func (api InteractionAPI) AdmirePost(ctx context.Context, postID persist.DBID) (persist.DBID, error)

func (InteractionAPI) AdmireToken

func (api InteractionAPI) AdmireToken(ctx context.Context, tokenID persist.DBID) (persist.DBID, error)

func (InteractionAPI) CommentOnFeedEvent

func (api InteractionAPI) CommentOnFeedEvent(ctx context.Context, feedEventID persist.DBID, replyToID *persist.DBID, mentions []*model.MentionInput, comment string) (persist.DBID, error)

func (InteractionAPI) CommentOnPost

func (api InteractionAPI) CommentOnPost(ctx context.Context, postID persist.DBID, replyToID *persist.DBID, mentions []*model.MentionInput, comment string) (persist.DBID, error)

func (InteractionAPI) GetAdmireByActorIDAndCommentID

func (api InteractionAPI) GetAdmireByActorIDAndCommentID(ctx context.Context, actorID persist.DBID, commentID persist.DBID) (*db.Admire, error)

func (InteractionAPI) GetAdmireByActorIDAndFeedEventID

func (api InteractionAPI) GetAdmireByActorIDAndFeedEventID(ctx context.Context, actorID persist.DBID, feedEventID persist.DBID) (*db.Admire, error)

func (InteractionAPI) GetAdmireByActorIDAndPostID

func (api InteractionAPI) GetAdmireByActorIDAndPostID(ctx context.Context, actorID persist.DBID, postID persist.DBID) (*db.Admire, error)

func (InteractionAPI) GetAdmireByActorIDAndTokenID

func (api InteractionAPI) GetAdmireByActorIDAndTokenID(ctx context.Context, actorID persist.DBID, tokenID persist.DBID) (*db.Admire, error)

func (InteractionAPI) GetAdmireByID

func (api InteractionAPI) GetAdmireByID(ctx context.Context, admireID persist.DBID) (*db.Admire, error)

func (InteractionAPI) GetCommentByID

func (api InteractionAPI) GetCommentByID(ctx context.Context, commentID persist.DBID) (*db.Comment, error)

func (InteractionAPI) GetMentionsByCommentID

func (api InteractionAPI) GetMentionsByCommentID(ctx context.Context, commentID persist.DBID) ([]db.Mention, error)

func (InteractionAPI) GetMentionsByPostID

func (api InteractionAPI) GetMentionsByPostID(ctx context.Context, postID persist.DBID) ([]db.Mention, error)

func (InteractionAPI) GetTotalCommentsByFeedEventID

func (api InteractionAPI) GetTotalCommentsByFeedEventID(ctx context.Context, feedEventID persist.DBID) (*int, error)

func (InteractionAPI) GetTotalCommentsByPostID

func (api InteractionAPI) GetTotalCommentsByPostID(ctx context.Context, postID persist.DBID) (*int, error)

func (InteractionAPI) PaginateAdmiresByCommentID

func (api InteractionAPI) PaginateAdmiresByCommentID(ctx context.Context, commentID persist.DBID, before *string, after *string, first *int, last *int) ([]db.Admire, PageInfo, error)

func (InteractionAPI) PaginateAdmiresByFeedEventID

func (api InteractionAPI) PaginateAdmiresByFeedEventID(ctx context.Context, feedEventID persist.DBID, before *string, after *string,
	first *int, last *int) ([]db.Admire, PageInfo, error)

func (InteractionAPI) PaginateAdmiresByPostID

func (api InteractionAPI) PaginateAdmiresByPostID(ctx context.Context, postID persist.DBID, before *string, after *string,
	first *int, last *int) ([]db.Admire, PageInfo, error)

func (InteractionAPI) PaginateAdmiresByTokenID

func (api InteractionAPI) PaginateAdmiresByTokenID(ctx context.Context, tokenID persist.DBID, before *string, after *string,
	first *int, last *int, userID *persist.DBID) ([]db.Admire, PageInfo, error)

func (InteractionAPI) PaginateCommentsByFeedEventID

func (api InteractionAPI) PaginateCommentsByFeedEventID(ctx context.Context, feedEventID persist.DBID, before *string, after *string, first *int, last *int) ([]db.Comment, PageInfo, error)

func (InteractionAPI) PaginateCommentsByPostID

func (api InteractionAPI) PaginateCommentsByPostID(ctx context.Context, postID persist.DBID, before *string, after *string, first *int, last *int) ([]db.Comment, PageInfo, error)

func (InteractionAPI) PaginateInteractionsByFeedEventID

func (api InteractionAPI) PaginateInteractionsByFeedEventID(ctx context.Context, feedEventID persist.DBID, before *string, after *string,
	first *int, last *int) ([]any, PageInfo, error)

func (InteractionAPI) PaginateInteractionsByPostID

func (api InteractionAPI) PaginateInteractionsByPostID(ctx context.Context, postID persist.DBID, before *string, after *string, first *int, last *int) ([]any, PageInfo, error)

func (InteractionAPI) PaginateRepliesByCommentID

func (api InteractionAPI) PaginateRepliesByCommentID(ctx context.Context, commentID persist.DBID, before *string, after *string, first *int, last *int) ([]db.Comment, PageInfo, error)

func (InteractionAPI) RemoveAdmire

func (api InteractionAPI) RemoveAdmire(ctx context.Context, admireID persist.DBID) (persist.DBID, persist.DBID, error)

func (InteractionAPI) RemoveComment

func (api InteractionAPI) RemoveComment(ctx context.Context, commentID persist.DBID) (persist.DBID, persist.DBID, error)

func (InteractionAPI) ReportPost

func (api InteractionAPI) ReportPost(ctx context.Context, postID persist.DBID, reason persist.ReportReason) error

type InteractionKey

type InteractionKey struct {
	Tag int32
	ID  persist.DBID
}

type MerchAPI

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

func (MerchAPI) GetMerchTokenByTokenID

func (api MerchAPI) GetMerchTokenByTokenID(ctx context.Context, tokenID persist.HexTokenID) (*model.MerchToken, error)

func (MerchAPI) GetMerchTokens

func (api MerchAPI) GetMerchTokens(ctx context.Context, address persist.Address) ([]*model.MerchToken, error)

func (MerchAPI) RedeemMerchItems

func (api MerchAPI) RedeemMerchItems(ctx context.Context, tokenIDs []persist.HexTokenID, address persist.ChainAddress, sig string, walletType persist.WalletType) ([]*model.MerchToken, error)

type MintAPI

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

func (*MintAPI) ClaimHighlightMint

func (api *MintAPI) ClaimHighlightMint(ctx context.Context, collectionID string, walletID persist.DBID) (persist.DBID, error)

func (*MintAPI) GetHighlightMintClaimByID

func (api *MintAPI) GetHighlightMintClaimByID(ctx context.Context, id persist.DBID) (db.HighlightMintClaim, error)

type MiscAPI

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

func (MiscAPI) GetGalleryOfTheWeekWinners

func (api MiscAPI) GetGalleryOfTheWeekWinners(ctx context.Context) ([]db.User, error)

func (MiscAPI) GetGeneralAllowlist

func (api MiscAPI) GetGeneralAllowlist(ctx context.Context) ([]persist.EthereumAddress, error)

type NotificationsAPI

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

func (NotificationsAPI) ClearUserNotifications

func (api NotificationsAPI) ClearUserNotifications(ctx context.Context) ([]db.Notification, error)

func (NotificationsAPI) GetByID

func (api NotificationsAPI) GetByID(ctx context.Context, id persist.DBID) (db.Notification, error)

func (NotificationsAPI) GetViewerNotifications

func (api NotificationsAPI) GetViewerNotifications(ctx context.Context, before, after *string, first *int, last *int) ([]db.Notification, PageInfo, int, error)

type PageInfo

type PageInfo struct {
	Total           *int
	Size            int
	HasPreviousPage bool
	HasNextPage     bool
	StartCursor     string
	EndCursor       string
}

type PublicAPI

type PublicAPI struct {
	APQ *apq.APQCache

	Auth          *AuthAPI
	Collection    *CollectionAPI
	Gallery       *GalleryAPI
	User          *UserAPI
	Token         *TokenAPI
	Contract      *ContractAPI
	Community     *CommunityAPI
	Wallet        *WalletAPI
	Misc          *MiscAPI
	Feed          *FeedAPI
	Notifications *NotificationsAPI
	Interaction   *InteractionAPI
	Admin         *admin.AdminAPI
	Merch         *MerchAPI
	Social        *SocialAPI
	Card          *CardAPI
	Search        *SearchAPI
	Mint          *MintAPI
	// contains filtered or unexported fields
}

func For

func For(ctx context.Context) *PublicAPI

func New

func New(ctx context.Context, disableDataloaderCaching bool, repos *postgres.Repositories, queries *db.Queries, httpClient *http.Client, ethClient *ethclient.Client, ipfsClient *shell.Shell,
	arweaveClient *goar.Client, storageClient *storage.Client, multichainProvider *multichain.Provider, taskClient *task.Client, throttler *throttle.Locker, secrets *secretmanager.Client, apq *apq.APQCache, feedCache, socialCache, authRefreshCache, tokenManageCache, oneTimeLoginCache *redis.Cache, magicClient *magicclient.API, neynar *farcaster.NeynarAPI, mintLimiter *limiters.KeyRateLimiter) *PublicAPI

type SearchAPI

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

func (SearchAPI) SearchCommunities

func (api SearchAPI) SearchCommunities(ctx context.Context, query string, limit int, nameWeight float32,
	descriptionWeight float32, poapAddressWeight float32, providerNameWeight float32) ([]db.Community, error)

SearchCommunities searches for contracts with the given query, limit, and optional weights. Weights may be nil to accept default values. Weighting will probably be removed after we settle on defaults that feel correct!

func (SearchAPI) SearchGalleries

func (api SearchAPI) SearchGalleries(ctx context.Context, query string, limit int, nameWeight float32, descriptionWeight float32) ([]db.Gallery, error)

SearchGalleries searches for galleries with the given query, limit, and optional weights. Weights may be nil to accept default values. Weighting will probably be removed after we settle on defaults that feel correct!

func (SearchAPI) SearchUsers

func (api SearchAPI) SearchUsers(ctx context.Context, query string, limit int, usernameWeight float32, bioWeight float32) ([]db.User, error)

SearchUsers searches for users with the given query, limit, and optional weights. Weights may be nil to accept default values. Weighting will probably be removed after we settle on defaults that feel correct!

type SocialAPI

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

func (*SocialAPI) DisconnectSocialAccount

func (s *SocialAPI) DisconnectSocialAccount(ctx context.Context, socialType persist.SocialProvider) error

func (SocialAPI) GetConnections

func (api SocialAPI) GetConnections(ctx context.Context, socialProvider persist.SocialProvider, onlyUnfollowing *bool) ([]model.SocialConnection, error)

func (SocialAPI) GetConnectionsPaginate

func (api SocialAPI) GetConnectionsPaginate(ctx context.Context, socialProvider persist.SocialProvider, before, after *string, first, last *int, onlyUnfollowing *bool) ([]model.SocialConnection, PageInfo, error)

func (SocialAPI) GetFarcasterFollowingByUserID

func (api SocialAPI) GetFarcasterFollowingByUserID(ctx context.Context, userID persist.DBID) ([]farcaster.NeynarUser, error)

func (SocialAPI) NewFarcasterAuthenticator

func (s SocialAPI) NewFarcasterAuthenticator(userID persist.DBID, address persist.Address, withSigner bool) *socialauth.FarcasterAuthenticator

func (SocialAPI) NewLensAuthenticator

func (s SocialAPI) NewLensAuthenticator(userID persist.DBID, address persist.Address, sig string) *socialauth.LensAuthenticator

func (SocialAPI) NewTwitterAuthenticator

func (s SocialAPI) NewTwitterAuthenticator(userID persist.DBID, authCode string) *socialauth.TwitterAuthenticator

type TokenAPI

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

func (TokenAPI) GetCommunitiesByTokenDefinitionID

func (api TokenAPI) GetCommunitiesByTokenDefinitionID(ctx context.Context, tokenDefinitionID persist.DBID) ([]db.Community, error)

func (TokenAPI) GetMediaByMediaID

func (api TokenAPI) GetMediaByMediaID(ctx context.Context, id persist.DBID) (db.TokenMedia, error)

func (TokenAPI) GetMediaByTokenIdentifiers

func (api TokenAPI) GetMediaByTokenIdentifiers(ctx context.Context, tokenIdentifiers persist.TokenIdentifiers) (db.TokenDefinition, db.TokenMedia, error)

func (TokenAPI) GetNewTokensByFeedEventID

func (api TokenAPI) GetNewTokensByFeedEventID(ctx context.Context, eventID persist.DBID) ([]db.Token, error)

GetNewTokensByFeedEventID returns new tokens added to a collection from an event. Since its possible for tokens to be deleted, the return size may not be the same size of the tokens added, so the caller should handle the matching of arguments to response if used in that context.

func (TokenAPI) GetProcessingStateByTokenDefinitionID

func (api TokenAPI) GetProcessingStateByTokenDefinitionID(ctx context.Context, id persist.DBID) (bool, error)

GetProcessingStateByTokenDefinitionID returns true if a token is queued for processing, or is currently being processed.

func (TokenAPI) GetTokenByEnsDomain

func (api TokenAPI) GetTokenByEnsDomain(ctx context.Context, userID persist.DBID, domain string) (db.Token, db.TokenDefinition, db.TokenMedia, error)

func (TokenAPI) GetTokenById

func (api TokenAPI) GetTokenById(ctx context.Context, tokenID persist.DBID) (*db.Token, error)

func (TokenAPI) GetTokenByIdIgnoreDisplayable

func (api TokenAPI) GetTokenByIdIgnoreDisplayable(ctx context.Context, tokenID persist.DBID) (*db.Token, error)

GetTokenByIdIgnoreDisplayable returns a token by ID, ignoring the displayable flag.

func (TokenAPI) GetTokenDefinitionByID

func (api TokenAPI) GetTokenDefinitionByID(ctx context.Context, id persist.DBID) (db.TokenDefinition, error)

func (TokenAPI) GetTokensBookmarkedByUserId

func (api TokenAPI) GetTokensBookmarkedByUserId(ctx context.Context, userID persist.DBID, before, after *string, first, last *int) ([]db.Token, PageInfo, error)

func (TokenAPI) GetTokensByCollectionId

func (api TokenAPI) GetTokensByCollectionId(ctx context.Context, collectionID persist.DBID, limit *int) ([]db.Token, error)

func (TokenAPI) GetTokensByContractIdPaginate

func (api TokenAPI) GetTokensByContractIdPaginate(ctx context.Context, contractID persist.DBID, before, after *string, first, last *int, onlyGalleryUsers bool) ([]db.Token, PageInfo, error)

func (TokenAPI) GetTokensByIDs

func (api TokenAPI) GetTokensByIDs(ctx context.Context, tokenIDs []persist.DBID) ([]db.Token, error)

func (TokenAPI) GetTokensByUserID

func (api TokenAPI) GetTokensByUserID(ctx context.Context, userID persist.DBID, ownershipFilter []persist.TokenOwnershipType) ([]db.Token, error)

GetTokensByUserID returns all tokens owned by a user. ownershipFilter is optional and may be nil or empty, which will cause all tokens to be returned. If filter values are provided, only the tokens matching the filter will be returned.

func (TokenAPI) GetTokensByWalletID

func (api TokenAPI) GetTokensByWalletID(ctx context.Context, walletID persist.DBID) ([]db.Token, error)

func (TokenAPI) RefreshCollection

func (api TokenAPI) RefreshCollection(ctx context.Context, collectionDBID persist.DBID) error

func (TokenAPI) RefreshToken

func (api TokenAPI) RefreshToken(ctx context.Context, tokenDBID persist.DBID) error

func (TokenAPI) SetSpamPreference

func (api TokenAPI) SetSpamPreference(ctx context.Context, tokens []persist.DBID, isSpam bool) error

func (TokenAPI) SyncCreatedTokensAdmin

func (api TokenAPI) SyncCreatedTokensAdmin(ctx context.Context, includeChains []persist.Chain, userID persist.DBID) error

func (TokenAPI) SyncCreatedTokensForExistingContract

func (api TokenAPI) SyncCreatedTokensForExistingContract(ctx context.Context, contractID persist.DBID) error

func (TokenAPI) SyncCreatedTokensForExistingContractAdmin

func (api TokenAPI) SyncCreatedTokensForExistingContractAdmin(ctx context.Context, userID persist.DBID, chainAddress persist.ChainAddress) error

func (TokenAPI) SyncCreatedTokensForNewContracts

func (api TokenAPI) SyncCreatedTokensForNewContracts(ctx context.Context, includeChains []persist.Chain, incrementally bool) error

func (TokenAPI) SyncTokens

func (api TokenAPI) SyncTokens(ctx context.Context, chains []persist.Chain, incrementally bool) error

func (TokenAPI) SyncTokensAdmin

func (api TokenAPI) SyncTokensAdmin(ctx context.Context, chains []persist.Chain, userID persist.DBID) error

func (TokenAPI) UpdateTokenInfo

func (api TokenAPI) UpdateTokenInfo(ctx context.Context, tokenID persist.DBID, collectionID persist.DBID, collectorsNote string) error

func (TokenAPI) ViewToken

func (api TokenAPI) ViewToken(ctx context.Context, tokenID persist.DBID, collectionID persist.DBID) (db.Event, error)

type UserAPI

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

func (UserAPI) AddSocialAccountToUser

func (api UserAPI) AddSocialAccountToUser(ctx context.Context, authenticator socialauth.Authenticator, display bool) error

func (UserAPI) AddWalletToUser

func (api UserAPI) AddWalletToUser(ctx context.Context, chainAddress persist.ChainAddress, authenticator auth.Authenticator) error

func (UserAPI) BlockUser

func (api UserAPI) BlockUser(ctx context.Context, userID persist.DBID) error

func (UserAPI) CreatePushTokenForUser

func (api UserAPI) CreatePushTokenForUser(ctx context.Context, pushToken string) (db.PushNotificationToken, error)

CreatePushTokenForUser adds a push token to a user, or returns the existing push token if it's already been added to this user. If the token can't be added because it belongs to another user, an error is returned.

func (UserAPI) CreateUser

func (api UserAPI) CreateUser(ctx context.Context, authenticator auth.Authenticator, username string, email *persist.Email, bio, galleryName, galleryDesc, galleryPos string, importFarcasterWallets bool) (userID persist.DBID, galleryID persist.DBID, err error)

func (UserAPI) CreatedCommunities

func (api UserAPI) CreatedCommunities(ctx context.Context, userID persist.DBID, includeChains []persist.Chain, before, after *string, first, last *int) ([]db.Contract, PageInfo, error)

func (UserAPI) DeletePushTokenByPushToken

func (api UserAPI) DeletePushTokenByPushToken(ctx context.Context, pushToken string) error

DeletePushTokenByPushToken removes a push token from a user, or does nothing if the token doesn't exist. If the token can't be removed because it belongs to another user, an error is returned.

func (UserAPI) FollowAllOnboardingRecommendations

func (api UserAPI) FollowAllOnboardingRecommendations(ctx context.Context, curStr *string) error

func (UserAPI) FollowAllSocialConnections

func (api UserAPI) FollowAllSocialConnections(ctx context.Context, socialType persist.SocialProvider) error

func (UserAPI) FollowUser

func (api UserAPI) FollowUser(ctx context.Context, userID persist.DBID) error

func (UserAPI) GetCurrentUserEmailNotificationSettings

func (api UserAPI) GetCurrentUserEmailNotificationSettings(ctx context.Context) (persist.EmailUnsubscriptions, error)

func (UserAPI) GetDisplayedSocials

func (api UserAPI) GetDisplayedSocials(ctx context.Context, userID persist.DBID) (*model.SocialAccounts, error)

func (UserAPI) GetFollowersByUserId

func (api UserAPI) GetFollowersByUserId(ctx context.Context, userID persist.DBID) ([]db.User, error)

func (UserAPI) GetFollowingByUserId

func (api UserAPI) GetFollowingByUserId(ctx context.Context, userID persist.DBID) ([]db.User, error)

func (UserAPI) GetLoggedInUserId

func (api UserAPI) GetLoggedInUserId(ctx context.Context) persist.DBID

func (UserAPI) GetMembershipByMembershipId

func (api UserAPI) GetMembershipByMembershipId(ctx context.Context, membershipID persist.DBID) (*db.Membership, error)

func (UserAPI) GetMembershipTiers

func (api UserAPI) GetMembershipTiers(ctx context.Context, forceRefresh bool) ([]persist.MembershipTier, error)

func (UserAPI) GetPotentialENSProfileImageByUserID

func (api UserAPI) GetPotentialENSProfileImageByUserID(ctx context.Context, userID persist.DBID) (a EnsAvatar, err error)

GetPotentialENSProfileImageByUserID returns the an ENS profile image for a user based on their set of wallets

func (UserAPI) GetProfileImageByUserID

func (api UserAPI) GetProfileImageByUserID(ctx context.Context, userID persist.DBID) (db.ProfileImage, error)

func (UserAPI) GetSocials

func (api UserAPI) GetSocials(ctx context.Context, userID persist.DBID) (*model.SocialAccounts, error)

func (UserAPI) GetSuggestedUsers

func (api UserAPI) GetSuggestedUsers(ctx context.Context, before, after *string, first, last *int) ([]db.User, PageInfo, error)

func (UserAPI) GetSuggestedUsersFarcaster

func (api UserAPI) GetSuggestedUsersFarcaster(ctx context.Context, before, after *string, first, last *int) ([]db.User, PageInfo, error)

func (UserAPI) GetUserByAddress

func (api UserAPI) GetUserByAddress(ctx context.Context, chainAddress persist.ChainAddress) (*db.User, error)

func (UserAPI) GetUserById

func (api UserAPI) GetUserById(ctx context.Context, userID persist.DBID) (*db.User, error)

func (UserAPI) GetUserByUsername

func (api UserAPI) GetUserByUsername(ctx context.Context, username string) (*db.User, error)

func (UserAPI) GetUserByVerifiedEmailAddress

func (api UserAPI) GetUserByVerifiedEmailAddress(ctx context.Context, emailAddress persist.Email) (*db.User, error)

func (UserAPI) GetUserExperiences

func (api UserAPI) GetUserExperiences(ctx context.Context, userID persist.DBID) ([]*model.UserExperience, error)

func (*UserAPI) GetUserRolesByUserID

func (api *UserAPI) GetUserRolesByUserID(ctx context.Context, userID persist.DBID) ([]persist.Role, error)

func (UserAPI) GetUserWithPII

func (api UserAPI) GetUserWithPII(ctx context.Context) (*db.PiiUserView, error)

GetUserWithPII returns the current user and their associated personally identifiable information

func (UserAPI) GetUsersByAddresses

func (api UserAPI) GetUsersByAddresses(ctx context.Context, chainAddresses []persist.ChainAddress) ([]db.User, error)

func (UserAPI) GetUsersByIDs

func (api UserAPI) GetUsersByIDs(ctx context.Context, userIDs []persist.DBID, before, after *string, first, last *int) ([]db.User, PageInfo, error)

func (UserAPI) GetUsersWithTrait

func (api UserAPI) GetUsersWithTrait(ctx context.Context, trait string) ([]db.User, error)

func (UserAPI) IsMemberOfCommunity

func (api UserAPI) IsMemberOfCommunity(ctx context.Context, userID persist.DBID, communityID persist.DBID) (bool, error)

func (UserAPI) IsUserLoggedIn

func (api UserAPI) IsUserLoggedIn(ctx context.Context) bool

func (*UserAPI) OptInForRoles

func (api *UserAPI) OptInForRoles(ctx context.Context, roles []persist.Role) (*db.User, error)

func (*UserAPI) OptOutForRoles

func (api *UserAPI) OptOutForRoles(ctx context.Context, roles []persist.Role) (*db.User, error)

func (UserAPI) PaginateUsersWithRole

func (api UserAPI) PaginateUsersWithRole(ctx context.Context, role persist.Role, before *string, after *string, first *int, last *int) ([]db.User, PageInfo, error)

func (UserAPI) RemoveProfileImage

func (api UserAPI) RemoveProfileImage(ctx context.Context) error

func (UserAPI) RemoveWalletsFromUser

func (api UserAPI) RemoveWalletsFromUser(ctx context.Context, walletIDs []persist.DBID) error

func (UserAPI) ResendEmailVerification

func (api UserAPI) ResendEmailVerification(ctx context.Context) error

func (UserAPI) SetPersona

func (api UserAPI) SetPersona(ctx context.Context, persona persist.Persona) error

func (UserAPI) SetProfileImage

func (api UserAPI) SetProfileImage(ctx context.Context, tokenID *persist.DBID, walletAddress *persist.ChainAddress) error

SetProfileImage sets the profile image for the current user.

func (UserAPI) SharedCommunities

func (api UserAPI) SharedCommunities(ctx context.Context, userID persist.DBID, before, after *string, first, last *int) ([]db.Community, PageInfo, error)

func (UserAPI) SharedFollowers

func (api UserAPI) SharedFollowers(ctx context.Context, userID persist.DBID, before, after *string, first, last *int) ([]db.User, PageInfo, error)

func (UserAPI) UnblockUser

func (api UserAPI) UnblockUser(ctx context.Context, userID persist.DBID) error

func (UserAPI) UnfollowUser

func (api UserAPI) UnfollowUser(ctx context.Context, userID persist.DBID) error

func (UserAPI) UpdateFeaturedGallery

func (api UserAPI) UpdateFeaturedGallery(ctx context.Context, galleryID persist.DBID) error

func (UserAPI) UpdateUserEmailNotificationSettings

func (api UserAPI) UpdateUserEmailNotificationSettings(ctx context.Context, settings persist.EmailUnsubscriptions) error

func (UserAPI) UpdateUserEmailWithAuthenticator

func (api UserAPI) UpdateUserEmailWithAuthenticator(ctx context.Context, email persist.Email, authenticator auth.Authenticator) error

func (UserAPI) UpdateUserEmailWithManualVerification

func (api UserAPI) UpdateUserEmailWithManualVerification(ctx context.Context, email persist.Email) error

func (UserAPI) UpdateUserExperience

func (api UserAPI) UpdateUserExperience(ctx context.Context, experienceType model.UserExperienceType, value bool) error

func (UserAPI) UpdateUserInfo

func (api UserAPI) UpdateUserInfo(ctx context.Context, username string, bio string) error

func (UserAPI) UpdateUserNotificationSettings

func (api UserAPI) UpdateUserNotificationSettings(ctx context.Context, notificationSettings persist.UserNotificationSettings) error

func (UserAPI) UpdateUserPrimaryWallet

func (api UserAPI) UpdateUserPrimaryWallet(ctx context.Context, primaryWalletID persist.DBID) error

func (UserAPI) UpdateUserSocialDisplayed

func (api UserAPI) UpdateUserSocialDisplayed(ctx context.Context, socialType persist.SocialProvider, displayed bool) error

func (*UserAPI) UserIsAdmin

func (api *UserAPI) UserIsAdmin(ctx context.Context) bool

func (UserAPI) VerifiedEmailAddressExists

func (api UserAPI) VerifiedEmailAddressExists(ctx context.Context, emailAddress persist.Email) (bool, error)

type WalletAPI

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

func (WalletAPI) GetWalletByID

func (api WalletAPI) GetWalletByID(ctx context.Context, walletID persist.DBID) (*db.Wallet, error)

func (WalletAPI) GetWalletsByIDs

func (api WalletAPI) GetWalletsByIDs(ctx context.Context, walletIDs []persist.DBID) ([]db.Wallet, error)

func (WalletAPI) GetWalletsByUserID

func (api WalletAPI) GetWalletsByUserID(ctx context.Context, userID persist.DBID) ([]db.Wallet, error)

Jump to

Keyboard shortcuts

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