Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add on-chain withdraw UI #69

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Add on-chain withdraw UI #69

wants to merge 4 commits into from

Conversation

yoss1x
Copy link

@yoss1x yoss1x commented Mar 4, 2019

No description provided.

@@ -68,6 +69,7 @@ module.exports = ({ dismiss$, togExp$, togTheme$, togUnit$, page$, goHome$, goRe
, outgoing$.map(p => [ 'success', `Sent payment of @{{${p.msatoshi}}}` ])
, funded$.map(c => [ 'success', `Opening channel for @{{${c.chan.msatoshi_total}}}, awaiting on-chain confirmation` ])
, closed$.map(c => [ 'success', `Channel ${c.chan.short_channel_id || c.chan.channel_id} is closing` ])
, withdrawn$.map(w => [ 'success', `Withdraw completed. t word-wrap: break-word;word-wrap: break-word; xid: ${w.txid}` ])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like something slipped in here?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Completed" could imply "confirmed", which isn't true at this point. How about "sent" instead "completed"?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both fixed

@@ -5,6 +5,7 @@ module.exports = {
, ...require('./recv')
, ...require('./node')
, ...require('./channels')
, ...require('./onchain')
, ...require('./deposit')
, ...require('./withdraw')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe have both views under onchain.js?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

// Withdraw
, execWithdraw$ = submit('[do=exec-withdraw]')
.map(d => ({ ...d, amount_sat: toSatCapacity(d.amount_sat) }))
, withdrawAll$ = on('[name=withdraw-all]', 'input')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps fundMaxChan$ and withdrawAll$ could be unified to a single stream of fundMax$, used both in the channel creation and withdraw pages?

Copy link
Author

@yoss1x yoss1x Mar 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a better way?

, fundMax$ = O.merge(

@@ -30,6 +30,7 @@ exports.parseRes = ({ HTTP, SSE }) => {
, invoice$: reply('invoice').map(r => ({ ...r.body, ...r.request.ctx }))
, outgoing$: reply('pay').map(r => ({ ...r.body, ...r.request.ctx }))
, newaddr$: reply('newaddr').map(r => ({ address: r.body.address, type: r.request.send.params[0] }))
, withdrawn$: reply('withdraw').map(r => ({tx: r.body.tx, txid: r.body.txid}))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have use for the full tx, we can keep just the txid.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants