commit fc9bb3cf0e37150ec939b8aa4aabb0c4fe99566d parent 4c12077c7eb6db009feb8682614fdd1708846d8a Author: Marc Stibane <marc@taler.net> Date: Mon, 15 Apr 2024 19:50:11 +0200 noFees Diffstat:
7 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/TalerWallet1/Backend/WalletBackendRequest.swift b/TalerWallet1/Backend/WalletBackendRequest.swift @@ -31,7 +31,7 @@ struct ScopeInfo: Codable, Hashable { case auditor } var type: ScopeInfoType - var hasNoFees: Bool? // only for "global". Regional have this field per Exchange + var noFees: Bool? // only for "global". Regional have this field per Exchange var url: String? // only for "exchange" var currency: String // 3-char ISO 4217 code for global currency. Regional MUST be >= 4 letters diff --git a/TalerWallet1/Model/Model+Exchange.swift b/TalerWallet1/Model/Model+Exchange.swift @@ -48,13 +48,16 @@ struct Exchange: Codable, Hashable, Identifiable { } var exchangeBaseUrl: String + var masterPub: String var scopeInfo: ScopeInfo var paytoUris: [String] var tosStatus: ExchangeTosStatus var exchangeEntryStatus: ExchangeEntryStatus var exchangeUpdateStatus: ExchangeUpdateStatus - var hasNoFees: Bool? + var peerPaymentsDisabled: Bool? + var noFees: Bool? var ageRestrictionOptions: [Int] + var lastUpdateTimestamp: Timestamp? var lastUpdateErrorInfo: ExchangeError? var id: String { exchangeBaseUrl } diff --git a/TalerWallet1/Views/Banking/DepositAmountV.swift b/TalerWallet1/Views/Banking/DepositAmountV.swift @@ -31,7 +31,7 @@ struct DepositAmountV: View { @State private var feeStr: String = EMPTYSTRING @State private var depositStarted = false @State private var amountShortcut = Amount.zero(currency: EMPTYSTRING) // Update currency when used - @State private var exchange: Exchange? = nil // wg. hasNoFees + @State private var exchange: Exchange? = nil // wg. noFees private func fee(ppCheck: PrepareDepositResult?) -> Amount? { do { @@ -48,7 +48,7 @@ struct DepositAmountV: View { var feeLabel: String { feeStr.count > 0 ? String(localized: "+ \(feeStr) fee") : EMPTYSTRING } private func feeIsNotZero() -> Bool? { - if let hasNoFees = exchange?.hasNoFees { + if let hasNoFees = exchange?.noFees { if hasNoFees { return nil // this exchange never has fees } diff --git a/TalerWallet1/Views/Banking/ExchangeRowView.swift b/TalerWallet1/Views/Banking/ExchangeRowView.swift @@ -83,6 +83,7 @@ fileprivate struct ExchangeRow_Container : View { var body: some View { let scopeInfo = ScopeInfo(type: .exchange, currency: LONGCURRENCY) let exchange1 = Exchange(exchangeBaseUrl: ARS_AGE_EXCHANGE, + masterPub: "masterPub", scopeInfo: scopeInfo, paytoUris: [], tosStatus: .pending, @@ -90,6 +91,7 @@ fileprivate struct ExchangeRow_Container : View { exchangeUpdateStatus: .initial, ageRestrictionOptions: [12,16]) let exchange2 = Exchange(exchangeBaseUrl: ARS_EXP_EXCHANGE, + masterPub: "masterPub", scopeInfo: scopeInfo, paytoUris: [], tosStatus: .proposed, diff --git a/TalerWallet1/Views/Banking/ManualWithdrawDone.swift b/TalerWallet1/Views/Banking/ManualWithdrawDone.swift @@ -72,6 +72,7 @@ struct ManualWithdrawDone_Container : View { var body: some View { let scopeInfo = ScopeInfo(type: .exchange, currency: LONGCURRENCY) let exchange = Exchange(exchangeBaseUrl: DEMOEXCHANGE, + masterPub: "masterPub", scopeInfo: scopeInfo, paytoUris: [], tosStatus: .pending, diff --git a/TalerWallet1/Views/Peer2peer/RequestPayment.swift b/TalerWallet1/Views/Peer2peer/RequestPayment.swift @@ -23,14 +23,14 @@ struct RequestPayment: View { @State private var expireDays: UInt = 0 @State private var buttonSelected = false @State private var amountShortcut = Amount.zero(currency: EMPTYSTRING) // Update currency when used - @State private var exchange: Exchange? = nil // wg. hasNoFees + @State private var exchange: Exchange? = nil // wg. noFees private func shortcutAction(_ shortcut: Amount) { amountShortcut = shortcut buttonSelected = true } private func feeIsNotZero() -> Bool? { - if let hasNoFees = exchange?.hasNoFees { + if let hasNoFees = exchange?.noFees { if hasNoFees { return nil // this exchange never has fees } diff --git a/TalerWallet1/Views/Peer2peer/SendAmount.swift b/TalerWallet1/Views/Peer2peer/SendAmount.swift @@ -30,7 +30,7 @@ struct SendAmount: View { @State private var buttonSelected = false @State private var shortcutSelected = false @State private var amountShortcut = Amount.zero(currency: EMPTYSTRING) // Update currency when used - @State private var exchange: Exchange? = nil // wg. hasNoFees + @State private var exchange: Exchange? = nil // wg. noFees private func fee(ppCheck: CheckPeerPushDebitResponse?) -> Amount? { do { @@ -54,7 +54,7 @@ struct SendAmount: View { buttonSelected = true } private func feeIsNotZero() -> Bool? { - if let hasNoFees = exchange?.hasNoFees { + if let hasNoFees = exchange?.noFees { if hasNoFees { return nil // this exchange never has fees } @@ -173,6 +173,7 @@ fileprivate struct Preview_Content: View { let amount = Amount(currency: LONGCURRENCY, cent: 1000) let scopeInfo = ScopeInfo(type: .exchange, currency: LONGCURRENCY) let exchange2 = Exchange(exchangeBaseUrl: ARS_EXP_EXCHANGE, + masterPub: "masterPub", scopeInfo: scopeInfo, paytoUris: [], tosStatus: .proposed,