feat: add per-principal fungible token transfer history endpoint - #2646
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds per-principal, per-token fungible-token transfer history with cursor pagination.
Changes:
- Adds the v3 endpoint, schema, serializer, and datastore query.
- Adds optimized FT event indexes.
- Adds integration coverage for filtering, pagination, self-transfers, and reorgs.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/api/v3/principal-ft-transfers.test.ts |
Tests the new endpoint. |
src/datastore/v3/types.ts |
Defines the transfer database model. |
src/datastore/v3/pg-store-v3.ts |
Implements transfer retrieval and pagination. |
src/api/serializers/v3/ft-transfers.ts |
Serializes transfer records. |
src/api/schemas/v3/entities/principal-ft-transfers.ts |
Defines the response schema. |
src/api/routes/v3/principals.ts |
Registers the endpoint. |
migrations/1779800000012_ft-events-principal-asset-indexes.ts |
Adds query-supporting indexes. |
migrations/1779800000011_ft-balances-token-balance-address-index.ts |
Reformats migration documentation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
fabrizio-stacks
approved these changes
Aug 28, 2026
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.
Adds a per-principal, per-token FT transfer history endpoint.
{ "total": 4, "limit": 20, "cursor": { "next": null, "previous": null, "current": "2:0:0:1" }, "results": [ { "sender": "SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP", "recipient": null, "amount": "1000", "transaction": { "tx_id": "0x…c2", "event_index": 1 }, "block": { "height": 2, "hash": "0x…a2", "index_hash": "0x…b2", "time": 94869287, "tx_index": 0 } }, { "sender": "SP2X0TZ59D5SZ8ACQ6YMCHHNR2ZN51Z32E2CJ173", "recipient": "SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP", "amount": "12000000", "transaction": { "tx_id": "0x…c2", "event_index": 0 }, "block": { "height": 2, "hash": "0x…a2", "index_hash": "0x…b2", "time": 94869287, "tx_index": 0 } }, { "sender": "SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP", "recipient": "SP1JTCR202ECC6333N7ZXD7MK7E3ZTEEE1MJ73C60.pool-v1", "amount": "75250000", "transaction": { "tx_id": "0x…c1", "event_index": 1 }, "block": { "height": 1, "hash": "0x…a1", "index_hash": "0x…b1", "time": 94869287, "tx_index": 0 } }, { "sender": null, "recipient": "SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP", "amount": "250000000", "transaction": { "tx_id": "0x…c1", "event_index": 0 }, "block": { "height": 1, "hash": "0x…a1", "index_hash": "0x…b1", "time": 94869287, "tx_index": 0 } } ] }