diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-05-18 18:29:25 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-05-18 18:29:25 +0200 |
commit | d35d8df37b02c23561c5af1d8fc70f69f99a4fab (patch) | |
tree | 12c4f3da0d9b2aad94bca9c628e33d3e3a5b5d36 | |
parent | 72065f18ba1f08355aa2a767c05fbda8587b3e3b (diff) | |
download | docs-d35d8df37b02c23561c5af1d8fc70f69f99a4fab.tar.gz docs-d35d8df37b02c23561c5af1d8fc70f69f99a4fab.tar.bz2 docs-d35d8df37b02c23561c5af1d8fc70f69f99a4fab.zip |
deal with purse auto-refund on expiration, ensure exchange has max_deposit_fees always
-rw-r--r-- | core/api-common.rst | 17 | ||||
-rw-r--r-- | core/api-exchange.rst | 44 |
2 files changed, 60 insertions, 1 deletions
diff --git a/core/api-common.rst b/core/api-common.rst index cc69870b..e5afa872 100644 --- a/core/api-common.rst +++ b/core/api-common.rst @@ -1299,6 +1299,23 @@ within the }; +.. _TALER_SIGNATURE_EXCHANGE_CONFIRM_PURSE_REFUND: +.. sourcecode:: c + + struct TALER_CoinPurseRefundConfirmationPS { + /** + * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_PURSE_REFUND. + */ + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + struct TALER_PursePublicKey purse_pub; + struct TALER_CoinSpendPublicKeyP coin_pub; + struct TALER_MerchantPublicKeyP merchant; + struct TALER_AmountNBO remaining_amount; + struct TALER_AmountNBO purse_fee_share; + struct TALER_AmountNBO refund_fee; + }; + + .. _TALER_DenominationKeyAnnouncementPS: .. sourcecode:: c 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; |