Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ft holder indexing #2030

Merged
merged 5 commits into from
Jul 15, 2024
Merged

feat: ft holder indexing #2030

merged 5 commits into from
Jul 15, 2024

Conversation

zone117x
Copy link
Member

@zone117x zone117x commented Jul 11, 2024

Closes #1985
Implements indexing code to track (FT, account) balances

This data is exposed in a new endpoint:

/extended/v1/tokens/ft/{token}/holders

Examples
GET /extended/v1/tokens/ft/stx/holders

{
  "limit": 100,
  "offset": 0,
  "total": 3,
  "total_supply": "11700",
  "results": [
    {
      "address": "SP3Y2ZSH8P7D50B0VBTSX11S7XSG24M1VB9YFQA2K",
      "balance": "10000"
    },
    {
      "address": "SP3WJYXJZ4QK2V5V9VX2VXVZ6VXVZ6V2V5V2V2V2V",
      "balance": "900"
    },
    {
      "address": "SP3WJYXJZ4QK2V5V9VX2VXVZ6VXVZ6V2V5V2V2V2V",
      "balance": "800"
    }
  ]
}

Copy link

github-actions bot commented Jul 11, 2024

Vercel deployment URL: https://stacks-blockchain-jzaqvt3y4-hirosystems.vercel.app 🚀

Copy link

codecov bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@zone117x zone117x marked this pull request as ready for review July 11, 2024 15:08
Copy link
Collaborator

@rafaelcr rafaelcr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Looks great, just a couple questions

src/api/routes/tokens.ts Outdated Show resolved Hide resolved
notNull: true,
},
balance: {
type: 'numeric',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming this is the raw number without the metadata decimals for each token, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep that is correct

Copy link
Collaborator

@janniks janniks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to Rafael's notes

src/datastore/pg-write-store.ts Outdated Show resolved Hide resolved
@zone117x zone117x changed the title feat: stx holder indexing feat: ft holder indexing Jul 12, 2024
@zone117x zone117x merged commit 815c16f into develop Jul 15, 2024
29 checks passed
@zone117x zone117x deleted the feat/stx-holders branch July 15, 2024 09:01
blockstack-devops pushed a commit that referenced this pull request Jul 15, 2024
## [7.13.0-beta.1](v7.12.0...v7.13.0-beta.1) (2024-07-15)

### Features

* ft holder indexing ([#2030](#2030)) ([815c16f](815c16f))
@blockstack-devops
Copy link

🎉 This PR is included in version 7.13.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

blockstack-devops pushed a commit that referenced this pull request Jul 18, 2024
## [7.13.0](v7.12.0...v7.13.0) (2024-07-18)

### Features

* ft holder indexing ([#2030](#2030)) ([815c16f](815c16f))

### Bug Fixes

* `/v2/addresses/{addr}/transactions` incorrect when address only involved with token events ([#2033](#2033)) ([1d9d0a6](1d9d0a6))
@blockstack-devops
Copy link

🎉 This PR is included in version 7.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add endpoint for holder data
4 participants