diff options
Diffstat (limited to 'packages/taler-util/src')
-rw-r--r-- | packages/taler-util/src/errors.ts | 3 | ||||
-rw-r--r-- | packages/taler-util/src/wallet-types.ts | 43 |
2 files changed, 10 insertions, 36 deletions
diff --git a/packages/taler-util/src/errors.ts b/packages/taler-util/src/errors.ts index 155562865..c4733a194 100644 --- a/packages/taler-util/src/errors.ts +++ b/packages/taler-util/src/errors.ts @@ -26,7 +26,6 @@ import { AbsoluteTime, PayMerchantInsufficientBalanceDetails, - PayPeerInsufficientBalanceDetails, TalerErrorCode, TalerErrorDetail, TransactionType, @@ -136,7 +135,7 @@ export interface DetailsMap { insufficientBalanceDetails: PayMerchantInsufficientBalanceDetails; }; [TalerErrorCode.WALLET_PEER_PUSH_PAYMENT_INSUFFICIENT_BALANCE]: { - insufficientBalanceDetails: PayPeerInsufficientBalanceDetails; + insufficientBalanceDetails: PayMerchantInsufficientBalanceDetails; }; [TalerErrorCode.WALLET_REFRESH_GROUP_INCOMPLETE]: { numErrors: number; diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index 1efa6651f..9fe114b3d 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -877,6 +877,14 @@ export interface PayMerchantInsufficientBalanceDetails { * on the coin selection for the amount that would be additionally withdrawn. */ feeGapEstimate: AmountString; + + perExchange: { + [url: string]: { + balanceAvailable: AmountString; + balanceMaterial: AmountString; + feeGapEstimate: AmountString; + }; + }; } export const codecForPayMerchantInsufficientBalanceDetails = @@ -889,6 +897,7 @@ export const codecForPayMerchantInsufficientBalanceDetails = .property("balanceMerchantAcceptable", codecForAmountString()) .property("balanceMerchantDepositable", codecForAmountString()) .property("feeGapEstimate", codecForAmountString()) + .property("perExchange", codecForAny()) .build("PayMerchantInsufficientBalanceDetails"); export const codecForPreparePayResultInsufficientBalance = @@ -2858,40 +2867,6 @@ export interface InitiatePeerPullCreditResponse { transactionId: TransactionIdStr; } -/** - * Detailed reason for why the wallet's balance is insufficient. - */ -export interface PayPeerInsufficientBalanceDetails { - /** - * Amount requested by the merchant. - */ - amountRequested: AmountString; - - /** - * Balance of type "available" (see balance.ts for definition). - */ - balanceAvailable: AmountString; - - /** - * Balance of type "material" (see balance.ts for definition). - */ - balanceMaterial: AmountString; - - /** - * If non-zero, the largest fee gap estimate of an exchange - * where we would otherwise have enough balance available. - */ - feeGapEstimate: AmountString; - - perExchange: { - [url: string]: { - balanceAvailable: AmountString; - balanceMaterial: AmountString; - feeGapEstimate: AmountString; - }; - }; -} - export interface ValidateIbanRequest { iban: string; } |