[explorer] feat: add NEM account harvest history endpoint - #2584
Open
cryptoBeliever wants to merge 3 commits into
Open
cryptoBeliever wants to merge 3 commits into
cryptoBeliever wants to merge 3 commits into
Conversation
Problem:
The account page has no way to list the blocks an account harvested.
An `address` filter on /blocks would have been cheaper but would not
carry over: in Symbol the per-account reward lives in the harvestFee
receipts, not on the block row, so the frontend contract would have been
locked to the NEM data model.
Solution:
A chain independent endpoint the Symbol implementation can later serve
from receipts:
GET /api/nem/account/harvests?address=&limit=&offset=&sort=
[{ "height": 1, "timestamp": "...", "amount": 102.0, "type": "harvesting" }]
`address` is required; an account with no harvests returns an empty list
rather than 404, like the other NEM listings.
Blocks are matched on `beneficiary`, not on `signer`. A delegated
harvester signs with its remote account, while the fees and the harvest
counters the puller keeps on `accounts` always go to the beneficiary.
Problem:
The account page has no way to list the blocks an account harvested.
An `address` filter on /blocks would have been cheaper but would not
carry over: in Symbol the per-account reward lives in the harvestFee
receipts, not on the block row, so the frontend contract would have been
locked to the NEM data model.
Solution:
A chain independent endpoint the Symbol implementation can later serve
from receipts:
GET /api/nem/account/harvests?address=&limit=&offset=&sort=
[{ "height": 1, "timestamp": "...", "amount": 102.0, "type": "harvesting" }]
`address` is required; an account with no harvests returns an empty list
rather than 404, like the other NEM listings.
Blocks are matched on `beneficiary`, not on `signer`. A delegated
harvester signs with its remote account, while the fees and the harvest
counters the puller keeps on `accounts` always go to the beneficiary.
Problem:
The account page has no way to list the blocks an account harvested.
An `address` filter on /blocks would have been cheaper but would not
carry over: in Symbol the per-account reward lives in the harvestFee
receipts, not on the block row, so the frontend contract would have been
locked to the NEM data model.
Solution:
A chain independent endpoint the Symbol implementation can later serve
from receipts:
GET /api/nem/account/harvests?address=&limit=&offset=&sort=
[{ "height": 1, "timestamp": "...", "amount": 102.0, "type": "harvesting" }]
`address` is required; an account with no harvests returns an empty list
rather than 404, like the other NEM listings.
Blocks are matched on `beneficiary`, not on `signer`. A delegated
harvester signs with its remote account, while the fees and the harvest
counters the puller keeps on `accounts` always go to the beneficiary.
cryptoBeliever
force-pushed
the
explorer/backend/account-harvests
branch
from
September 18, 2026 15:50
e154146 to
4c0e13d
Compare
Wayonb
requested changes
Sep 22, 2026
|
|
||
| # endregion | ||
|
|
||
|
|
Contributor
There was a problem hiding this comment.
maybe add testing for invalid values for limit, offset, and sort?
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.
Problem
The account page has no way to list the blocks an account harvested.
Adding an
addressfilter to/blockswould have been cheaper, but it wouldnot carry over to Symbol, where the per-account share lives in the
harvestFeereceipts rather than on the block row. That would have locked the frontend
contract to the NEM data model.
Solution
A dedicated endpoint whose response shape is chain independent, so a Symbol
implementation can later serve the same contract from receipts:
[{ "height": 1, "timestamp": "2015-03-29 00:06:25", "amount": 102.0, "type": "harvesting" }]addresslimitoffsetsortDESCrewardedOnlyfalseAn account with no harvests returns an empty list.
rewardedOnlydefaults tofalseso the endpoint staystruthful - leaving rows out is an opt-in decision for the caller.
Blocks are matched on beneficiary, not on signer
A delegated harvester signs with its remote account, while the fees - and the
harvested_fees,harvested_blocksandlast_harvested_heightcounters thepuller keeps on
accounts- always go to the beneficiary. Matching on thesigner would leave a delegating account with an empty list next to a non-zero
harvested block count for the same account.
NEM has no inflation or block subsidy, so the block fee is the whole reward.