Skip to content

feat(api): expand ExtendedAccount to all 65 on-chain fields - #17

Merged
ety001 merged 1 commit into
masterfrom
feat/extended-account-full-fields
Aug 10, 2026
Merged

feat(api): expand ExtendedAccount to all 65 on-chain fields#17
ety001 merged 1 commit into
masterfrom
feat/extended-account-full-fields

Conversation

@ety001

@ety001 ety001 commented Aug 10, 2026

Copy link
Copy Markdown
Member

What

Expand ExtendedAccount (protocol/api/accounts.go) to carry all 65 keys a live condenser_api.get_accounts response 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's condenser_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.go

  • New Manabar struct for voting_manabar / downvote_manabar (current_mana is a share_type string, last_update_time a uint32).
  • ExtendedAccount extended to the full 65 fields, grouped: original subset, scalar strings, scalar bool/int, Manabar, share_type RawMessage, extended_account collections.
  • Original 8 conveyor-facing fields unchanged (order / type / tag) — backward compatible.

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 (+ typed Manabar replacing the previous RawMessage manabar fields).

Type design — driven by on-chain reality

field(s) Go type reason
voting_manabar / downvote_manabar Manabar {current_mana:string, last_update_time:number}
withdrawn, to_withdraw, curation_rewards, posting_rewards, post_bandwidth json.RawMessage share_type serializes as string or number across nodes
proxied_vsf_votes []json.RawMessage chain emits a mixed array, e.g. ["452574069424",0,0,0]
*_history, tags_usage, guest_bloggers json.RawMessage always [] on chain today; kept raw so a future fill (FC [[k,v],...]) won't break decode

Verification

  • go build ./...
  • go vet ./protocol/api/...
  • go test ./... ✅ (all packages green, no regression)
  • Script cross-check: the struct's json tags match the live response's 65 keys exactly — 0 missing, 0 extra.
  • New TestUnmarshal_ExtendedAccount_FullFixture decodes a real 65-key snapshot and asserts representative fields from every group (including the mixed proxied_vsf_votes array and Manabar round-trip).

Note on the data path

condenser_api.get_accounts is 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.

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.
@ety001
ety001 merged commit a2cad55 into master Aug 10, 2026
3 checks passed
@ety001
ety001 deleted the feat/extended-account-full-fields branch August 10, 2026 01:21
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

Successfully merging this pull request may close these issues.

1 participant