Documentation ¶
Index ¶
- Constants
- type ErrorCode
- type FilterOwnedCollectiblesResponse
- type GetCollectiblesDataResponse
- type Manager
- func (o *Manager) FetchAllAssetsByOwner(chainID walletCommon.ChainID, owner common.Address, cursor string, limit int) (*thirdparty.CollectibleDataContainer, error)
- func (o *Manager) FetchAllAssetsByOwnerAndCollection(chainID walletCommon.ChainID, owner common.Address, collectionSlug string, ...) (*thirdparty.CollectibleDataContainer, error)
- func (o *Manager) FetchAllAssetsByOwnerAndContractAddress(chainID walletCommon.ChainID, owner common.Address, ...) (*thirdparty.CollectibleDataContainer, error)
- func (o *Manager) FetchAllCollectionsByOwner(chainID walletCommon.ChainID, owner common.Address) ([]opensea.OwnedCollection, error)
- func (o *Manager) FetchAllOpenseaAssetsByOwnerAndCollection(chainID walletCommon.ChainID, owner common.Address, collectionSlug string, ...) (*opensea.AssetContainer, error)
- func (o *Manager) FetchAssetsByCollectibleUniqueID(uniqueIDs []thirdparty.CollectibleUniqueID) ([]thirdparty.CollectibleData, 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) SetMetadataProvider(metadataProvider thirdparty.CollectibleMetadataProvider)
- type OwnershipDB
- type Service
- func (s *Service) FilterOwnedCollectiblesAsync(ctx context.Context, chainIDs []walletCommon.ChainID, ...)
- func (s *Service) GetCollectiblesDataAsync(ctx context.Context, uniqueIDs []thirdparty.CollectibleUniqueID)
- func (s *Service) GetOwnedCollectibles(chainIDs []walletCommon.ChainID, owners []common.Address, offset int, ...) ([]thirdparty.CollectibleUniqueID, bool, error)
- func (s *Service) Start()
- func (s *Service) Stop()
Constants ¶
View Source
const ( EventCollectiblesOwnershipUpdateStarted walletevent.EventType = "wallet-collectibles-ownership-update-started" EventCollectiblesOwnershipUpdateFinished walletevent.EventType = "wallet-collectibles-ownership-update-finished" EventCollectiblesOwnershipUpdateFinishedWithError walletevent.EventType = "wallet-collectibles-ownership-update-finished-with-error" EventOwnedCollectiblesFilteringDone walletevent.EventType = "wallet-owned-collectibles-filtering-done" EventGetCollectiblesDataDone walletevent.EventType = "wallet-get-collectibles-data-done" )
These events are used to notify the UI of state changes
View Source
const FetchFromStartCursor = ""
View Source
const FetchNoLimit = 0
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilterOwnedCollectiblesResponse ¶ added in v0.162.13
type FilterOwnedCollectiblesResponse struct { Collectibles []thirdparty.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"` ErrorCode ErrorCode `json:"errorCode"` }
type GetCollectiblesDataResponse ¶ added in v0.162.13
type GetCollectiblesDataResponse struct { Collectibles []thirdparty.CollectibleData `json:"collectibles"` ErrorCode ErrorCode `json:"errorCode"` }
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(rpcClient *rpc.Client, mainContractOwnershipProvider thirdparty.CollectibleContractOwnershipProvider, fallbackContractOwnershipProvider thirdparty.CollectibleContractOwnershipProvider, opensea *opensea.Client) *Manager
func (*Manager) FetchAllAssetsByOwner ¶
func (o *Manager) FetchAllAssetsByOwner(chainID walletCommon.ChainID, owner common.Address, cursor string, limit int) (*thirdparty.CollectibleDataContainer, error)
func (*Manager) FetchAllAssetsByOwnerAndCollection ¶
func (o *Manager) FetchAllAssetsByOwnerAndCollection(chainID walletCommon.ChainID, owner common.Address, collectionSlug string, cursor string, limit int) (*thirdparty.CollectibleDataContainer, error)
func (*Manager) FetchAllAssetsByOwnerAndContractAddress ¶
func (o *Manager) FetchAllAssetsByOwnerAndContractAddress(chainID walletCommon.ChainID, owner common.Address, contractAddresses []common.Address, cursor string, limit int) (*thirdparty.CollectibleDataContainer, error)
func (*Manager) FetchAllCollectionsByOwner ¶
func (o *Manager) FetchAllCollectionsByOwner(chainID walletCommon.ChainID, owner common.Address) ([]opensea.OwnedCollection, error)
func (*Manager) FetchAllOpenseaAssetsByOwnerAndCollection ¶ added in v0.162.13
func (*Manager) FetchAssetsByCollectibleUniqueID ¶ added in v0.162.13
func (o *Manager) FetchAssetsByCollectibleUniqueID(uniqueIDs []thirdparty.CollectibleUniqueID) ([]thirdparty.CollectibleData, 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) (*thirdparty.CollectibleOwnershipContainer, error)
func (*Manager) SetMetadataProvider ¶ added in v0.162.1
func (o *Manager) SetMetadataProvider(metadataProvider thirdparty.CollectibleMetadataProvider)
Used to break circular dependency, call once as soon as possible after initialization
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) 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) Update ¶ added in v0.162.13
func (o *OwnershipDB) Update(chainID w_common.ChainID, ownerAddress common.Address, collectibles []thirdparty.CollectibleUniqueID) (err error)
type Service ¶ added in v0.162.13
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶ added in v0.162.13
func (*Service) FilterOwnedCollectiblesAsync ¶ added in v0.162.13
func (s *Service) FilterOwnedCollectiblesAsync(ctx context.Context, chainIDs []walletCommon.ChainID, addresses []common.Address, 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) GetCollectiblesDataAsync ¶ added in v0.162.13
func (s *Service) GetCollectiblesDataAsync(ctx context.Context, uniqueIDs []thirdparty.CollectibleUniqueID)
func (*Service) GetOwnedCollectibles ¶ added in v0.162.13
func (s *Service) GetOwnedCollectibles(chainIDs []walletCommon.ChainID, owners []common.Address, offset int, limit int) ([]thirdparty.CollectibleUniqueID, bool, error)
Click to show internal directories.
Click to hide internal directories.