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

Add support to return token balances for an account and contract account #144

Open
SimiHunjan opened this issue Nov 20, 2023 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@SimiHunjan
Copy link
Collaborator

Problem

HIP: https://hips.hedera.com/hip/hip-367

The token balances (tokens that are created via Hedera Token Service) information for accounts and smart contract accounts have been deprecated. This needs to be replaced with the mirror node API that provides the data.

The fields in the SDKs were deprecated for the HAPI queries that were impacted:

HAPI

Account Balance Query:

  • repeated TokenBalance tokenBalances = 4

Account Info Query:

  • repeated TokenRelationship tokenRelationships = 15

Contract Info Query:

  • repeated TokenRelationship tokenRelationships = 11;

hashgraph/hedera-sdk-java#1053

hashgraph/hedera-sdk-js#1192

Mirror node released a REST API that provides the token relationships information that was deprecated in the Hedera APIs (protobufs).

hashgraph/hedera-mirror-node#4142

https://mainnet-public.mirrornode.hedera.com/api/v1/docs/#/tokens/listTokenBalancesById

https://mainnet-public.mirrornode.hedera.com/api/v1/docs/#/accounts/listTokenRelationshipByAccountId

Goal

The SDK should still support returning the token balances for the queries that deprecated the field for token balances, but instead of querying the data from consensus nodes, they should use the mirror node rest API

Solution

Propose a design for returning token balances from the mirror node API.

Alternatives

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant