const { frontiers } = await rpc.post('accounts_frontiers', data)
const { blocks } = await rpc.post('blocks_info', { json_block: true, include_not_found: true, hashes: Object.values(frontiers ?? {}) })
for (const account of accounts.values()) {
+ const reqAccountInfo: AccountInfoRequest = {
+ account: account.address,
+ include_confirmed: true,
+ receivable: true,
+ representative: true,
+ weight: true
+ }
+ const accountInfo = await rpc.post('account_info', reqAccountInfo)
+ for (const [k, v] of Object.entries(accountInfo)) {
+ account[k] = v
+ }
account.balance = balances?.[account.address]?.balance ?? 0
account.receivable = balances?.[account.address]?.receivable ?? 0
if (frontiers?.[account.address] != null) {
if (typeof frontierBlock[subtype] !== 'function') {
throw new TypeError('Unknown frontier block subtype', { cause: subtype })
}
- frontierBlock[subtype](link === BURN_PUBLIC_KEY ? representative : link, 0).signature = signature
+ const arg = subtype === 'epoch' ? account.version : subtype === 'change' ? representative : link
+ frontierBlock[subtype](arg, 0).signature = signature
account.frontier_block = frontierBlock
}
}