Documentation ¶
Index ¶
- Constants
- Variables
- type CollectibleDataDB
- func (o *CollectibleDataDB) GetCommunityInfo(id thirdparty.CollectibleUniqueID) (*thirdparty.CollectibleCommunityInfo, error)
- func (o *CollectibleDataDB) GetData(ids []thirdparty.CollectibleUniqueID) (map[string]thirdparty.CollectibleData, error)
- func (o *CollectibleDataDB) GetIDsNotInDB(ids []thirdparty.CollectibleUniqueID) ([]thirdparty.CollectibleUniqueID, error)
- func (o *CollectibleDataDB) SetCommunityInfo(id thirdparty.CollectibleUniqueID, ...) (err error)
- func (o *CollectibleDataDB) SetData(collectibles []thirdparty.CollectibleData) (err error)
- type CollectibleDetails
- type CollectibleHeader
- type CollectionDataDB
- func (o *CollectionDataDB) GetData(ids []thirdparty.ContractID) (map[string]thirdparty.CollectionData, error)
- func (o *CollectionDataDB) GetIDsNotInDB(ids []thirdparty.ContractID) ([]thirdparty.ContractID, error)
- func (o *CollectionDataDB) SetData(collections []thirdparty.CollectionData) (err error)
- type CommunityCollectibleHeader
- type CommunityDetails
- type CommunityHeader
- type Controller
- type ErrorCode
- type Filter
- type FilterCommunityType
- type FilterOwnedCollectiblesResponse
- type GetCollectiblesDetailsResponse
- type Manager
- func (o *Manager) FetchAllAssetsByOwner(chainID walletCommon.ChainID, owner common.Address, cursor string, limit int, ...) (*thirdparty.FullCollectibleDataContainer, error)
- func (o *Manager) FetchAllAssetsByOwnerAndContractAddress(chainID walletCommon.ChainID, owner common.Address, ...) (*thirdparty.FullCollectibleDataContainer, error)
- func (o *Manager) FetchAssetsByCollectibleUniqueID(uniqueIDs []thirdparty.CollectibleUniqueID) ([]thirdparty.FullCollectibleData, error)
- func (o *Manager) FetchBalancesByOwnerAndContractAddress(chainID walletCommon.ChainID, ownerAddress common.Address, ...) (thirdparty.TokenBalancesPerContractAddress, error)
- func (o *Manager) FetchCollectibleOwnersByContractAddress(chainID walletCommon.ChainID, contractAddress common.Address) (*thirdparty.CollectibleContractOwnership, error)
- func (o *Manager) FetchCollectibleOwnershipByOwner(chainID walletCommon.ChainID, owner common.Address, cursor string, limit int, ...) (*thirdparty.CollectibleOwnershipContainer, error)
- func (o *Manager) FetchCollectionsDataByContractID(ids []thirdparty.ContractID) ([]thirdparty.CollectionData, error)
- func (o *Manager) ResetConnectionStatus()
- func (o *Manager) SetCommunityInfoProvider(communityInfoProvider thirdparty.CollectibleCommunityInfoProvider)
- type ManagerInterface
- type OwnedCollectibles
- type OwnedCollectiblesCb
- type OwnershipDB
- func (o *OwnershipDB) GetIDsNotInDB(chainID w_common.ChainID, ownerAddress common.Address, ...) ([]thirdparty.CollectibleUniqueID, error)
- func (o *OwnershipDB) GetLatestOwnershipUpdateTimestamp(chainID walletCommon.ChainID) (int64, error)
- func (o *OwnershipDB) GetOwnedCollectible(chainID w_common.ChainID, ownerAddresses common.Address, ...) (*thirdparty.CollectibleUniqueID, error)
- func (o *OwnershipDB) GetOwnedCollectibles(chainIDs []w_common.ChainID, ownerAddresses []common.Address, offset int, ...) ([]thirdparty.CollectibleUniqueID, error)
- func (o *OwnershipDB) GetOwnershipUpdateTimestamp(owner common.Address, chainID walletCommon.ChainID) (int64, error)
- func (o *OwnershipDB) Update(chainID w_common.ChainID, ownerAddress common.Address, ...) (err error)
- type OwnershipState
- type OwnershipStatus
- type OwnershipStatusPerAddressAndChainID
- type OwnershipStatusPerChainID
- type Service
- func (s *Service) FilterOwnedCollectibles(chainIDs []walletCommon.ChainID, owners []common.Address, filter Filter, ...) ([]thirdparty.CollectibleUniqueID, bool, error)
- func (s *Service) FilterOwnedCollectiblesAsync(requestID int32, chainIDs []walletCommon.ChainID, addresses []common.Address, ...)
- func (s *Service) GetCollectiblesDetailsAsync(requestID int32, uniqueIDs []thirdparty.CollectibleUniqueID)
- func (s *Service) GetOwnedCollectible(chainID walletCommon.ChainID, owner common.Address, ...) (*thirdparty.CollectibleUniqueID, error)
- func (s *Service) GetOwnershipStatus(chainIDs []walletCommon.ChainID, owners []common.Address) (OwnershipStatusPerAddressAndChainID, error)
- func (s *Service) RefetchOwnedCollectibles()
- func (s *Service) Start()
- func (s *Service) Stop()
Constants ¶
const ( EventCollectiblesOwnershipUpdateStarted walletevent.EventType = "wallet-collectibles-ownership-update-started" EventCollectiblesOwnershipUpdatePartial walletevent.EventType = "wallet-collectibles-ownership-update-partial" EventCollectiblesOwnershipUpdateFinished walletevent.EventType = "wallet-collectibles-ownership-update-finished" EventCollectiblesOwnershipUpdateFinishedWithError walletevent.EventType = "wallet-collectibles-ownership-update-finished-with-error" EventCommunityCollectiblesReceived walletevent.EventType = "wallet-collectibles-community-collectibles-received" EventOwnedCollectiblesFilteringDone walletevent.EventType = "wallet-owned-collectibles-filtering-done" EventGetCollectiblesDetailsDone walletevent.EventType = "wallet-get-collectibles-details-done" )
These events are used to notify the UI of state changes
const EventCollectiblesConnectionStatusChanged walletevent.EventType = "wallet-collectible-status-changed"
const InvalidTimestamp = int64(-1)
Variables ¶
var ( ErrAllProvidersFailedForChainID = errors.New("all providers failed for chainID") ErrNoProvidersAvailableForChainID = errors.New("no providers available for chainID") )
Functions ¶
This section is empty.
Types ¶
type CollectibleDataDB ¶ added in v0.163.4
type CollectibleDataDB struct {
// contains filtered or unexported fields
}
func NewCollectibleDataDB ¶ added in v0.163.4
func NewCollectibleDataDB(sqlDb *sql.DB) *CollectibleDataDB
func (*CollectibleDataDB) GetCommunityInfo ¶ added in v0.171.8
func (o *CollectibleDataDB) GetCommunityInfo(id thirdparty.CollectibleUniqueID) (*thirdparty.CollectibleCommunityInfo, error)
func (*CollectibleDataDB) GetData ¶ added in v0.163.4
func (o *CollectibleDataDB) GetData(ids []thirdparty.CollectibleUniqueID) (map[string]thirdparty.CollectibleData, error)
func (*CollectibleDataDB) GetIDsNotInDB ¶ added in v0.163.4
func (o *CollectibleDataDB) GetIDsNotInDB(ids []thirdparty.CollectibleUniqueID) ([]thirdparty.CollectibleUniqueID, error)
func (*CollectibleDataDB) SetCommunityInfo ¶ added in v0.171.8
func (o *CollectibleDataDB) SetCommunityInfo(id thirdparty.CollectibleUniqueID, communityInfo thirdparty.CollectibleCommunityInfo) (err error)
func (*CollectibleDataDB) SetData ¶ added in v0.163.4
func (o *CollectibleDataDB) SetData(collectibles []thirdparty.CollectibleData) (err error)
type CollectibleDetails ¶ added in v0.162.15
type CollectibleDetails struct { ID thirdparty.CollectibleUniqueID `json:"id"` Name string `json:"name"` Description string `json:"description"` ImageURL string `json:"image_url"` AnimationURL string `json:"animation_url"` AnimationMediaType string `json:"animation_media_type"` Traits []thirdparty.CollectibleTrait `json:"traits"` BackgroundColor string `json:"background_color"` CollectionName string `json:"collection_name"` CollectionSlug string `json:"collection_slug"` CollectionImageURL string `json:"collection_image_url"` CommunityInfo *CommunityDetails `json:"community_info,omitempty"` }
Combined Collection+Collectible info, used to display a detailed view of a collectible
type CollectibleHeader ¶ added in v0.162.15
type CollectibleHeader struct { ID thirdparty.CollectibleUniqueID `json:"id"` Name string `json:"name"` ImageURL string `json:"image_url"` AnimationURL string `json:"animation_url"` AnimationMediaType string `json:"animation_media_type"` BackgroundColor string `json:"background_color"` CollectionName string `json:"collection_name"` CollectionSlug string `json:"collection_slug"` CollectionImageURL string `json:"collection_image_url"` CommunityHeader *CommunityHeader `json:"community_header,omitempty"` }
Combined Collection+Collectible info, used to display a basic view of a collectible in a list
type CollectionDataDB ¶ added in v0.163.4
type CollectionDataDB struct {
// contains filtered or unexported fields
}
func NewCollectionDataDB ¶ added in v0.163.4
func NewCollectionDataDB(sqlDb *sql.DB) *CollectionDataDB
func (*CollectionDataDB) GetData ¶ added in v0.163.4
func (o *CollectionDataDB) GetData(ids []thirdparty.ContractID) (map[string]thirdparty.CollectionData, error)
func (*CollectionDataDB) GetIDsNotInDB ¶ added in v0.163.4
func (o *CollectionDataDB) GetIDsNotInDB(ids []thirdparty.ContractID) ([]thirdparty.ContractID, error)
func (*CollectionDataDB) SetData ¶ added in v0.163.4
func (o *CollectionDataDB) SetData(collections []thirdparty.CollectionData) (err error)
type CommunityCollectibleHeader ¶ added in v0.170.0
type CommunityCollectibleHeader struct { ID thirdparty.CollectibleUniqueID `json:"id"` Name string `json:"name"` CommunityHeader CommunityHeader `json:"community_header"` }
type CommunityDetails ¶ added in v0.171.8
type CommunityHeader ¶ added in v0.167.5
type CommunityHeader struct { CommunityID string `json:"community_id"` CommunityName string `json:"community_name"` CommunityColor string `json:"community_color"` PrivilegesLevel token.PrivilegesLevel `json:"privileges_level"` }
type Controller ¶ added in v0.170.0
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶ added in v0.170.0
func (*Controller) GetCommandState ¶ added in v0.170.0
func (c *Controller) GetCommandState(chainID walletCommon.ChainID, address common.Address) OwnershipState
func (*Controller) RefetchOwnedCollectibles ¶ added in v0.170.0
func (c *Controller) RefetchOwnedCollectibles()
func (*Controller) Start ¶ added in v0.170.0
func (c *Controller) Start()
func (*Controller) Stop ¶ added in v0.170.0
func (c *Controller) Stop()
type Filter ¶ added in v0.171.9
type Filter struct { CommunityIDs []string `json:"community_ids"` CommunityPrivilegesLevels []token.PrivilegesLevel `json:"community_privileges_levels"` FilterCommunity FilterCommunityType `json:"filter_community"` }
type FilterCommunityType ¶ added in v0.171.9
type FilterCommunityType int
const ( All FilterCommunityType = iota OnlyNonCommunity OnlyCommunity )
type FilterOwnedCollectiblesResponse ¶ added in v0.162.13
type FilterOwnedCollectiblesResponse struct { Collectibles []CollectibleHeader `json:"collectibles"` Offset int `json:"offset"` // Used to indicate that there might be more collectibles that were not returned // based on a simple heuristic HasMore bool `json:"hasMore"` OwnershipStatus OwnershipStatusPerAddressAndChainID `json:"ownershipStatus"` ErrorCode ErrorCode `json:"errorCode"` }
type GetCollectiblesDetailsResponse ¶ added in v0.162.15
type GetCollectiblesDetailsResponse struct { Collectibles []CollectibleDetails `json:"collectibles"` ErrorCode ErrorCode `json:"errorCode"` }
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager( db *sql.DB, rpcClient *rpc.Client, contractOwnershipProviders []thirdparty.CollectibleContractOwnershipProvider, accountOwnershipProviders []thirdparty.CollectibleAccountOwnershipProvider, collectibleDataProviders []thirdparty.CollectibleDataProvider, collectionDataProviders []thirdparty.CollectionDataProvider, feed *event.Feed) *Manager
func (*Manager) FetchAllAssetsByOwner ¶
func (o *Manager) FetchAllAssetsByOwner(chainID walletCommon.ChainID, owner common.Address, cursor string, limit int, providerID string) (*thirdparty.FullCollectibleDataContainer, error)
func (*Manager) FetchAllAssetsByOwnerAndContractAddress ¶
func (o *Manager) FetchAllAssetsByOwnerAndContractAddress(chainID walletCommon.ChainID, owner common.Address, contractAddresses []common.Address, cursor string, limit int, providerID string) (*thirdparty.FullCollectibleDataContainer, error)
func (*Manager) FetchAssetsByCollectibleUniqueID ¶ added in v0.162.13
func (o *Manager) FetchAssetsByCollectibleUniqueID(uniqueIDs []thirdparty.CollectibleUniqueID) ([]thirdparty.FullCollectibleData, error)
func (*Manager) FetchBalancesByOwnerAndContractAddress ¶ added in v0.162.5
func (o *Manager) FetchBalancesByOwnerAndContractAddress(chainID walletCommon.ChainID, ownerAddress common.Address, contractAddresses []common.Address) (thirdparty.TokenBalancesPerContractAddress, error)
Need to combine different providers to support all needed ChainIDs
func (*Manager) FetchCollectibleOwnersByContractAddress ¶ added in v0.162.13
func (o *Manager) FetchCollectibleOwnersByContractAddress(chainID walletCommon.ChainID, contractAddress common.Address) (*thirdparty.CollectibleContractOwnership, error)
func (*Manager) FetchCollectibleOwnershipByOwner ¶ added in v0.162.13
func (o *Manager) FetchCollectibleOwnershipByOwner(chainID walletCommon.ChainID, owner common.Address, cursor string, limit int, providerID string) (*thirdparty.CollectibleOwnershipContainer, error)
func (*Manager) FetchCollectionsDataByContractID ¶ added in v0.162.15
func (o *Manager) FetchCollectionsDataByContractID(ids []thirdparty.ContractID) ([]thirdparty.CollectionData, error)
func (*Manager) ResetConnectionStatus ¶ added in v0.167.5
func (o *Manager) ResetConnectionStatus()
Reset connection status to trigger notifications on the next status update
func (*Manager) SetCommunityInfoProvider ¶ added in v0.167.5
func (o *Manager) SetCommunityInfoProvider(communityInfoProvider thirdparty.CollectibleCommunityInfoProvider)
Used to break circular dependency, call once as soon as possible after initialization
type ManagerInterface ¶ added in v0.166.7
type ManagerInterface interface {
FetchAssetsByCollectibleUniqueID(uniqueIDs []thirdparty.CollectibleUniqueID) ([]thirdparty.FullCollectibleData, error)
}
type OwnedCollectibles ¶ added in v0.170.0
type OwnedCollectibles struct {
// contains filtered or unexported fields
}
type OwnedCollectiblesCb ¶ added in v0.170.0
type OwnedCollectiblesCb func(OwnedCollectibles)
type OwnershipDB ¶ added in v0.162.13
type OwnershipDB struct {
// contains filtered or unexported fields
}
func NewOwnershipDB ¶ added in v0.162.13
func NewOwnershipDB(sqlDb *sql.DB) *OwnershipDB
func (*OwnershipDB) GetIDsNotInDB ¶ added in v0.170.0
func (o *OwnershipDB) GetIDsNotInDB( chainID w_common.ChainID, ownerAddress common.Address, newIDs []thirdparty.CollectibleUniqueID) ([]thirdparty.CollectibleUniqueID, error)
Returns the list of new IDs when comparing the given list of IDs with the ones in the DB. Call before Update for the result to be useful.
func (*OwnershipDB) GetLatestOwnershipUpdateTimestamp ¶ added in v0.167.5
func (o *OwnershipDB) GetLatestOwnershipUpdateTimestamp(chainID walletCommon.ChainID) (int64, error)
func (*OwnershipDB) GetOwnedCollectible ¶ added in v0.166.9
func (o *OwnershipDB) GetOwnedCollectible(chainID w_common.ChainID, ownerAddresses common.Address, contractAddress common.Address, tokenID *big.Int) (*thirdparty.CollectibleUniqueID, error)
func (*OwnershipDB) GetOwnedCollectibles ¶ added in v0.162.13
func (o *OwnershipDB) GetOwnedCollectibles(chainIDs []w_common.ChainID, ownerAddresses []common.Address, offset int, limit int) ([]thirdparty.CollectibleUniqueID, error)
func (*OwnershipDB) GetOwnershipUpdateTimestamp ¶ added in v0.166.11
func (o *OwnershipDB) GetOwnershipUpdateTimestamp(owner common.Address, chainID walletCommon.ChainID) (int64, error)
func (*OwnershipDB) Update ¶ added in v0.162.13
func (o *OwnershipDB) Update(chainID w_common.ChainID, ownerAddress common.Address, collectibles []thirdparty.CollectibleUniqueID, timestamp int64) (err error)
type OwnershipState ¶ added in v0.166.11
type OwnershipState = int
const ( OwnershipStateIdle OwnershipState = iota + 1 OwnershipStateDelayed OwnershipStateUpdating OwnershipStateError )
type OwnershipStatus ¶ added in v0.166.11
type OwnershipStatus struct { State OwnershipState `json:"state"` Timestamp int64 `json:"timestamp"` }
type OwnershipStatusPerAddressAndChainID ¶ added in v0.166.11
type OwnershipStatusPerAddressAndChainID = map[common.Address]OwnershipStatusPerChainID
type OwnershipStatusPerChainID ¶ added in v0.166.11
type OwnershipStatusPerChainID = map[walletCommon.ChainID]OwnershipStatus
type Service ¶ added in v0.162.13
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶ added in v0.162.13
func (*Service) FilterOwnedCollectibles ¶ added in v0.171.9
func (s *Service) FilterOwnedCollectibles(chainIDs []walletCommon.ChainID, owners []common.Address, filter Filter, offset int, limit int) ([]thirdparty.CollectibleUniqueID, bool, error)
func (*Service) FilterOwnedCollectiblesAsync ¶ added in v0.162.13
func (s *Service) FilterOwnedCollectiblesAsync(requestID int32, chainIDs []walletCommon.ChainID, addresses []common.Address, filter Filter, offset int, limit int)
FilterOwnedCollectiblesResponse allows only one filter task to run at a time and it cancels the current one if a new one is started All calls will trigger an EventOwnedCollectiblesFilteringDone event with the result of the filtering
func (*Service) GetCollectiblesDetailsAsync ¶ added in v0.162.15
func (s *Service) GetCollectiblesDetailsAsync(requestID int32, uniqueIDs []thirdparty.CollectibleUniqueID)
func (*Service) GetOwnedCollectible ¶ added in v0.166.9
func (s *Service) GetOwnedCollectible(chainID walletCommon.ChainID, owner common.Address, contractAddress common.Address, tokenID *big.Int) (*thirdparty.CollectibleUniqueID, error)
func (*Service) GetOwnershipStatus ¶ added in v0.166.11
func (s *Service) GetOwnershipStatus(chainIDs []walletCommon.ChainID, owners []common.Address) (OwnershipStatusPerAddressAndChainID, error)
func (*Service) RefetchOwnedCollectibles ¶ added in v0.167.5
func (s *Service) RefetchOwnedCollectibles()