[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 18/32: updateExchange
From: |
gnunet |
Subject: |
[taler-taler-ios] 18/32: updateExchange |
Date: |
Mon, 16 Oct 2023 00:03:16 +0200 |
This is an automated email from the git hooks/post-receive script.
marc-stibane pushed a commit to branch master
in repository taler-ios.
commit c6cd080659131d682b26749904afdaca96eb691b
Author: Marc Stibane <marc@taler.net>
AuthorDate: Fri Oct 13 19:22:22 2023 +0200
updateExchange
---
TalerWallet1/Model/Model+Exchange.swift | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/TalerWallet1/Model/Model+Exchange.swift
b/TalerWallet1/Model/Model+Exchange.swift
index bf4a2ca..7ac8d72 100644
--- a/TalerWallet1/Model/Model+Exchange.swift
+++ b/TalerWallet1/Model/Model+Exchange.swift
@@ -82,10 +82,23 @@ fileprivate struct ListExchanges:
WalletBackendFormattedRequest {
}
}
+/// A request to update a single exchange.
+fileprivate struct UpdateExchange: WalletBackendFormattedRequest {
+ struct Response: Decodable {} // no result - getting no error back means
success
+ func operation() -> String { return "updateExchangeEntry" }
+ func args() -> Args { return Args(scopeInfo: scopeInfo) }
+
+ var scopeInfo: ScopeInfo
+
+ struct Args: Encodable {
+ var scopeInfo: ScopeInfo
+ }
+}
+
/// A request to add an exchange.
fileprivate struct AddExchange: WalletBackendFormattedRequest {
struct Response: Decodable {} // no result - getting no error back means
success
- func operation() -> String { return "addExchange" }
+ func operation() -> String { return "addExchange" } // addExchangeEntry
func args() -> Args { return Args(exchangeBaseUrl: exchangeBaseUrl) }
var exchangeBaseUrl: String
@@ -129,6 +142,14 @@ extension WalletModel {
_ = try await sendRequest(request)
}
+ /// ask wallet-core to update an existing exchange by querying it for
denominations, fees, and scoped currency info
+ func updateExchange(scopeInfo: ScopeInfo)
+ async throws {
+ let request = UpdateExchange(scopeInfo: scopeInfo)
+ logger.info("updating exchange for: \(scopeInfo.currency, privacy:
.public)")
+ _ = try await sendRequest(request)
+ }
+
@MainActor func getCurrencySpecificationM(scope: ScopeInfo)
async throws -> CurrencySpecification { // M for MainActor
let request = GetCurrencySpecification(scope: scope)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] branch master updated (bb640f0 -> 65313c5), gnunet, 2023/10/15
- [taler-taler-ios] 04/32: CallStack, gnunet, 2023/10/15
- [taler-taler-ios] 19/32: AccessibilityNotification.Announcement, gnunet, 2023/10/15
- [taler-taler-ios] 01/32: products seem no longer mandatory, gnunet, 2023/10/15
- [taler-taler-ios] 18/32: updateExchange,
gnunet <=
- [taler-taler-ios] 14/32: fix bars, gnunet, 2023/10/15
- [taler-taler-ios] 03/32: Debugging, gnunet, 2023/10/15
- [taler-taler-ios] 17/32: getCurrencySpecification, gnunet, 2023/10/15
- [taler-taler-ios] 02/32: Layout for QR-View and ThreeAmounts, gnunet, 2023/10/15
- [taler-taler-ios] 08/32: cleanup, gnunet, 2023/10/15
- [taler-taler-ios] 13/32: width of rendered string, gnunet, 2023/10/15
- [taler-taler-ios] 10/32: secret token, gnunet, 2023/10/15
- [taler-taler-ios] 15/32: TwoRowButtons, gnunet, 2023/10/15
- [taler-taler-ios] 05/32: No spellout, gnunet, 2023/10/15
- [taler-taler-ios] 09/32: TabBar for Taler Wallet - GNU Taler stays on SideView, gnunet, 2023/10/15