if (typeof confirmedFrontierBlock[confirmedFrontierSubtype] !== 'function') {
throw new TypeError('Unknown subtype of confirmed frontier block', { cause: confirmedFrontierSubtype })
}
- confirmedFrontierBlock[confirmedFrontierSubtype](confirmedFrontierContents.link, 0).sign(confirmedFrontierContents.signature)
+ confirmedFrontierBlock[confirmedFrontierSubtype](confirmedFrontierContents.link, 0).signature = confirmedFrontierContents.signature
account.confirmed_frontier_block = confirmedFrontierBlock
const reqFrontier = {
if (typeof frontierBlock[frontierSubtype] !== 'function') {
throw new TypeError('Unknown subtype of frontier block', { cause: frontierSubtype })
}
- frontierBlock[frontierSubtype](frontierContents.link, 0).sign(frontierContents.signature)
+ frontierBlock[frontierSubtype](frontierContents.link, 0).signature = frontierContents.signature
account.frontier_block = frontierBlock
}
if (from > to) [from as number, to as number] = [to, from]
const accounts = await wallet.accounts(from, to)
const addresses = []
- for (const [index, account] of accounts) {
+ for (const account of accounts.values()) {
addresses.push(account.address)
}
const data = {
const { frontiers } = await rpc.post('accounts_frontiers', data) as { frontiers: { [address: string]: string } }
const { representatives } = await rpc.post('accounts_representatives', data) as { representatives: { [address: string]: string } }
const { blocks } = await rpc.post('blocks_info', { json_block: true, hashes: Object.values(frontiers) }) as BlockInfo
- for (const [index, account] of accounts) {
+ for (const account of accounts.values()) {
account.balance = balances[account.address]?.balance
account.receivable = balances[account.address]?.receivable
account.representative = representatives?.[account.address]
if (typeof frontierBlock[subtype] !== 'function') {
throw new TypeError('Unknown frontier block subtype', { cause: subtype })
}
- frontierBlock[subtype](link, 0).sign(signature)
+ frontierBlock[subtype](link, 0).signature = signature
account.frontier_block = frontierBlock
}
}
const to = from + batchSize
const accounts = await wallet.accounts(from, to - 1)
const addresses = []
- for (const [index, account] of accounts) {
+ for (const account of accounts.values()) {
addresses.push(account.address)
}
const data = {
assert.exists(accounts)
assert.equal(accounts.size, 2)
- for (const [index, account] of accounts) {
+ for (const account of accounts.values()) {
assert.ok(account instanceof Account)
assert.exists(account.address)
assert.exists(account.publicKey)
const accounts = await wallet.refresh(rpc, 0, 2)
assert.exists(accounts)
- for (const [index, account] of accounts) {
+ for (const account of accounts.values()) {
assert.ok(account instanceof Account)
assert.exists(account.address)
assert.exists(account.publicKey)