diff --git a/service/src/main/kotlin/io/provenance/explorer/service/TokenService.kt b/service/src/main/kotlin/io/provenance/explorer/service/TokenService.kt index c1821666..a3ea7d65 100644 --- a/service/src/main/kotlin/io/provenance/explorer/service/TokenService.kt +++ b/service/src/main/kotlin/io/provenance/explorer/service/TokenService.kt @@ -31,7 +31,6 @@ import io.provenance.explorer.domain.extensions.toCoinStr import io.provenance.explorer.domain.extensions.toOffset import io.provenance.explorer.domain.extensions.toPercentage import io.provenance.explorer.domain.models.explorer.DlobHistBase -import io.provenance.explorer.domain.models.explorer.DlobHistorical import io.provenance.explorer.domain.models.explorer.TokenHistoricalDataRequest import io.provenance.explorer.grpc.v1.AccountGrpcClient import io.provenance.explorer.model.AssetHolder @@ -70,7 +69,7 @@ class TokenService(private val accountClient: AccountGrpcClient) { AccountRecord.saveAccount( it.ownerAddress, PROV_ACC_PREFIX, - accountClient.getAccountInfo(it.ownerAddress) + accountClient.getAccountInfo(it.ownerAddress), ) }.collect() TokenDistributionPaginatedResultsRecord.savePaginatedResults(records) @@ -96,7 +95,7 @@ class TokenService(private val accountClient: AccountGrpcClient) { denom: String, page: Int, count: Int, - retryCount: Int = 3 + retryCount: Int = 3, ): PagedResults { var hasSucceeded = false var numberOfTriesRemaining = retryCount @@ -132,7 +131,7 @@ class TokenService(private val accountClient: AccountGrpcClient) { Triple(50, 50, "51-100"), Triple(500, 100, "101-500"), Triple(500, 500, "501-1000"), - Triple("ALL", 1000, "1001-") + Triple("ALL", 1000, "1001-"), ).map { (limit, offset, range) -> val results = TokenDistributionPaginatedResultsRecord.findByLimitOffset(richListAccounts(), limit, offset) val denom = results[0].data.denom @@ -154,7 +153,7 @@ class TokenService(private val accountClient: AccountGrpcClient) { circulatingSupply().toCoinStr(UTILITY_TOKEN), communityPoolSupply().toCoinStr(UTILITY_TOKEN), bonded, - burnedSupply().toCoinStr(UTILITY_TOKEN) + burnedSupply().toCoinStr(UTILITY_TOKEN), ) } @@ -171,8 +170,7 @@ class TokenService(private val accountClient: AccountGrpcClient) { runBlocking { accountClient.getCommunityPoolAmount(UTILITY_TOKEN).toBigDecimal().roundWhole() } fun richListAccounts() = - allAccounts().addressList() - zeroSeqAccounts().toSet() - moduleAccounts().addressList() - - contractAccounts().addressList() - setOf(nhashMarkerAddr()) + allAccounts().addressList() - zeroSeqAccounts().toSet() - moduleAccounts().addressList() - contractAccounts().addressList() - setOf(nhashMarkerAddr()) fun totalBalanceForList(addresses: Set) = runBlocking { TokenDistributionPaginatedResultsRecord.findByAddresses(addresses).asFlow() @@ -218,7 +216,7 @@ class TokenService(private val accountClient: AccountGrpcClient) { RichAccount( it.ownerAddress, CoinStr(it.data.count, it.data.denom), - it.data.count.toPercentage(BigDecimal(100), totalSupply, 4) + it.data.count.toPercentage(BigDecimal(100), totalSupply, 4), ) } }