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

As a User, I want to create a list of accounts eligible to receive my airdrop #1

Open
StanislawMazowieckiAriane opened this issue Mar 1, 2024 · 0 comments

Comments

@StanislawMazowieckiAriane
Copy link
Contributor

Acceptance criteria:

  • The app should take tokenId and a list of account ids as input
  • The app should return an array of filtered account ids
  • There is a documentation on how to use this function
  • The code is unit and end2end tested
  • The app is hosted on GitHub pages

flow:

  1. I want to pass a list of 100 account ids and tokenId.
  2. The app checks if these accounts have associated with token id OR have available auto association slots
  3. The app returns a filtered list of account ids that can successfully receive my token.

How to check if account is associated with token id:

For each accountId in the list query the mirror node for balance of given token id https://mainnet-public.mirrornode.hedera.com/api/v1/tokens/0.0.3103996/balances?account.id=0.0.3854868
If balances length is more than 0, then the user is associated

How to check for available auto association slots:

Image

This way, you can determine how many automatic associations the user has used and compare it with the max_automatic_token_associations value.

If max_automatic_token_associations is greater than count of current automatic associations, then there are still some automatic associations slots left.

Context:
Image

@StanislawMazowieckiAriane StanislawMazowieckiAriane converted this from a draft issue Mar 1, 2024
@StanislawMazowieckiAriane StanislawMazowieckiAriane moved this from In Progress to Code review in Hedera-NFT-SDK Mar 5, 2024
@StanislawMazowieckiAriane StanislawMazowieckiAriane moved this from Code review to Done in Hedera-NFT-SDK Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant