[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: wallet-core: prepareDeposit -
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: wallet-core: prepareDeposit -> checkDeposit |
Date: |
Mon, 09 Sep 2024 11:16:41 +0200 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new 845ce1ecc wallet-core: prepareDeposit -> checkDeposit
845ce1ecc is described below
commit 845ce1ecc305f3fcc6fd18d17da8776f6c727fba
Author: Florian Dold <florian@dold.me>
AuthorDate: Mon Sep 9 11:16:35 2024 +0200
wallet-core: prepareDeposit -> checkDeposit
---
packages/taler-util/src/types-taler-wallet.ts | 8 ++++----
packages/taler-wallet-core/src/deposits.ts | 12 ++++++------
packages/taler-wallet-core/src/wallet-api-types.ts | 11 +++++++----
packages/taler-wallet-core/src/wallet.ts | 8 ++++++--
4 files changed, 23 insertions(+), 16 deletions(-)
diff --git a/packages/taler-util/src/types-taler-wallet.ts
b/packages/taler-util/src/types-taler-wallet.ts
index 0ce5e0117..a4d042804 100644
--- a/packages/taler-util/src/types-taler-wallet.ts
+++ b/packages/taler-util/src/types-taler-wallet.ts
@@ -2437,7 +2437,7 @@ export interface CreateDepositGroupRequest {
amount: AmountString;
}
-export interface PrepareDepositRequest {
+export interface CheckDepositRequest {
/**
* Payto URI to identify the (bank) account that the exchange will wire
* the money to.
@@ -2465,14 +2465,14 @@ export interface PrepareDepositRequest {
clientCancellationId?: string;
}
-export const codecForPrepareDepositRequest = (): Codec<PrepareDepositRequest>
=>
- buildCodecForObject<PrepareDepositRequest>()
+export const codecForCheckDepositRequest = (): Codec<CheckDepositRequest> =>
+ buildCodecForObject<CheckDepositRequest>()
.property("amount", codecForAmountString())
.property("depositPaytoUri", codecForString())
.property("clientCancellationId", codecOptional(codecForString()))
.build("PrepareDepositRequest");
-export interface PrepareDepositResponse {
+export interface CheckDepositResponse {
totalDepositCost: AmountString;
effectiveDepositAmount: AmountString;
fees: DepositGroupFees;
diff --git a/packages/taler-wallet-core/src/deposits.ts
b/packages/taler-wallet-core/src/deposits.ts
index 4b3a33ec2..b27b0157f 100644
--- a/packages/taler-wallet-core/src/deposits.ts
+++ b/packages/taler-wallet-core/src/deposits.ts
@@ -40,8 +40,8 @@ import {
Logger,
MerchantContractTerms,
NotificationType,
- PrepareDepositRequest,
- PrepareDepositResponse,
+ CheckDepositRequest,
+ CheckDepositResponse,
RefreshReason,
SelectedProspectiveCoin,
TalerError,
@@ -1715,8 +1715,8 @@ async function trackDeposit(
*/
export async function checkDepositGroup(
wex: WalletExecutionContext,
- req: PrepareDepositRequest,
-): Promise<PrepareDepositResponse> {
+ req: CheckDepositRequest,
+): Promise<CheckDepositResponse> {
return await runWithClientCancellation(
wex,
"checkDepositGroup",
@@ -1731,8 +1731,8 @@ export async function checkDepositGroup(
*/
export async function internalCheckDepositGroup(
wex: WalletExecutionContext,
- req: PrepareDepositRequest,
-): Promise<PrepareDepositResponse> {
+ req: CheckDepositRequest,
+): Promise<CheckDepositResponse> {
const p = parsePaytoUri(req.depositPaytoUri);
if (!p) {
throw Error("invalid payto URI");
diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts
b/packages/taler-wallet-core/src/wallet-api-types.ts
index 8ccf36e61..6927fce45 100644
--- a/packages/taler-wallet-core/src/wallet-api-types.ts
+++ b/packages/taler-wallet-core/src/wallet-api-types.ts
@@ -109,8 +109,8 @@ import {
ListKnownBankAccountsRequest,
PrepareBankIntegratedWithdrawalRequest,
PrepareBankIntegratedWithdrawalResponse,
- PrepareDepositRequest,
- PrepareDepositResponse,
+ CheckDepositRequest,
+ CheckDepositResponse,
PreparePayRequest,
PreparePayResult,
PreparePayTemplateRequest,
@@ -235,7 +235,9 @@ export enum WalletApiOperation {
ExportBackupRecovery = "exportBackupRecovery",
ImportBackupRecovery = "importBackupRecovery",
GetBackupInfo = "getBackupInfo",
+ // Deprecated alias
PrepareDeposit = "prepareDeposit",
+ CheckDeposit = "checkDeposit",
GetVersion = "getVersion",
GenerateDepositGroupTxId = "generateDepositGroupTxId",
CreateDepositGroup = "createDepositGroup",
@@ -838,8 +840,8 @@ export type CreateDepositGroupOp = {
// FIXME: Rename to checkDeposit, as it does not create a transaction, just
computes fees!
export type PrepareDepositOp = {
op: WalletApiOperation.PrepareDeposit;
- request: PrepareDepositRequest;
- response: PrepareDepositResponse;
+ request: CheckDepositRequest;
+ response: CheckDepositResponse;
};
// group: Backups
@@ -1345,6 +1347,7 @@ export type WalletOperations = {
[WalletApiOperation.GetExchangeDetailedInfo]: GetExchangeDetailedInfoOp;
[WalletApiOperation.GetExchangeEntryByUrl]: GetExchangeEntryByUrlOp;
[WalletApiOperation.PrepareDeposit]: PrepareDepositOp;
+ [WalletApiOperation.CheckDeposit]: PrepareDepositOp;
[WalletApiOperation.GenerateDepositGroupTxId]: GenerateDepositGroupTxIdOp;
[WalletApiOperation.CreateDepositGroup]: CreateDepositGroupOp;
[WalletApiOperation.SetWalletDeviceId]: SetWalletDeviceIdOp;
diff --git a/packages/taler-wallet-core/src/wallet.ts
b/packages/taler-wallet-core/src/wallet.ts
index a0c66f414..1931d9d90 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -170,7 +170,7 @@ import {
codecForListExchangesForScopedCurrencyRequest,
codecForListKnownBankAccounts,
codecForPrepareBankIntegratedWithdrawalRequest,
- codecForPrepareDepositRequest,
+ codecForCheckDepositRequest,
codecForPreparePayRequest,
codecForPreparePayTemplateRequest,
codecForPreparePeerPullPaymentRequest,
@@ -1917,7 +1917,11 @@ const handlers: { [T in WalletApiOperation]:
HandlerWithValidator<T> } = {
handler: getBackupInfo,
},
[WalletApiOperation.PrepareDeposit]: {
- codec: codecForPrepareDepositRequest(),
+ codec: codecForCheckDepositRequest(),
+ handler: checkDepositGroup,
+ },
+ [WalletApiOperation.CheckDeposit]: {
+ codec: codecForCheckDepositRequest(),
handler: checkDepositGroup,
},
[WalletApiOperation.GenerateDepositGroupTxId]: {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: wallet-core: prepareDeposit -> checkDeposit,
gnunet <=