From b14679ef6703be5265f6970f93f06cb4e8ee76e1 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sat, 8 Aug 2026 08:54:17 -0700 Subject: [PATCH] Start fixing Sony version required for epoch blocks during refresh. --- src/lib/wallet/refresh.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lib/wallet/refresh.ts b/src/lib/wallet/refresh.ts index 23a9ac9..5b15b77 100644 --- a/src/lib/wallet/refresh.ts +++ b/src/lib/wallet/refresh.ts @@ -33,6 +33,17 @@ export async function _refresh (wallet: Wallet, rpc: unknown, from: unknown, to: 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) { @@ -44,7 +55,8 @@ export async function _refresh (wallet: Wallet, rpc: unknown, from: unknown, to: 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 } } -- 2.52.0