opensea

package
v0.0.0-...-ba49cc1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	API_URL string = "https://api.opensea.io/api"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ProfileImgUrl string `json:"profile_img_url"`
}

type CollectionsResp

type CollectionsResp struct {
	Collections []SingleCollectionResp `json:"collections"`
	Next        string                 `json:"next"`
}

type ContractResp

type ContractResp struct {
	Address string `json:"address"`
	Chain   string `json:"chain"`
}

type HardCodeCollection

type HardCodeCollection struct {
	Address string
	Chain   string
	Slug    string
	ChainID int
}

type OpenSeaFilterCollections

type OpenSeaFilterCollections struct {
	Chain           string
	CreatorUsername string
	IncludeHidden   *bool
	Limit           int    //The number of collections to return. Must be between 1 and 100. Default: 100
	Next            string //The cursor for the next page of results. This is returned from a previous request.
	OrderBy         string
	Inscription     *bool
}

type OpenseaGetCollectionStats

type OpenseaGetCollectionStats struct {
	Total OpenseaGetCollectionStatsTotal `json:"total"`
}

type OpenseaGetCollectionStatsTotal

type OpenseaGetCollectionStatsTotal struct {
	FloorPrice interface{} `json:"floor_price"`
}

type OpenseaGetContract

type OpenseaGetContract struct {
	Address    string `json:"address"`
	Collection string `json:"collection"`
	Name       string `json:"name"`
}

type OpenseaService

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

func NewOpensea

func NewOpensea(apiKey string) *OpenseaService

func (*OpenseaService) AdditionBaseCollections

func (s *OpenseaService) AdditionBaseCollections() map[string]HardCodeCollection

func (*OpenseaService) FindHardCodeCollectionByAddress

func (s *OpenseaService) FindHardCodeCollectionByAddress(address string) *HardCodeCollection

func (*OpenseaService) GetProfileAvatar

func (s *OpenseaService) GetProfileAvatar(addr string) (string, error)

func (*OpenseaService) IsInAdditionalCollections

func (s *OpenseaService) IsInAdditionalCollections(slug string) *HardCodeCollection

func (*OpenseaService) OpenseaGetCollections

func (s *OpenseaService) OpenseaGetCollections(ctx context.Context, f OpenSeaFilterCollections) (*CollectionsResp, error)

func (*OpenseaService) OpenseaGetContract

func (s *OpenseaService) OpenseaGetContract(ctx context.Context, address string, chain string) (*OpenseaGetContract, error)

func (*OpenseaService) OpenseaGetSingleCollection

func (s *OpenseaService) OpenseaGetSingleCollection(ctx context.Context, collectionSlug string) (*SingleCollectionResp, error)

type SingleCollectionResp

type SingleCollectionResp struct {
	Collection              string         `json:"collection"`
	Name                    string         `json:"name"`
	Description             string         `json:"description"`
	ImageUrl                string         `json:"image_url"`
	BannerImageUrl          string         `json:"banner_image_url"`
	Owner                   string         `json:"owner"`
	SafelistStatus          string         `json:"safelist_status"`
	Category                string         `json:"category"`
	IsDisabled              bool           `json:"is_disabled"`
	IsNsfw                  bool           `json:"is_nsfw"`
	TraitOffersEnabled      bool           `json:"trait_offers_enabled"`
	CollectionOffersEnabled bool           `json:"collection_offers_enabled"`
	OpenseaUrl              string         `json:"opensea_url"`
	ProjectUrl              string         `json:"project_url"`
	WikiUrl                 string         `json:"wiki_url"`
	DiscordUrl              string         `json:"discord_url"`
	TelegramUrl             string         `json:"telegram_url"`
	TwitterUsername         string         `json:"twitter_username"`
	InstagramUsername       string         `json:"instagram_username"`
	Chain                   string         `json:"chain"`
	Contracts               []ContractResp `json:"contracts"`
}

type User

type User struct {
	Username string  `json:"username"`
	Account  Account `json:"account"`
}

Jump to

Keyboard shortcuts

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