Documentation ¶
Index ¶
- type AddressCollection
- type BaseCollection
- type CollectionDB
- type Event
- type EventType
- type EventWithStyle
- type GbCollection
- func (uc *GbCollection) AddMint()
- func (uc *GbCollection) AddSale(value *big.Int, numItems uint64) float64
- func (uc *GbCollection) CalculateFloorPrice(tokenPrice float64) (float64, float64)
- func (uc *GbCollection) CalculateSaLiRa(address common.Address) (float64, float64)
- func (uc *GbCollection) Render(text string) string
- func (uc *GbCollection) ResetStats()
- func (uc *GbCollection) Style() lipgloss.Style
- func (uc *GbCollection) StyleSecondary() lipgloss.Style
- type PushEvent
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressCollection ¶
type BaseCollection ¶ added in v0.2.0
type BaseCollection struct{}
type CollectionDB ¶ added in v0.2.0
type CollectionDB struct { Collections map[common.Address]*GbCollection // 'queue' to store collections to be processed // ListingAddresses chan common.Address RWMu *sync.RWMutex }
func New ¶
func New() *CollectionDB
func (*CollectionDB) Addresses ¶ added in v0.2.0
func (cs *CollectionDB) Addresses() []common.Address
func (*CollectionDB) ListingsAddresses ¶ added in v0.2.0
func (cs *CollectionDB) ListingsAddresses() []common.Address
ListingsAddresses returns a slice of addresses.
func (*CollectionDB) OpenseaSlugs ¶ added in v0.2.0
func (cs *CollectionDB) OpenseaSlugs() []string
OpenseaSlugs returns a slice of slugs for collections with enabled listings.
func (*CollectionDB) SortedAndColoredNames ¶ added in v0.2.0
func (cs *CollectionDB) SortedAndColoredNames() []string
func (*CollectionDB) UserCollectionsAddresses ¶ added in v0.2.0
func (cs *CollectionDB) UserCollectionsAddresses() []common.Address
type Event ¶
type Event struct { NodeID int EventType EventType Topic string TxHash common.Hash TransactionCollector *txlogcollector.TxLogs ContractAddress common.Address Collection *GbCollection TokenID *big.Int UniqueTokenIDs []*big.Int ENSMetadata *external.ENSMetadata PriceWei *big.Int PriceArrowColor lipgloss.Color CollectionColor lipgloss.Color Permalink string TxLogCount uint64 Time time.Time From User FromENS string To User ToColor lipgloss.Color ToENS string FromAddresses map[common.Address]bool ToAddresses map[common.Address]bool WorkerID int PrintEvent bool }
type EventWithStyle ¶ added in v0.0.16
type EventWithStyle struct { Verbose bool Source string SourceColor lipgloss.Color Time time.Time TimeColor lipgloss.Color EventType EventType EventEmoji string Marker string MarkerColor lipgloss.Color TxHash common.Hash CollectionName string CollectionColor lipgloss.Color CollectionTotalSupply uint64 TokenID *big.Int PriceEther string PriceEtherColor lipgloss.Color PriceArrowColor lipgloss.Color PriceWei *big.Int PricePerItem *big.Int TxItemCount uint64 EtherscanURL string OpenseaURL string From User FromColor lipgloss.Color FromENS string To User ToColor lipgloss.Color ToENS string SalesCount uint64 ListingsCount uint64 }
type GbCollection ¶
type GbCollection struct { // // configurable fields ContractAddress common.Address `mapstructure:"address"` Name string `mapstructure:"name"` OpenseaSlug string `mapstructure:"slug"` IgnorePrinting bool `mapstructure:"ignore"` 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:"listings.enabled"` ListingsBelowPrice float64 `mapstructure:"listings_below_price"` } // // calculated/generated fields Metadata *models.CollectionMetadata `mapstructure:"metadata"` Source models.CollectionSource `mapstructure:"source"` Colors struct { Primary lipgloss.Color `mapstructure:"primary"` Secondary lipgloss.Color `mapstructure:"secondary"` } `mapstructure:"colors"` Counters struct { Sales uint64 Mints uint64 Transfers uint64 Listings uint64 SalesVolume *big.Int } SaLiRa ewma.MovingAverage `json:"salira"` FloorPrice *ewma.MovingAverage `mapstructure:"floorPrice"` PreviousFloorPrice float64 `mapstructure:"previousFloorPrice"` }
GbCollection represents the collections configured by the user.
func NewCollection ¶
func NewCollection(contractAddress common.Address, name string, nodes *nodes.Nodes, source models.CollectionSource) *GbCollection
func (*GbCollection) AddMint ¶
func (uc *GbCollection) AddMint()
func (*GbCollection) AddSale ¶
func (uc *GbCollection) AddSale(value *big.Int, numItems uint64) float64
func (*GbCollection) CalculateFloorPrice ¶ added in v0.2.0
func (uc *GbCollection) CalculateFloorPrice(tokenPrice float64) (float64, float64)
CalculateFloorPrice updates the moving average of a given collection.
func (*GbCollection) CalculateSaLiRa ¶
func (uc *GbCollection) CalculateSaLiRa(address common.Address) (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) Style ¶
func (uc *GbCollection) Style() lipgloss.Style
func (*GbCollection) StyleSecondary ¶
func (uc *GbCollection) StyleSecondary() lipgloss.Style
type PushEvent ¶ added in v0.2.0
type PushEvent struct { NodeID int EventType EventType Topic string TxHash common.Hash CollectionName string ContractAddress common.Address TokenID *big.Int ENSMetadata *external.ENSMetadata PriceWei *big.Int PricePerItem *big.Int CollectionColor lipgloss.Color Permalink string TxItemCount uint64 Time time.Time From User FromENS string To User ToENS string }
Click to show internal directories.
Click to hide internal directories.