syntheticProviderCSPLocations = {
if (!funderTreeWithDelegates) return
const providerLocationsWithDelegates = []
for (const provider of funderTreeWithDelegates.leaves()) {
const { miner_id: providerId, delegateId } = provider.data
const targetId = delegateId || providerId
const targetLocations = providerCSPLocations.get(targetId)
if (targetLocations) {
for (const location of targetLocations) {
const { miner, ...rest } = location
const outputLocation = {
provider: providerId,
...rest
}
if (delegateId) {
outputLocation.delegate = delegateId
}
providerLocationsWithDelegates.push(outputLocation)
}
}
}
return providerLocationsWithDelegates.sort(sortProviderRecords)
}