Documentation ¶
Index ¶
- Constants
- func EtherToWei(eth *big.Float) *big.Int
- func GetAssetContract(contractAddress common.Address) *models.AssetContract
- func GetAssetEvents(_ time.Time, userCollections *collections.Collections, ...)
- func GetCollectionSlug(collectionAddress common.Address) string
- func GetCollectionsFor(walletAddress common.Address, userCollections *collections.Collections, ...) []*collections.GbCollection
- func GetWalletCollections(wallets map[common.Address]*models.Wallet, ...) []*collections.GbCollection
- func ParseBigFloat(value string) (*big.Float, error)
- func SubscribeToCollectionSlug(client *StreamClient, slug string, eventHandler func(itemListedEvent any))
- func SubscribeToCollectionSlugs(apiToken string, slugs []string, eventHandler func(itemListedEvent any))
- type StreamClient
- type StreamEventType
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 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 ¶
ParseBigFloat parse string value to big.Float.
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))
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" )
Click to show internal directories.
Click to hide internal directories.