Contents

purgeExchangeLegacyKeys#

Purge every non-current key set retained for an exchange URL.

Request:

The request arguments must be a PurgeExchangeLegacyKeysRequest object.

Response:

On success, the result is an empty object.

Side effects:

Deletes the retained non-current key sets of the exchange.

Expected errors:

The caller can handle the following errors inline: WALLET_EXCHANGE_ENTRY_NOT_FOUND, WALLET_CORE_API_BAD_REQUEST.

Details:

Removes the coins, denominations and other stored data issued under superseded master public keys of the exchange; withdrawals of purged coins are marked as legacy. The currentMasterPub must be the current master key observed by the client before confirming the purge: the operation fails atomically with WALLET_CORE_API_BAD_REQUEST if the exchange has changed keys since, so a key rotation between review and execution cannot turn the key the user just reviewed into another key that is silently purged.

interface PurgeExchangeLegacyKeysRequest {
  exchangeBaseUrl: string;

  // Current master key observed by the client before confirming the
  // purge.  The operation fails atomically if the exchange has
  // changed keys since.
  currentMasterPub: string;
}