gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] 02/02: always return WithdrawalAccountInfo instead o


From: gnunet
Subject: [taler-wallet-core] 02/02: always return WithdrawalAccountInfo instead of using two separate types for the same purpose
Date: Tue, 28 Nov 2023 11:24:34 +0100

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

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

commit 7d562e7ee1172f14e4d304d0fbf39b1f9a524550
Author: Florian Dold <florian@dold.me>
AuthorDate: Tue Nov 28 11:24:31 2023 +0100

    always return WithdrawalAccountInfo instead of using two separate types for 
the same purpose
---
 packages/taler-util/src/wallet-types.ts            | 25 +++++++++++++++++-----
 .../taler-wallet-core/src/operations/withdraw.ts   | 12 ++---------
 2 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/packages/taler-util/src/wallet-types.ts 
b/packages/taler-util/src/wallet-types.ts
index d8e62dca0..d4d6119fb 100644
--- a/packages/taler-util/src/wallet-types.ts
+++ b/packages/taler-util/src/wallet-types.ts
@@ -1463,11 +1463,6 @@ export interface DenomSelectionState {
   }[];
 }
 
-export interface WireAccountDetails {
-  paytoUri: string;
-  creditRestrictions?: AccountRestriction[];
-}
-
 /**
  * Information about what will happen doing a withdrawal.
  *
@@ -2770,6 +2765,26 @@ export interface TestingWaitTransactionRequest {
 }
 
 export interface WithdrawalAccountInfo {
+  /**
+   * Payto URI to credit the exchange.
+   *
+   * Depending on whether the (manual!) withdrawal is accepted or just
+   * being checked, this already includes the subject with the
+   * reserve public key.
+   */
   paytoUri: string;
+
+  /**
+   * Transfer amount. Might be in a different currency than the requested
+   * amount for withdrawal.
+   *
+   * Redundant with the amount in paytoUri, just included to avoid parsing.
+   */
   transferAmount: AmountString;
+
+  /**
+   * Further restrictions for sending money to the
+   * exchange.
+   */
+  creditRestrictions?: AccountRestriction[];
 }
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts 
b/packages/taler-wallet-core/src/operations/withdraw.ts
index 4673e1f0b..9dd0f0a3f 100644
--- a/packages/taler-wallet-core/src/operations/withdraw.ts
+++ b/packages/taler-wallet-core/src/operations/withdraw.ts
@@ -43,7 +43,6 @@ import {
   LibtoolVersion,
   Logger,
   NotificationType,
-  PaytoUri,
   TalerError,
   TalerErrorCode,
   TalerErrorDetail,
@@ -56,7 +55,6 @@ import {
   TransactionType,
   URL,
   UnblindedSignature,
-  WireAccountDetails,
   WithdrawUriInfoResponse,
   WithdrawalAccountInfo,
   addPaytoQueryParams,
@@ -68,7 +66,6 @@ import {
   codecForReserveStatus,
   codecForWalletKycUuid,
   codecForWithdrawOperationStatusResponse,
-  createEddsaKeyPair,
   encodeCrock,
   getErrorDetailFromException,
   getRandomBytes,
@@ -1796,13 +1793,7 @@ export async function getExchangeWithdrawalInfo(
   const exchangeWireAccounts: string[] = [];
 
   for (const account of exchangeDetails.wireInfo.accounts) {
-    const details: WireAccountDetails = {
-      paytoUri: account.payto_uri,
-    };
-    if (account.credit_restrictions) {
-      details.creditRestrictions = account.credit_restrictions;
-    }
-    exchangeWireAccounts.push(details.paytoUri);
+    exchangeWireAccounts.push(account.payto_uri);
   }
 
   let hasDenomWithAgeRestriction = false;
@@ -2629,6 +2620,7 @@ async function fetchWithdrawalAccountInfo(
     const acctInfo: WithdrawalAccountInfo = {
       paytoUri,
       transferAmount,
+      creditRestrictions: acct.credit_restrictions,
     };
     withdrawalAccounts.push(acctInfo);
   }

-- 
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]