gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: take fiat currency from confi


From: gnunet
Subject: [taler-wallet-core] branch master updated: take fiat currency from config
Date: Sat, 18 Feb 2023 14:11:32 +0100

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new 0ba479c6e take fiat currency from config
0ba479c6e is described below

commit 0ba479c6e764815f2b4ec48649378cc488140ab6
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Sat Feb 18 10:11:23 2023 -0300

    take fiat currency from config
---
 packages/demobank-ui/src/declaration.d.ts          | 4 +++-
 packages/demobank-ui/src/hooks/circuit.ts          | 3 ---
 packages/demobank-ui/src/pages/BusinessAccount.tsx | 5 ++---
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/packages/demobank-ui/src/declaration.d.ts 
b/packages/demobank-ui/src/declaration.d.ts
index e3160d9ae..e31eb47b7 100644
--- a/packages/demobank-ui/src/declaration.d.ts
+++ b/packages/demobank-ui/src/declaration.d.ts
@@ -364,7 +364,6 @@ namespace SandboxBackend {
       // Contains ratios and fees related to buying
       // and selling the circuit currency.
       ratios_and_fees: RatiosAndFees;
-      currency: string;
     }
     interface RatiosAndFees {
       // Exchange rate to buy the circuit currency from fiat.
@@ -375,6 +374,9 @@ namespace SandboxBackend {
       buy_in_fee: float;
       // Fee to subtract after applying the sell ratio.
       sell_out_fee: float;
+      // Fiat currency.  That is the currency in which
+      // cash-out operations ultimately wire money.
+      fiat_currency: string;
     }
     interface Cashouts {
       // Every string represents a cash-out operation UUID.
diff --git a/packages/demobank-ui/src/hooks/circuit.ts 
b/packages/demobank-ui/src/hooks/circuit.ts
index c7170309b..3abe8cd54 100644
--- a/packages/demobank-ui/src/hooks/circuit.ts
+++ b/packages/demobank-ui/src/hooks/circuit.ts
@@ -288,9 +288,6 @@ export function useRatiosAndFeeConfig(): HttpResponse<
     keepPreviousData: true,
   });
 
-  if (data) {
-    data.data.currency = "FIAT";
-  }
   if (data) return data;
   if (error) return error.info;
   return { loading: true };
diff --git a/packages/demobank-ui/src/pages/BusinessAccount.tsx 
b/packages/demobank-ui/src/pages/BusinessAccount.tsx
index 6651ef0f7..64ec81c2e 100644
--- a/packages/demobank-ui/src/pages/BusinessAccount.tsx
+++ b/packages/demobank-ui/src/pages/BusinessAccount.tsx
@@ -194,6 +194,7 @@ function CreateCashout({
   const sellFee = !config.ratios_and_fees.sell_out_fee
     ? zero
     : Amounts.fromFloat(config.ratios_and_fees.sell_out_fee, balance.currency);
+  const fiatCurrency = config.ratios_and_fees.fiat_currency;
 
   if (!sellRate || sellRate < 0) return <div>error rate</div>;
 
@@ -220,7 +221,7 @@ function CreateCashout({
 
   const __amount_credit = Amounts.sub(credit_before_fee, sellFee).amount;
   const amount_credit = Amounts.parseOrThrow(
-    `${config.currency}:${Amounts.stringifyValue(__amount_credit)}`,
+    `${fiatCurrency}:${Amounts.stringifyValue(__amount_credit)}`,
   );
 
   const balanceAfter = Amounts.sub(balance, amount_debit).amount;
@@ -243,8 +244,6 @@ function CreateCashout({
     channel: !form.channel ? i18n.str`required` : undefined,
   });
 
-  // setErrors(validationResult);
-
   return (
     <div>
       {error && (

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]