-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
feat(suite): Coin Control #6019
Conversation
3f9fd61
to
d5be092
Compare
1826f1a
to
1915783
Compare
4e7b3d4
to
959eff8
Compare
...rc/views/wallet/send/components/Options/components/BitcoinOptions/components/CoinControl.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! 🤓
...rc/views/wallet/send/components/Options/components/BitcoinOptions/components/CoinControl.tsx
Outdated
Show resolved
Hide resolved
<> | ||
<Dot /> | ||
<ChangeAddress> | ||
<Translation id="TR_CHANGE_ADDRESS" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps would make sense to add a tooltip and a guide article? @hynek-jina
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dahaca Where would be the tooltip? I can't imagine it from these few lines..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, i think the tooltip would be nice..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it may sound like call to action
I like to use a dash to emphasize that it's a single term, so "change-address" or "change-output", but I don't think it's widely used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would stick to change address
or only change
With reference to Bitcoin Design
https://bitcoin.design/guide/glossary/address/#change-address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@b-irving please decide 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's solve it as a followup
...rc/views/wallet/send/components/Options/components/BitcoinOptions/components/CoinControl.tsx
Show resolved
Hide resolved
packages/suite/src/views/wallet/send/components/Options/components/BitcoinOptions/index.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks great and the PR is well structured in commits - easy to follow 👍
setValue( | ||
'selectedUtxos', | ||
!selectedUtxos.length && !isCoinControl | ||
? [...new Set([...preselectedUtxos, utxo])] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work as expected here with objects? This prevents to add utxo object with the reference already existing in preselectedUtxos array, but doesn't prevent to add the same utxo with different reference - wouldn't it be safer to check it by txid and vout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I am not following what this code does, could you explain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are selectedUtxosOld
the pre-selected ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selectedUtxosOld
are the pre-selected ones only if Coin Control is not enabled and user turning the Coin Control on by selecting some UTXO. If Coin Control is already enabled, selectedUtxosOld
are those already selected. I know it's a bit confusing, not sure how to name it better. Maybe it would be useful to add a comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, a commend would be great. Also what about preselectedUtxos
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the comments and made a refactored it a little bit in 206f141. I did not change the variable names because preselectedUtxos
is already used.
packages/suite/src/views/wallet/send/components/Options/components/BitcoinOptions/index.tsx
Outdated
Show resolved
Hide resolved
<> | ||
<Dot /> | ||
<ChangeAddress> | ||
<Translation id="TR_CHANGE_ADDRESS" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages/suite/src/components/suite/Labeling/components/Metadata/definitions.ts
Outdated
Show resolved
Hide resolved
Also figuring that out with Ondra |
...rc/views/wallet/send/components/Options/components/BitcoinOptions/components/CoinControl.tsx
Outdated
Show resolved
Hide resolved
...rc/views/wallet/send/components/Options/components/BitcoinOptions/components/CoinControl.tsx
Show resolved
Hide resolved
206f141
to
0df2878
Compare
0df2878
to
c453cb5
Compare
Enable coin control in Suite.
Description
Related Issue
Resolve #2770
@b-irving, please check the copy in points 3, 6, 9 and 10.
QA: The above points correspond to what to test, please look for any edge cases as well. There is also fiat amount shown for every UTXO when not on a testnet.