Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdesalle committed Jan 24, 2025
2 parents 01dc2f3 + 79453a3 commit fde2d50
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions shell/tokenlist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ for file in src/tokens/*.json; do
# Extract the filename and replace '-' with '_'
network=$(basename "$file" .json | tr '-' '_' | tr '[:lower:]' '[:upper:]')

echo -n "Decimals for $network tokens list: "
echo -n "$network tokens list: "

# Construct the RPC URL variable name from filename
rpc_url_var="${network}_RPC_URL"

# Load the RPC URL from the environment variable
rpc_url=${!rpc_url_var}
# Load the RPC URL from the environment variable or default to empty string if not found
rpc_url=${!rpc_url_var:-}

if [ -z "$rpc_url" ]; then
echo -e "🟡 missing RPC endpoint."
continue
fi

# Loop through JSON objects and extract address and token decimals
echo "$json_objects" | jq -c '.[]' | while read -r row; do
Expand Down

0 comments on commit fde2d50

Please sign in to comment.