opensea

package
v0.0.0-...-476b611 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 Owner

type Owner struct {
	Address  string `json:"address"`
	Quantity int    `json:"quantity"`
}

type Provider

type Provider struct {
	Chain persist.Chain
	// contains filtered or unexported fields
}

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) 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

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

Jump to

Keyboard shortcuts

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