Add wallet activity-calendar and largest-transfers endpoints - #52
Merged
christabel888 merged 2 commits intoJul 21, 2026
Conversation
Four unrelated pre-existing bugs kept the crate from compiling at all: misplaced inner doc comments in queue/mod.rs, #[allow(...)] attributes placed mid method-chain in realtime_broadcaster.rs and shutdown.rs, and a duplicated/dead code block in rpc/stellar.rs that left a brace unclosed. Filed Stellar-Insightss#51 for the remaining dependency/API-mismatch errors this does not address.
Closes Stellar-Insightss#28 and Stellar-Insightss#29. - GET /api/v1/wallets/{address}/activity-calendar: per-UTC-day transaction count for an address, from the ingested payments table. - GET /api/v1/wallets/{address}/largest-transfers: the address's largest transfers (in or out) ranked by USD value via the price feed, since comparing raw asset amounts across assets of different unit value is meaningless. Ranking is computed over the address's most recent 1000 transfers to keep the query and price-feed conversion pass bounded. Also adds PriceFeedClient::with_provider() so handlers that depend on price conversion can be tested with an injected provider instead of making real network calls to CoinGecko.
yosemite01
force-pushed
the
feat/28-29-wallet-activity-largest-transfers
branch
from
July 21, 2026 13:28
20a4ae2 to
f8acc65
Compare
4 tasks
christabel888
pushed a commit
to Stellar-Insightss/Stellar-inights
that referenced
this pull request
Jul 21, 2026
… Wallet dashboard Closes #174. Adds the two remaining Wallet Dashboard panels described in the pivot doc, alongside the existing Balance History chart: - ActivityCalendarHeatmap: a GitHub-style contribution calendar of the address's per-day transaction count, with total/active-days/streak summary stats. Grid math is done in UTC throughout (not local time) to match the backend's UTC-day convention and avoid an off-by-one shift for users outside UTC. - LargestTransfersList: a table of the address's largest transfers by USD value, with direction (sent/received), counterparty, raw amount, and USD value. Both consume new analytics-api.ts client functions (fetchWalletActivityCalendar, fetchWalletLargestTransfers) against /api/v1/wallets/{address}/activity-calendar and .../largest-transfers (see Stellar-Insightss/backend#52), following the existing fetchWalletBalanceHistory pattern: graceful mock-data fallback when the backend is unreachable, so the dashboard still renders during local development. Fixes a pre-existing `any` type on the balance history state while touching this file.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #28, closes #29.
GET /api/v1/wallets/{address}/activity-calendar— per-UTC-day transaction count for an address, sourced from the ingestedpaymentstable. Boundary is UTC midnight via SQLitedate(), matching the convention noted in Add /api/v1/wallets/{address}/activity-calendar endpoint #28/Add /api/v1/network/daily-active-accounts time-series endpoint #15.GET /api/v1/wallets/{address}/largest-transfers— the address's largest transfers (incoming or outgoing), ranked by USD value via the existing price feed rather than raw asset amount, since comparing a large XLM transfer to a small USDC transfer by raw amount is meaningless (per Add /api/v1/wallets/{address}/largest-transfers endpoint #29's own note). Ranking is computed over the address's most recent 1000 transfers to keep the query and the price-feed conversion pass bounded — documented as aTRANSFER_CANDIDATE_POOLconstant, not silently assumed.PriceFeedClient::with_provider()so handlers that depend on price conversion can be exercised with an injected provider in tests, instead of making real network calls to CoinGecko.Walletstag).Unrelated fixes included
maindid not compile at all on a clean checkout. Since that blocks verifying any change, this PR's first commit repairs four small, unrelated pre-existing syntax bugs that were the direct compile blockers:src/queue/mod.rs: a stray//!inner-doc-comment block mid-file (invalid placement).src/services/realtime_broadcaster.rs,src/shutdown.rs:#[allow(clippy::expect_used)]attributes placed mid method-chain (invalid).src/rpc/stellar.rs: a duplicated/dead code block left inside anelsebranch after areturn, leaving a brace unclosed for the rest of the file.After that fix, the build still fails with ~149 unrelated errors (dependency/API mismatches touching crypto signing, redis, tracing/opentelemetry, HMAC) — filed as #51, intentionally not addressed here since it's a much larger, unrelated cleanup.
Test plan
cargo test/cargo clippylocally — blocked by the pre-existing, unrelated errors tracked in main branch fails to compile: ~149 pre-existing errors across unrelated subsystems #51. New code was reviewed carefully against this repo's existing conventions (Database/ApiError/sqlx::FromRowpatterns fromcorridors.rs,account_merges.rs,db/aggregation.rs; price feed batch API fromprice_feed.rs).cargo test wallets,cargo clippy --lib.GET /api/v1/wallets/{address}/activity-calendar?days=30andGET /api/v1/wallets/{address}/largest-transfers?limit=10against a DB with seededpaymentsrows.