aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-util
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-util')
-rw-r--r--packages/taler-util/src/wallet-types.ts30
1 files changed, 22 insertions, 8 deletions
diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts
index d7685fa6e..6b3e39794 100644
--- a/packages/taler-util/src/wallet-types.ts
+++ b/packages/taler-util/src/wallet-types.ts
@@ -419,6 +419,7 @@ export const codecForPreparePayResultInsufficientBalance =
"status",
codecForConstString(PreparePayResultType.InsufficientBalance),
)
+ .property("balanceDetails", codecForPayMerchantInsufficientBalanceDetails())
.build("PreparePayResultInsufficientBalance");
export const codecForPreparePayResultAlreadyConfirmed =
@@ -483,6 +484,7 @@ export interface PreparePayResultInsufficientBalance {
amountRaw: string;
noncePriv: string;
talerUri: string;
+ balanceDetails: PayMerchantInsufficientBalanceDetails;
}
export interface PreparePayResultAlreadyConfirmed {
@@ -2090,32 +2092,32 @@ export interface PayMerchantInsufficientBalanceDetails {
/**
* Amount requested by the merchant.
*/
- amountRequested: AmountJson;
+ amountRequested: AmountString;
/**
* Balance of type "available" (see balance.ts for definition).
*/
- balanceAvailable: AmountJson;
+ balanceAvailable: AmountString;
/**
* Balance of type "material" (see balance.ts for definition).
*/
- balanceMaterial: AmountJson;
+ balanceMaterial: AmountString;
/**
* Balance of type "age-acceptable" (see balance.ts for definition).
*/
- balanceAgeAcceptable: AmountJson;
+ balanceAgeAcceptable: AmountString;
/**
* Balance of type "merchant-acceptable" (see balance.ts for definition).
*/
- balanceMechantAcceptable: AmountJson;
+ balanceMerchantAcceptable: AmountString;
/**
* Balance of type "merchant-depositable" (see balance.ts for definition).
*/
- balanceMechantDepositable: AmountJson;
+ balanceMerchantDepositable: AmountString;
/**
* If the payment would succeed without fees
@@ -2126,5 +2128,17 @@ export interface PayMerchantInsufficientBalanceDetails {
* It is not possible to give an exact value here, since it depends
* on the coin selection for the amount that would be additionally withdrawn.
*/
- feeGapEstimate: AmountJson;
-} \ No newline at end of file
+ feeGapEstimate: AmountString;
+}
+
+const codecForPayMerchantInsufficientBalanceDetails =
+(): Codec<PayMerchantInsufficientBalanceDetails> =>
+ buildCodecForObject<PayMerchantInsufficientBalanceDetails>()
+ .property("amountRequested", codecForAmountString())
+ .property("balanceAgeAcceptable", codecForAmountString())
+ .property("balanceAvailable", codecForAmountString())
+ .property("balanceMaterial", codecForAmountString())
+ .property("balanceMerchantAcceptable", codecForAmountString())
+ .property("balanceMerchantDepositable", codecForAmountString())
+ .property("feeGapEstimate", codecForAmountString())
+ .build("PayMerchantInsufficientBalanceDetails"); \ No newline at end of file