feat(api): expand ExtendedAccount to all 65 on-chain fields - #17
Merged
Conversation
ExtendedAccount previously covered only the 51 fields listed in the expansion spec (the original 8 conveyor-facing fields plus 43 more). A live condenser_api.get_accounts(["steemit"]) response actually returns 65 keys, matching steemd's condenser_api::api_account_object (58) + extended_account (7). This adds the missing 14 fields so steemdb-sync's account refresher can capture a complete account snapshot in a single decode. Field typing follows the on-chain reality, verified against a live response and steemd source: - voting_manabar/downvote_manabar -> typed Manabar struct (current_mana is a share_type string, last_update_time a uint32) - withdrawn/to_withdraw/curation_rewards/posting_rewards/post_bandwidth -> json.RawMessage; share_type serializes as string or number depending on node/version, so a typed field would fail on one - proxied_vsf_votes -> []json.RawMessage; the chain emits a MIXED array (e.g. ["452574069424",0,0,0]), impossible to type as a slice - *_history/tags_usage/guest_bloggers -> json.RawMessage; currently always empty [] on chain, kept raw so a future steemd that fills them (FC serializes map<uint64,T> as [[k,v],...]) won't break decode The original 8 conveyor-facing fields (name, created, reputation, voting_power, balance, posting, active, owner) keep their order, types, and tags unchanged for backward compatibility. jussi does not rewrite get_accounts responses (it's not in the special upstream/rewrite list, only TTL-cached), so the JSON the SDK sees is steemd's verbatim. Adds TestUnmarshal_ExtendedAccount_FullFixture: a 65-key real snapshot decoded end-to-end, asserting representative fields from every group, including the mixed proxied_vsf_votes array and Manabar round-trip.
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.
What
Expand
ExtendedAccount(protocol/api/accounts.go) to carry all 65 keys a livecondenser_api.get_accountsresponse returns, so steemdb-sync's account refresher can capture a complete account snapshot in a single decode.Previously the struct covered only 51 fields (the original 8 conveyor-facing fields + 43 from the expansion spec). A real
get_accounts(["steemit"])returns 65 keys, matching steemd'scondenser_api::api_account_object(58) +extended_account(7).Why
steemdb-sync's golang account refresher needs the full chain state per account. The expansion spec's field list was missing 14 fields, and several of its type assumptions diverged from what the chain actually emits.
Changes
protocol/api/accounts.goManabarstruct forvoting_manabar/downvote_manabar(current_manais a share_type string,last_update_timea uint32).ExtendedAccountextended to the full 65 fields, grouped: original subset, scalar strings, scalar bool/int, Manabar, share_type RawMessage, extended_account collections.Added fields (14)
id,savings_withdraw_requests,reward_sbd_balance,reward_steem_balance,reward_vesting_balance,reward_vesting_steem,transfer_history,market_history,post_history,vote_history,other_history,tags_usage,guest_bloggers(+ typedManabarreplacing the previous RawMessage manabar fields).Type design — driven by on-chain reality
voting_manabar/downvote_manabarManabar{current_mana:string, last_update_time:number}withdrawn,to_withdraw,curation_rewards,posting_rewards,post_bandwidthjson.RawMessageproxied_vsf_votes[]json.RawMessage["452574069424",0,0,0]*_history,tags_usage,guest_bloggersjson.RawMessage[]on chain today; kept raw so a future fill (FC[[k,v],...]) won't break decodeVerification
go build ./...✅go vet ./protocol/api/...✅go test ./...✅ (all packages green, no regression)TestUnmarshal_ExtendedAccount_FullFixturedecodes a real 65-key snapshot and asserts representative fields from every group (including the mixedproxied_vsf_votesarray and Manabar round-trip).Note on the data path
condenser_api.get_accountsis not in jussi's special upstream/rewrite list — it is only TTL-cached, so the JSON the SDK sees is steemd's verbatim output. No jussi-side field changes to account for.Related: steemdb-sync account refresher.