From d35d8df37b02c23561c5af1d8fc70f69f99a4fab Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 18 May 2021 18:29:25 +0200 Subject: deal with purse auto-refund on expiration, ensure exchange has max_deposit_fees always --- core/api-exchange.rst | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'core/api-exchange.rst') diff --git a/core/api-exchange.rst b/core/api-exchange.rst index d588e582..b8f61a8a 100644 --- a/core/api-exchange.rst +++ b/core/api-exchange.rst @@ -1628,7 +1628,8 @@ denomination. | CoinRecoupTransaction | CoinOldCoinRecoupTransaction | CoinRecoupRefreshTransaction - | CoinPurseDepositTransaction; + | CoinPurseDepositTransaction + | CoinPurseRefundTransaction; .. ts:def:: CoinDepositTransaction @@ -1874,6 +1875,39 @@ denomination. } + .. ts:def:: CoinPurseRefundTransaction + + interface CoinPurseRefundTransaction { + type: "PURSE_REFUND"; + + // The total amount of the coin's value restored + // by this transaction. + // The amount given excludes the refund fee. + // The current coin value can thus be computed by + // adding the amount to the coin's denomination value. + amount: Amount; + + // Refund fee (of the coin's denomination). The deposit + // fee will be waived. + refund_fee: Amount; + + // Share of the purse fee charged to this coin. + // The sum of all purse fee shares will match the + // total purse fee. + purse_fee_share: Amount; + + // Public key of the purse that expired. + purse_pub: EddsaPublicKey; + + // Signature by the exchange over a + // `TALER_CoinPurseRefundConfirmationPS` + // of purpose ``TALER_SIGNATURE_EXCHANGE_CONFIRM_PURSE_REFUND``. + exchange_sig: EddsaSignature; + + // Public key used to sign 'exchange_sig'. + exchange_pub: EddsaPublicKey; + + } ---------- @@ -2675,6 +2709,9 @@ Wallet-to-wallet transfers // purse once the amount given here is reached. total_purse_amount: Amount; + // Maximum deposit fees that can be charged under the contract. + max_deposit_fees: Amount; + // SHA-512 hash of the contact of the purse. h_contract_terms: HashCode; @@ -2930,6 +2967,11 @@ Wallet-to-wallet transfers // reserve can be higher! minimum_amount_contributed: Amount; + // Maximum deposit fees that can be charged under the contract. + // The 'total_purse_amount' will be the + // 'minimum_amount_contributed' plus the 'max_deposit_fees'. + max_deposit_fees: Amount; + // SHA-512 hash of the contact of the purse. h_contract_terms: HashCode; -- cgit v1.2.3