A simple utility to convert Stargaze (stars) addresses to Cosmos Hub (cosmos) addresses and check their balances.
npm install
- Create a file named
wallets.csv
with Stargaze addresses. The addresses should be in the first column.
Example wallets.csv
:
StargazeAddress
stars1abcdefghijklmnopqrstuvwxyz0123456
stars1zyxwvutsrqponmlkjihgfedcba9876543
- Run the conversion:
npm start
- Find the converted addresses in
output.csv
.
After converting addresses, you can check their balances on Cosmos Hub:
npm run check-balances
This will:
- Read the converted addresses from
output.csv
- Check the balance of each Cosmos Hub address
- Create a new file called
hub.csv
with Stargaze addresses, Cosmos Hub addresses, and their balances - Addresses with zero balance will be included with a balance of "0"
This tool uses the bech32 encoding/decoding to change the address prefix from 'stars' to 'cosmos' while preserving the underlying public key data.
The balance checker connects to the Cosmos Hub REST API to query account balances for each converted address.