Skip to content

Commit a616e5d

Browse files
authored
Add --exclude-unpriced flag to sim evm balances (GRO-229) (#53)
Default is true so unpriced tokens are filtered out by default; pass --exclude-unpriced=false to include them. Flag is shared with 'sim evm stablecoins' via addBalanceFlags.
1 parent 248e655 commit a616e5d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cmd/sim/evm/balances.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ func addBalanceFlags(cmd *cobra.Command) {
116116
cmd.Flags().String("filters", "", "Filter by token standard: 'erc20' (only ERC20 tokens) or 'native' (only native chain assets like ETH)")
117117
cmd.Flags().String("metadata", "", "Request additional metadata fields in the response (comma-separated): 'logo' (token icon URL), 'url' (project website), 'pools' (liquidity pool details)")
118118
cmd.Flags().Bool("exclude-spam", false, "Exclude low-liquidity tokens (less than $100 USD pool size) commonly associated with spam airdrops")
119+
cmd.Flags().Bool("exclude-unpriced", true, "Exclude tokens without a USD price (default: true); pass --exclude-unpriced=false to include them")
119120
cmd.Flags().String("historical-prices", "", "Include historical USD prices at the specified hour offsets from now (comma-separated, e.g. '720,168,24' for 30d, 7d, 1d ago)")
120121
cmd.Flags().Int("limit", 0, "Maximum number of balance entries to return per page (1-1000, default: server-determined)")
121122
cmd.Flags().String("offset", "", "Pagination cursor returned as next_offset in a previous response; use to fetch the next page of results")
@@ -155,6 +156,11 @@ func runBalancesEndpoint(cmd *cobra.Command, args []string, pathPrefix, pathSuff
155156
if v, _ := cmd.Flags().GetBool("exclude-spam"); v {
156157
params.Set("exclude_spam_tokens", "true")
157158
}
159+
if v, _ := cmd.Flags().GetBool("exclude-unpriced"); v {
160+
params.Set("exclude_unpriced", "true")
161+
} else {
162+
params.Set("exclude_unpriced", "false")
163+
}
158164
if v, _ := cmd.Flags().GetString("historical-prices"); v != "" {
159165
params.Set("historical_prices", v)
160166
}

0 commit comments

Comments
 (0)