Documentation ¶
Index ¶
- type AddressCollection
- type CollectionSource
- type Collections
- type Event
- type EventType
- type GbCollection
- func (uc *GbCollection) AddMint()
- func (uc *GbCollection) AddSale(value *big.Int, numItems uint64) float64
- func (uc *GbCollection) CalculateArtificialFloor(tokenPrice float64) (float64, float64)
- func (uc *GbCollection) CalculateSaLiRa() (float64, float64)
- func (uc *GbCollection) Render(text string) string
- func (uc *GbCollection) ResetStats()
- func (uc *GbCollection) SaLiRaAdd() float64
- func (uc *GbCollection) Style() lipgloss.Style
- func (uc *GbCollection) StyleSecondary() lipgloss.Style
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressCollection ¶
type CollectionSource ¶
type CollectionSource int64
const ( Configuration CollectionSource = iota Wallet Stream )
type Collections ¶
type Collections struct { UserCollections map[common.Address]*GbCollection // 'queue' to store collections to be processed // ListingAddresses chan common.Address RWMu *sync.RWMutex }
func New ¶
func New() *Collections
func (*Collections) Addresses ¶
func (cs *Collections) Addresses() []common.Address
func (*Collections) ListingsAddresses ¶
func (cs *Collections) ListingsAddresses() []common.Address
ListingsAddresses returns a slice of addresses.
func (*Collections) OpenseaSlugs ¶
func (cs *Collections) OpenseaSlugs() []string
OpenseaSlugs returns a slice of slugs for collections with enabled listings.
func (*Collections) SortedAndColoredNames ¶
func (cs *Collections) SortedAndColoredNames() []string
func (*Collections) UserCollectionsAddresses ¶
func (cs *Collections) UserCollectionsAddresses() []common.Address
type Event ¶
type Event struct { NodeID int EventType EventType Topic string TxHash common.Hash // Collection *Collection Collection *GbCollection TokenID uint64 PriceWei *big.Int PricePerItem *big.Int CollectionColor lipgloss.Color // MultiItemTx bool Permalink string TxItemCount uint Time time.Time From User FromENS string To User ToENS string WorkerID int }
type GbCollection ¶
type GbCollection struct { ContractAddress common.Address `mapstructure:"address"` Name string `mapstructure:"name"` OpenseaSlug string `mapstructure:"slug"` Show struct { Sales bool `mapstructure:"sales"` Mints bool `mapstructure:"mints"` Transfers bool `mapstructure:"transfers"` Listings bool `mapstructure:"listings"` } `mapstructure:"show"` Highlight struct { Color lipgloss.Color `mapstructure:"color"` Sales lipgloss.Color `mapstructure:"show.sales"` Mints lipgloss.Color `mapstructure:"mints"` Transfers lipgloss.Color `mapstructure:"transfers"` Listings lipgloss.Color `mapstructure:"show.listings"` ListingsBelowPrice float64 `mapstructure:"listings_below_price"` } Metadata *gbnode.CollectionMetadata `mapstructure:"metadata"` Source CollectionSource `mapstructure:"source"` Colors struct { Primary lipgloss.Color `mapstructure:"primary"` Secondary lipgloss.Color `mapstructure:"secondary"` } `mapstructure:"colors"` Counters struct { Sales uint64 `mapstructure:"sales"` Mints uint64 `mapstructure:"mints"` Transfers uint64 `mapstructure:"transfers"` Listings uint64 `mapstructure:"listings"` SalesVolume *big.Int `mapstructure:"salesVolume"` } `mapstructure:"counters"` SaLiRa ewma.MovingAverage `mapstructure:"salira"` // exponential moving average of the actual sale prices ArtificialFloor ewma.MovingAverage `mapstructure:"artificialFloor"` PreviousArtificialFloor float64 `mapstructure:"artificialFloor"` }
GbCollection represents the collections configured by the user.
func GetCollectionsFromConfiguration ¶
func GetCollectionsFromConfiguration(nodes *gbnode.NodeCollection) []*GbCollection
func NewCollection ¶
func NewCollection(contractAddress common.Address, name string, nodes *gbnode.NodeCollection, source CollectionSource) *GbCollection
func (*GbCollection) AddMint ¶
func (uc *GbCollection) AddMint()
func (*GbCollection) AddSale ¶
func (uc *GbCollection) AddSale(value *big.Int, numItems uint64) float64
func (*GbCollection) CalculateArtificialFloor ¶
func (uc *GbCollection) CalculateArtificialFloor(tokenPrice float64) (float64, float64)
CalculateArtificialFloor updates the moving average of a given collection.
func (*GbCollection) CalculateSaLiRa ¶
func (uc *GbCollection) CalculateSaLiRa() (float64, float64)
CalculateSaLiRa updates the salira moving average of a given collection.
func (*GbCollection) Render ¶
func (uc *GbCollection) Render(text string) string
func (*GbCollection) ResetStats ¶
func (uc *GbCollection) ResetStats()
func (*GbCollection) SaLiRaAdd ¶
func (uc *GbCollection) SaLiRaAdd() float64
func (*GbCollection) Style ¶
func (uc *GbCollection) Style() lipgloss.Style
func (*GbCollection) StyleSecondary ¶
func (uc *GbCollection) StyleSecondary() lipgloss.Style
Click to show internal directories.
Click to hide internal directories.