aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-10-08 06:17:35 +0800
committerDan Finlay <dan@danfinlay.com>2016-10-08 06:17:35 +0800
commitdec282f4fde4b3d1a286c587b64f171835d6ad6a (patch)
treec9e2fddd0e8b85268b63fb78adcdd0d96d2b9615 /docs
parent0182f8a4e91b8a9b0951967d2c075955bfb4f24f (diff)
downloadtangerine-wallet-browser-dec282f4fde4b3d1a286c587b64f171835d6ad6a.tar
tangerine-wallet-browser-dec282f4fde4b3d1a286c587b64f171835d6ad6a.tar.gz
tangerine-wallet-browser-dec282f4fde4b3d1a286c587b64f171835d6ad6a.tar.bz2
tangerine-wallet-browser-dec282f4fde4b3d1a286c587b64f171835d6ad6a.tar.lz
tangerine-wallet-browser-dec282f4fde4b3d1a286c587b64f171835d6ad6a.tar.xz
tangerine-wallet-browser-dec282f4fde4b3d1a286c587b64f171835d6ad6a.tar.zst
tangerine-wallet-browser-dec282f4fde4b3d1a286c587b64f171835d6ad6a.zip
Add multi-vault planning doc
Diffstat (limited to 'docs')
-rw-r--r--docs/multi_vault_planning.md175
1 files changed, 175 insertions, 0 deletions
diff --git a/docs/multi_vault_planning.md b/docs/multi_vault_planning.md
new file mode 100644
index 000000000..dbd98e4a5
--- /dev/null
+++ b/docs/multi_vault_planning.md
@@ -0,0 +1,175 @@
+https://hackmd.io/JwIwDMDGKQZgtAFgKZjEgbARhPAhgKxZbwAcA7LAWOQCaKEgFA==?edit
+
+Subscribablez(initState)
+ .subscribe()
+ .emitUpdate(newState)
+ //.getState()
+
+
+var initState = fromDisk()
+ReduxStore(reducer, initState)
+.reduce(action) -> .emitUpdate()
+
+ReduxStore.subscribe(toDisk)
+
+
+### KeyChainManager / idStore 2.0 (maybe just in MetaMaskController)
+ keychains: []
+ getAllAccounts(cb)
+ getAllKeychainViewStates(cb) -> returns [ KeyChainViewState]
+
+#### Old idStore external methods, for feature parity:
+
+- init(configManager)
+- setStore(ethStore)
+- getState()
+- getSelectedAddres()
+- setSelectedAddress()
+- createNewVault()
+- recoverFromSeed()
+- submitPassword()
+- approveTransaction()
+- cancelTransaction()
+- addUnconfirmedMessage(msgParams, cb)
+- signMessage()
+- cancelMessage()
+- setLocked()
+- clearSeedWordCache()
+- exportAccount()
+- revealAccount()
+- saveAccountLabel()
+- tryPassword()
+- recoverSeed()
+- getNetwork()
+
+##### Of those methods
+
+Where they should end up:
+
+##### MetaMaskController
+
+- getNetwork()
+
+##### KeyChainManager
+
+- init(configManager)
+- setStore(ethStore)
+- getState() // Deprecate for unidirectional flow
+- on('update', cb)
+- createNewVault(password)
+- getSelectedAddres()
+- setSelectedAddress()
+- submitPassword()
+- tryPassword()
+- approveTransaction()
+- cancelTransaction()
+- signMessage()
+- cancelMessage()
+- setLocked()
+- exportAccount()
+
+##### Bip44 KeyChain
+
+- getState() // Deprecate for unidirectional flow
+- on('update', cb)
+
+If we adopt a ReactStore style unidirectional action dispatching data flow, these methods will be unified under a `dispatch` method, and rather than having a cb will emit an update to the UI:
+
+- createNewKeyChain(entropy)
+- recoverFromSeed()
+- approveTransaction()
+- signMessage()
+- clearSeedWordCache()
+- exportAccount()
+- revealAccount()
+- saveAccountLabel()
+- recoverSeed()
+
+### KeyChain (ReduxStore?)
+ // attributes
+ @name
+
+ signTx(txParams, cb)
+ signMsg(msg, cb)
+
+ getAddressList(cb)
+
+ getViewState(cb) -> returns KeyChainViewState
+
+ serialize(cb) -> obj
+ deserialize(obj)
+
+### KeyChainViewState
+ // The serialized, renderable keychain data
+ accountList: [],
+ typeName: 'uPort',
+ iconAddress: 'uport.gif',
+ internal: {} // Subclass-defined metadata
+
+### KeyChainReactComponent
+ // takes a KeyChainViewState
+
+ // Subclasses of this:
+ - KeyChainListItemComponent
+ - KeyChainInitComponent - Maybe part of the List Item
+ - KeyChainAccountHeaderComponent
+ - KeyChainConfirmationComponent
+ // Account list item, tx confirmation extra data (like a QR code),
+ // Maybe an options screen, init screen,
+
+ how to send actions?
+ emitAction(keychains.<id>.didInit)
+
+
+gimmeRemoteKeychain((err, remoteKeychain)=>
+
+)
+
+
+
+
+
+KeyChainReactComponent({
+ keychain
+})
+
+Keychain:
+ methods:{},
+ cachedAccountList: [],
+ name: '',
+
+
+CoinbaseKeychain
+ getAccountList
+
+
+CoinbaseKeychainComponent
+ isLoading = true
+ keychain.getAccountList(()=>{
+ isLoading=false
+ accountList=accounts
+ })
+
+
+
+
+
+KeyChainViewState {
+ attributes: {
+ //mandatory:
+ accountList: [],
+ typeName: 'uPort',
+ iconAddress: 'uport.gif',
+
+ internal: {
+ // keychain-specific metadata
+ proxyAddresses: {
+ 0xReal: '0xProxy'
+ }
+ },
+ },
+ methods: {
+ // arbitrary, internal
+ }
+}
+