Documentation ¶
Index ¶
- Variables
- func SortMapByValue(m map[string]int64, reverse bool) []string
- func WriteDataToFile(data interface{}, filePath string)
- func ZstdCompress(in io.Reader, out io.Writer) error
- type Accounts
- type Address
- type CollectionColors
- type Degen
- type DegenDB
- func (ddb *DegenDB) AddCollectionToken(collections interface{}, tokens interface{})
- func (ddb *DegenDB) Disconnect() error
- func (ddb *DegenDB) NewAddress(address common.Address) *Address
- func (ddb *DegenDB) NewAddresses(addresses []common.Address) []*Address
- func (ddb *DegenDB) NewDegen(name string, addresses []common.Address, twitter string, telegram string, ...) *Degen
- type EventColors
- type EventType
- type GBEventType
- type MetadataAttribute
- type OpenSeaMetadata
- type OpenSeaRanks
- type ParsedEvent
- type Rank
- type RecentEvent
- type SaLiRa
- type SaLiRas
- type Score
- type Slugs
- type Tag
- type Token
- type TokenMetadata
- type TokenRank
- type Trait
- type TransferredCollection
- type TransferredToken
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // event types. Unknown = &GBEventType{name: "Unknown", actionName: "did something", icon: "❓", openseaEventName: ""} Transfer = &GBEventType{name: "Transfer", actionName: "transferred", icon: "📦", openseaEventName: "item_transferred"} Sale = &GBEventType{name: "Sale", actionName: "sold", icon: "💰", openseaEventName: "item_sold"} Purchase = &GBEventType{name: "Purchase", actionName: "purchased", icon: "💰", openseaEventName: "item_sold"} Mint = &GBEventType{name: "Mint", actionName: "minted", icon: "Ⓜ️", openseaEventName: ""} Airdrop = &GBEventType{name: "Airdrop", actionName: "got airdropped", icon: "🎁", openseaEventName: ""} Burn = &GBEventType{name: "Burn", actionName: "burned", icon: "🔥", openseaEventName: ""} BurnRedeem = &GBEventType{name: "BurnRedeem", actionName: "redeemed burned", icon: "🔥", openseaEventName: ""} Loan = &GBEventType{name: "Loan", actionName: "loaned", icon: "💸", openseaEventName: ""} RepayLoan = &GBEventType{name: "RepayLoan", actionName: "repaid loan", icon: "💸", openseaEventName: ""} Listing = &GBEventType{name: "Listing", actionName: "listed", icon: "📢", openseaEventName: "item_listed"} Bid = &GBEventType{name: "Bid", actionName: "(got) bid", icon: "💦", openseaEventName: "item_received_bid"} OwnBid = &GBEventType{name: "OwnBid", actionName: "bid", icon: "🤑", openseaEventName: ""} Offer = &GBEventType{name: "Offer", actionName: "(got) offered", icon: "💦", openseaEventName: "item_received_offer"} AcceptedOffer = &GBEventType{name: "AcceptedOffer", actionName: "accepted offer", icon: "🤝", openseaEventName: ""} CollectionOffer = &GBEventType{name: "CollectionOffer", actionName: "(got) collection-offered", icon: "🧊", openseaEventName: "collection_offer"} AcceptedCollectionOffer = &GBEventType{name: "AcceptedCollectionOffer", actionName: "accepted collection offer", icon: "🤝", openseaEventName: ""} MetadataUpdate = &GBEventType{name: "MetadataUpdate", actionName: "metadata updated", icon: "♻️", openseaEventName: "item_metadata_updated"} Cancelled = &GBEventType{name: "Cancelled", actionName: "cancelled", icon: "❌", openseaEventName: "item_cancelled"} // event type sets. SaleTypes = mapset.NewSet[EventType](Sale, Purchase) )
Functions ¶
func SortMapByValue ¶ added in v0.8.0
func WriteDataToFile ¶ added in v0.8.0
func WriteDataToFile(data interface{}, filePath string)
Types ¶
type Accounts ¶
type Accounts struct { // Twitter is the Twitter username for this degen Twitter string `bson:"twitter,omitempty" json:"twitter"` // Telegram is the Telegram username for this degen Telegram string `bson:"telegram,omitempty" json:"telegram"` // ChatID is the Telegram chat ID for this degen TelegramChatID int64 `bson:"telegram_chat_id,omitempty" json:"telegram_chat_id"` }
type Address ¶ added in v0.11.0
type Address struct { // Address is the ethereum address for this wallet/collection HexAddress string `bson:"_id" json:"hex_address"` // Address is the ethereum Address for this wallet/collection Address common.Address `json:"address"` // Type is the type of this wallet/collection, e.g. EOA or contract Type string `bson:"type,omitempty" json:"type,omitempty"` IsContract bool `bson:"is_contract,omitempty" json:"is_contract,omitempty"` // Domain is the (main/reverseable) domain (e.g. ENS) for this wallet/collection Domain string `bson:"domain,omitempty" json:"domain"` // Name is the name of this wallet/collection Name string `bson:"name,omitempty" json:"name"` // Tags is a list of tags associated with this wallet/collection Tags []Tag `bson:"tags,omitempty" json:"tags"` // Slugs are the collection slugs of the collection Slugs Slugs `bson:"slugs,omitempty" json:"slugs,omitempty"` // Description is the description of the collection Description string `bson:"description,omitempty" json:"description,omitempty"` // TotalSupply is the total supply of the collection TotalSupply int `bson:"total_supply,omitempty" json:"total_supply,omitempty"` // ImageURL is the URL of the image of the collection ImageURL string `bson:"image_url,omitempty" json:"image_url,omitempty"` // ExternalURL is the URL of the collection ExternalURL string `bson:"external_url,omitempty" json:"external_url,omitempty"` // CreatedAt is the time this collection was created in our db CreatedAt time.Time `bson:"created_at,omitempty" json:"created_at,omitempty"` // UpdatedAt is the time this collection was last updated in our db UpdatedAt time.Time `bson:"updated_at,omitempty" json:"updated_at,omitempty"` }
type CollectionColors ¶ added in v0.11.0
type Degen ¶
type Degen struct { // ID is the unique identifier for this degen ID primitive.ObjectID `bson:"_id,omitempty" json:"id"` // Name is the name of the degen Name string `bson:"name,omitempty" json:"name"` // Accounts contains other accounts of this degen Accounts Accounts `bson:"accounts,omitempty" json:"accounts"` // HexAddresses is the ethereum address for this wallet/collection HexAddresses []string `bson:"hex_addresses,omitempty" json:"hex_addresses"` // Addresses is a list of wallet addresses associated with this degen Addresses []*Address `bson:"addresses,omitempty" json:"addresses"` // Tags is a list of tags associated with this degen Tags []Tag `bson:"tags,omitempty" json:"tags"` // CreatedAt is the time this degen was created CreatedAt time.Time `bson:"created_at,omitempty" json:"created_at"` // UpdatedAt is the time this degen was last updated UpdatedAt time.Time `bson:"updated_at,omitempty" json:"updated_at"` }
type DegenDB ¶
type DegenDB struct {
// contains filtered or unexported fields
}
func NewDegenDB ¶
func NewDegenDB() *DegenDB
func (*DegenDB) AddCollectionToken ¶
func (ddb *DegenDB) AddCollectionToken(collections interface{}, tokens interface{})
func (*DegenDB) Disconnect ¶ added in v0.11.0
func (*DegenDB) NewAddress ¶ added in v0.11.0
func (*DegenDB) NewAddresses ¶ added in v0.11.0
type EventColors ¶ added in v0.11.0
type GBEventType ¶ added in v0.11.0
type GBEventType struct {
// contains filtered or unexported fields
}
func GetEventType ¶ added in v0.11.1
func GetEventType(name string) *GBEventType
func (*GBEventType) ActionName ¶ added in v0.11.0
func (et *GBEventType) ActionName() string
func (*GBEventType) Icon ¶ added in v0.11.0
func (et *GBEventType) Icon() string
func (*GBEventType) OpenseaEventName ¶ added in v0.11.0
func (et *GBEventType) OpenseaEventName() string
func (*GBEventType) String ¶ added in v0.11.0
func (et *GBEventType) String() string
type MetadataAttribute ¶ added in v0.8.0
type OpenSeaMetadata ¶ added in v0.8.0
type OpenSeaRanks ¶ added in v0.8.0
type ParsedEvent ¶ added in v0.10.0
type ParsedEvent struct { TxHash common.Hash Action string ReceivedAt time.Time Typemoji string Price *price.Price TransferredCollections []TransferredCollection BlurURL string EtherscanURL string OpenSeaURL string // "attributes" IsOwnWallet bool IsOwnCollection bool // fix this with new chawago watcher IsWatchUsersWallet bool // temporary until we have a better solution From *Degen FromAddress common.Address To *Degen ToAddress common.Address Colors EventColors Other map[string]interface{} }
type RecentEvent ¶ added in v0.9.0
type RecentEvent struct { Timestamp time.Time `bson:"timestamp,omitempty" json:"timestamp,omitempty"` // Event Type Type EventType `bson:"type,omitempty" json:"type,omitempty"` // Event Volume AmountWei *big.Int `bson:"amount_wei,omitempty" json:"amount_wei,omitempty"` AmountTokens uint64 `bson:"amount_tokens,omitempty" json:"amount_tokens,omitempty"` }
type SaLiRa ¶ added in v0.9.0
type SaLiRa struct { ewma.MovingAverage Timeframe time.Duration CountSales int CountListings int Previous float64 }
single SaLiRa instance.
type SaLiRas ¶ added in v0.9.0
type SaLiRas []*SaLiRa
SaLiRas is a group of saLiRa instances for different timeframes type SaLiRas map[time.Duration]*saLiRa.
func NewSaLiRas ¶ added in v0.9.0
NewSaLiRas creates a new SaLiRas instance.
type Token ¶
type Token struct { // ID is the unique identifier for this token ID primitive.ObjectID `bson:"_id,omitempty" json:"id"` // Collection is the collection this token belongs to Address Address `bson:"collection,omitempty" json:"collection"` // CollectionSlugs are the collection slugs of the collection this token belongs to CollectionSlugs Slugs `bson:"collection_slugs,omitempty" json:"collection_slugs"` // ContractAddress is the address of the contract this token belongs to ContractAddress string `bson:"contract_address,omitempty" json:"contract_address"` // Token ID used as in the collection TokenID int64 `bson:"token_id,omitempty" json:"token_id"` // Name is the name of the token Name string `bson:"name,omitempty" json:"name"` // Ranks are the ranks of the token Rank Rank `bson:"ranks,omitempty" json:"ranks"` // Score is the score of the token calculated via the open-rarity algorithm Score float64 `bson:"score,omitempty" json:"score"` // Metadata is the metadata of the token Metadata []MetadataAttribute `bson:"metadata,omitempty" json:"metadata"` // CreatedAt is the time this token was created CreatedAt time.Time `bson:"created_at,omitempty" json:"created_at"` // UpdatedAt is the time this token was last updated UpdatedAt time.Time `bson:"updated_at,omitempty" json:"updated_at"` }
type TokenMetadata ¶ added in v0.8.0
type TokenRank ¶ added in v0.8.0
func (TokenRank) GetRankSymbol ¶ added in v0.10.0
type Trait ¶ added in v0.11.0
type Trait struct { Name string `json:"trait_type" mapstructure:"trait_type"` Value interface{} `json:"value" mapstructure:"value"` DisplayType string `json:"display_type" mapstructure:"display_type"` MaxValue interface{} `json:"max_value" mapstructure:"max_value"` Order interface{} `json:"order" mapstructure:"order"` TraitCount float64 `json:"trait_count" mapstructure:"trait_count"` }
func (*Trait) StringBold ¶ added in v0.11.0
type TransferredCollection ¶ added in v0.10.0
type TransferredCollection struct { CollectionName string TransferredTokens []TransferredToken Colors CollectionColors // from & to per collection as we print one line per collection...^^ From string To string }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.