aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-util
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-01-06 13:55:08 +0100
committerFlorian Dold <florian@dold.me>2023-01-06 13:55:08 +0100
commit417c07f3f4866918e1aaa6d42b7d5ec0ca59dd51 (patch)
tree9966f647bb0779cf2de248b805f0ea13a24ddba6 /packages/taler-util
parentc2c35925bb953bf07e32c005dbe312d220b45749 (diff)
downloadwallet-core-417c07f3f4866918e1aaa6d42b7d5ec0ca59dd51.tar.xz
wallet-core: insufficient balance details for p2p payments
Diffstat (limited to 'packages/taler-util')
-rw-r--r--packages/taler-util/src/taler-error-codes.ts8
-rw-r--r--packages/taler-util/src/wallet-types.ts23
2 files changed, 15 insertions, 16 deletions
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
@@ -3249,6 +3249,14 @@ export enum TalerErrorCode {
/**
+ * 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).
* (A value of 0 indicates that the error is generated client-side).
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;
+ };
+ };
}