Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ final class IdentityTopUpViewModel: ObservableObject {
static func estimatedFeeCredits(source: FundingSource) -> UInt64 {
let unshieldFee: UInt64
if source == .shielded {
unshieldFee = (try? PlatformWalletManager.estimateShieldedFee(kind: .unshield, numActions: 2)) ?? 0
unshieldFee = (try? SwiftDashSDKHost.shared.manager?.estimateShieldedFee(kind: .unshield, numActions: 2)) ?? 0
} else {
unshieldFee = 0
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,11 @@ struct InternalTransferConfirmSheet: View {
case .platformToShielded:
// Shield (Type 15): base shielded fee. Real metered storage is
// extra and only knowable on-chain, so this is a lower bound.
return try? PlatformWalletManager.estimateShieldedFee(kind: .transfer, numActions: 2)
return try? SwiftDashSDKHost.shared.manager?.estimateShieldedFee(kind: .transfer, numActions: 2)
case .shieldedToCore:
return try? PlatformWalletManager.estimateShieldedFee(kind: .withdrawal, numActions: 2)
return try? SwiftDashSDKHost.shared.manager?.estimateShieldedFee(kind: .withdrawal, numActions: 2)
case .shieldedToPlatform:
return try? PlatformWalletManager.estimateShieldedFee(kind: .unshield, numActions: 2)
return try? SwiftDashSDKHost.shared.manager?.estimateShieldedFee(kind: .unshield, numActions: 2)
case .coreToPlatform:
// Address-funding asset lock: the required processing balance
// (the same 50k-duff base the Rust side reserves for address
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ enum CoreToShieldedAmountPolicy {
static let assetLockBaseCostCredits: UInt64 = 50_000_000

static var poolFeeCredits: UInt64? {
guard let shieldedFee = try? PlatformWalletManager.estimateShieldedFee(
guard let shieldedFee = try? SwiftDashSDKHost.shared.manager?.estimateShieldedFee(
kind: .transfer,
numActions: 2)
else { return nil }
Expand Down Expand Up @@ -886,11 +886,11 @@ final class InternalTransferViewModel: ObservableObject {
// (`ShieldedActionBudget.maxActionsPerTransition`) so a fragmented
// wallet can't pass the affordability check and then fail SDK note
// selection.
return try? PlatformWalletManager.estimateShieldedFee(
return try? SwiftDashSDKHost.shared.manager?.estimateShieldedFee(
kind: .withdrawal,
numActions: ShieldedActionBudget.maxActionsPerTransition)
case .shieldedToPlatform:
return try? PlatformWalletManager.estimateShieldedFee(
return try? SwiftDashSDKHost.shared.manager?.estimateShieldedFee(
kind: .unshield,
numActions: ShieldedActionBudget.maxActionsPerTransition)
case .platformToCore:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ final class ShieldedTransferCoordinator: ObservableObject {
guard allCredits != UInt64.max else { return .unavailable }

let feeForActions: (Int) -> UInt64? = { actionCount in
try? PlatformWalletManager.estimateShieldedFee(
try? SwiftDashSDKHost.shared.manager?.estimateShieldedFee(
kind: feeKind,
numActions: actionCount)
}
Expand Down
8 changes: 4 additions & 4 deletions DashWallet/Sources/UI/Payments/Pay/SendScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -943,13 +943,13 @@ struct SendConfirmSheet: View {
// The Type 15 shield is an output-only bundle padded to exactly
// 2 actions, charged the flat base fee — same number the Rust
// side reserves on input 0.
return try? PlatformWalletManager.estimateShieldedFee(kind: .transfer, numActions: 2)
return try? SwiftDashSDKHost.shared.manager?.estimateShieldedFee(kind: .transfer, numActions: 2)
case .shieldedToCore:
return try? PlatformWalletManager.estimateShieldedFee(kind: .withdrawal, numActions: 2)
return try? SwiftDashSDKHost.shared.manager?.estimateShieldedFee(kind: .withdrawal, numActions: 2)
case .shieldedToPlatform:
return try? PlatformWalletManager.estimateShieldedFee(kind: .unshield, numActions: 2)
return try? SwiftDashSDKHost.shared.manager?.estimateShieldedFee(kind: .unshield, numActions: 2)
case .shieldedToShielded:
return try? PlatformWalletManager.estimateShieldedFee(kind: .transfer, numActions: 2)
return try? SwiftDashSDKHost.shared.manager?.estimateShieldedFee(kind: .transfer, numActions: 2)
case .coreToCore:
// Never presented here — the L1 processor shows the real fee.
return nil
Expand Down
6 changes: 3 additions & 3 deletions DashWallet/Sources/UI/Payments/Pay/SendViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -569,15 +569,15 @@ final class SendViewModel: ObservableObject {
case .shieldedToCore:
// Worst-case note selection for a bundle the size limit actually
// admits — same reasoning as the internal transfer's reserve.
return try? PlatformWalletManager.estimateShieldedFee(
return try? SwiftDashSDKHost.shared.manager?.estimateShieldedFee(
kind: .withdrawal,
numActions: ShieldedActionBudget.maxActionsPerTransition)
case .shieldedToPlatform:
return try? PlatformWalletManager.estimateShieldedFee(
return try? SwiftDashSDKHost.shared.manager?.estimateShieldedFee(
kind: .unshield,
numActions: ShieldedActionBudget.maxActionsPerTransition)
case .shieldedToShielded:
return try? PlatformWalletManager.estimateShieldedFee(
return try? SwiftDashSDKHost.shared.manager?.estimateShieldedFee(
kind: .transfer,
numActions: ShieldedActionBudget.maxActionsPerTransition)
}
Expand Down
Loading