Documentation
¶
Index ¶
- type ContractInput
- type CurrencyInput
- type DisplayAchievementInput
- type DisplayAchievementsInput
- type DisplayColorsInput
- type DisplayConfigInput
- type DisplayGroupInput
- type DisplayInfoInput
- type DisplayItemInput
- type DisplayPictureInput
- type FungibleTokenInput
- type GetAllCurrenciesInput
- type GetAllFungibleTokensInput
- type GetAllInteractionsInput
- type GetAllNonFungibleTokensInput
- type GetAllStatisticsInput
- type GetChallengeInput
- type GetCurrencyInput
- type GetDefaultProfileInput
- type GetFungibleTokenInput
- type GetInteractionInput
- type GetListingMetadataInput
- type GetListingsInput
- type GetNonFungibleTokenInput
- type GetProfileInput
- type GetStatisticsInput
- type GetTopProfilesInput
- type IGetAllCurrenciesUseCase
- type IGetAllFungibleTokensUseCase
- type IGetAllInteractionsUseCase
- type IGetAllNonFungibleTokensUseCase
- type IGetAllStatisticsUseCase
- type IGetChallengeUseCase
- type IGetCurrencyUseCase
- type IGetDefaultProfileUseCase
- type IGetFungibleTokenUseCase
- type IGetInteractionUseCase
- type IGetListingMetadataUseCase
- type IGetListingsUseCase
- type IGetNonFungibleTokenUseCase
- type IGetProfileUseCase
- type IGetStatisticUseCase
- type IGetStoreMetadataUseCase
- type IGetTopProfilesUseCase
- type IRecordProfileViewUseCase
- type IRefreshProfileUseCase
- type IResolveAddressUseCase
- type IResolveENSNameUseCase
- type ISaveProfileUseCase
- type IVerifyChallengeUseCase
- type IVerifyRateLimitUseCase
- type InteractionInput
- type NonFungibleTokenInput
- type ProfileInput
- type RecordProfileViewInput
- type RefreshProfileInput
- type ResolveAddressInput
- type ResolveENSNameInput
- type SaveProfileInput
- type StatisticInput
- type TransactionInput
- type VerifyChallengeInput
- type VerifyRateLimitInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContractInput ¶
type ContractInput struct { Blockchain common.Blockchain `json:"blockchain" validate:"required,oneof=ethereum polygon arbitrum optimism"` Address string `json:"address" validate:"required,eth_addr"` Interface common.Interface `` /* 176-byte string literal not displayed */ }
type CurrencyInput ¶
type CurrencyInput struct {
Blockchain common.Blockchain `json:"blockchain" validate:"required,oneof=ethereum polygon arbitrum optimism"`
}
type DisplayAchievementInput ¶
type DisplayAchievementInput struct { Id string `json:"id" validate:"required"` Index uint64 `json:"index" validate:"gte=0"` Type common.AchievementType `json:"type" validate:"required,oneof=interactions"` }
type DisplayAchievementsInput ¶
type DisplayAchievementsInput struct { Text string `json:"text" validate:"max=30"` Items *[]DisplayAchievementInput `json:"items" validate:"required,dive"` }
type DisplayColorsInput ¶
type DisplayColorsInput struct { Primary string `json:"primary" validate:"required,max=15"` Secondary string `json:"secondary" validate:"required,max=15"` PrimaryText string `json:"primary_text" validate:"required,max=15"` SecondaryText string `json:"secondary_text" validate:"required,max=15"` Shadow string `json:"shadow" validate:"required,max=15"` Accent string `json:"accent" validate:"required,max=15"` }
type DisplayConfigInput ¶
type DisplayConfigInput struct { Colors *DisplayColorsInput `json:"colors" validate:"required,dive"` Info *DisplayInfoInput `json:"info" validate:"required,dive"` Picture *DisplayPictureInput `json:"picture" validate:"required,dive"` Achievements *DisplayAchievementsInput `json:"achievements" validate:"required,dive"` Groups *[]DisplayGroupInput `json:"groups" validate:"required,dive"` }
type DisplayGroupInput ¶
type DisplayGroupInput struct { Id string `json:"id" validate:"required,max=30"` Text string `json:"text" validate:"max=30"` Items *[]DisplayItemInput `json:"items" validate:"required,dive"` }
type DisplayInfoInput ¶
type DisplayItemInput ¶
type DisplayPictureInput ¶
type DisplayPictureInput struct {
Item *DisplayItemInput `json:"item,omitempty" validate:""` // Item can be nil. TODO: figure out how to validate this properly. dive will not allow nil values
}
type FungibleTokenInput ¶
type FungibleTokenInput struct {
Contract *ContractInput `json:"contract" validate:"required,dive"`
}
type GetAllCurrenciesInput ¶
type GetAllCurrenciesInput struct {
Currencies *[]GetCurrencyInput `validate:"required"`
}
type GetAllFungibleTokensInput ¶
type GetAllFungibleTokensInput struct {
Tokens *[]GetFungibleTokenInput `validate:"required"`
}
type GetAllInteractionsInput ¶
type GetAllInteractionsInput struct {
Interactions *[]GetInteractionInput `validate:"required"`
}
type GetAllNonFungibleTokensInput ¶
type GetAllNonFungibleTokensInput struct {
NonFungibleTokens *[]GetNonFungibleTokenInput `validate:"required"`
}
type GetAllStatisticsInput ¶
type GetAllStatisticsInput struct {
Stats *[]GetStatisticsInput `validate:"required"`
}
type GetChallengeInput ¶
type GetChallengeInput struct {
Address string `validate:"required,eth_addr"`
}
type GetCurrencyInput ¶
type GetCurrencyInput struct { Address string `validate:"required,eth_addr"` Blockchain common.Blockchain `validate:"required,oneof=ethereum polygon arbitrum optimism"` }
type GetDefaultProfileInput ¶
type GetDefaultProfileInput struct {
Address string `validate:"required,eth_addr"`
}
type GetFungibleTokenInput ¶
type GetFungibleTokenInput struct { Address string `validate:"required,eth_addr"` Token *FungibleTokenInput `validate:"required,dive"` }
type GetInteractionInput ¶
type GetInteractionInput struct { Address string `validate:"required,eth_addr"` Interaction *InteractionInput `validate:"required,dive"` }
type GetListingMetadataInput ¶
type GetListingMetadataInput struct {
TokenId string `validate:"required,numeric"`
}
type GetListingsInput ¶
type GetListingsInput struct {
TokenIds *[]string `json:"token_ids" validate:"required,dive,numeric"`
}
type GetNonFungibleTokenInput ¶
type GetNonFungibleTokenInput struct { Address string `validate:"required,eth_addr"` NonFungibleToken *NonFungibleTokenInput `validate:"required,dive"` }
type GetProfileInput ¶
type GetProfileInput struct {
Address string `validate:"required,eth_addr"`
}
type GetStatisticsInput ¶
type GetStatisticsInput struct { Address string `validate:"required,eth_addr"` Statistic *StatisticInput `validate:"required,dive"` }
type GetTopProfilesInput ¶
type GetTopProfilesInput struct { }
type IGetAllCurrenciesUseCase ¶
type IGetAllCurrenciesUseCase interface { // Get the balances for the given list of addresses and blockchains. // A nil balance will be returned for any invalid contracts Do(ctx context.Context, input *GetAllCurrenciesInput) *[]entities.Currency }
func NewGetAllCurrenciesUseCase ¶
func NewGetAllCurrenciesUseCase( logger common.ILogger, getCurrency IGetCurrencyUseCase, ) IGetAllCurrenciesUseCase
type IGetAllFungibleTokensUseCase ¶
type IGetAllFungibleTokensUseCase interface { // Get a slice of fungible tokens for the given contracts/address. // Invalid contracts will return a token with a zeroed balance. Do(ctx context.Context, input *GetAllFungibleTokensInput) *[]entities.FungibleToken }
func NewGetAllFungibleTokens ¶
func NewGetAllFungibleTokens( logger common.ILogger, getFungibleToken IGetFungibleTokenUseCase, ) IGetAllFungibleTokensUseCase
type IGetAllInteractionsUseCase ¶
type IGetAllInteractionsUseCase interface { // Get all interactions. // A non nil error will be returned if any interactions in the list are invalid Do(ctx context.Context, input *GetAllInteractionsInput) (*[]entities.Interaction, error) }
func NewGetAllInteractionsUseCase ¶
func NewGetAllInteractionsUseCase( logger common.ILogger, getInteraction IGetInteractionUseCase, ) IGetAllInteractionsUseCase
type IGetAllNonFungibleTokensUseCase ¶
type IGetAllNonFungibleTokensUseCase interface { // Get the metadata and balance of a slice of nfts. // Invalid contracts have a zeroed balance and nil metadata returned. Do(ctx context.Context, input *GetAllNonFungibleTokensInput) *[]entities.NonFungibleToken }
func NewGetAllNonFungibleTokens ¶
func NewGetAllNonFungibleTokens( logger common.ILogger, getNonFungibleToken IGetNonFungibleTokenUseCase, ) IGetAllNonFungibleTokensUseCase
type IGetAllStatisticsUseCase ¶
type IGetAllStatisticsUseCase interface { // Get all statistic data for a given slice of statistics. // Invalid contracts will return a statistic with nil Data. Do(ctx context.Context, input *GetAllStatisticsInput) *[]entities.Statistic }
func NewGetAllStatistics ¶
func NewGetAllStatistics( logger common.ILogger, getStatistic IGetStatisticUseCase, ) IGetAllStatisticsUseCase
type IGetChallengeUseCase ¶
type IGetChallengeUseCase interface { // Get a new challenge message for the provided address Do(ctx context.Context, input *GetChallengeInput) (*entities.Challenge, error) }
func NewGetChallenge ¶
func NewGetChallenge(cacheGateway gateways.ICacheGateway) IGetChallengeUseCase
type IGetCurrencyUseCase ¶
type IGetCurrencyUseCase interface { // Get the balance for a given address and blockchain Do(ctx context.Context, input *GetCurrencyInput) (*entities.Currency, error) }
func NewGetCurrency ¶
func NewGetCurrency( logger common.ILogger, blockchainGateway gateways.IBlockchainGateway, ) IGetCurrencyUseCase
type IGetDefaultProfileUseCase ¶
type IGetDefaultProfileUseCase interface { // Get a default profile for the provided address Do(ctx context.Context, input *GetDefaultProfileInput) (*entities.Profile, error) }
func NewGetDefaultProfile ¶
func NewGetDefaultProfile( logger common.ILogger, settings common.ISettings, blockchainGateway gateways.IBlockchainGateway, blochchainIndexGateway gateways.IBlockchainIndexGateway, offchainGateway gateways.IOffchainGateway, getAllFungibleTokens IGetAllFungibleTokensUseCase, getAllStatistics IGetAllStatisticsUseCase, getAllCurrencies IGetAllCurrenciesUseCase, resolveENSName IResolveENSNameUseCase, ) IGetDefaultProfileUseCase
type IGetFungibleTokenUseCase ¶
type IGetFungibleTokenUseCase interface { // Get the metadata and balance of an nft Do(ctx context.Context, input *GetFungibleTokenInput) (*entities.FungibleToken, error) }
func NewGetFungibleToken ¶
func NewGetFungibleToken( logger common.ILogger, blockchainGateway gateways.IBlockchainGateway, cacheGateway gateways.ICacheGateway, offchainGateway gateways.IOffchainGateway, ) IGetFungibleTokenUseCase
type IGetInteractionUseCase ¶
type IGetInteractionUseCase interface { // Get the transaction data for a given interaction input // Validate transaction against interaction type Do(ctx context.Context, input *GetInteractionInput) (*entities.Interaction, error) }
func NewGetInteractionUseCase ¶
func NewGetInteractionUseCase( logger common.ILogger, blockchainGateway gateways.IBlockchainGateway, ) IGetInteractionUseCase
type IGetListingMetadataUseCase ¶
type IGetListingMetadataUseCase interface { // Get the metadata for a provided token id for the EtherAlley store Do(ctx context.Context, input *GetListingMetadataInput) (metadata *entities.NonFungibleMetadata, err error) }
func NewGetListingMetadata ¶
func NewGetListingMetadata( logger common.ILogger, settings common.ISettings, ) IGetListingMetadataUseCase
type IGetListingsUseCase ¶
type IGetListingsUseCase interface { // Get the EtherAlley store listings for the provided array of token ids Do(ctx context.Context, input *GetListingsInput) (listings *[]entities.Listing, err error) }
func NewGetListings ¶
func NewGetListings( logger common.ILogger, settings common.ISettings, blockchainGateway gateways.IBlockchainGateway, cacheGateway gateways.ICacheGateway, getListingMetadata IGetListingMetadataUseCase, ) IGetListingsUseCase
type IGetNonFungibleTokenUseCase ¶
type IGetNonFungibleTokenUseCase interface { // Get the metadata and balance of an nft. // Metadata doesnt change so we cache it. // Metadata is an optional implementation in ERC721 and ERC1155 and may not exist. // Its also possible that we simply have issues following the uri. // In these scenarios we will return nil metadata and not bubble up an err. Do(ctx context.Context, input *GetNonFungibleTokenInput) (*entities.NonFungibleToken, error) }
func NewGetNonFungibleToken ¶
func NewGetNonFungibleToken( logger common.ILogger, settings common.ISettings, blockchainGateway gateways.IBlockchainGateway, offchainGateway gateways.IOffchainGateway, cacheGateway gateways.ICacheGateway, ) IGetNonFungibleTokenUseCase
type IGetProfileUseCase ¶
type IGetProfileUseCase interface { // get the profile for the provided address Do(ctx context.Context, input *GetProfileInput) (*entities.Profile, error) }
func NewGetProfile ¶
func NewGetProfile( logger common.ILogger, blockchainGateway gateways.IBlockchainGateway, cacheGateway gateways.ICacheGateway, databaseGateway gateways.IDatabaseGateway, getDefaultProfile IGetDefaultProfileUseCase, getAllNonFungibleTokens IGetAllNonFungibleTokensUseCase, getAllFungibleTokens IGetAllFungibleTokensUseCase, getAllStatistics IGetAllStatisticsUseCase, getAllCurrencies IGetAllCurrenciesUseCase, resolveENSName IResolveENSNameUseCase, ) IGetProfileUseCase
type IGetStatisticUseCase ¶
type IGetStatisticUseCase interface { // Get the statistic for a given address and contract Do(ctx context.Context, input *GetStatisticsInput) (*entities.Statistic, error) }
func NewGetStatistic ¶
func NewGetStatistic( logger common.ILogger, blockchainIndexGateway gateways.IBlockchainIndexGateway, ) IGetStatisticUseCase
type IGetStoreMetadataUseCase ¶
type IGetStoreMetadataUseCase interface { // Get the store metadata for the url that resolves from the contractURI call on the store contract Do(ctx context.Context) (metadata *entities.StoreMetadata) }
func NewGetStoreMetadata ¶
func NewGetStoreMetadata() IGetStoreMetadataUseCase
type IGetTopProfilesUseCase ¶
type IGetTopProfilesUseCase interface {
Do(ctx context.Context, input *GetTopProfilesInput) *[]entities.Profile
}
func NewGetTopProfilesUseCase ¶
func NewGetTopProfilesUseCase( logger common.ILogger, cacheGateway gateways.ICacheGateway, getProfile IGetProfileUseCase, ) IGetTopProfilesUseCase
type IRecordProfileViewUseCase ¶
type IRecordProfileViewUseCase interface {
Do(ctx context.Context, input *RecordProfileViewInput) error
}
func NewRecordProfileViewUseCase ¶
func NewRecordProfileViewUseCase(logger common.ILogger, cacheGateway gateways.ICacheGateway) IRecordProfileViewUseCase
type IRefreshProfileUseCase ¶
type IRefreshProfileUseCase interface { // Refresh any relevant transient info that is currently cached. // Info that is currently refreshed: // // - Store Assets Do(ctx context.Context, input *RefreshProfileInput) error }
func NewRefreshProfileUseCase ¶
func NewRefreshProfileUseCase(logger common.ILogger, cacheGateway gateways.ICacheGateway, blockchainGateway gateways.IBlockchainGateway) IRefreshProfileUseCase
type IResolveAddressUseCase ¶
type IResolveAddressUseCase interface { // Resolve an address from an ens name Do(ctx context.Context, input *ResolveAddressInput) (string, error) }
func NewResolveENSAddress ¶
func NewResolveENSAddress( logger common.ILogger, blockchainGateway gateways.IBlockchainGateway, cacheGateway gateways.ICacheGateway, ) IResolveAddressUseCase
type IResolveENSNameUseCase ¶
type IResolveENSNameUseCase interface { // Resolve an ens name for an address Do(ctx context.Context, input *ResolveENSNameInput) (name string, err error) }
func NewResolveENSName ¶
func NewResolveENSName( logger common.ILogger, blockchainGateway gateways.IBlockchainGateway, cacheGateway gateways.ICacheGateway, ) IResolveENSNameUseCase
type ISaveProfileUseCase ¶
type ISaveProfileUseCase interface { // Validate the non transient info being submitted (interactions). // Save the profile to the database. // Remove the cached profile. // // TODO: can fetch interactions and premium balance concurrently. Do(ctx context.Context, input *SaveProfileInput) error }
func NewSaveProfile ¶
func NewSaveProfile( logger common.ILogger, blockchainGateway gateways.IBlockchainGateway, databaseGateway gateways.IDatabaseGateway, cacheGateway gateways.ICacheGateway, getAllInteractions IGetAllInteractionsUseCase, ) ISaveProfileUseCase
type IVerifyChallengeUseCase ¶
type IVerifyChallengeUseCase interface { // verify if the provided signature was signed with the correct address and signed the correct challenge message Do(ctx context.Context, input *VerifyChallengeInput) error }
func NewVerifyChallenge ¶
func NewVerifyChallenge(cacheGateway gateways.ICacheGateway) IVerifyChallengeUseCase
type IVerifyRateLimitUseCase ¶
type IVerifyRateLimitUseCase interface { // Verify that the provided IpAddress is not rate limited Do(ctx context.Context, input *VerifyRateLimitInput) error }
func NewVerifyRateLimit ¶
func NewVerifyRateLimit( logger common.ILogger, cacheGateway gateways.ICacheGateway, ) IVerifyRateLimitUseCase
type InteractionInput ¶
type InteractionInput struct { Transaction *TransactionInput `json:"transaction" validate:"required,dive"` Type common.Interaction `json:"type" validate:"required,oneof=CONTRACT_CREATION SEND_ETHER"` }
type NonFungibleTokenInput ¶
type NonFungibleTokenInput struct { Contract *ContractInput `json:"contract" validate:"required,dive"` TokenId string `json:"token_id" validate:"required,numeric"` }
type ProfileInput ¶
type ProfileInput struct { Address string `json:"-" validate:"required,eth_addr"` DisplayConfig *DisplayConfigInput `json:"display_config" validate:"required,dive"` NonFungibleTokens *[]NonFungibleTokenInput `json:"non_fungible_tokens" validate:"required,dive"` FungibleTokens *[]FungibleTokenInput `json:"fungible_tokens" validate:"required,dive"` Statistics *[]StatisticInput `json:"statistics" validate:"required,dive"` Interactions *[]InteractionInput `json:"interactions" validate:"required,dive"` Currencies *[]CurrencyInput `json:"currencies" validate:"required,dive"` }
type RecordProfileViewInput ¶
type RefreshProfileInput ¶
type RefreshProfileInput struct {
Address string `validate:"required,eth_addr"`
}
type ResolveAddressInput ¶
type ResolveAddressInput struct {
Value string `validate:"required"`
}
type ResolveENSNameInput ¶
type ResolveENSNameInput struct {
Address string `validate:"required,eth_addr"`
}
type SaveProfileInput ¶
type SaveProfileInput struct {
Profile *ProfileInput `validate:"required,dive"`
}
type StatisticInput ¶
type StatisticInput struct { Contract *ContractInput `json:"contract" validate:"required,dive"` Type common.StatisticType `json:"type" validate:"required,oneof=SWAP STAKE"` }
type TransactionInput ¶
type TransactionInput struct { Id string `json:"id" validate:"required"` Blockchain common.Blockchain `json:"blockchain" validate:"required,oneof=ethereum polygon arbitrum optimism"` }
type VerifyChallengeInput ¶
type VerifyRateLimitInput ¶
type VerifyRateLimitInput struct {
IpAddress string `validate:"required,ip"`
}
Source Files
¶
- get_all_currencies.go
- get_all_interactions.go
- get_all_nfts.go
- get_all_statistics.go
- get_all_tokens.go
- get_challenge.go
- get_currency.go
- get_default_profile.go
- get_interaction.go
- get_listing_metadata.go
- get_listings.go
- get_nft.go
- get_profile.go
- get_statistic.go
- get_store_metadata.go
- get_token.go
- get_top_profiles.go
- record_profile_view.go
- refresh_profile.go
- resolve_address.go
- resolve_name.go
- save_profile.go
- usecase.go
- verify_challenge.go
- verify_rate_limit.go
Click to show internal directories.
Click to hide internal directories.