opensea

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 18 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 GetCollectionSlug

func GetCollectionSlug(collectionAddress common.Address) string

func GetCollectionsFor

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

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

func GetWalletCollections

func GetWalletCollections(wallets map[common.Address]*wallet.Wallet, userCollections *collections.Collections, nodes *node.Nodes) []*collections.GbCollection

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

func SubscribeToCollectionSlug

func SubscribeToCollectionSlug(client *StreamClient, slug 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))

func (*StreamClient) OnItemReceivedOffer added in v0.0.9

func (s *StreamClient) OnItemReceivedOffer(collectionSlug string, eventHandler func(itemReceivedOfferEvent any))

type StreamEventType

type StreamEventType string
const (
	Listed        StreamEventType = "item_listed"
	ReceivedOffer StreamEventType = "item_received_offer"
)

Jump to

Keyboard shortcuts

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