-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
declare -A networks=( | ||
[mainnets]="osmosis neutron nolus crescent akash cosmoshub sentinel stargaze omniflixhub cosmoshub terra kujira stride injective juno agoric evmos noble omny quasar dvpn onomy" | ||
[testnets]="agorictestnet quasartestnet stridetestnet onomytestnet axelartestnet nibirutestnet nobletestnet dydxtestnet osmosistestnet cosmoshubtestnet" | ||
) | ||
|
||
base_url="https://cosmos-upgrades.apis.defiantlabs.net" | ||
|
||
# Loop over both mainnets and testnets | ||
for type in "${!networks[@]}"; do | ||
# Construct the jq filter dynamically | ||
jq_filter='.[] | select(.network | IN(' | ||
for network in ${networks[$type]}; do | ||
jq_filter+='"'$network'",' | ||
done | ||
jq_filter=${jq_filter%,}')) | select(.upgrade_found == true)' | ||
|
||
# Use the constructed filter with curl and jq | ||
curl -s -X GET \ | ||
-H "Content-Type: application/json" \ | ||
$base_url/"$type" | jq "$jq_filter" | ||
done |