From 417c07f3f4866918e1aaa6d42b7d5ec0ca59dd51 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 6 Jan 2023 13:55:08 +0100 Subject: wallet-core: insufficient balance details for p2p payments --- packages/taler-util/src/taler-error-codes.ts | 8 ++++++++ packages/taler-util/src/wallet-types.ts | 23 +++++++---------------- 2 files changed, 15 insertions(+), 16 deletions(-) (limited to 'packages/taler-util') diff --git a/packages/taler-util/src/taler-error-codes.ts b/packages/taler-util/src/taler-error-codes.ts index 5e3c8fdfb..9e735817d 100644 --- a/packages/taler-util/src/taler-error-codes.ts +++ b/packages/taler-util/src/taler-error-codes.ts @@ -3248,6 +3248,14 @@ export enum TalerErrorCode { WALLET_PEER_PUSH_PAYMENT_INSUFFICIENT_BALANCE = 7027, + /** + * The wallet does not have sufficient balance to pay for an invoice. + * Returned with an HTTP status code of #MHD_HTTP_UNINITIALIZED (0). + * (A value of 0 indicates that the error is generated client-side). + */ + WALLET_PEER_PULL_PAYMENT_INSUFFICIENT_BALANCE = 7028, + + /** * We encountered a timeout with our payment backend. * Returned with an HTTP status code of #MHD_HTTP_GATEWAY_TIMEOUT (504). diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index 3a1176021..06edfe285 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -2164,20 +2164,11 @@ export interface PayPeerInsufficientBalanceDetails { */ balanceMaterial: AmountString; - /** - * Acceptable balance based on restrictions on which - * exchange can be used. - */ - balanceExchangeAcceptable: AmountString - - /** - * If the payment would succeed without fees - * (i.e. balanceExchangeAcceptable >= amountRequested), - * this field contains an estimate of the amount that would additionally - * be required to cover the fees. - * - * 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: AmountString; + perExchange: { + [url: string]: { + balanceAvailable: AmountString; + balanceMaterial: AmountString; + feeGapEstimate: AmountString; + }; + }; } -- cgit v1.2.3