wallet-core: spec/clarify explicit refresh transaction

This commit is contained in:
Florian Dold 2022-10-08 23:21:34 +02:00
parent 526f4eba95
commit 3897bd4f01
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
2 changed files with 23 additions and 9 deletions

View File

@ -43,7 +43,7 @@ import {
codecForList, codecForList,
codecForAny, codecForAny,
} from "./codec.js"; } from "./codec.js";
import { TalerErrorDetail } from "./walletTypes.js"; import { RefreshReason, TalerErrorDetail } from "./walletTypes.js";
export interface TransactionsRequest { export interface TransactionsRequest {
/** /**
@ -468,19 +468,35 @@ export interface TransactionTip extends TransactionCommon {
merchantBaseUrl: string; merchantBaseUrl: string;
} }
// A transaction shown for refreshes that are not associated to other transactions /**
// such as a refresh necessary before coin expiration. * A transaction shown for refreshes.
// It should only be returned by the API if the effective amount is different from zero. * Only shown for (1) refreshes not associated with other transactions
* and (2) refreshes in an error state.
*/
export interface TransactionRefresh extends TransactionCommon { export interface TransactionRefresh extends TransactionCommon {
type: TransactionType.Refresh; type: TransactionType.Refresh;
// Exchange that the coins are refreshed with /**
* Exchange that the coins are refreshed with
*/
exchangeBaseUrl: string; exchangeBaseUrl: string;
// Raw amount that is refreshed refreshReason: RefreshReason;
/**
* Transaction ID that caused this refresh.
*/
originatingTransactionId?: string;
/**
* Always zero for refreshes
*/
amountRaw: AmountString; amountRaw: AmountString;
// Amount that will be paid as fees for the refresh /**
* Fees, i.e. the effective, negative effect of the refresh
* on the balance.
*/
amountEffective: AmountString; amountEffective: AmountString;
} }

View File

@ -1382,8 +1382,6 @@ export interface WithdrawalGroupRecord {
/** /**
* Current status of the reserve. * Current status of the reserve.
*
* FIXME: Wrong name!
*/ */
status: WithdrawalGroupStatus; status: WithdrawalGroupStatus;