Skip to content

Commit

Permalink
Merge pull request #385 from tangem/merge_5.2.1_dev
Browse files Browse the repository at this point in the history
Merge 5.2.1 dev
  • Loading branch information
kozarezvlad authored Nov 24, 2023
2 parents 3c3afc5 + 75f5b71 commit 39f05b8
Showing 1 changed file with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,23 @@ class RavencoinNetworkProvider(
}

override suspend fun getFee(): Result<BitcoinFee> {
val feeResponse = api.getFee(numberOfBlocks = FEE_NUMBER_OF_BLOCKS)
val feePerKb = feeResponse["$FEE_NUMBER_OF_BLOCKS"] ?: return Result.Failure(BlockchainSdkError.FailedToLoadFee)
val minimalRate = feePerKb * BigDecimal.valueOf(1.1)
val normalRate = feePerKb * BigDecimal.valueOf(1.3)
val priorityRate = feePerKb * BigDecimal.valueOf(1.5)
return Result.Success(
BitcoinFee(
minimalPerKb = minimalRate,
normalPerKb = normalRate,
priorityPerKb = priorityRate,
try {
val feeResponse = api.getFee(numberOfBlocks = FEE_NUMBER_OF_BLOCKS)
val feePerKb =
feeResponse["$FEE_NUMBER_OF_BLOCKS"] ?: return Result.Failure(BlockchainSdkError.FailedToLoadFee)
val minimalRate = feePerKb * BigDecimal.valueOf(1.1)
val normalRate = feePerKb * BigDecimal.valueOf(1.3)
val priorityRate = feePerKb * BigDecimal.valueOf(1.5)
return Result.Success(
BitcoinFee(
minimalPerKb = minimalRate,
normalPerKb = normalRate,
priorityPerKb = priorityRate,
)
)
)
} catch (e: Exception) {
return Result.Failure(e.toBlockchainSdkError())
}
}

override suspend fun sendTransaction(transaction: String): SimpleResult {
Expand Down

0 comments on commit 39f05b8

Please sign in to comment.