account.receivable = balances?.[account.address]?.receivable ?? 0
if (frontiers[account.address] != null) {
account.frontier = frontiers[account.address]
- const { subtype, contents: { balance, link, previous, representative, signature } } = blocks[account.frontier]
+ const { subtype } = blocks[account.frontier]
if (!['change', 'epoch', 'open', 'receive', 'send'].includes(subtype)) {
- throw new RangeError('Invalid subtype for account frontier block', { cause: subtype })
- }
+ throw new RangeError('Invalid subtype for account frontier block', { cause: subtype })
+ }
+ const frontierContents: Record<string, string> = {}
+ for (const [k, v] of Object.entries(blocks[account.frontier].contents)) {
+ if (Schema.block_info.contents.fields.includes(k) && typeof v === 'string') {
+ frontierContents[k] = v
+ }
+ }
+ const { balance, link, previous, representative, signature } = frontierContents
account.representative = representative
const frontierBlock = new Block(account, balance, previous, representative)
if (typeof frontierBlock[subtype] !== 'function') {