Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
)
// get a bunch of fresh addresses
const rawAddresses = await timeoutTagged(
'getFreshPublicAddresses',
10000,
njsAccount.getFreshPublicAddresses(),
)
const addresses = rawAddresses.map(njsAddress => ({
str: njsAddress.toString(),
path: `${accountPath}/${njsAddress.getDerivationPath()}`,
}))
if (addresses.length === 0) {
throw new NoAddressesFound()
}
const { str: freshAddress, path: freshAddressPath } = addresses[0]
ops.sort((a, b) => b.getDate() - a.getDate())
const operations = ops.map(op => buildOperationRaw({ core, op, xpub }))
const name =
operations.length === 0
? getNewAccountPlaceholderName({ currency, index: accountIndex, derivationMode })
: getAccountPlaceholderName({
currency,
index: accountIndex,
derivationMode,
})