opensea

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const StreamAPIEndpoint = "wss://stream.openseabeta.com/socket"

Variables

This section is empty.

Functions

func GetAssetContract

func GetAssetContract(contractAddress common.Address) *models.AssetContract

func GetAssetEvents

func GetAssetEvents(_ time.Time, userCollections *collections.Collections, contractAddress common.Address, newListings chan<- []models.AssetEvent)

GetAssetEvents returns the events for a collection.

func GetCollectionSlug

func GetCollectionSlug(collectionAddress common.Address) string

func GetCollectionsFor

func GetCollectionsFor(walletAddress common.Address, userCollections *collections.Collections, nodes *gbnode.NodeCollection, try int) []*collections.GbCollection

GetCollectionsFor returns the collections a wallet owns at least one item of.

func GetWalletCollections

func GetWalletCollections(wallets map[common.Address]*models.Wallet, userCollections *collections.Collections, nodes *gbnode.NodeCollection) []*collections.GbCollection

GetWalletCollections returns the collections a wallet owns at least one item of.

func ParseBigFloat

func ParseBigFloat(value string) (*big.Float, error)

ParseBigFloat parse string value to big.Float.

func SubscribeToCollectionSlug

func SubscribeToCollectionSlug(client *StreamClient, slug string, eventHandler func(itemListedEvent any))

func SubscribeToCollectionSlugs

func SubscribeToCollectionSlugs(apiToken string, slugs []string, eventHandler func(itemListedEvent any))

Types

type StreamClient

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

func NewStreamClient

func NewStreamClient(token string, onError func(error)) *StreamClient

func (StreamClient) Connect

func (s StreamClient) Connect() error

func (*StreamClient) Disconnect

func (s *StreamClient) Disconnect() error

func (StreamClient) OnItemListed

func (s StreamClient) OnItemListed(collectionSlug string, eventHandler func(itemListedEvent any))

type StreamEventType

type StreamEventType string
const (
	MetadataUpdated StreamEventType = "item_metadata_updated"
	Listed          StreamEventType = "item_listed"
	Sold            StreamEventType = "item_sold"
	Transferred     StreamEventType = "item_transferred"
	ReceivedOffer   StreamEventType = "item_received_offer"
	ReceivedBid     StreamEventType = "item_received_bid"
	Cancelled       StreamEventType = "item_cancelle"
)

Jump to

Keyboard shortcuts

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