Contents

testingRecoverCoins#

Follow the refresh/link recovery chain for coins at one exchange.

Request:

The request must be a TestingRecoverCoinsRequest object.

Response:

On success, the result is a TestingRecoverCoinsResponse object.

Side effects:

Scans the exchange for coins belonging to the wallet over the network and re-claims the coins it finds, creating transactions and emitting notifications.

interface TestingRecoverCoinsRequest {
  exchangeBaseUrl: string;

  // Start with fresh coins by default.
  // Unfinished recovery always resumes.
  onlyFresh?: boolean;

  progressToken?: string;
}
interface TestingRecoverCoinsResponse {
  exchangeBaseUrl: string;
  progressToken: string;

  // False when a coin or residual refresh remains unfinished.
  complete: boolean;

  // Histories processed during this invocation.
  numChecked: number;

  numDiscovered: number;

  numQueued: number;

  // Newly imported coins that are now spendable,
  // including residual refreshes.
  numRecovered: number;

  // Cumulative for a resumed recovery; excludes existing coins,
  // spent ancestors, fees and pending refreshes.
  recoveredAmount: AmountString;

  issues: CoinRecoveryIssue[];
}
interface CoinRecoveryIssue {
  coinPub: string;
  refreshCommitment?: string;
  reason:
    | "missing-recovery-data"
    | "missing-denomination"
    | "invalid-history"
    | "commitment-mismatch"
    | "request-failed"
    | "local-data-changed"
    | "refresh-incomplete"
    | "coin-unavailable";
  description: string;
}