Documentation ¶
Index ¶
- Variables
- type Asset
- type Collection
- type Contract
- type ErrOpenseaRateLimited
- type Owner
- type Provider
- func (p *Provider) GetContractByAddress(ctx context.Context, contractAddress persist.Address) (common.ChainAgnosticContract, error)
- func (p *Provider) GetTokenByTokenIdentifiersAndOwner(ctx context.Context, ti common.ChainAgnosticIdentifiers, ...) (common.ChainAgnosticToken, common.ChainAgnosticContract, error)
- func (p *Provider) GetTokenDescriptorsByTokenIdentifiers(ctx context.Context, ti common.ChainAgnosticIdentifiers) (common.ChainAgnosticTokenDescriptors, common.ChainAgnosticContractDescriptors, ...)
- func (p *Provider) GetTokenMetadataByTokenIdentifiers(ctx context.Context, ti common.ChainAgnosticIdentifiers) (persist.TokenMetadata, error)
- func (p *Provider) GetTokensByContractAddress(ctx context.Context, contractAddress persist.Address, limit, offset int) ([]common.ChainAgnosticToken, common.ChainAgnosticContract, error)
- func (p *Provider) GetTokensByTokenIdentifiers(ctx context.Context, ti common.ChainAgnosticIdentifiers) ([]common.ChainAgnosticToken, common.ChainAgnosticContract, error)
- func (p *Provider) GetTokensByWalletAddress(ctx context.Context, ownerAddress persist.Address) ([]common.ChainAgnosticToken, []common.ChainAgnosticContract, error)
- func (p *Provider) GetTokensIncrementallyByContractAddress(ctx context.Context, address persist.Address, maxLimit int) (<-chan common.ChainAgnosticTokensAndContracts, <-chan error)
- func (p *Provider) GetTokensIncrementallyByWalletAddress(ctx context.Context, ownerAddress persist.Address) (<-chan common.ChainAgnosticTokensAndContracts, <-chan error)
Constants ¶
This section is empty.
Variables ¶
var ErrAPIKeyExpired = errors.New("opensea api key expired")
Functions ¶
This section is empty.
Types ¶
type Asset ¶
type Asset struct { Identifier string `json:"identifier"` Collection string `json:"collection"` Contract string `json:"contract"` TokenStandard string `json:"token_standard"` Name string `json:"name"` Description string `json:"description"` ImageURL string `json:"image_url"` AnimationURL string `json:"animation_url"` MetadataURL string `json:"metadata_url"` Owners []Owner `json:"owners"` }
Asset is an NFT from OpenSea
type Collection ¶
type Collection struct { Name string `json:"name"` Description string `json:"description"` Owner string `json:"owner"` ImageURL string `json:"image_url"` ProjectURL string `json:"project_url"` }
Collection is a collection from OpenSea
type Contract ¶
type Contract struct { Address persist.Address `json:"address"` ChainIdentifier string `json:"chain_identifier"` Collection string `json:"collection"` Name string `json:"name"` }
Contract represents an NFT contract from Opensea
type ErrOpenseaRateLimited ¶
type ErrOpenseaRateLimited struct{ Err error }
func (ErrOpenseaRateLimited) Error ¶
func (e ErrOpenseaRateLimited) Error() string
func (ErrOpenseaRateLimited) Unwrap ¶
func (e ErrOpenseaRateLimited) Unwrap() error
type Provider ¶
func NewProvider ¶
func NewProvider(ctx context.Context, httpClient *http.Client, chain persist.Chain, l retry.Limiter) (*Provider, func())
NewProvider creates a new provider for OpenSea
func (*Provider) GetContractByAddress ¶
func (p *Provider) GetContractByAddress(ctx context.Context, contractAddress persist.Address) (common.ChainAgnosticContract, error)
GetContractByAddress returns a contract for a contract address
func (*Provider) GetTokenByTokenIdentifiersAndOwner ¶
func (p *Provider) GetTokenByTokenIdentifiersAndOwner(ctx context.Context, ti common.ChainAgnosticIdentifiers, ownerAddress persist.Address) (common.ChainAgnosticToken, common.ChainAgnosticContract, error)
func (*Provider) GetTokenDescriptorsByTokenIdentifiers ¶
func (p *Provider) GetTokenDescriptorsByTokenIdentifiers(ctx context.Context, ti common.ChainAgnosticIdentifiers) (common.ChainAgnosticTokenDescriptors, common.ChainAgnosticContractDescriptors, error)
func (*Provider) GetTokenMetadataByTokenIdentifiers ¶
func (p *Provider) GetTokenMetadataByTokenIdentifiers(ctx context.Context, ti common.ChainAgnosticIdentifiers) (persist.TokenMetadata, error)
GetTokenMetadataByTokenIdentifiers retrieves a token's metadata for a given contract address and token ID
func (*Provider) GetTokensByContractAddress ¶
func (p *Provider) GetTokensByContractAddress(ctx context.Context, contractAddress persist.Address, limit, offset int) ([]common.ChainAgnosticToken, common.ChainAgnosticContract, error)
GetTokensByContractAddress returns a list of tokens for a contract address
func (*Provider) GetTokensByTokenIdentifiers ¶
func (p *Provider) GetTokensByTokenIdentifiers(ctx context.Context, ti common.ChainAgnosticIdentifiers) ([]common.ChainAgnosticToken, common.ChainAgnosticContract, error)
GetTokensByTokenIdentifiers returns a list of tokens for a list of token identifiers
func (*Provider) GetTokensByWalletAddress ¶
func (p *Provider) GetTokensByWalletAddress(ctx context.Context, ownerAddress persist.Address) ([]common.ChainAgnosticToken, []common.ChainAgnosticContract, error)
GetTokensByWalletAddress returns a list of tokens for an address
func (*Provider) GetTokensIncrementallyByContractAddress ¶
func (p *Provider) GetTokensIncrementallyByContractAddress(ctx context.Context, address persist.Address, maxLimit int) (<-chan common.ChainAgnosticTokensAndContracts, <-chan error)
GetTokensIncrementallyByWalletAddress returns a list of tokens for a contract address
func (*Provider) GetTokensIncrementallyByWalletAddress ¶
func (p *Provider) GetTokensIncrementallyByWalletAddress(ctx context.Context, ownerAddress persist.Address) (<-chan common.ChainAgnosticTokensAndContracts, <-chan error)
GetTokensIncrementallyByWalletAddress returns a list of tokens for an address