This is needed for the CLI (#674) and it's common for web3 ux
We are implement wallet kit at the top level which gives components access to the wallet kit so components could have access to the connecte wallet.
Design: @charles-sdf
States:
There are two states. Connected and Disconnected. The the connected states, the UI shows the wallet address. In the disconnected state, there is a button the the upper right hand corner ask the user to connect a wallet if they wish to. If a wallet has been connected, components that requires sign a tx should call kit to signTx instead of poping up a wallet connect screen to reconnect because a wallet is already there.
Source Account Options:
Let's call the state that shows the connected Wallet Kit address as logged in for the user. How should Lab handle it?
The logged in wallet is one of the possible input value for source account. There are two places where the account could be populated source account. One place is from a logged in wallet. The other place is from generated address from account page. So we need a dropdown if there are multiple wallet available.
Does the Wallet Kit disconnect after a while and we need to check for the connection again?
No the user explicitly disconnect the wallet.
Do we log out after X amount of time?
No, the user is explicit when they disconnect.
How to handle a network change?
If the network is changed and the wallet in question doesn't support a network change, the user will be logged out the wallet. If the wallet supports a network change say from testnet to mainnet, and a different network account on mainnet is is available on the logged in wallet then the new account associated to the network should now be displayed and available for us by Lab components.
This is needed for the CLI (#674) and it's common for web3 ux
We are implement wallet kit at the top level which gives components access to the wallet kit so components could have access to the connecte wallet.
Design: @charles-sdf
States:
kit
to signTx instead of poping up a wallet connect screen to reconnect because a wallet is already there.Source Account Options:
Does the Wallet Kit disconnect after a while and we need to check for the connection again? No the user explicitly disconnect the wallet.
Do we log out after X amount of time? No, the user is explicit when they disconnect.
How to handle a network change? If the network is changed and the wallet in question doesn't support a network change, the user will be logged out the wallet. If the wallet supports a network change say from testnet to mainnet, and a different network account on mainnet is is available on the logged in wallet then the new account associated to the network should now be displayed and available for us by Lab components.
This is the PR that previously integrates the wallet kit in a component but kit needs to be accessible to multiple components with Lab: https://github.com/stellar/laboratory/pull/852/files