lightninglabs / lightninglabs/taproot-assets
[feature]: Address balance display or height-based transfer list
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 525
- Forks
- 150
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 31
Description
Is your feature request related to a problem? Please describe.
Currently, I am unable to directly query the balance of specific addresses in my wallet. To obtain address balance information, I have to manually iterate through transfer records at each block height, then parse the input and output addresses of each transfer to calculate the balance. This process is very cumbersome and inefficient, especially when I need to monitor address balances in real-time or develop wallet-related features.
Describe the solution you'd like
I would like to propose one of the following two interface solutions:
-
Address Balance Query Interface: Provide an interface that can directly query the balance of a specified address, for example:
GetAddressBalance(address), returning the current asset balance of that address. -
Height-filtered Transfers Interface: If a direct balance query is not feasible, please provide a transfer query interface filtered by block height, for example:
ListTransfersByHeight(height), returning all transfer records related to my wallet at the specified block height. This would allow me to calculate address balances by analyzing these transfer records myself.
Describe alternatives you've considered
The alternative solutions I have considered are:
- Using the existing
ListTransfersinterface to get all transfer records, then filtering and analyzing them locally by block height and address. - Building my own indexing system to track and calculate address balances.
However, both solutions have efficiency issues and become difficult to maintain as transaction volume increases.
Additional context
This feature is crucial for the following scenarios:
- Developing user-friendly wallet interfaces that display address balances in real-time.
- Displaying address asset information when building a block explorer.
- Quickly querying transfer records at specific heights for transaction monitoring and auditing purposes.
As a Taproot Assets user, I believe this feature would significantly improve both the developer experience and end-user convenience.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing ListTransfers interface and the wallet transfer-handling entry points. Decide whether the feature should provide direct address-balance queries or height-filtered transfers; done means the selected interface supports the stated wallet and monitoring use cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100