testing-recover-coins.rst (1765B)
1 .. ts:op:: testingRecoverCoins 2 3 Follow the refresh/link recovery chain for coins at one exchange. 4 5 **Request:** 6 7 The request must be a `TestingRecoverCoinsRequest` object. 8 9 **Response:** 10 11 On success, the result is a `TestingRecoverCoinsResponse` object. 12 13 **Side effects:** 14 15 Scans the exchange for coins belonging to the wallet over the 16 network and re-claims the coins it finds, creating transactions and 17 emitting notifications. 18 19 .. ts:def:: TestingRecoverCoinsRequest 20 21 interface TestingRecoverCoinsRequest { 22 exchangeBaseUrl: string; 23 24 // Start with fresh coins by default. 25 // Unfinished recovery always resumes. 26 onlyFresh?: boolean; 27 28 progressToken?: string; 29 } 30 31 .. ts:def:: TestingRecoverCoinsResponse 32 33 interface TestingRecoverCoinsResponse { 34 exchangeBaseUrl: string; 35 progressToken: string; 36 37 // False when a coin or residual refresh remains unfinished. 38 complete: boolean; 39 40 // Histories processed during this invocation. 41 numChecked: number; 42 43 numDiscovered: number; 44 45 numQueued: number; 46 47 // Newly imported coins that are now spendable, 48 // including residual refreshes. 49 numRecovered: number; 50 51 // Cumulative for a resumed recovery; excludes existing coins, 52 // spent ancestors, fees and pending refreshes. 53 recoveredAmount: AmountString; 54 55 issues: CoinRecoveryIssue[]; 56 } 57 58 .. ts:def:: CoinRecoveryIssue 59 60 interface CoinRecoveryIssue { 61 coinPub: string; 62 refreshCommitment?: string; 63 reason: 64 | "missing-recovery-data" 65 | "missing-denomination" 66 | "invalid-history" 67 | "commitment-mismatch" 68 | "request-failed" 69 | "local-data-changed" 70 | "refresh-incomplete" 71 | "coin-unavailable"; 72 description: string; 73 }