stellar/stellar-client — pull request #1065 by bartekn (2014-11-05 16:32:22+00:00)
Title: Wallet V2

This PR introduces code that consumes v2 endpoints of [stellar-wallet](https://github.com/stellar/stellar-wallet) enabling new major features:
* Recovery Code Reset,
* Two Factor Authentication,
* Wallets Migration (v1 -> v2 server).

All requests to stellar-wallet server are now being sent using [stellar-wallet-js-sdk](https://github.com/stellar/stellar-wallet-js-sdk). Login, recovery and change password controllers from V1 are left to allow to migrate and recover wallets that haven't been migrated. Wallets are migrated during login V1 process (because to migrate a wallet we need to know the password) so we can be sure that all users that successfully logged in have their wallets migrated. To check which branch (v1/v2) to choose during login we check whether user with specific username exists in v2 database. After migration Wallet factory object has:
* one additional property: `walletV2` which contains [`Wallet`](https://github.com/stellar/stellar-wallet-js-sdk#wallet-object) object from JS SDK,
* two additional properties in `keychainData.signingKeys` derived from wallet's `secret`:
* `secretKey` - secret key used to sign requests sent to stellar-wallet server,
* `publicKey` - public key.

Recovery Code Reset and Two Factor Authentication can be found in settings.

Please submit all bugs you'll find using issues or as a comment to this PR.

**Open issues**
- [ ] stellar/ix#375 Email user upon wallet v2 migration
- [ ] stellar/ix#376 Email user when TOTP is disabled
- [ ] Logout user with persistent session that hasn't migrated a wallet yet.
- [ ] Remove legacy methods from Wallet factory that are no longer used.
- [ ] *More to come*

**Testing checklist**
- [ ] Review [stellar-wallet-js-sdk](https://github.com/stellar/stellar-wallet-js-sdk) key pair generation process,
- [ ] Ensure migration process works correctly (user can send transactions and update settings after migration).
- [ ] Ensure we handle different structure of usernames correctly (username / username@stellar.org).
- [ ] Test 2FA codes/qr codes with different mobile apps.
- [ ] Check if invites work.
- [ ] Setup recovery using settings and reward pane.
- [ ] Reset recovery codes.
- [ ] Case when someone persisted a session and loaded client after V2 deploy (logout should solve all problems).
- [ ] V1 recovery should work in case user that haven't migrated a wallet forgets a password.
- [ ] *Feel free to add more*