-
Notifications
You must be signed in to change notification settings - Fork 87
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
frontend: change transaction info for send-to-self #3035
frontend: change transaction info for send-to-self #3035
Conversation
@@ -221,8 +221,8 @@ func (handlers *Handlers) getTxInfoJSON(txInfo *accounts.TransactionData, detail | |||
Note: handlers.account.TxNote(txInfo.InternalID), | |||
} | |||
|
|||
txInfoJSON.Fee = feeString | |||
if detail { |
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 slightly prefer if we could just pass all that data anyways.
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.
interestingly TypeScript already expected that there is fee, also it thinks there is gas and nonce. I am planing to open another PR to fix the types and make gas/nonce only be in /transaction?id= endpoint and optional.
bitbox-wallet-app/frontends/web/src/api/account.ts
Lines 247 to 250 in 12df2de
fee: IAmount; | |
feeRatePerKb: IAmount; | |
gas: number; | |
nonce: number | null; |
271373e
to
615f8b8
Compare
rebased |
e39c0dc
to
9e5dfe0
Compare
9e5dfe0
to
ab6480e
Compare
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.
@thisconnect nack from me, personally showing the fee as the bigger number (and therefore the main number always being negative) seems really counterintuitive, I would switch them around, the send amount with the "send to self" icon as the main number and the fee as the smaller number below (ideally with the label "fee") Always having these long string fee amounts as the main tx amount doesn't look very good: |
Thanks for the input, the main reason to show the fee as negative "bigger number" is so it shows what was spent for this transaction.
In ETH this indeed shows very long numbers due to 18 digits. I will discuss both points internally... |
@Tomasvrba did you test with tokens as well? |
Yes, same issue from my perspective, since it's a token "account" I would expect the main tx number be the token transferred in the tx, not the eth-denominated fee |
ab6480e
to
1e0ba31
Compare
rebased |
As discussed internally: For send-to-self transactions we keep showing the fee as the bigger number so that the user see what they spent to do so. In ERC20 tokens the fee is in ETH that is how Ethereum works, but …there seems to be no good use-case to do send-to-self on account based coins/tokens. If you find out how contract interaction would look like in the app where the user initiates some kind of withdrawal which results in a deposit to the user's address please let me know. |
rebased, cc @Beerosagos PTAL at the backend change. |
@@ -221,8 +221,8 @@ func (handlers *Handlers) getTxInfoJSON(txInfo *accounts.TransactionData, detail | |||
Note: handlers.account.TxNote(txInfo.InternalID), | |||
} | |||
|
|||
txInfoJSON.Fee = feeString |
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.
This works, but it would be better as Fee: feeString,
inside the txInfoJSON
object creation above
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.
done
8aa34f6
to
c635b55
Compare
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.
backend LGTM
c635b55
to
cf1c17f
Compare
rebased |
Until now a send-to-self transaction looked more like an outgoing transaction with the amount sent. Changed to only show the fee paid as outgoing and the amount of coin as conversion amount.
cf1c17f
to
2b29341
Compare
Until now a send-to-self transaction looked more like an outgoing transaction with the amount sent.
Changed to only show the fee paid as outgoing and the amount of coin as conversion amount.