Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
benleb committed Jul 1, 2023
1 parent 7e392bf commit d7da84a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cmd/live.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ func init() { //nolint:gochecknoinits
viper.SetDefault("stats.lines", 6)
// high volume mints detection
viper.SetDefault("stats.high_volume.check_interval", time.Second*17)
viper.SetDefault("stats.high_volume.min_checks_below_threshold", 3)
viper.SetDefault("stats.high_volume.min_checks_below_threshold", 2)
viper.SetDefault("stats.high_volume.mints.threshold", 37)
}

Expand Down
28 changes: 13 additions & 15 deletions internal/nemo/watch/watch.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package watch

import "github.com/ethereum/go-ethereum/common"
import (
"github.com/benleb/gloomberg/internal/nemo/wallet"
"github.com/ethereum/go-ethereum/common"
)

type WatcherUsers map[common.Address]*WUser

Expand All @@ -26,32 +29,27 @@ type Watcher struct {
WatchUsers WatcherUsers
}

type WWallet struct {
Name string `mapstructure:"name"`
Address common.Address `mapstructure:"address"`
}

type ChatID struct {
ChatID int64 `mapstructure:"chat_id"`
}

type WUser struct {
Name string `mapstructure:"name"`
TelegramUsername string `mapstructure:"telegram_username"`
Wallets []*WWallet `mapstructure:"wallets"`
Name string `mapstructure:"name"`
TelegramUsername string `mapstructure:"telegram_username"`
Wallets []*wallet.Wallet `mapstructure:"wallets"`

WalletAddresses []common.Address

Group *WGroup
}

type WGroup struct {
Name string `mapstructure:"group"`
TelegramChatID int64 `mapstructure:"telegram_chat_id"`
ReplyToMessageID int `mapstructure:"telegram_reply_to_message_id"`
AdditionalChatIDs []*ChatID `mapstructure:"telegram_chat_ids"`
Users []*WUser `mapstructure:"users"`
Wallets []*WWallet `mapstructure:"wallets"`
Name string `mapstructure:"group"`
TelegramChatID int64 `mapstructure:"telegram_chat_id"`
ReplyToMessageID int `mapstructure:"telegram_reply_to_message_id"`
AdditionalChatIDs []*ChatID `mapstructure:"telegram_chat_ids"`
Users []*WUser `mapstructure:"users"`
Wallets []*wallet.Wallet `mapstructure:"wallets"`

// addresses []common.Address
// Contracts []WatchContract `mapstructure:"contracts"`
Expand Down
17 changes: 17 additions & 0 deletions internal/trapri/trapri.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,18 @@ func formatTokenTransaction(gb *gloomberg.Gloomberg, seawa *seawatcher.SeaWatche
fmtHistoryEvent.WriteString(collection.StyleSecondary().Render("…"))
}

// total supply
if currentCollection.Metadata.TotalSupply > 0 && currentCollection.Metadata.TotalSupply < 99999 {
fmtTotalSupply := fmt.Sprint(currentCollection.Metadata.TotalSupply)

if currentCollection.Metadata.TotalSupply > 999 {
shortTotalSupply := int(currentCollection.Metadata.TotalSupply / 1000)
fmtTotalSupply = fmt.Sprint(shortTotalSupply) + "k"
}

fmtEvent.WriteString(style.DarkGrayStyle.Render(" /") + collection.StyleSecondary().Copy().Faint(true).Render(fmtTotalSupply))
}

fmtTokensTransferred = append(fmtTokensTransferred, fmtEvent.String())

if collection.Show.History {
Expand Down Expand Up @@ -747,6 +759,11 @@ func formatTokenTransaction(gb *gloomberg.Gloomberg, seawa *seawatcher.SeaWatche
// SaLiRas
if timeframedSaLiRas := currentCollection.GetPrettySaLiRas(); len(timeframedSaLiRas) > 0 {
out.WriteString(" ~ " + strings.Join(timeframedSaLiRas, " "))

// add collection symbol ad the end for easier matching between salira and collection
if currentCollection.Metadata != nil && currentCollection.Metadata.Symbol != "" {
out.WriteString(style.DarkGrayStyle.Render(" | ") + currentCollection.Style().Copy().Faint(true).Render(currentCollection.Metadata.Symbol))
}
}
}

Expand Down

0 comments on commit d7da84a

Please sign in to comment.