reservoir

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	ID              string          `json:"id"`
	Name            string          `json:"name"`
	Description     string          `json:"description"`
	ImageURL        string          `json:"imageUrl"`
	Creator         persist.Address `json:"creator"`
	Symbol          string          `json:"symbol"`
	PrimaryContract persist.Address `json:"primaryContract"`
}

type ErrCollectionNotFoundByAddress

type ErrCollectionNotFoundByAddress struct {
	Address persist.Address
}

func (ErrCollectionNotFoundByAddress) Error

type ErrTokenNotFoundByIdentifiers

type ErrTokenNotFoundByIdentifiers struct {
	ContractAddress persist.Address
	TokenID         persist.HexTokenID
	OwnerAddress    persist.Address
}

func (ErrTokenNotFoundByIdentifiers) Error

type Ownership

type Ownership struct {
	TokenCount string `json:"tokenCount"`
	AcquiredAt string `json:"acquiredAt"`
}

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider is an the struct for retrieving data from the Ethereum blockchain

func NewProvider

func NewProvider(ctx context.Context, httpClient *http.Client, chain persist.Chain, l retry.Limiter) (*Provider, func())

NewProvider creates a new Reservoir provider

func (Provider) GetContractByAddress

func (p Provider) GetContractByAddress(ctx context.Context, chain persist.Chain, contractAddress persist.Address) (common.ChainAgnosticContract, error)

func (*Provider) GetTokenMetadataByTokenIdentifiers

func (p *Provider) GetTokenMetadataByTokenIdentifiers(ctx context.Context, ti common.ChainAgnosticIdentifiers) (persist.TokenMetadata, error)

func (*Provider) GetTokensByContractAddress

func (p *Provider) GetTokensByContractAddress(ctx context.Context, contractAddress persist.Address, limit int, offset int) ([]common.ChainAgnosticToken, common.ChainAgnosticContract, error)

func (Provider) GetTokensByTokenIdentifiersBatch

func (p Provider) GetTokensByTokenIdentifiersBatch(ctx context.Context, tIDs []common.ChainAgnosticIdentifiers) ([]common.ChainAgnosticToken, []error)

GetTokensByTokenIdentifiersBatch returns a slice tokens from a list of token identifiers Data is returned in the same order as the input. If a token is not found, the zero-value is used instead.

func (*Provider) GetTokensByWalletAddress

func (p *Provider) GetTokensByWalletAddress(ctx context.Context, ownerAddress persist.Address) ([]common.ChainAgnosticToken, []common.ChainAgnosticContract, error)

func (*Provider) GetTokensIncrementallyByContractAddress

func (p *Provider) GetTokensIncrementallyByContractAddress(ctx context.Context, address persist.Address, maxLimit int) (<-chan common.ChainAgnosticTokensAndContracts, <-chan error)

GetTokensIncrementallyByContractAddress returns tokens for a contract address

func (*Provider) GetTokensIncrementallyByWalletAddress

func (p *Provider) GetTokensIncrementallyByWalletAddress(ctx context.Context, ownerAddress persist.Address) (<-chan common.ChainAgnosticTokensAndContracts, <-chan error)

type Token

type Token struct {
	Contract    persist.Address       `json:"contract"`
	TokenID     string                `json:"tokenId"`
	Kind        string                `json:"kind"`
	Name        string                `json:"name"`
	Description string                `json:"description"`
	Metadata    persist.TokenMetadata `json:"metadata"`
	Media       string                `json:"media"`
	Image       string                `json:"image"`
	ImageSmall  string                `json:"imageSmall"`
	ImageLarge  string                `json:"imageLarge"`
	Collection  Collection            `json:"collection"`
	Owner       persist.Address       `json:"owner"`
	IsSpam      bool                  `json:"isSpam"`
}

type TokenWithOwnership

type TokenWithOwnership struct {
	Token     Token     `json:"token"`
	Ownership Ownership `json:"ownership"`
}

Jump to

Keyboard shortcuts

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