From 1a2cd882b57aaf2e5b7be17c49b29562ca653f3d Mon Sep 17 00:00:00 2001 From: anilcse Date: Thu, 12 Dec 2024 16:39:27 +0530 Subject: [PATCH 1/3] fix fmt --- internal/cosmos/client.go | 17 ----------------- internal/portfolio/display.go | 6 ++++-- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/internal/cosmos/client.go b/internal/cosmos/client.go index ba5db6c..fa391e5 100644 --- a/internal/cosmos/client.go +++ b/internal/cosmos/client.go @@ -348,20 +348,3 @@ func getActiveEndpoint(endpoints []RestEndpoint) string { return "" } - -func isValidJSONResponse(resp *http.Response, body []byte) bool { - contentType := resp.Header.Get("Content-Type") - if !strings.Contains(strings.ToLower(contentType), "application/json") { - return false - } - - // Check if the response looks like HTML - if strings.Contains(strings.ToLower(string(body)), " Date: Thu, 12 Dec 2024 16:43:48 +0530 Subject: [PATCH 2/3] update readme --- README.md | 90 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 64 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 2452452..926a2e1 100644 --- a/README.md +++ b/README.md @@ -132,30 +132,72 @@ Note: Cosmos network configurations are now automatically fetched from the [Cosm - Infura: https://infura.io/ - Or other RPC providers -## CI/CD +## Sample Output -The project uses GitHub Actions for continuous integration and deployment: +Running `cosmoscope` produces a detailed breakdown of your portfolio across different networks and asset types: -- Automated testing and code coverage reporting -- Linting with golangci-lint -- Multi-platform builds (Linux, macOS, Windows) -- Automatic releases on tags -- Coverage reporting with Codecov - -### Release Process - -To create a new release: - -```bash -git tag v1.0.0 -git push origin v1.0.0 ``` - -This will trigger the CI pipeline to: -1. Run tests and coverage -2. Build binaries for all platforms -3. Create a GitHub release -4. Upload binaries to the release +╔════════════════════════════════════════════════════════════╗ +║ ║ +║ BALANCES REPORT - 2024-03-12 15:04:05 ║ +║ ║ +╚════════════════════════════════════════════════════════════╝ + +Detailed Balance View: ++----------------------+-----------------+----------+---------------+--------------+ +| ACCOUNT | NETWORK | TOKEN | AMOUNT | USD VALUE | ++----------------------+-----------------+----------+---------------+--------------+ +| cosmos1abc...def | cosmos-bank | ATOM | 520.4530 | $5,204.53 | +| cosmos1abc...def | cosmos-staking | ATOM | 2500.0000 | $25,000.00 | +| cosmos1abc...def | cosmos-rewards | ATOM | 3.4520 | $34.52 | +| osmo1xyz...789 | osmosis-bank | OSMO | 1200.0000 | $2,400.00 | +| osmo1xyz...789 | osmosis-bank | ATOM | 150.0000 | $1,500.00 | +| osmo1xyz...789 | osmosis-staking | OSMO | 5000.0000 | $10,000.00 | +| stars1pqr...456 | stargaze-bank | STARS | 15000.0000 | $1,500.00 | +| evmos1mno...123 | evmos-staking | EVMOS | 1000.0000 | $2,500.00 | +| 0x123...789 | ethereum | ETH | 1.5000 | $4,500.00 | +| 0x123...789 | polygon | MATIC | 10000.0000 | $10,000.00 | +| Cold Storage | Fixed Balance | BTC | 0.7500 | $30,000.00 | +| Exchange | Fixed Balance | ETH | 2.0000 | $6,000.00 | ++----------------------+-----------------+----------+---------------+--------------+ + +Portfolio Summary: ++----------+---------------+--------------+----------+ +| TOKEN | AMOUNT | USD VALUE | SHARE % | ++----------+---------------+--------------+----------+ +| ATOM | 3173.9050 | $31,739.05 | 31.74% | +| OSMO | 6200.0000 | $12,400.00 | 12.40% | +| ETH | 3.5000 | $10,500.00 | 10.50% | +| MATIC | 10000.0000 | $10,000.00 | 10.00% | +| BTC | 0.7500 | $30,000.00 | 30.00% | +| EVMOS | 1000.0000 | $2,500.00 | 2.50% | +| STARS | 15000.0000 | $1,500.00 | 1.50% | ++----------+---------------+--------------+----------+ +Total Portfolio Value: $98,639.05 + +Network Distribution: ++-------------------+--------------+----------+ +| NETWORK | USD VALUE | SHARE % | ++-------------------+--------------+----------+ +| Cosmos Hub | $31,739.05 | 32.18% | +| Osmosis | $12,400.00 | 12.57% | +| Ethereum | $10,500.00 | 10.64% | +| Polygon | $10,000.00 | 10.14% | +| Fixed Balance | $36,000.00 | 36.50% | +| Evmos | $2,500.00 | 2.53% | +| Stargaze | $1,500.00 | 1.52% | ++-------------------+--------------+----------+ + +Asset Types: ++------------+--------------+----------+ +| TYPE | USD VALUE | SHARE % | ++------------+--------------+----------+ +| Bank | $15,104.53 | 15.31% | +| Staking | $47,500.00 | 48.15% | +| Rewards | $34.52 | 0.04% | +| Fixed | $36,000.00 | 36.50% | ++------------+--------------+----------+ +``` ## Contributing @@ -164,8 +206,4 @@ This will trigger the CI pipeline to: 3. Run tests and linting (`make test lint`) 4. Commit your changes (`git commit -m 'Add amazing feature'`) 5. Push to the branch (`git push origin feature/amazing-feature`) -6. Open a Pull Request - -## License - -This project is licensed under the MIT License - see the LICENSE file for details \ No newline at end of file +6. Open a Pull Request \ No newline at end of file From 6017af57c90a25f17e7e11bbef6f27fcee8a1a8e Mon Sep 17 00:00:00 2001 From: anilcse Date: Thu, 12 Dec 2024 16:51:27 +0530 Subject: [PATCH 3/3] update features list --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.md b/README.md index 926a2e1..5ffba31 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,39 @@ Asset Types: +------------+--------------+----------+ ``` +## Features & Roadmap + +### Current Features ✅ +- **Cosmos Ecosystem** + - Auto-configuration using Chain Registry + - Bank, staking, and reward balances + - IBC token resolution +- **EVM Networks** + - Ethereum & compatible chains + - Native token balances + - Custom RPC support +- **Portfolio Analytics** + - Real-time USD values + - Network distribution + - Asset type breakdown + +### Coming Soon 🚧 +- **Solana Integration** + - Native SOL & SPL tokens + - Stake accounts + - Program-owned accounts +- **Enhancements** + - NFT tracking + - DeFi positions + +### Future Plans 📋 +- Additional L1 blockchains +- CSV export +- Custom grouping +- Database support for snapshots +- Historical snapshots + + ## Contributing 1. Fork the repository