connext / indra

[LEGACY] Monorepo containing everything related to the core Connext protocols and network.
MIT License
84 stars 38 forks source link

[card] Collateralization stoplight indicator #363

Closed LayneHaber closed 4 years ago

LayneHaber commented 5 years ago

Is your feature request related to a problem? Please describe. It's often unclear to users what is happening when their channel is being collateralized, or why certain payments take longer than other ones

Describe the solution you'd like A stoplight-like indicator that turns yellow/green if your card is being setup, collateralized, or needs some time to get ready for some other reason. You can have a hover tooltip that explains what state your card is in and why.

ghost commented 5 years ago

Hello! pico from the discord channel here. Going to take a stab at this one.

Can I get some input on the different states for this stoplight indicator? So far I have:

# State Description Indicator Tooltip Message
1. Uncollateralized Is when user spins up a fresh wallet Red/Grey, Static "Your Dai card is ready! Add funds by sending Eth or DAI to your deposit address."
2. Pending User has send ETH/DAI to deposit address but transaction is yet to be confirmed Yellow, Blinking "Your deposit is being processed"
3. Deposit Received Funds received at deposit address and is in process of being loaded onto channel Yellow, Static "Your deposit has been received. Initialising state channel.."
4. Ready / Collateralized Users channel has been initialized with funds Green, Static "Channel successfully loaded"

Any thoughts?

rhlsthrm commented 5 years ago

Hey @blockhead2019! Awesome to have you helping out! We already have indicators for 2. and 3. in the UI. The main indicators we need is whether or not a user has been collateralized which means the hub has deposited into its side of its channel with the user. When a user is collateralized, that means it can receive money instantly. You can check this by getting the channel's free balance by using the getFreeBalance function and checking the hub's balance. If it's 0, then the light should be red. If the hub collateralization is in progress (we might need to expose this as a status to the client, let's make an issue for that), the light should be yellow. If you see that the free balance is above 0, the light should be green. If I were you I would look into the DEPOSIT_STARTED and the DEPOSIT_CONFIRMED events to start the indicators.

ghost commented 4 years ago

hey guys apologies for the delay on this. Its been a long time since I last wrote code. Spent several hours trying to figure out react grid layout and before giving up :( Anyway just wanted to make known in case anyone else wishes to take this up while I go off and learn React..

LayneHaber commented 4 years ago

Don't think we'll get to this any time soon so feel free to take your time!

ArjunBhuptani commented 4 years ago

Stale issue, moving this here for now until we reprioritize it: https://github.com/ConnextProject/indra/issues/620