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

frontend/backend: show outputs as individual row for receive transactions #2843

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

NicolaLS
Copy link
Contributor

@NicolaLS NicolaLS commented Aug 5, 2024

Closes: #1728

Display each output of a receive transaction as one transaction in the app. The outputs data is only added to the endpoint response if the transaction is of type receive. Non-utxo model transactions e.g. ETH will just contain a single item in the outputs field which is weird but fine imo.

In the current implementation the index used for the note key (txid:idx) is set/defined by the order of the Adresses in the TransactionData struct returned by txInfo (here)

  • if the logic there changes all notes would be broken
  • the way the frontend treats the outputs field right now kind of implies that we are dealing with the actual outpoint/output index of the transaction which is not true and could be confusing when working on the code after some time.

Probably it would be better to add index to TransactionOutput and actually set it to the transactions output index and then use that in the frontend. Let me know if you think the current implementation is fine or if I should change that.

@NicolaLS
Copy link
Contributor Author

NicolaLS commented Aug 5, 2024

This can be tested by checking out #2844

./scripts/regtest/run_regtest.sh
make servewallet-regtest
make webdev
cd ./scrips/regtest/
export DOCKER_REGTEST=1
source examples.sh
mine_blocks 101
example_bitbox_receive_many

@NicolaLS NicolaLS force-pushed the distinct-outputs-receive-only branch from 79a11e6 to 879b139 Compare August 20, 2024 16:23
The transactions/transaction endpoint actually return "send", "receive"
and "send_to_self" but the ITransaction type was "self" this was
unnoticed because the type was never directly checked. But it should be
the correct type, also in preparation for the frontend collaborative
type implementation.
Remove the "first" class that was used in combination with "container"
its CSS rule does not contain any CSS declarations and thus does not do
anything. The CSS rule was empty after this commit:
5e1898b

Since the index prop on the transaction component is only used to add
this class it can also be removed.
Return tx. output(s) data for recevie transactions containing the
address, amount, amountAtTime, and note per output. Non utxo model
transactions will also contain one value in this list which will have
the same values as the tx. level address, amount, etc..
This can be used to represent individual outputs as transactions for
transactions that are of type receive.
Use the outputs data to display one transction per output item for
recevie transactions. This also enables the user to create a note for
each output address of a recevie tx.
@NicolaLS NicolaLS force-pushed the distinct-outputs-receive-only branch from 879b139 to d173ad5 Compare September 2, 2024 15:28
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.

Feature Request: Option to split consolidated transactions
1 participant